diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2017-08-10 08:11:03 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2017-08-16 05:52:39 -0400 |
commit | 5cdc8dbbdae163b08baa60a1c9408c4ea3af8643 (patch) | |
tree | f33c9efffcff2b28b74fdd8a11d102b9794df614 | |
parent | d874b3a7c44ca48c0e57b8744c1eed2a6d299ba1 (diff) |
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: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rw-r--r-- | drivers/gpu/drm/omapdrm/dss/dsi.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c index a66d2b1a6c74..1855d69b211d 100644 --- a/drivers/gpu/drm/omapdrm/dss/dsi.c +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c | |||
@@ -2107,7 +2107,6 @@ static int dsi_omap4_mux_pads(struct dsi_data *dsi, unsigned int lanes) | |||
2107 | { | 2107 | { |
2108 | u32 enable_mask, enable_shift; | 2108 | u32 enable_mask, enable_shift; |
2109 | u32 pipd_mask, pipd_shift; | 2109 | u32 pipd_mask, pipd_shift; |
2110 | u32 reg; | ||
2111 | 2110 | ||
2112 | if (!dsi->syscon) | 2111 | if (!dsi->syscon) |
2113 | return 0; | 2112 | return 0; |
@@ -2126,17 +2125,9 @@ static int dsi_omap4_mux_pads(struct dsi_data *dsi, unsigned int lanes) | |||
2126 | return -ENODEV; | 2125 | return -ENODEV; |
2127 | } | 2126 | } |
2128 | 2127 | ||
2129 | regmap_read(dsi->syscon, OMAP4_DSIPHY_SYSCON_OFFSET, ®); | 2128 | return regmap_update_bits(dsi->syscon, OMAP4_DSIPHY_SYSCON_OFFSET, |
2130 | 2129 | enable_mask | pipd_mask, | |
2131 | reg &= ~enable_mask; | 2130 | (lanes << enable_shift) | (lanes << pipd_shift)); |
2132 | reg &= ~pipd_mask; | ||
2133 | |||
2134 | reg |= (lanes << enable_shift) & enable_mask; | ||
2135 | reg |= (lanes << pipd_shift) & pipd_mask; | ||
2136 | |||
2137 | regmap_write(dsi->syscon, OMAP4_DSIPHY_SYSCON_OFFSET, reg); | ||
2138 | |||
2139 | return 0; | ||
2140 | } | 2131 | } |
2141 | 2132 | ||
2142 | static int dsi_enable_pads(struct dsi_data *dsi, unsigned int lane_mask) | 2133 | static int dsi_enable_pads(struct dsi_data *dsi, unsigned int lane_mask) |