@@ -904,42 +904,36 @@ int pinctrl_gpio_direction_output_new(struct gpio_chip *gc, unsigned int offset)
904904}
905905EXPORT_SYMBOL_GPL (pinctrl_gpio_direction_output_new );
906906
907- /* This function is deprecated and will be removed. Don't use. */
908- int pinctrl_gpio_set_config (unsigned gpio , unsigned long config )
907+ /**
908+ * pinctrl_gpio_set_config_new() - Apply config to given GPIO pin
909+ * @gc: GPIO chip structure from the GPIO subsystem
910+ * @offset: hardware offset of the GPIO relative to the controller
911+ * @config: the configuration to apply to the GPIO
912+ *
913+ * This function should *ONLY* be used from gpiolib-based GPIO drivers, if
914+ * they need to call the underlying pin controller to change GPIO config
915+ * (for example set debounce time).
916+ */
917+ int pinctrl_gpio_set_config_new (struct gpio_chip * gc , unsigned int offset ,
918+ unsigned long config )
909919{
910920 unsigned long configs [] = { config };
911921 struct pinctrl_gpio_range * range ;
912922 struct pinctrl_dev * pctldev ;
913923 int ret , pin ;
914924
915- ret = pinctrl_get_device_gpio_range (gpio , & pctldev , & range );
925+ ret = pinctrl_get_device_gpio_range (gc -> base + offset , & pctldev ,
926+ & range );
916927 if (ret )
917928 return ret ;
918929
919930 mutex_lock (& pctldev -> mutex );
920- pin = gpio_to_pin (range , gpio );
931+ pin = gpio_to_pin (range , gc -> base + offset );
921932 ret = pinconf_set_config (pctldev , pin , configs , ARRAY_SIZE (configs ));
922933 mutex_unlock (& pctldev -> mutex );
923934
924935 return ret ;
925936}
926- EXPORT_SYMBOL_GPL (pinctrl_gpio_set_config );
927-
928- /**
929- * pinctrl_gpio_set_config_new() - Apply config to given GPIO pin
930- * @gc: GPIO chip structure from the GPIO subsystem
931- * @offset: hardware offset of the GPIO relative to the controller
932- * @config: the configuration to apply to the GPIO
933- *
934- * This function should *ONLY* be used from gpiolib-based GPIO drivers, if
935- * they need to call the underlying pin controller to change GPIO config
936- * (for example set debounce time).
937- */
938- int pinctrl_gpio_set_config_new (struct gpio_chip * gc , unsigned int offset ,
939- unsigned long config )
940- {
941- return pinctrl_gpio_set_config (gc -> base + offset , config );
942- }
943937EXPORT_SYMBOL_GPL (pinctrl_gpio_set_config_new );
944938
945939static struct pinctrl_state * find_state (struct pinctrl * p ,
0 commit comments