media: atomisp: add support for possible new names
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Sat, 25 Apr 2020 11:39:24 +0000 (13:39 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Wed, 20 May 2020 10:32:17 +0000 (12:32 +0200)
This patch addresses what it sounds to be a change at the
name of some ACPI registers on newer ACPI tables.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/staging/media/atomisp/platform/intel-mid/atomisp_gmin_platform.c

index 4f1500ef0990caac96ce4f9e4431623a304d6434..eef7123a586f19349dddb6ed721a110916c9df14 100644 (file)
@@ -394,6 +394,17 @@ static struct gmin_subdev *gmin_subdev_add(struct v4l2_subdev *subdev)
                gmin_subdevs[i].v1p2_reg = regulator_get(dev, "V1P2A");
                gmin_subdevs[i].v2p8_vcm_reg = regulator_get(dev, "VPROG4B");
 
+               /*
+                * Based on DTST dumps on newer Atom E3800 devices, it seems that
+                * the regulators data now have new names.
+                */
+               if (IS_ERR(gmin_subdevs[i].v1p8_reg))
+                       gmin_subdevs[i].v1p8_reg = regulator_get(dev, "Regulator1p8v");
+
+               if (IS_ERR(gmin_subdevs[i].v2p8_reg))
+                       gmin_subdevs[i].v2p8_reg = regulator_get(dev, "Regulator2p8v");
+
+
                /* Note: ideally we would initialize v[12]p8_on to the
                 * output of regulator_is_enabled(), but sadly that
                 * API is broken with the current drivers, returning