Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

phy: amlogic: meson8b-usb2: Use the regmap_{clear,set}_bits helpers

These require less code, reduce the chance of typos and overall make the
intent clearer. No functional changes.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Reviewed-by: Anand Moon <linux.amoon@gmail.com>
Link: https://lore.kernel.org/r/20250329190712.858349-3-martin.blumenstingl@googlemail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Martin Blumenstingl and committed by
Vinod Koul
e60363bc ff02c5a3

+11 -17
+11 -17
drivers/phy/amlogic/phy-meson8b-usb2.c
··· 165 165 return ret; 166 166 } 167 167 168 - regmap_update_bits(priv->regmap, REG_CONFIG, REG_CONFIG_CLK_32k_ALTSEL, 169 - REG_CONFIG_CLK_32k_ALTSEL); 168 + regmap_set_bits(priv->regmap, REG_CONFIG, REG_CONFIG_CLK_32k_ALTSEL); 170 169 171 170 regmap_update_bits(priv->regmap, REG_CTRL, REG_CTRL_REF_CLK_SEL_MASK, 172 171 FIELD_PREP(REG_CTRL_REF_CLK_SEL_MASK, 0x2)); ··· 174 175 FIELD_PREP(REG_CTRL_FSEL_MASK, 0x5)); 175 176 176 177 /* reset the PHY */ 177 - regmap_update_bits(priv->regmap, REG_CTRL, REG_CTRL_POWER_ON_RESET, 178 - REG_CTRL_POWER_ON_RESET); 178 + regmap_set_bits(priv->regmap, REG_CTRL, REG_CTRL_POWER_ON_RESET); 179 179 udelay(RESET_COMPLETE_TIME); 180 - regmap_update_bits(priv->regmap, REG_CTRL, REG_CTRL_POWER_ON_RESET, 0); 180 + regmap_clear_bits(priv->regmap, REG_CTRL, REG_CTRL_POWER_ON_RESET); 181 181 udelay(RESET_COMPLETE_TIME); 182 182 183 - regmap_update_bits(priv->regmap, REG_CTRL, REG_CTRL_SOF_TOGGLE_OUT, 184 - REG_CTRL_SOF_TOGGLE_OUT); 183 + regmap_set_bits(priv->regmap, REG_CTRL, REG_CTRL_SOF_TOGGLE_OUT); 185 184 186 185 if (priv->dr_mode == USB_DR_MODE_HOST) { 187 - regmap_update_bits(priv->regmap, REG_DBG_UART, 188 - REG_DBG_UART_SET_IDDQ, 0); 186 + regmap_clear_bits(priv->regmap, REG_DBG_UART, 187 + REG_DBG_UART_SET_IDDQ); 189 188 190 189 if (priv->match->host_enable_aca) { 191 - regmap_update_bits(priv->regmap, REG_ADP_BC, 192 - REG_ADP_BC_ACA_ENABLE, 193 - REG_ADP_BC_ACA_ENABLE); 190 + regmap_set_bits(priv->regmap, REG_ADP_BC, 191 + REG_ADP_BC_ACA_ENABLE); 194 192 195 193 udelay(ACA_ENABLE_COMPLETE_TIME); 196 194 ··· 210 214 struct phy_meson8b_usb2_priv *priv = phy_get_drvdata(phy); 211 215 212 216 if (priv->dr_mode == USB_DR_MODE_HOST) 213 - regmap_update_bits(priv->regmap, REG_DBG_UART, 214 - REG_DBG_UART_SET_IDDQ, 215 - REG_DBG_UART_SET_IDDQ); 217 + regmap_set_bits(priv->regmap, REG_DBG_UART, 218 + REG_DBG_UART_SET_IDDQ); 216 219 217 220 clk_disable_unprepare(priv->clk_usb); 218 221 clk_disable_unprepare(priv->clk_usb_general); 219 222 reset_control_rearm(priv->reset); 220 223 221 224 /* power off the PHY by putting it into reset mode */ 222 - regmap_update_bits(priv->regmap, REG_CTRL, REG_CTRL_POWER_ON_RESET, 223 - REG_CTRL_POWER_ON_RESET); 225 + regmap_set_bits(priv->regmap, REG_CTRL, REG_CTRL_POWER_ON_RESET); 224 226 225 227 return 0; 226 228 }