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: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
This commit is contained in:
parent
60cc43fc88
commit
af09a5e926
|
@ -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);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue