Commit cd65a645 authored by Sylwester Nawrocki's avatar Sylwester Nawrocki Committed by Mauro Carvalho Chehab

[media] s5p-csis: Enable only data lanes that are actively used

Enable only MIPI CSI-2 data lanes at the DPHY that are actively
used, rather than unmasking all unconditionally.
Signed-off-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent e26991b4
...@@ -273,7 +273,8 @@ static void s5pcsis_reset(struct csis_state *state) ...@@ -273,7 +273,8 @@ static void s5pcsis_reset(struct csis_state *state)
static void s5pcsis_system_enable(struct csis_state *state, int on) static void s5pcsis_system_enable(struct csis_state *state, int on)
{ {
u32 val; struct s5p_platform_mipi_csis *pdata = state->pdev->dev.platform_data;
u32 val, mask;
val = s5pcsis_read(state, S5PCSIS_CTRL); val = s5pcsis_read(state, S5PCSIS_CTRL);
if (on) if (on)
...@@ -283,10 +284,11 @@ static void s5pcsis_system_enable(struct csis_state *state, int on) ...@@ -283,10 +284,11 @@ static void s5pcsis_system_enable(struct csis_state *state, int on)
s5pcsis_write(state, S5PCSIS_CTRL, val); s5pcsis_write(state, S5PCSIS_CTRL, val);
val = s5pcsis_read(state, S5PCSIS_DPHYCTRL); val = s5pcsis_read(state, S5PCSIS_DPHYCTRL);
if (on)
val |= S5PCSIS_DPHYCTRL_ENABLE;
else
val &= ~S5PCSIS_DPHYCTRL_ENABLE; val &= ~S5PCSIS_DPHYCTRL_ENABLE;
if (on) {
mask = (1 << (pdata->lanes + 1)) - 1;
val |= (mask & S5PCSIS_DPHYCTRL_ENABLE);
}
s5pcsis_write(state, S5PCSIS_DPHYCTRL, val); s5pcsis_write(state, S5PCSIS_DPHYCTRL, val);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment