@@ -103,11 +103,11 @@ skl_int3472_get_sensor_module_config(struct int3472_discrete_device *int3472)
103
103
}
104
104
105
105
static int skl_int3472_map_gpio_to_sensor (struct int3472_discrete_device * int3472 ,
106
- struct acpi_resource * ares ,
106
+ struct acpi_resource_gpio * agpio ,
107
107
const char * func , u32 polarity )
108
108
{
109
- char * path = ares -> data .gpio .resource_source .string_ptr ;
110
109
const struct int3472_sensor_config * sensor_config ;
110
+ char * path = agpio -> resource_source .string_ptr ;
111
111
struct gpiod_lookup * table_entry ;
112
112
struct acpi_device * adev ;
113
113
acpi_handle handle ;
@@ -145,7 +145,7 @@ static int skl_int3472_map_gpio_to_sensor(struct int3472_discrete_device *int347
145
145
146
146
table_entry = & int3472 -> gpios .table [int3472 -> n_sensor_gpios ];
147
147
table_entry -> key = acpi_dev_name (adev );
148
- table_entry -> chip_hwnum = ares -> data . gpio . pin_table [0 ];
148
+ table_entry -> chip_hwnum = agpio -> pin_table [0 ];
149
149
table_entry -> con_id = func ;
150
150
table_entry -> idx = 0 ;
151
151
table_entry -> flags = polarity ;
@@ -156,23 +156,22 @@ static int skl_int3472_map_gpio_to_sensor(struct int3472_discrete_device *int347
156
156
}
157
157
158
158
static int skl_int3472_map_gpio_to_clk (struct int3472_discrete_device * int3472 ,
159
- struct acpi_resource * ares , u8 type )
159
+ struct acpi_resource_gpio * agpio , u8 type )
160
160
{
161
- char * path = ares -> data .gpio .resource_source .string_ptr ;
161
+ char * path = agpio -> resource_source .string_ptr ;
162
+ u16 pin = agpio -> pin_table [0 ];
162
163
struct gpio_desc * gpio ;
163
164
164
165
switch (type ) {
165
166
case INT3472_GPIO_TYPE_CLK_ENABLE :
166
- gpio = acpi_get_and_request_gpiod (path , ares -> data .gpio .pin_table [0 ],
167
- "int3472,clk-enable" );
167
+ gpio = acpi_get_and_request_gpiod (path , pin , "int3472,clk-enable" );
168
168
if (IS_ERR (gpio ))
169
169
return (PTR_ERR (gpio ));
170
170
171
171
int3472 -> clock .ena_gpio = gpio ;
172
172
break ;
173
173
case INT3472_GPIO_TYPE_PRIVACY_LED :
174
- gpio = acpi_get_and_request_gpiod (path , ares -> data .gpio .pin_table [0 ],
175
- "int3472,privacy-led" );
174
+ gpio = acpi_get_and_request_gpiod (path , pin , "int3472,privacy-led" );
176
175
if (IS_ERR (gpio ))
177
176
return (PTR_ERR (gpio ));
178
177
@@ -242,37 +241,36 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares,
242
241
243
242
if (!obj ) {
244
243
dev_warn (int3472 -> dev , "No _DSM entry for GPIO pin %u\n" ,
245
- ares -> data . gpio . pin_table [0 ]);
244
+ agpio -> pin_table [0 ]);
246
245
return 1 ;
247
246
}
248
247
249
248
type = obj -> integer .value & 0xff ;
250
249
251
250
switch (type ) {
252
251
case INT3472_GPIO_TYPE_RESET :
253
- ret = skl_int3472_map_gpio_to_sensor (int3472 , ares , "reset" ,
252
+ ret = skl_int3472_map_gpio_to_sensor (int3472 , agpio , "reset" ,
254
253
GPIO_ACTIVE_LOW );
255
254
if (ret )
256
255
err_msg = "Failed to map reset pin to sensor\n" ;
257
256
258
257
break ;
259
258
case INT3472_GPIO_TYPE_POWERDOWN :
260
- ret = skl_int3472_map_gpio_to_sensor (int3472 , ares ,
261
- "powerdown" ,
259
+ ret = skl_int3472_map_gpio_to_sensor (int3472 , agpio , "powerdown" ,
262
260
GPIO_ACTIVE_LOW );
263
261
if (ret )
264
262
err_msg = "Failed to map powerdown pin to sensor\n" ;
265
263
266
264
break ;
267
265
case INT3472_GPIO_TYPE_CLK_ENABLE :
268
266
case INT3472_GPIO_TYPE_PRIVACY_LED :
269
- ret = skl_int3472_map_gpio_to_clk (int3472 , ares , type );
267
+ ret = skl_int3472_map_gpio_to_clk (int3472 , agpio , type );
270
268
if (ret )
271
269
err_msg = "Failed to map GPIO to clock\n" ;
272
270
273
271
break ;
274
272
case INT3472_GPIO_TYPE_POWER_ENABLE :
275
- ret = skl_int3472_register_regulator (int3472 , ares );
273
+ ret = skl_int3472_register_regulator (int3472 , agpio );
276
274
if (ret )
277
275
err_msg = "Failed to map regulator to sensor\n" ;
278
276
0 commit comments