Commit 5cdc8dbb authored by Tomi Valkeinen's avatar Tomi Valkeinen

drm/omap: use regmap_update_bit() when muxing DSI pads

Use regmap_update_bits instead of regmap_read/write, which simplifies
the code.
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
parent d874b3a7
...@@ -2107,7 +2107,6 @@ static int dsi_omap4_mux_pads(struct dsi_data *dsi, unsigned int lanes) ...@@ -2107,7 +2107,6 @@ static int dsi_omap4_mux_pads(struct dsi_data *dsi, unsigned int lanes)
{ {
u32 enable_mask, enable_shift; u32 enable_mask, enable_shift;
u32 pipd_mask, pipd_shift; u32 pipd_mask, pipd_shift;
u32 reg;
if (!dsi->syscon) if (!dsi->syscon)
return 0; return 0;
...@@ -2126,17 +2125,9 @@ static int dsi_omap4_mux_pads(struct dsi_data *dsi, unsigned int lanes) ...@@ -2126,17 +2125,9 @@ static int dsi_omap4_mux_pads(struct dsi_data *dsi, unsigned int lanes)
return -ENODEV; return -ENODEV;
} }
regmap_read(dsi->syscon, OMAP4_DSIPHY_SYSCON_OFFSET, &reg); return regmap_update_bits(dsi->syscon, OMAP4_DSIPHY_SYSCON_OFFSET,
enable_mask | pipd_mask,
reg &= ~enable_mask; (lanes << enable_shift) | (lanes << pipd_shift));
reg &= ~pipd_mask;
reg |= (lanes << enable_shift) & enable_mask;
reg |= (lanes << pipd_shift) & pipd_mask;
regmap_write(dsi->syscon, OMAP4_DSIPHY_SYSCON_OFFSET, reg);
return 0;
} }
static int dsi_enable_pads(struct dsi_data *dsi, unsigned int lane_mask) static int dsi_enable_pads(struct dsi_data *dsi, unsigned int lane_mask)
......
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