media: atomisp_gmin_platform: Fix axp_regulator_set() writing to the wrong register
authorHans de Goede <hdegoede@redhat.com>
Sun, 16 Jan 2022 21:51:59 +0000 (22:51 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Tue, 8 Feb 2022 05:28:37 +0000 (06:28 +0100)
The second write done in axp_regulator_set() must go to the ctrl_reg which
turns the various regulators on/off. This replaces the second write
writing the sel_reg, which sets the voltage for the regulator, for a
second time with a wrong value.

Link: https://lore.kernel.org/linux-media/20220116215204.307649-5-hdegoede@redhat.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c

index 1cc5810..a29e508 100644 (file)
@@ -741,7 +741,7 @@ static int axp_regulator_set(struct device *dev, struct gmin_subdev *gs,
 
        val = on ? 1 << shift : 0;
 
-       ret = gmin_i2c_write(dev, gs->pwm_i2c_addr, sel_reg, val, 1 << shift);
+       ret = gmin_i2c_write(dev, gs->pwm_i2c_addr, ctrl_reg, val, 1 << shift);
        if (ret)
                return ret;