@@ -783,47 +783,40 @@ bool pinctrl_gpio_can_use_line_new(struct gpio_chip *gc, unsigned int offset)
783783}
784784EXPORT_SYMBOL_GPL (pinctrl_gpio_can_use_line_new );
785785
786- /* This function is deprecated and will be removed. Don't use. */
787- int pinctrl_gpio_request (unsigned gpio )
786+ /**
787+ * pinctrl_gpio_request_new() - request a single pin to be used as GPIO
788+ * @gc: GPIO chip structure from the GPIO subsystem
789+ * @offset: hardware offset of the GPIO relative to the controller
790+ *
791+ * This function should *ONLY* be used from gpiolib-based GPIO drivers,
792+ * as part of their gpio_request() semantics, platforms and individual drivers
793+ * shall *NOT* request GPIO pins to be muxed in.
794+ */
795+ int pinctrl_gpio_request_new (struct gpio_chip * gc , unsigned int offset )
788796{
789- struct pinctrl_dev * pctldev ;
790797 struct pinctrl_gpio_range * range ;
791- int ret ;
792- int pin ;
798+ struct pinctrl_dev * pctldev ;
799+ int ret , pin ;
793800
794- ret = pinctrl_get_device_gpio_range (gpio , & pctldev , & range );
801+ ret = pinctrl_get_device_gpio_range (gc -> base + offset , & pctldev ,
802+ & range );
795803 if (ret ) {
796- if (pinctrl_ready_for_gpio_range (gpio ))
804+ if (pinctrl_ready_for_gpio_range (gc -> base + offset ))
797805 ret = 0 ;
798806 return ret ;
799807 }
800808
801809 mutex_lock (& pctldev -> mutex );
802810
803811 /* Convert to the pin controllers number space */
804- pin = gpio_to_pin (range , gpio );
812+ pin = gpio_to_pin (range , gc -> base + offset );
805813
806- ret = pinmux_request_gpio (pctldev , range , pin , gpio );
814+ ret = pinmux_request_gpio (pctldev , range , pin , gc -> base + offset );
807815
808816 mutex_unlock (& pctldev -> mutex );
809817
810818 return ret ;
811819}
812- EXPORT_SYMBOL_GPL (pinctrl_gpio_request );
813-
814- /**
815- * pinctrl_gpio_request_new() - request a single pin to be used as GPIO
816- * @gc: GPIO chip structure from the GPIO subsystem
817- * @offset: hardware offset of the GPIO relative to the controller
818- *
819- * This function should *ONLY* be used from gpiolib-based GPIO drivers,
820- * as part of their gpio_request() semantics, platforms and individual drivers
821- * shall *NOT* request GPIO pins to be muxed in.
822- */
823- int pinctrl_gpio_request_new (struct gpio_chip * gc , unsigned int offset )
824- {
825- return pinctrl_gpio_request (gc -> base + offset );
826- }
827820EXPORT_SYMBOL_GPL (pinctrl_gpio_request_new );
828821
829822/* This function is deprecated and will be removed. Don't use. */
0 commit comments