]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: atomisp: gmin: Remove GPIO driven regulator support
authorHans de Goede <hdegoede@redhat.com>
Thu, 7 Nov 2024 22:11:34 +0000 (23:11 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Mon, 5 May 2025 07:47:27 +0000 (09:47 +0200)
The GMIN code has support for sensors using external regulators enabled
by GPIOS, rather then using regulators build into the PMIC.

With the exception of the Trekstor ST70408-4 (1) tablet there are no known
devices which actually use external regulators for the sensors and the code
for this is using deprecated old style GPIO numbers support for which is
going away.

Remove the GPIO driven regulator support so that the gmin code no longer
depends on deprecated GPIO APIs.

1) The GMIN support itself is also deprecated and all sensor drivers still
using it are being moved over to use ACPI + runtime-pm and the ST70408-4
shipped with Android as factory OS and thus will have broken ACPI tables
for the sensors, so like other Android factory OS tablets it will need
a bespoke solution anyways.

Reported-by: Bartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/r/20241107221134.596149-1-hdegoede@redhat.com
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c

index 8ec990293b4882f2820fe273e8994a6dd8bccc7b..e7923dc38f2e5eb4dec9e03d40e80b9c6895ff39 100644 (file)
@@ -85,9 +85,6 @@ struct gmin_subdev {
        bool v2p8_on;
        bool v1p2_on;
 
-       int v1p8_gpio;
-       int v2p8_gpio;
-
        u8 pwm_i2c_addr;
 
        /* For PMIC AXP */
@@ -242,22 +239,6 @@ static struct gmin_cfg_var mrd7_vars[] = {
        {},
 };
 
-static struct gmin_cfg_var ecs7_vars[] = {
-       {"INT33BE:00_CsiPort", "1"},
-       {"INT33BE:00_CsiLanes", "2"},
-       {"INT33BE:00_CsiFmt", "13"},
-       {"INT33BE:00_CsiBayer", "2"},
-       {"INT33BE:00_CamClk", "0"},
-
-       {"INT33F0:00_CsiPort", "0"},
-       {"INT33F0:00_CsiLanes", "1"},
-       {"INT33F0:00_CsiFmt", "13"},
-       {"INT33F0:00_CsiBayer", "0"},
-       {"INT33F0:00_CamClk", "1"},
-       {"gmin_V2P8GPIO", "402"},
-       {},
-};
-
 static struct gmin_cfg_var i8880_vars[] = {
        {"XXOV2680:00_CsiPort", "1"},
        {"XXOV2680:00_CsiLanes", "1"},
@@ -307,13 +288,6 @@ static const struct dmi_system_id gmin_vars[] = {
                },
                .driver_data = mrd7_vars,
        },
-       {
-               .ident = "ST70408",
-               .matches = {
-                       DMI_MATCH(DMI_BOARD_NAME, "ST70408"),
-               },
-               .driver_data = ecs7_vars,
-       },
        {
                .ident = "VTA0803",
                .matches = {
@@ -531,23 +505,6 @@ static int gmin_subdev_add(struct gmin_subdev *gs)
        else
                dev_info(dev, "will handle gpio1 via ACPI\n");
 
-       /*
-        * Those are used only when there is an external regulator apart
-        * from the PMIC that would be providing power supply, like on the
-        * two cases below:
-        *
-        * The ECS E7 board drives camera 2.8v from an external regulator
-        * instead of the PMIC.  There's a gmin_CamV2P8 config variable
-        * that specifies the GPIO to handle this particular case,
-        * but this needs a broader architecture for handling camera power.
-        *
-        * The CHT RVP board drives camera 1.8v from an* external regulator
-        * instead of the PMIC just like ECS E7 board.
-        */
-
-       gs->v1p8_gpio = gmin_get_var_int(dev, true, "V1P8GPIO", -1);
-       gs->v2p8_gpio = gmin_get_var_int(dev, true, "V2P8GPIO", -1);
-
        /*
         * FIXME:
         *
@@ -820,16 +777,6 @@ static int gmin_v1p8_ctrl(struct v4l2_subdev *subdev, int on)
        if (!gs || gs->v1p8_on == on)
                return 0;
 
-       if (gs->v1p8_gpio >= 0) {
-               pr_info("atomisp_gmin_platform: 1.8v power on GPIO %d\n",
-                       gs->v1p8_gpio);
-               ret = gpio_request(gs->v1p8_gpio, "camera_v1p8_en");
-               if (!ret)
-                       ret = gpio_direction_output(gs->v1p8_gpio, 0);
-               if (ret)
-                       pr_err("V1P8 GPIO initialization failed\n");
-       }
-
        gs->v1p8_on = on;
 
        ret = 0;
@@ -844,9 +791,6 @@ static int gmin_v1p8_ctrl(struct v4l2_subdev *subdev, int on)
                        goto out; /* Still needed */
        }
 
-       if (gs->v1p8_gpio >= 0)
-               gpio_set_value(gs->v1p8_gpio, on);
-
        if (gs->v1p8_reg) {
                regulator_set_voltage(gs->v1p8_reg, 1800000, 1800000);
                if (on)
@@ -901,16 +845,6 @@ static int gmin_v2p8_ctrl(struct v4l2_subdev *subdev, int on)
        if (WARN_ON(!gs))
                return -ENODEV;
 
-       if (gs->v2p8_gpio >= 0) {
-               pr_info("atomisp_gmin_platform: 2.8v power on GPIO %d\n",
-                       gs->v2p8_gpio);
-               ret = gpio_request(gs->v2p8_gpio, "camera_v2p8");
-               if (!ret)
-                       ret = gpio_direction_output(gs->v2p8_gpio, 0);
-               if (ret)
-                       pr_err("V2P8 GPIO initialization failed\n");
-       }
-
        if (gs->v2p8_on == on)
                return 0;
        gs->v2p8_on = on;
@@ -927,9 +861,6 @@ static int gmin_v2p8_ctrl(struct v4l2_subdev *subdev, int on)
                        goto out; /* Still needed */
        }
 
-       if (gs->v2p8_gpio >= 0)
-               gpio_set_value(gs->v2p8_gpio, on);
-
        if (gs->v2p8_reg) {
                regulator_set_voltage(gs->v2p8_reg, 2900000, 2900000);
                if (on)