@@ -743,8 +743,8 @@ static int acpi_gpio_update_gpiod_lookup_flags(unsigned long *lookupflags,
743
743
}
744
744
745
745
struct acpi_gpio_lookup {
746
- struct acpi_gpio_info info ;
747
746
struct acpi_gpio_params params ;
747
+ struct acpi_gpio_info * info ;
748
748
struct gpio_desc * desc ;
749
749
int n ;
750
750
};
@@ -753,6 +753,7 @@ static int acpi_populate_gpio_lookup(struct acpi_resource *ares, void *data)
753
753
{
754
754
struct acpi_gpio_lookup * lookup = data ;
755
755
struct acpi_gpio_params * params = & lookup -> params ;
756
+ struct acpi_gpio_info * info = lookup -> info ;
756
757
757
758
if (ares -> type != ACPI_RESOURCE_TYPE_GPIO )
758
759
return 1 ;
@@ -763,7 +764,7 @@ static int acpi_populate_gpio_lookup(struct acpi_resource *ares, void *data)
763
764
struct gpio_desc * desc ;
764
765
u16 pin_index ;
765
766
766
- if (lookup -> info . quirks & ACPI_GPIO_QUIRK_ONLY_GPIOIO && gpioint )
767
+ if (info -> quirks & ACPI_GPIO_QUIRK_ONLY_GPIOIO && gpioint )
767
768
params -> crs_entry_index ++ ;
768
769
769
770
if (lookup -> n ++ != params -> crs_entry_index )
@@ -773,16 +774,16 @@ static int acpi_populate_gpio_lookup(struct acpi_resource *ares, void *data)
773
774
if (pin_index >= agpio -> pin_table_length )
774
775
return 1 ;
775
776
776
- if (lookup -> info . quirks & ACPI_GPIO_QUIRK_ABSOLUTE_NUMBER )
777
+ if (info -> quirks & ACPI_GPIO_QUIRK_ABSOLUTE_NUMBER )
777
778
desc = gpio_to_desc (agpio -> pin_table [pin_index ]);
778
779
else
779
780
desc = acpi_get_gpiod (agpio -> resource_source .string_ptr ,
780
781
agpio -> pin_table [pin_index ]);
781
782
lookup -> desc = desc ;
782
- lookup -> info . pin_config = agpio -> pin_config ;
783
- lookup -> info . debounce = agpio -> debounce_timeout ;
784
- lookup -> info . gpioint = gpioint ;
785
- lookup -> info . wake_capable = acpi_gpio_irq_is_wake (& lookup -> info . adev -> dev , agpio );
783
+ info -> pin_config = agpio -> pin_config ;
784
+ info -> debounce = agpio -> debounce_timeout ;
785
+ info -> gpioint = gpioint ;
786
+ info -> wake_capable = acpi_gpio_irq_is_wake (& info -> adev -> dev , agpio );
786
787
787
788
/*
788
789
* Polarity and triggering are only specified for GpioInt
@@ -791,22 +792,23 @@ static int acpi_populate_gpio_lookup(struct acpi_resource *ares, void *data)
791
792
* - ACPI_ACTIVE_LOW == GPIO_ACTIVE_LOW
792
793
* - ACPI_ACTIVE_HIGH == GPIO_ACTIVE_HIGH
793
794
*/
794
- if (lookup -> info . gpioint ) {
795
- lookup -> info . polarity = agpio -> polarity ;
796
- lookup -> info . triggering = agpio -> triggering ;
795
+ if (info -> gpioint ) {
796
+ info -> polarity = agpio -> polarity ;
797
+ info -> triggering = agpio -> triggering ;
797
798
} else {
798
- lookup -> info . polarity = params -> active_low ;
799
+ info -> polarity = params -> active_low ;
799
800
}
800
801
801
- lookup -> info . flags = acpi_gpio_to_gpiod_flags (agpio , lookup -> info . polarity );
802
+ info -> flags = acpi_gpio_to_gpiod_flags (agpio , info -> polarity );
802
803
}
803
804
804
805
return 1 ;
805
806
}
806
807
807
808
static int acpi_gpio_resource_lookup (struct acpi_gpio_lookup * lookup )
808
809
{
809
- struct acpi_device * adev = lookup -> info .adev ;
810
+ struct acpi_gpio_info * info = lookup -> info ;
811
+ struct acpi_device * adev = info -> adev ;
810
812
struct list_head res_list ;
811
813
int ret ;
812
814
@@ -831,6 +833,7 @@ static int acpi_gpio_property_lookup(struct fwnode_handle *fwnode, const char *p
831
833
{
832
834
struct fwnode_reference_args args ;
833
835
struct acpi_gpio_params * params = & lookup -> params ;
836
+ struct acpi_gpio_info * info = lookup -> info ;
834
837
unsigned int index = params -> crs_entry_index ;
835
838
unsigned int quirks = 0 ;
836
839
int ret ;
@@ -858,8 +861,8 @@ static int acpi_gpio_property_lookup(struct fwnode_handle *fwnode, const char *p
858
861
params -> line_index = args .args [1 ];
859
862
params -> active_low = !!args .args [2 ];
860
863
861
- lookup -> info . adev = to_acpi_device_node (args .fwnode );
862
- lookup -> info . quirks = quirks ;
864
+ info -> adev = to_acpi_device_node (args .fwnode );
865
+ info -> quirks = quirks ;
863
866
864
867
return 0 ;
865
868
}
@@ -891,8 +894,8 @@ static int acpi_gpio_property_lookup(struct fwnode_handle *fwnode, const char *p
891
894
static int acpi_get_gpiod_by_index (struct acpi_device * adev , const char * propname ,
892
895
struct acpi_gpio_lookup * lookup )
893
896
{
894
- struct acpi_gpio_info * info = & lookup -> info ;
895
897
struct acpi_gpio_params * params = & lookup -> params ;
898
+ struct acpi_gpio_info * info = lookup -> info ;
896
899
int ret ;
897
900
898
901
if (propname ) {
@@ -973,6 +976,7 @@ __acpi_find_gpio(struct fwnode_handle *fwnode, const char *con_id, unsigned int
973
976
974
977
memset (& lookup , 0 , sizeof (lookup ));
975
978
lookup .params .crs_entry_index = idx ;
979
+ lookup .info = info ;
976
980
977
981
/* Try first from _DSD */
978
982
for_each_gpio_property_name (propname , con_id ) {
0 commit comments