diff options
author | Charles Keepax <ckeepax@opensource.cirrus.com> | 2019-12-09 14:09:08 +0300 |
---|---|---|
committer | Chanwoo Choi <cw00.choi@samsung.com> | 2019-12-09 14:18:14 +0300 |
commit | b82f871a335a8b0de178ace526c847183d17f66d (patch) | |
tree | eef27f71bc2c262dd598e41459924640c5240c27 /drivers/extcon | |
parent | 9c8eaec8ebe41198b10599f2586750d8900afd97 (diff) | |
download | linux-b82f871a335a8b0de178ace526c847183d17f66d.tar.xz |
extcon: arizona: Make rev A register sequences atomic
The special register sequences that are applied for rev A of wm5102
should be applied atomically with respect to any other register writes.
Use regmap_multi_reg_write to ensure all writes happen under the regmap
lock.
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Diffstat (limited to 'drivers/extcon')
-rw-r--r-- | drivers/extcon/extcon-arizona.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c index 79e9a2410182..a8b0bc2d4323 100644 --- a/drivers/extcon/extcon-arizona.c +++ b/drivers/extcon/extcon-arizona.c @@ -310,9 +310,13 @@ static void arizona_start_mic(struct arizona_extcon_info *info) } if (info->micd_reva) { - regmap_write(arizona->regmap, 0x80, 0x3); - regmap_write(arizona->regmap, 0x294, 0); - regmap_write(arizona->regmap, 0x80, 0x0); + const struct reg_sequence reva[] = { + { 0x80, 0x3 }, + { 0x294, 0x0 }, + { 0x80, 0x0 }, + }; + + regmap_multi_reg_write(arizona->regmap, reva, ARRAY_SIZE(reva)); } if (info->detecting && arizona->pdata.micd_software_compare) @@ -361,9 +365,13 @@ static void arizona_stop_mic(struct arizona_extcon_info *info) snd_soc_dapm_sync(dapm); if (info->micd_reva) { - regmap_write(arizona->regmap, 0x80, 0x3); - regmap_write(arizona->regmap, 0x294, 2); - regmap_write(arizona->regmap, 0x80, 0x0); + const struct reg_sequence reva[] = { + { 0x80, 0x3 }, + { 0x294, 0x2 }, + { 0x80, 0x0 }, + }; + + regmap_multi_reg_write(arizona->regmap, reva, ARRAY_SIZE(reva)); } ret = regulator_allow_bypass(info->micvdd, true); |