Commit af09a5e9 authored by Sylwester Nawrocki's avatar Sylwester Nawrocki Committed by Kishon Vijay Abraham I

phy: exynos-mipi-video: Simplify code by using regmap_update_bits()

There is no functional change, just replacing regmap_read()/modify/
regmap_write() with regmap_update_bits() function calls.
Signed-off-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
parent 60cc43fc
...@@ -231,33 +231,27 @@ struct exynos_mipi_video_phy { ...@@ -231,33 +231,27 @@ struct exynos_mipi_video_phy {
static int __set_phy_state(const struct exynos_mipi_phy_desc *data, static int __set_phy_state(const struct exynos_mipi_phy_desc *data,
struct exynos_mipi_video_phy *state, unsigned int on) struct exynos_mipi_video_phy *state, unsigned int on)
{ {
u32 val; struct regmap *enable_map = state->regmaps[data->enable_map];
struct regmap *resetn_map = state->regmaps[data->resetn_map];
spin_lock(&state->slock); spin_lock(&state->slock);
/* disable in PMU sysreg */ /* disable in PMU sysreg */
if (!on && data->coupled_phy_id >= 0 && if (!on && data->coupled_phy_id >= 0 &&
state->phys[data->coupled_phy_id].phy->power_count == 0) { state->phys[data->coupled_phy_id].phy->power_count == 0)
regmap_read(state->regmaps[data->enable_map], data->enable_reg, regmap_update_bits(enable_map, data->enable_reg,
&val); data->enable_val, 0);
val &= ~data->enable_val;
regmap_write(state->regmaps[data->enable_map], data->enable_reg,
val);
}
/* PHY reset */ /* PHY reset */
regmap_read(state->regmaps[data->resetn_map], data->resetn_reg, &val); if (on)
val = on ? (val | data->resetn_val) : (val & ~data->resetn_val); regmap_update_bits(resetn_map, data->resetn_reg,
regmap_write(state->regmaps[data->resetn_map], data->resetn_reg, val); data->resetn_val, data->resetn_val);
else
regmap_update_bits(resetn_map, data->resetn_reg,
data->resetn_val, 0);
/* enable in PMU sysreg */ /* enable in PMU sysreg */
if (on) { if (on)
regmap_read(state->regmaps[data->enable_map], data->enable_reg, regmap_update_bits(enable_map, data->enable_reg,
&val); data->enable_val, data->enable_val);
val |= data->enable_val;
regmap_write(state->regmaps[data->enable_map], data->enable_reg,
val);
}
spin_unlock(&state->slock); spin_unlock(&state->slock);
......
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