File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
drivers/platform/x86/intel/int3472 Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -99,6 +99,32 @@ static int skl_int3472_map_gpio_to_sensor(struct int3472_discrete_device *int347
99
99
return 0 ;
100
100
}
101
101
102
+ /* This should *really* only be used when there's no other way... */
103
+ static struct gpio_desc *
104
+ skl_int3472_gpiod_get_from_temp_lookup (struct int3472_discrete_device * int3472 ,
105
+ struct acpi_resource_gpio * agpio ,
106
+ const char * func , u32 polarity )
107
+ {
108
+ struct gpio_desc * desc ;
109
+ int ret ;
110
+
111
+ struct gpiod_lookup_table * lookup __free (kfree ) =
112
+ kzalloc (struct_size (lookup , table , 2 ), GFP_KERNEL );
113
+ if (!lookup )
114
+ return ERR_PTR (- ENOMEM );
115
+
116
+ lookup -> dev_id = dev_name (int3472 -> dev );
117
+ ret = skl_int3472_fill_gpiod_lookup (& lookup -> table [0 ], agpio , func , polarity );
118
+ if (ret )
119
+ return ERR_PTR (ret );
120
+
121
+ gpiod_add_lookup_table (lookup );
122
+ desc = gpiod_get (int3472 -> dev , func , GPIOD_OUT_LOW );
123
+ gpiod_remove_lookup_table (lookup );
124
+
125
+ return desc ;
126
+ }
127
+
102
128
static void int3472_get_func_and_polarity (u8 type , const char * * func , u32 * polarity )
103
129
{
104
130
switch (type ) {
You can’t perform that action at this time.
0 commit comments