summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpio/gpiolib-acpi.c19
-rw-r--r--drivers/gpio/gpiolib-acpi.h8
2 files changed, 10 insertions, 17 deletions
diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
index fdee8afa5339..2b6fdc9947f7 100644
--- a/drivers/gpio/gpiolib-acpi.c
+++ b/drivers/gpio/gpiolib-acpi.c
@@ -728,6 +728,16 @@ static struct gpio_desc *acpi_get_gpiod_by_index(struct acpi_device *adev,
728 return ret ? ERR_PTR(ret) : lookup.desc; 728 return ret ? ERR_PTR(ret) : lookup.desc;
729} 729}
730 730
731static bool acpi_can_fallback_to_crs(struct acpi_device *adev,
732 const char *con_id)
733{
734 /* Never allow fallback if the device has properties */
735 if (acpi_dev_has_props(adev) || adev->driver_gpios)
736 return false;
737
738 return con_id == NULL;
739}
740
731struct gpio_desc *acpi_find_gpio(struct device *dev, 741struct gpio_desc *acpi_find_gpio(struct device *dev,
732 const char *con_id, 742 const char *con_id,
733 unsigned int idx, 743 unsigned int idx,
@@ -1264,15 +1274,6 @@ int acpi_gpio_count(struct device *dev, const char *con_id)
1264 return count ? count : -ENOENT; 1274 return count ? count : -ENOENT;
1265} 1275}
1266 1276
1267bool acpi_can_fallback_to_crs(struct acpi_device *adev, const char *con_id)
1268{
1269 /* Never allow fallback if the device has properties */
1270 if (acpi_dev_has_props(adev) || adev->driver_gpios)
1271 return false;
1272
1273 return con_id == NULL;
1274}
1275
1276/* Run deferred acpi_gpiochip_request_irqs() */ 1277/* Run deferred acpi_gpiochip_request_irqs() */
1277static int acpi_gpio_handle_deferred_request_irqs(void) 1278static int acpi_gpio_handle_deferred_request_irqs(void)
1278{ 1279{
diff --git a/drivers/gpio/gpiolib-acpi.h b/drivers/gpio/gpiolib-acpi.h
index d7241b432b8b..1c6d65cf0629 100644
--- a/drivers/gpio/gpiolib-acpi.h
+++ b/drivers/gpio/gpiolib-acpi.h
@@ -52,8 +52,6 @@ struct gpio_desc *acpi_node_get_gpiod(struct fwnode_handle *fwnode,
52 struct acpi_gpio_info *info); 52 struct acpi_gpio_info *info);
53 53
54int acpi_gpio_count(struct device *dev, const char *con_id); 54int acpi_gpio_count(struct device *dev, const char *con_id);
55
56bool acpi_can_fallback_to_crs(struct acpi_device *adev, const char *con_id);
57#else 55#else
58static inline void acpi_gpiochip_add(struct gpio_chip *chip) { } 56static inline void acpi_gpiochip_add(struct gpio_chip *chip) { }
59static inline void acpi_gpiochip_remove(struct gpio_chip *chip) { } 57static inline void acpi_gpiochip_remove(struct gpio_chip *chip) { }
@@ -93,12 +91,6 @@ static inline int acpi_gpio_count(struct device *dev, const char *con_id)
93{ 91{
94 return -ENODEV; 92 return -ENODEV;
95} 93}
96
97static inline bool acpi_can_fallback_to_crs(struct acpi_device *adev,
98 const char *con_id)
99{
100 return false;
101}
102#endif 94#endif
103 95
104#endif /* GPIOLIB_ACPI_H */ 96#endif /* GPIOLIB_ACPI_H */