Skip to content

Commit b52798a

Browse files
committed
platform/x86: int3472: discrete: Drop GPIO remapping support
The only sensor driver which needs GPIO remapping support is the ov2680 driver and ACPI enumeration support + other necessary changes to the ov2680 driver were never upstreamed. A new series updating the ov2680 driver is pending upstream now and in this series the ov2680 driver is patched to look for "powerdown" as con-id, instead of relying on GPIO remapping in the int3472 code, so the GPIO remapping is no longer necessary. Tested-by: Hao Yao <[email protected]> Reviewed-by: Daniel Scally <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 669f1f4 commit b52798a

File tree

2 files changed

+3
-40
lines changed

2 files changed

+3
-40
lines changed

drivers/platform/x86/intel/int3472/common.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,9 @@ struct int3472_cldb {
6969
u8 reserved2[17];
7070
};
7171

72-
struct int3472_gpio_function_remap {
73-
const char *documented;
74-
const char *actual;
75-
};
76-
7772
struct int3472_sensor_config {
7873
const char *sensor_module_name;
7974
struct regulator_consumer_supply supply_map;
80-
const struct int3472_gpio_function_remap *function_maps;
8175
};
8276

8377
struct int3472_discrete_device {

drivers/platform/x86/intel/int3472/discrete.c

Lines changed: 3 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -39,27 +39,13 @@ static const guid_t cio2_sensor_module_guid =
3939
* the functions mapping resources to the sensors. Where the sensors have
4040
* a power enable pin defined in DSDT we need to provide a supply name so
4141
* the sensor drivers can find the regulator. The device name will be derived
42-
* from the sensor's ACPI device within the code. Optionally, we can provide a
43-
* NULL terminated array of function name mappings to deal with any platform
44-
* specific deviations from the documented behaviour of GPIOs.
45-
*
46-
* Map a GPIO function name to NULL to prevent the driver from mapping that
47-
* GPIO at all.
42+
* from the sensor's ACPI device within the code.
4843
*/
49-
50-
static const struct int3472_gpio_function_remap ov2680_gpio_function_remaps[] = {
51-
{ "reset", NULL },
52-
{ "powerdown", "reset" },
53-
{ }
54-
};
55-
5644
static const struct int3472_sensor_config int3472_sensor_configs[] = {
57-
/* Lenovo Miix 510-12ISK - OV2680, Front */
58-
{ "GNDF140809R", { 0 }, ov2680_gpio_function_remaps },
5945
/* Lenovo Miix 510-12ISK - OV5648, Rear */
60-
{ "GEFF150023R", REGULATOR_SUPPLY("avdd", NULL), NULL },
46+
{ "GEFF150023R", REGULATOR_SUPPLY("avdd", NULL) },
6147
/* Surface Go 1&2 - OV5693, Front */
62-
{ "YHCU", REGULATOR_SUPPLY("avdd", NULL), NULL },
48+
{ "YHCU", REGULATOR_SUPPLY("avdd", NULL) },
6349
};
6450

6551
static const struct int3472_sensor_config *
@@ -96,7 +82,6 @@ static int skl_int3472_map_gpio_to_sensor(struct int3472_discrete_device *int347
9682
struct acpi_resource_gpio *agpio,
9783
const char *func, u32 polarity)
9884
{
99-
const struct int3472_sensor_config *sensor_config;
10085
char *path = agpio->resource_source.string_ptr;
10186
struct gpiod_lookup *table_entry;
10287
struct acpi_device *adev;
@@ -108,22 +93,6 @@ static int skl_int3472_map_gpio_to_sensor(struct int3472_discrete_device *int347
10893
return -EINVAL;
10994
}
11095

111-
sensor_config = int3472->sensor_config;
112-
if (!IS_ERR(sensor_config) && sensor_config->function_maps) {
113-
const struct int3472_gpio_function_remap *remap;
114-
115-
for (remap = sensor_config->function_maps; remap->documented; remap++) {
116-
if (!strcmp(func, remap->documented)) {
117-
func = remap->actual;
118-
break;
119-
}
120-
}
121-
}
122-
123-
/* Functions mapped to NULL should not be mapped to the sensor */
124-
if (!func)
125-
return 0;
126-
12796
status = acpi_get_handle(NULL, path, &handle);
12897
if (ACPI_FAILURE(status))
12998
return -EINVAL;

0 commit comments

Comments
 (0)