summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2023-11-07 16:36:25 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2023-11-07 16:36:25 -0800
commitdc1434801d2ee8b57286f587877e67d2f9b699d6 (patch)
treed2105702b361bc8ab6b45965a0671d3bec29602f /include
parent13d88ac54ddd1011b6e94443958e798aa06eb835 (diff)
parent5be55473a06475cc1128ccd93831ff57a068a81e (diff)
Merge tag 'gpio-pinctrl-updates-for-v6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux
Pull gpio/pinctrl updates from Bartosz Golaszewski: "The bulk of it is a rework of the glue layer between pinctrl and GPIO. We changed the signature of GPIO helpers for pinctrl to taking the gpio_chip/offset pair as arguments instead of using the deprecated global GPIO numberspace. The last little bit is removing the gpiochip_find() function as it now has no more users in-tree. Summary: - rework the GPIO-to-pinctrl glue code to stop using the deprecated global GPIO numberspace - remove now unused wrappers around pinctrl GPIO helpers from drivers - remove gpiochip_find() as it has no more users" * tag 'gpio-pinctrl-updates-for-v6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: (70 commits) pinctrl: tegra: drop the wrapper around pinctrl_gpio_request() pinctrl: em: drop the wrapper around pinctrl_gpio_request() pinctrl: nuvoton: npcm8xx: drop wrappers around pinctrl_gpio_request/free() pinctrl: nuvoton: npcm7xx: drop wrappers around pinctrl_gpio_request/free() pinctrl: stm32: drop wrappers around pinctrl_gpio_free/input() pinctrl: starfive: jh7110: drop wrappers around pinctrl_gpio_request/free() pinctrl: starfive: jh7100: drop wrappers around pinctrl_gpio_request/free() pinctrl: ocelot: drop the wrapper around pinctrl_gpio_direction_input() pinctrl: cirrus: drop the wrapper around pinctrl_gpio_direction_input() pinctrl: mediatek: common: drop the wrappers around pinctrl_gpio_direction_input() pinctrl: mediatek: moore: drop the wrappers around pinctrl_gpio_direction_input() pinctrl: rk805: drop the wrapper around pinctrl_gpio_direction_input() pinctrl: axp209: drop the wrapper around pinctrl_gpio_direction_input() pinctrl: vt8500: drop the wrapper around pinctrl_gpio_direction_input() pinctrl: as3722: drop the wrapper around pinctrl_gpio_direction_input() pinctrl: ingenic: drop the wrapper around pinctrl_gpio_direction_input() pinctrl: st: drop the wrapper around pinctrl_gpio_direction_input() pinctrl: change the signature of pinctrl_ready_for_gpio_range() pinctrl: change the signature of gpio_to_pin() pinctrl: change the signature of pinctrl_match_gpio_range() ...
Diffstat (limited to 'include')
-rw-r--r--include/linux/gpio/driver.h3
-rw-r--r--include/linux/pinctrl/consumer.h61
2 files changed, 36 insertions, 28 deletions
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
index 1d454dc944b3..0aed62f0c633 100644
--- a/include/linux/gpio/driver.h
+++ b/include/linux/gpio/driver.h
@@ -605,9 +605,6 @@ int devm_gpiochip_add_data_with_key(struct device *dev, struct gpio_chip *gc,
void *data, struct lock_class_key *lock_key,
struct lock_class_key *request_key);
-struct gpio_chip *gpiochip_find(void *data,
- int (*match)(struct gpio_chip *gc, void *data));
-
struct gpio_device *gpio_device_find(void *data,
int (*match)(struct gpio_chip *gc, void *data));
struct gpio_device *gpio_device_find_by_label(const char *label);
diff --git a/include/linux/pinctrl/consumer.h b/include/linux/pinctrl/consumer.h
index 4729d54e8995..73de70362b98 100644
--- a/include/linux/pinctrl/consumer.h
+++ b/include/linux/pinctrl/consumer.h
@@ -17,6 +17,7 @@
#include <linux/pinctrl/pinctrl-state.h>
struct device;
+struct gpio_chip;
/* This struct is private to the core and should be regarded as a cookie */
struct pinctrl;
@@ -25,27 +26,30 @@ struct pinctrl_state;
#ifdef CONFIG_PINCTRL
/* External interface to pin control */
-extern bool pinctrl_gpio_can_use_line(unsigned gpio);
-extern int pinctrl_gpio_request(unsigned gpio);
-extern void pinctrl_gpio_free(unsigned gpio);
-extern int pinctrl_gpio_direction_input(unsigned gpio);
-extern int pinctrl_gpio_direction_output(unsigned gpio);
-extern int pinctrl_gpio_set_config(unsigned gpio, unsigned long config);
-
-extern struct pinctrl * __must_check pinctrl_get(struct device *dev);
-extern void pinctrl_put(struct pinctrl *p);
-extern struct pinctrl_state * __must_check pinctrl_lookup_state(struct pinctrl *p,
- const char *name);
-extern int pinctrl_select_state(struct pinctrl *p, struct pinctrl_state *s);
-
-extern struct pinctrl * __must_check devm_pinctrl_get(struct device *dev);
-extern void devm_pinctrl_put(struct pinctrl *p);
-extern int pinctrl_select_default_state(struct device *dev);
+bool pinctrl_gpio_can_use_line(struct gpio_chip *gc, unsigned int offset);
+int pinctrl_gpio_request(struct gpio_chip *gc, unsigned int offset);
+void pinctrl_gpio_free(struct gpio_chip *gc, unsigned int offset);
+int pinctrl_gpio_direction_input(struct gpio_chip *gc,
+ unsigned int offset);
+int pinctrl_gpio_direction_output(struct gpio_chip *gc,
+ unsigned int offset);
+int pinctrl_gpio_set_config(struct gpio_chip *gc, unsigned int offset,
+ unsigned long config);
+
+struct pinctrl * __must_check pinctrl_get(struct device *dev);
+void pinctrl_put(struct pinctrl *p);
+struct pinctrl_state * __must_check pinctrl_lookup_state(struct pinctrl *p,
+ const char *name);
+int pinctrl_select_state(struct pinctrl *p, struct pinctrl_state *s);
+
+struct pinctrl * __must_check devm_pinctrl_get(struct device *dev);
+void devm_pinctrl_put(struct pinctrl *p);
+int pinctrl_select_default_state(struct device *dev);
#ifdef CONFIG_PM
-extern int pinctrl_pm_select_default_state(struct device *dev);
-extern int pinctrl_pm_select_sleep_state(struct device *dev);
-extern int pinctrl_pm_select_idle_state(struct device *dev);
+int pinctrl_pm_select_default_state(struct device *dev);
+int pinctrl_pm_select_sleep_state(struct device *dev);
+int pinctrl_pm_select_idle_state(struct device *dev);
#else
static inline int pinctrl_pm_select_default_state(struct device *dev)
{
@@ -63,31 +67,38 @@ static inline int pinctrl_pm_select_idle_state(struct device *dev)
#else /* !CONFIG_PINCTRL */
-static inline bool pinctrl_gpio_can_use_line(unsigned gpio)
+static inline bool
+pinctrl_gpio_can_use_line(struct gpio_chip *gc, unsigned int offset)
{
return true;
}
-static inline int pinctrl_gpio_request(unsigned gpio)
+static inline int
+pinctrl_gpio_request(struct gpio_chip *gc, unsigned int offset)
{
return 0;
}
-static inline void pinctrl_gpio_free(unsigned gpio)
+static inline void
+pinctrl_gpio_free(struct gpio_chip *gc, unsigned int offset)
{
}
-static inline int pinctrl_gpio_direction_input(unsigned gpio)
+static inline int
+pinctrl_gpio_direction_input(struct gpio_chip *gc, unsigned int offset)
{
return 0;
}
-static inline int pinctrl_gpio_direction_output(unsigned gpio)
+static inline int
+pinctrl_gpio_direction_output(struct gpio_chip *gc, unsigned int offset)
{
return 0;
}
-static inline int pinctrl_gpio_set_config(unsigned gpio, unsigned long config)
+static inline int
+pinctrl_gpio_set_config(struct gpio_chip *gc, unsigned int offset,
+ unsigned long config)
{
return 0;
}