Commit 2dca9227 authored by Linus Walleij's avatar Linus Walleij

Merge branch 'pinconf-rename' into devel

parents 027c87fe ad5c3221
...@@ -757,8 +757,8 @@ that your datasheet calls "GPIO mode", but actually is just an electrical ...@@ -757,8 +757,8 @@ that your datasheet calls "GPIO mode", but actually is just an electrical
configuration for a certain device. See the section below named configuration for a certain device. See the section below named
"GPIO mode pitfalls" for more details on this scenario. "GPIO mode pitfalls" for more details on this scenario.
The public pinmux API contains two functions named pinctrl_request_gpio() The public pinmux API contains two functions named pinctrl_gpio_request()
and pinctrl_free_gpio(). These two functions shall *ONLY* be called from and pinctrl_gpio_free(). These two functions shall *ONLY* be called from
gpiolib-based drivers as part of their gpio_request() and gpiolib-based drivers as part of their gpio_request() and
gpio_free() semantics. Likewise the pinctrl_gpio_direction_[input|output] gpio_free() semantics. Likewise the pinctrl_gpio_direction_[input|output]
shall only be called from within respective gpio_direction_[input|output] shall only be called from within respective gpio_direction_[input|output]
...@@ -790,7 +790,7 @@ gpiolib driver and the affected GPIO range, pin offset and desired direction ...@@ -790,7 +790,7 @@ gpiolib driver and the affected GPIO range, pin offset and desired direction
will be passed along to this function. will be passed along to this function.
Alternatively to using these special functions, it is fully allowed to use Alternatively to using these special functions, it is fully allowed to use
named functions for each GPIO pin, the pinctrl_request_gpio() will attempt to named functions for each GPIO pin, the pinctrl_gpio_request() will attempt to
obtain the function "gpioN" where "N" is the global GPIO pin number if no obtain the function "gpioN" where "N" is the global GPIO pin number if no
special GPIO-handler is registered. special GPIO-handler is registered.
......
...@@ -273,8 +273,8 @@ easily, gating off unused clocks. ...@@ -273,8 +273,8 @@ easily, gating off unused clocks.
For GPIOs that use pins known to the pinctrl subsystem, that subsystem should For GPIOs that use pins known to the pinctrl subsystem, that subsystem should
be informed of their use; a gpiolib driver's .request() operation may call be informed of their use; a gpiolib driver's .request() operation may call
pinctrl_request_gpio(), and a gpiolib driver's .free() operation may call pinctrl_gpio_request(), and a gpiolib driver's .free() operation may call
pinctrl_free_gpio(). The pinctrl subsystem allows a pinctrl_request_gpio() pinctrl_gpio_free(). The pinctrl subsystem allows a pinctrl_gpio_request()
to succeed concurrently with a pin or pingroup being "owned" by a device for to succeed concurrently with a pin or pingroup being "owned" by a device for
pin multiplexing. pin multiplexing.
...@@ -448,8 +448,8 @@ together with an optional gpio feature. We have already covered the ...@@ -448,8 +448,8 @@ together with an optional gpio feature. We have already covered the
case where e.g. a GPIO controller need to reserve a pin or set the case where e.g. a GPIO controller need to reserve a pin or set the
direction of a pin by calling any of: direction of a pin by calling any of:
pinctrl_request_gpio() pinctrl_gpio_request()
pinctrl_free_gpio() pinctrl_gpio_free()
pinctrl_gpio_direction_input() pinctrl_gpio_direction_input()
pinctrl_gpio_direction_output() pinctrl_gpio_direction_output()
...@@ -466,7 +466,7 @@ gpio (under gpiolib) is still maintained by gpio drivers. It may happen ...@@ -466,7 +466,7 @@ gpio (under gpiolib) is still maintained by gpio drivers. It may happen
that different pin ranges in a SoC is managed by different gpio drivers. that different pin ranges in a SoC is managed by different gpio drivers.
This makes it logical to let gpio drivers announce their pin ranges to This makes it logical to let gpio drivers announce their pin ranges to
the pin ctrl subsystem before it will call 'pinctrl_request_gpio' in order the pin ctrl subsystem before it will call 'pinctrl_gpio_request' in order
to request the corresponding pin to be prepared by the pinctrl subsystem to request the corresponding pin to be prepared by the pinctrl subsystem
before any gpio usage. before any gpio usage.
......
...@@ -257,9 +257,9 @@ GPIO 值的命令需要等待其信息排到队首才发送命令,再获得其 ...@@ -257,9 +257,9 @@ GPIO 值的命令需要等待其信息排到队首才发送命令,再获得其
简单地关闭未使用时钟)。 简单地关闭未使用时钟)。
对于 GPIO 使用 pinctrl 子系统已知的引脚,子系统应该被告知其使用情况; 对于 GPIO 使用 pinctrl 子系统已知的引脚,子系统应该被告知其使用情况;
一个 gpiolib 驱动的 .request()操作应调用 pinctrl_request_gpio(), 一个 gpiolib 驱动的 .request()操作应调用 pinctrl_gpio_request(),
而 gpiolib 驱动的 .free()操作应调用 pinctrl_free_gpio()。pinctrl 而 gpiolib 驱动的 .free()操作应调用 pinctrl_gpio_free()。pinctrl
子系统允许 pinctrl_request_gpio()在某个引脚或引脚组以复用形式“属于” 子系统允许 pinctrl_gpio_request()在某个引脚或引脚组以复用形式“属于”
一个设备时都成功返回。 一个设备时都成功返回。
任何须将 GPIO 信号导向适当引脚的引脚复用硬件的编程应该发生在 GPIO 任何须将 GPIO 信号导向适当引脚的引脚复用硬件的编程应该发生在 GPIO
......
...@@ -536,12 +536,12 @@ static int aspeed_gpio_request(struct gpio_chip *chip, unsigned int offset) ...@@ -536,12 +536,12 @@ static int aspeed_gpio_request(struct gpio_chip *chip, unsigned int offset)
if (!have_gpio(gpiochip_get_data(chip), offset)) if (!have_gpio(gpiochip_get_data(chip), offset))
return -ENODEV; return -ENODEV;
return pinctrl_request_gpio(chip->base + offset); return pinctrl_gpio_request(chip->base + offset);
} }
static void aspeed_gpio_free(struct gpio_chip *chip, unsigned int offset) static void aspeed_gpio_free(struct gpio_chip *chip, unsigned int offset)
{ {
pinctrl_free_gpio(chip->base + offset); pinctrl_gpio_free(chip->base + offset);
} }
static inline void __iomem *bank_debounce_reg(struct aspeed_gpio *gpio, static inline void __iomem *bank_debounce_reg(struct aspeed_gpio *gpio,
......
...@@ -239,12 +239,12 @@ static int em_gio_to_irq(struct gpio_chip *chip, unsigned offset) ...@@ -239,12 +239,12 @@ static int em_gio_to_irq(struct gpio_chip *chip, unsigned offset)
static int em_gio_request(struct gpio_chip *chip, unsigned offset) static int em_gio_request(struct gpio_chip *chip, unsigned offset)
{ {
return pinctrl_request_gpio(chip->base + offset); return pinctrl_gpio_request(chip->base + offset);
} }
static void em_gio_free(struct gpio_chip *chip, unsigned offset) static void em_gio_free(struct gpio_chip *chip, unsigned offset)
{ {
pinctrl_free_gpio(chip->base + offset); pinctrl_gpio_free(chip->base + offset);
/* Set the GPIO as an input to ensure that the next GPIO request won't /* Set the GPIO as an input to ensure that the next GPIO request won't
* drive the GPIO pin as an output. * drive the GPIO pin as an output.
......
...@@ -330,16 +330,6 @@ static int pxa_gpio_of_xlate(struct gpio_chip *gc, ...@@ -330,16 +330,6 @@ static int pxa_gpio_of_xlate(struct gpio_chip *gc,
} }
#endif #endif
static int pxa_gpio_request(struct gpio_chip *chip, unsigned int offset)
{
return pinctrl_request_gpio(chip->base + offset);
}
static void pxa_gpio_free(struct gpio_chip *chip, unsigned int offset)
{
pinctrl_free_gpio(chip->base + offset);
}
static int pxa_init_gpio_chip(struct pxa_gpio_chip *pchip, int ngpio, static int pxa_init_gpio_chip(struct pxa_gpio_chip *pchip, int ngpio,
struct device_node *np, void __iomem *regbase) struct device_node *np, void __iomem *regbase)
{ {
...@@ -358,8 +348,8 @@ static int pxa_init_gpio_chip(struct pxa_gpio_chip *pchip, int ngpio, ...@@ -358,8 +348,8 @@ static int pxa_init_gpio_chip(struct pxa_gpio_chip *pchip, int ngpio,
pchip->chip.set = pxa_gpio_set; pchip->chip.set = pxa_gpio_set;
pchip->chip.to_irq = pxa_gpio_to_irq; pchip->chip.to_irq = pxa_gpio_to_irq;
pchip->chip.ngpio = ngpio; pchip->chip.ngpio = ngpio;
pchip->chip.request = pxa_gpio_request; pchip->chip.request = gpiochip_generic_request;
pchip->chip.free = pxa_gpio_free; pchip->chip.free = gpiochip_generic_free;
#ifdef CONFIG_OF_GPIO #ifdef CONFIG_OF_GPIO
pchip->chip.of_node = np; pchip->chip.of_node = np;
pchip->chip.of_xlate = pxa_gpio_of_xlate; pchip->chip.of_xlate = pxa_gpio_of_xlate;
......
...@@ -249,7 +249,7 @@ static int gpio_rcar_request(struct gpio_chip *chip, unsigned offset) ...@@ -249,7 +249,7 @@ static int gpio_rcar_request(struct gpio_chip *chip, unsigned offset)
if (error < 0) if (error < 0)
return error; return error;
error = pinctrl_request_gpio(chip->base + offset); error = pinctrl_gpio_request(chip->base + offset);
if (error) if (error)
pm_runtime_put(&p->pdev->dev); pm_runtime_put(&p->pdev->dev);
...@@ -260,7 +260,7 @@ static void gpio_rcar_free(struct gpio_chip *chip, unsigned offset) ...@@ -260,7 +260,7 @@ static void gpio_rcar_free(struct gpio_chip *chip, unsigned offset)
{ {
struct gpio_rcar_priv *p = gpiochip_get_data(chip); struct gpio_rcar_priv *p = gpiochip_get_data(chip);
pinctrl_free_gpio(chip->base + offset); pinctrl_gpio_free(chip->base + offset);
/* /*
* Set the GPIO as an input to ensure that the next GPIO request won't * Set the GPIO as an input to ensure that the next GPIO request won't
......
...@@ -141,14 +141,14 @@ static void tegra_gpio_disable(struct tegra_gpio_info *tgi, unsigned int gpio) ...@@ -141,14 +141,14 @@ static void tegra_gpio_disable(struct tegra_gpio_info *tgi, unsigned int gpio)
static int tegra_gpio_request(struct gpio_chip *chip, unsigned int offset) static int tegra_gpio_request(struct gpio_chip *chip, unsigned int offset)
{ {
return pinctrl_request_gpio(offset); return pinctrl_gpio_request(offset);
} }
static void tegra_gpio_free(struct gpio_chip *chip, unsigned int offset) static void tegra_gpio_free(struct gpio_chip *chip, unsigned int offset)
{ {
struct tegra_gpio_info *tgi = gpiochip_get_data(chip); struct tegra_gpio_info *tgi = gpiochip_get_data(chip);
pinctrl_free_gpio(offset); pinctrl_gpio_free(offset);
tegra_gpio_disable(tgi, offset); tegra_gpio_disable(tgi, offset);
} }
......
...@@ -232,7 +232,7 @@ static int tz1090_gpio_request(struct gpio_chip *chip, unsigned int offset) ...@@ -232,7 +232,7 @@ static int tz1090_gpio_request(struct gpio_chip *chip, unsigned int offset)
struct tz1090_gpio_bank *bank = gpiochip_get_data(chip); struct tz1090_gpio_bank *bank = gpiochip_get_data(chip);
int ret; int ret;
ret = pinctrl_request_gpio(chip->base + offset); ret = pinctrl_gpio_request(chip->base + offset);
if (ret) if (ret)
return ret; return ret;
...@@ -246,7 +246,7 @@ static void tz1090_gpio_free(struct gpio_chip *chip, unsigned int offset) ...@@ -246,7 +246,7 @@ static void tz1090_gpio_free(struct gpio_chip *chip, unsigned int offset)
{ {
struct tz1090_gpio_bank *bank = gpiochip_get_data(chip); struct tz1090_gpio_bank *bank = gpiochip_get_data(chip);
pinctrl_free_gpio(chip->base + offset); pinctrl_gpio_free(chip->base + offset);
tz1090_gpio_clear_bit(bank, REG_GPIO_BIT_EN, offset); tz1090_gpio_clear_bit(bank, REG_GPIO_BIT_EN, offset);
} }
......
...@@ -1859,7 +1859,7 @@ static inline void gpiochip_irqchip_free_valid_mask(struct gpio_chip *gpiochip) ...@@ -1859,7 +1859,7 @@ static inline void gpiochip_irqchip_free_valid_mask(struct gpio_chip *gpiochip)
*/ */
int gpiochip_generic_request(struct gpio_chip *chip, unsigned offset) int gpiochip_generic_request(struct gpio_chip *chip, unsigned offset)
{ {
return pinctrl_request_gpio(chip->gpiodev->base + offset); return pinctrl_gpio_request(chip->gpiodev->base + offset);
} }
EXPORT_SYMBOL_GPL(gpiochip_generic_request); EXPORT_SYMBOL_GPL(gpiochip_generic_request);
...@@ -1870,7 +1870,7 @@ EXPORT_SYMBOL_GPL(gpiochip_generic_request); ...@@ -1870,7 +1870,7 @@ EXPORT_SYMBOL_GPL(gpiochip_generic_request);
*/ */
void gpiochip_generic_free(struct gpio_chip *chip, unsigned offset) void gpiochip_generic_free(struct gpio_chip *chip, unsigned offset)
{ {
pinctrl_free_gpio(chip->gpiodev->base + offset); pinctrl_gpio_free(chip->gpiodev->base + offset);
} }
EXPORT_SYMBOL_GPL(gpiochip_generic_free); EXPORT_SYMBOL_GPL(gpiochip_generic_free);
......
...@@ -311,7 +311,7 @@ static int iproc_gpio_request(struct gpio_chip *gc, unsigned offset) ...@@ -311,7 +311,7 @@ static int iproc_gpio_request(struct gpio_chip *gc, unsigned offset)
if (!chip->pinmux_is_supported) if (!chip->pinmux_is_supported)
return 0; return 0;
return pinctrl_request_gpio(gpio); return pinctrl_gpio_request(gpio);
} }
static void iproc_gpio_free(struct gpio_chip *gc, unsigned offset) static void iproc_gpio_free(struct gpio_chip *gc, unsigned offset)
...@@ -322,7 +322,7 @@ static void iproc_gpio_free(struct gpio_chip *gc, unsigned offset) ...@@ -322,7 +322,7 @@ static void iproc_gpio_free(struct gpio_chip *gc, unsigned offset)
if (!chip->pinmux_is_supported) if (!chip->pinmux_is_supported)
return; return;
pinctrl_free_gpio(gpio); pinctrl_gpio_free(gpio);
} }
static int iproc_gpio_direction_input(struct gpio_chip *gc, unsigned gpio) static int iproc_gpio_direction_input(struct gpio_chip *gc, unsigned gpio)
......
...@@ -275,23 +275,6 @@ static struct irq_chip nsp_gpio_irq_chip = { ...@@ -275,23 +275,6 @@ static struct irq_chip nsp_gpio_irq_chip = {
.irq_set_type = nsp_gpio_irq_set_type, .irq_set_type = nsp_gpio_irq_set_type,
}; };
/*
* Request the nsp IOMUX pinmux controller to mux individual pins to GPIO
*/
static int nsp_gpio_request(struct gpio_chip *gc, unsigned offset)
{
unsigned gpio = gc->base + offset;
return pinctrl_request_gpio(gpio);
}
static void nsp_gpio_free(struct gpio_chip *gc, unsigned offset)
{
unsigned gpio = gc->base + offset;
pinctrl_free_gpio(gpio);
}
static int nsp_gpio_direction_input(struct gpio_chip *gc, unsigned gpio) static int nsp_gpio_direction_input(struct gpio_chip *gc, unsigned gpio)
{ {
struct nsp_gpio *chip = gpiochip_get_data(gc); struct nsp_gpio *chip = gpiochip_get_data(gc);
...@@ -670,8 +653,8 @@ static int nsp_gpio_probe(struct platform_device *pdev) ...@@ -670,8 +653,8 @@ static int nsp_gpio_probe(struct platform_device *pdev)
gc->label = dev_name(dev); gc->label = dev_name(dev);
gc->parent = dev; gc->parent = dev;
gc->of_node = dev->of_node; gc->of_node = dev->of_node;
gc->request = nsp_gpio_request; gc->request = gpiochip_generic_request;
gc->free = nsp_gpio_free; gc->free = gpiochip_generic_free;
gc->direction_input = nsp_gpio_direction_input; gc->direction_input = nsp_gpio_direction_input;
gc->direction_output = nsp_gpio_direction_output; gc->direction_output = nsp_gpio_direction_output;
gc->set = nsp_gpio_set; gc->set = nsp_gpio_set;
......
...@@ -733,14 +733,14 @@ int pinctrl_get_group_selector(struct pinctrl_dev *pctldev, ...@@ -733,14 +733,14 @@ int pinctrl_get_group_selector(struct pinctrl_dev *pctldev,
} }
/** /**
* pinctrl_request_gpio() - request a single pin to be used as GPIO * pinctrl_gpio_request() - request a single pin to be used as GPIO
* @gpio: the GPIO pin number from the GPIO subsystem number space * @gpio: the GPIO pin number from the GPIO subsystem number space
* *
* This function should *ONLY* be used from gpiolib-based GPIO drivers, * This function should *ONLY* be used from gpiolib-based GPIO drivers,
* as part of their gpio_request() semantics, platforms and individual drivers * as part of their gpio_request() semantics, platforms and individual drivers
* shall *NOT* request GPIO pins to be muxed in. * shall *NOT* request GPIO pins to be muxed in.
*/ */
int pinctrl_request_gpio(unsigned gpio) int pinctrl_gpio_request(unsigned gpio)
{ {
struct pinctrl_dev *pctldev; struct pinctrl_dev *pctldev;
struct pinctrl_gpio_range *range; struct pinctrl_gpio_range *range;
...@@ -765,17 +765,17 @@ int pinctrl_request_gpio(unsigned gpio) ...@@ -765,17 +765,17 @@ int pinctrl_request_gpio(unsigned gpio)
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(pinctrl_request_gpio); EXPORT_SYMBOL_GPL(pinctrl_gpio_request);
/** /**
* pinctrl_free_gpio() - free control on a single pin, currently used as GPIO * pinctrl_gpio_free() - free control on a single pin, currently used as GPIO
* @gpio: the GPIO pin number from the GPIO subsystem number space * @gpio: the GPIO pin number from the GPIO subsystem number space
* *
* This function should *ONLY* be used from gpiolib-based GPIO drivers, * This function should *ONLY* be used from gpiolib-based GPIO drivers,
* as part of their gpio_free() semantics, platforms and individual drivers * as part of their gpio_free() semantics, platforms and individual drivers
* shall *NOT* request GPIO pins to be muxed out. * shall *NOT* request GPIO pins to be muxed out.
*/ */
void pinctrl_free_gpio(unsigned gpio) void pinctrl_gpio_free(unsigned gpio)
{ {
struct pinctrl_dev *pctldev; struct pinctrl_dev *pctldev;
struct pinctrl_gpio_range *range; struct pinctrl_gpio_range *range;
...@@ -795,7 +795,7 @@ void pinctrl_free_gpio(unsigned gpio) ...@@ -795,7 +795,7 @@ void pinctrl_free_gpio(unsigned gpio)
mutex_unlock(&pctldev->mutex); mutex_unlock(&pctldev->mutex);
} }
EXPORT_SYMBOL_GPL(pinctrl_free_gpio); EXPORT_SYMBOL_GPL(pinctrl_gpio_free);
static int pinctrl_gpio_direction(unsigned gpio, bool input) static int pinctrl_gpio_direction(unsigned gpio, bool input)
{ {
......
...@@ -154,7 +154,7 @@ struct pinctrl_setting { ...@@ -154,7 +154,7 @@ struct pinctrl_setting {
* or pin, and each of these will increment the @usecount. * or pin, and each of these will increment the @usecount.
* @mux_owner: The name of device that called pinctrl_get(). * @mux_owner: The name of device that called pinctrl_get().
* @mux_setting: The most recent selected mux setting for this pin, if any. * @mux_setting: The most recent selected mux setting for this pin, if any.
* @gpio_owner: If pinctrl_request_gpio() was called for this pin, this is * @gpio_owner: If pinctrl_gpio_request() was called for this pin, this is
* the name of the GPIO that "owns" this pin. * the name of the GPIO that "owns" this pin.
*/ */
struct pin_desc { struct pin_desc {
......
...@@ -139,12 +139,12 @@ static int gpio_pin_request(struct gpio_chip *gc, unsigned offset) ...@@ -139,12 +139,12 @@ static int gpio_pin_request(struct gpio_chip *gc, unsigned offset)
if (idx < 0 || pfc->info->pins[idx].enum_id == 0) if (idx < 0 || pfc->info->pins[idx].enum_id == 0)
return -EINVAL; return -EINVAL;
return pinctrl_request_gpio(offset); return pinctrl_gpio_request(offset);
} }
static void gpio_pin_free(struct gpio_chip *gc, unsigned offset) static void gpio_pin_free(struct gpio_chip *gc, unsigned offset)
{ {
return pinctrl_free_gpio(offset); return pinctrl_gpio_free(offset);
} }
static void gpio_pin_set_value(struct sh_pfc_chip *chip, unsigned offset, static void gpio_pin_set_value(struct sh_pfc_chip *chip, unsigned offset,
......
...@@ -5860,7 +5860,7 @@ static int atlas7_gpio_request(struct gpio_chip *chip, ...@@ -5860,7 +5860,7 @@ static int atlas7_gpio_request(struct gpio_chip *chip,
if (ret < 0) if (ret < 0)
return ret; return ret;
if (pinctrl_request_gpio(chip->base + gpio)) if (pinctrl_gpio_request(chip->base + gpio))
return -ENODEV; return -ENODEV;
raw_spin_lock_irqsave(&a7gc->lock, flags); raw_spin_lock_irqsave(&a7gc->lock, flags);
...@@ -5890,7 +5890,7 @@ static void atlas7_gpio_free(struct gpio_chip *chip, ...@@ -5890,7 +5890,7 @@ static void atlas7_gpio_free(struct gpio_chip *chip,
raw_spin_unlock_irqrestore(&a7gc->lock, flags); raw_spin_unlock_irqrestore(&a7gc->lock, flags);
pinctrl_free_gpio(chip->base + gpio); pinctrl_gpio_free(chip->base + gpio);
} }
static int atlas7_gpio_direction_input(struct gpio_chip *chip, static int atlas7_gpio_direction_input(struct gpio_chip *chip,
......
...@@ -614,7 +614,7 @@ static int sirfsoc_gpio_request(struct gpio_chip *chip, unsigned offset) ...@@ -614,7 +614,7 @@ static int sirfsoc_gpio_request(struct gpio_chip *chip, unsigned offset)
struct sirfsoc_gpio_bank *bank = sirfsoc_gpio_to_bank(sgpio, offset); struct sirfsoc_gpio_bank *bank = sirfsoc_gpio_to_bank(sgpio, offset);
unsigned long flags; unsigned long flags;
if (pinctrl_request_gpio(chip->base + offset)) if (pinctrl_gpio_request(chip->base + offset))
return -ENODEV; return -ENODEV;
spin_lock_irqsave(&bank->lock, flags); spin_lock_irqsave(&bank->lock, flags);
...@@ -644,7 +644,7 @@ static void sirfsoc_gpio_free(struct gpio_chip *chip, unsigned offset) ...@@ -644,7 +644,7 @@ static void sirfsoc_gpio_free(struct gpio_chip *chip, unsigned offset)
spin_unlock_irqrestore(&bank->lock, flags); spin_unlock_irqrestore(&bank->lock, flags);
pinctrl_free_gpio(chip->base + offset); pinctrl_gpio_free(chip->base + offset);
} }
static int sirfsoc_gpio_direction_input(struct gpio_chip *chip, unsigned gpio) static int sirfsoc_gpio_direction_input(struct gpio_chip *chip, unsigned gpio)
......
...@@ -204,7 +204,7 @@ static int plgpio_request(struct gpio_chip *chip, unsigned offset) ...@@ -204,7 +204,7 @@ static int plgpio_request(struct gpio_chip *chip, unsigned offset)
if (offset >= chip->ngpio) if (offset >= chip->ngpio)
return -EINVAL; return -EINVAL;
ret = pinctrl_request_gpio(gpio); ret = pinctrl_gpio_request(gpio);
if (ret) if (ret)
return ret; return ret;
...@@ -242,7 +242,7 @@ static int plgpio_request(struct gpio_chip *chip, unsigned offset) ...@@ -242,7 +242,7 @@ static int plgpio_request(struct gpio_chip *chip, unsigned offset)
if (!IS_ERR(plgpio->clk)) if (!IS_ERR(plgpio->clk))
clk_disable(plgpio->clk); clk_disable(plgpio->clk);
err0: err0:
pinctrl_free_gpio(gpio); pinctrl_gpio_free(gpio);
return ret; return ret;
} }
...@@ -273,7 +273,7 @@ static void plgpio_free(struct gpio_chip *chip, unsigned offset) ...@@ -273,7 +273,7 @@ static void plgpio_free(struct gpio_chip *chip, unsigned offset)
if (!IS_ERR(plgpio->clk)) if (!IS_ERR(plgpio->clk))
clk_disable(plgpio->clk); clk_disable(plgpio->clk);
pinctrl_free_gpio(gpio); pinctrl_gpio_free(gpio);
} }
/* PLGPIO IRQ */ /* PLGPIO IRQ */
......
...@@ -150,12 +150,12 @@ static int stm32_gpio_request(struct gpio_chip *chip, unsigned offset) ...@@ -150,12 +150,12 @@ static int stm32_gpio_request(struct gpio_chip *chip, unsigned offset)
return -EINVAL; return -EINVAL;
} }
return pinctrl_request_gpio(chip->base + offset); return pinctrl_gpio_request(chip->base + offset);
} }
static void stm32_gpio_free(struct gpio_chip *chip, unsigned offset) static void stm32_gpio_free(struct gpio_chip *chip, unsigned offset)
{ {
pinctrl_free_gpio(chip->base + offset); pinctrl_gpio_free(chip->base + offset);
} }
static int stm32_gpio_get(struct gpio_chip *chip, unsigned offset) static int stm32_gpio_get(struct gpio_chip *chip, unsigned offset)
......
...@@ -25,8 +25,8 @@ struct device; ...@@ -25,8 +25,8 @@ struct device;
#ifdef CONFIG_PINCTRL #ifdef CONFIG_PINCTRL
/* External interface to pin control */ /* External interface to pin control */
extern int pinctrl_request_gpio(unsigned gpio); extern int pinctrl_gpio_request(unsigned gpio);
extern void pinctrl_free_gpio(unsigned gpio); extern void pinctrl_gpio_free(unsigned gpio);
extern int pinctrl_gpio_direction_input(unsigned gpio); extern int pinctrl_gpio_direction_input(unsigned gpio);
extern int pinctrl_gpio_direction_output(unsigned gpio); extern int pinctrl_gpio_direction_output(unsigned gpio);
extern int pinctrl_gpio_set_config(unsigned gpio, unsigned long config); extern int pinctrl_gpio_set_config(unsigned gpio, unsigned long config);
...@@ -62,12 +62,12 @@ static inline int pinctrl_pm_select_idle_state(struct device *dev) ...@@ -62,12 +62,12 @@ static inline int pinctrl_pm_select_idle_state(struct device *dev)
#else /* !CONFIG_PINCTRL */ #else /* !CONFIG_PINCTRL */
static inline int pinctrl_request_gpio(unsigned gpio) static inline int pinctrl_gpio_request(unsigned gpio)
{ {
return 0; return 0;
} }
static inline void pinctrl_free_gpio(unsigned gpio) static inline void pinctrl_gpio_free(unsigned gpio)
{ {
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment