Commit cac7479e authored by Richard Fitzgerald's avatar Richard Fitzgerald Committed by DidntRead
Browse files

switch: arizona: Only set the EDRE manual bits for OUT1



The handling of setting EDRE manual when OUT1 clamps are active was
assuming all the other bits in the register are always 0 so can
safely be overwritten with 0 using a regmap_write(). This isn't
good practice and can lead to hard-to-find bugs later if any of the
other bits are non-zero, so change to using an update_bits() so we
only change the bits we need to.

Change-Id: Ieba91a5f67cf6167d4dad7c5ed5d514080aa15ca
Signed-off-by: default avatarRichard Fitzgerald <rf@opensource.wolfsonmicro.com>
parent 49a35332
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -441,7 +441,10 @@ static void arizona_extcon_hp_clamp(struct arizona_extcon_info *info,
	}

	if (edre_reg && !ep_sel) {
			ret = regmap_write(arizona->regmap, edre_reg, edre_val);
			ret = regmap_update_bits(arizona->regmap,
						 edre_reg,
						 0x3,
						 edre_val);
			if (ret != 0)
				dev_warn(arizona->dev,
					"Failed to set EDRE Manual: %d\n",