@@ -55,7 +55,7 @@ static void skl_int3472_log_sensor_module_name(struct int3472_discrete_device *i
55
55
56
56
static int skl_int3472_fill_gpiod_lookup (struct gpiod_lookup * table_entry ,
57
57
struct acpi_resource_gpio * agpio ,
58
- const char * func , u32 polarity )
58
+ const char * func , unsigned long gpio_flags )
59
59
{
60
60
char * path = agpio -> resource_source .string_ptr ;
61
61
struct acpi_device * adev ;
@@ -70,14 +70,14 @@ static int skl_int3472_fill_gpiod_lookup(struct gpiod_lookup *table_entry,
70
70
if (!adev )
71
71
return - ENODEV ;
72
72
73
- * table_entry = GPIO_LOOKUP (acpi_dev_name (adev ), agpio -> pin_table [0 ], func , polarity );
73
+ * table_entry = GPIO_LOOKUP (acpi_dev_name (adev ), agpio -> pin_table [0 ], func , gpio_flags );
74
74
75
75
return 0 ;
76
76
}
77
77
78
78
static int skl_int3472_map_gpio_to_sensor (struct int3472_discrete_device * int3472 ,
79
79
struct acpi_resource_gpio * agpio ,
80
- const char * func , u32 polarity )
80
+ const char * func , unsigned long gpio_flags )
81
81
{
82
82
int ret ;
83
83
@@ -87,7 +87,7 @@ static int skl_int3472_map_gpio_to_sensor(struct int3472_discrete_device *int347
87
87
}
88
88
89
89
ret = skl_int3472_fill_gpiod_lookup (& int3472 -> gpios .table [int3472 -> n_sensor_gpios ],
90
- agpio , func , polarity );
90
+ agpio , func , gpio_flags );
91
91
if (ret )
92
92
return ret ;
93
93
@@ -100,7 +100,7 @@ static int skl_int3472_map_gpio_to_sensor(struct int3472_discrete_device *int347
100
100
static struct gpio_desc *
101
101
skl_int3472_gpiod_get_from_temp_lookup (struct int3472_discrete_device * int3472 ,
102
102
struct acpi_resource_gpio * agpio ,
103
- const char * func , u32 polarity )
103
+ const char * func , unsigned long gpio_flags )
104
104
{
105
105
struct gpio_desc * desc ;
106
106
int ret ;
@@ -111,7 +111,7 @@ skl_int3472_gpiod_get_from_temp_lookup(struct int3472_discrete_device *int3472,
111
111
return ERR_PTR (- ENOMEM );
112
112
113
113
lookup -> dev_id = dev_name (int3472 -> dev );
114
- ret = skl_int3472_fill_gpiod_lookup (& lookup -> table [0 ], agpio , func , polarity );
114
+ ret = skl_int3472_fill_gpiod_lookup (& lookup -> table [0 ], agpio , func , gpio_flags );
115
115
if (ret )
116
116
return ERR_PTR (ret );
117
117
@@ -122,32 +122,33 @@ skl_int3472_gpiod_get_from_temp_lookup(struct int3472_discrete_device *int3472,
122
122
return desc ;
123
123
}
124
124
125
- static void int3472_get_func_and_polarity (u8 type , const char * * func , u32 * polarity )
125
+ static void int3472_get_func_and_polarity (u8 type , const char * * func ,
126
+ unsigned long * gpio_flags )
126
127
{
127
128
switch (type ) {
128
129
case INT3472_GPIO_TYPE_RESET :
129
130
* func = "reset" ;
130
- * polarity = GPIO_ACTIVE_LOW ;
131
+ * gpio_flags = GPIO_ACTIVE_LOW ;
131
132
break ;
132
133
case INT3472_GPIO_TYPE_POWERDOWN :
133
134
* func = "powerdown" ;
134
- * polarity = GPIO_ACTIVE_LOW ;
135
+ * gpio_flags = GPIO_ACTIVE_LOW ;
135
136
break ;
136
137
case INT3472_GPIO_TYPE_CLK_ENABLE :
137
138
* func = "clk-enable" ;
138
- * polarity = GPIO_ACTIVE_HIGH ;
139
+ * gpio_flags = GPIO_ACTIVE_HIGH ;
139
140
break ;
140
141
case INT3472_GPIO_TYPE_PRIVACY_LED :
141
142
* func = "privacy-led" ;
142
- * polarity = GPIO_ACTIVE_HIGH ;
143
+ * gpio_flags = GPIO_ACTIVE_HIGH ;
143
144
break ;
144
145
case INT3472_GPIO_TYPE_POWER_ENABLE :
145
146
* func = "power-enable" ;
146
- * polarity = GPIO_ACTIVE_HIGH ;
147
+ * gpio_flags = GPIO_ACTIVE_HIGH ;
147
148
break ;
148
149
default :
149
150
* func = "unknown" ;
150
- * polarity = GPIO_ACTIVE_HIGH ;
151
+ * gpio_flags = GPIO_ACTIVE_HIGH ;
151
152
break ;
152
153
}
153
154
}
@@ -194,7 +195,7 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares,
194
195
struct gpio_desc * gpio ;
195
196
const char * err_msg ;
196
197
const char * func ;
197
- u32 polarity ;
198
+ unsigned long gpio_flags ;
198
199
int ret ;
199
200
200
201
if (!acpi_gpio_get_io_resource (ares , & agpio ))
@@ -217,7 +218,7 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares,
217
218
218
219
type = FIELD_GET (INT3472_GPIO_DSM_TYPE , obj -> integer .value );
219
220
220
- int3472_get_func_and_polarity (type , & func , & polarity );
221
+ int3472_get_func_and_polarity (type , & func , & gpio_flags );
221
222
222
223
pin = FIELD_GET (INT3472_GPIO_DSM_PIN , obj -> integer .value );
223
224
/* Pin field is not really used under Windows and wraps around at 8 bits */
@@ -227,24 +228,24 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares,
227
228
228
229
active_value = FIELD_GET (INT3472_GPIO_DSM_SENSOR_ON_VAL , obj -> integer .value );
229
230
if (!active_value )
230
- polarity ^= GPIO_ACTIVE_LOW ;
231
+ gpio_flags ^= GPIO_ACTIVE_LOW ;
231
232
232
233
dev_dbg (int3472 -> dev , "%s %s pin %d active-%s\n" , func ,
233
234
agpio -> resource_source .string_ptr , agpio -> pin_table [0 ],
234
- str_high_low (polarity == GPIO_ACTIVE_HIGH ));
235
+ str_high_low (gpio_flags == GPIO_ACTIVE_HIGH ));
235
236
236
237
switch (type ) {
237
238
case INT3472_GPIO_TYPE_RESET :
238
239
case INT3472_GPIO_TYPE_POWERDOWN :
239
- ret = skl_int3472_map_gpio_to_sensor (int3472 , agpio , func , polarity );
240
+ ret = skl_int3472_map_gpio_to_sensor (int3472 , agpio , func , gpio_flags );
240
241
if (ret )
241
242
err_msg = "Failed to map GPIO pin to sensor\n" ;
242
243
243
244
break ;
244
245
case INT3472_GPIO_TYPE_CLK_ENABLE :
245
246
case INT3472_GPIO_TYPE_PRIVACY_LED :
246
247
case INT3472_GPIO_TYPE_POWER_ENABLE :
247
- gpio = skl_int3472_gpiod_get_from_temp_lookup (int3472 , agpio , func , polarity );
248
+ gpio = skl_int3472_gpiod_get_from_temp_lookup (int3472 , agpio , func , gpio_flags );
248
249
if (IS_ERR (gpio )) {
249
250
ret = PTR_ERR (gpio );
250
251
err_msg = "Failed to get GPIO\n" ;
0 commit comments