diff options
Diffstat (limited to 'drivers/pinctrl/bcm')
-rw-r--r-- | drivers/pinctrl/bcm/pinctrl-bcm2835.c | 12 | ||||
-rw-r--r-- | drivers/pinctrl/bcm/pinctrl-iproc-gpio.c | 2 | ||||
-rw-r--r-- | drivers/pinctrl/bcm/pinctrl-nsp-gpio.c | 21 |
3 files changed, 15 insertions, 20 deletions
diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c index 75b0d8c8f058..0f5997ceb494 100644 --- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c +++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c @@ -23,7 +23,7 @@ #include <linux/delay.h> #include <linux/device.h> #include <linux/err.h> -#include <linux/gpio.h> +#include <linux/gpio/driver.h> #include <linux/interrupt.h> #include <linux/io.h> #include <linux/irq.h> @@ -337,14 +337,14 @@ static int bcm2835_gpio_direction_input(struct gpio_chip *chip, unsigned offset) static int bcm2835_gpio_get(struct gpio_chip *chip, unsigned offset) { - struct bcm2835_pinctrl *pc = dev_get_drvdata(chip->dev); + struct bcm2835_pinctrl *pc = gpiochip_get_data(chip); return bcm2835_gpio_get_bit(pc, GPLEV0, offset); } static void bcm2835_gpio_set(struct gpio_chip *chip, unsigned offset, int value) { - struct bcm2835_pinctrl *pc = dev_get_drvdata(chip->dev); + struct bcm2835_pinctrl *pc = gpiochip_get_data(chip); bcm2835_gpio_set_bit(pc, value ? GPSET0 : GPCLR0, offset); } @@ -358,7 +358,7 @@ static int bcm2835_gpio_direction_output(struct gpio_chip *chip, static int bcm2835_gpio_to_irq(struct gpio_chip *chip, unsigned offset) { - struct bcm2835_pinctrl *pc = dev_get_drvdata(chip->dev); + struct bcm2835_pinctrl *pc = gpiochip_get_data(chip); return irq_linear_revmap(pc->irq_domain, offset); } @@ -964,7 +964,7 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev) return PTR_ERR(pc->base); pc->gpio_chip = bcm2835_gpio_chip; - pc->gpio_chip.dev = dev; + pc->gpio_chip.parent = dev; pc->gpio_chip.of_node = np; pc->irq_domain = irq_domain_add_linear(np, BCM2835_NUM_GPIOS, @@ -1021,7 +1021,7 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev) } } - err = gpiochip_add(&pc->gpio_chip); + err = gpiochip_add_data(&pc->gpio_chip, pc); if (err) { dev_err(dev, "could not add GPIO chip\n"); return err; diff --git a/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c b/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c index 314591a4609b..3b2ac8f771ed 100644 --- a/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c +++ b/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c @@ -694,7 +694,7 @@ static int iproc_gpio_probe(struct platform_device *pdev) gc->ngpio = ngpios; chip->num_banks = (ngpios + NGPIOS_PER_BANK - 1) / NGPIOS_PER_BANK; gc->label = dev_name(dev); - gc->dev = dev; + gc->parent = dev; gc->of_node = dev->of_node; gc->request = iproc_gpio_request; gc->free = iproc_gpio_free; diff --git a/drivers/pinctrl/bcm/pinctrl-nsp-gpio.c b/drivers/pinctrl/bcm/pinctrl-nsp-gpio.c index 725c36f917f9..ac900435dc39 100644 --- a/drivers/pinctrl/bcm/pinctrl-nsp-gpio.c +++ b/drivers/pinctrl/bcm/pinctrl-nsp-gpio.c @@ -18,7 +18,7 @@ * through the interaction with the NSP IOMUX controller. */ -#include <linux/gpio.h> +#include <linux/gpio/driver.h> #include <linux/interrupt.h> #include <linux/io.h> #include <linux/ioport.h> @@ -81,11 +81,6 @@ enum base_type { IO_CTRL }; -static inline struct nsp_gpio *to_nsp_gpio(struct gpio_chip *gc) -{ - return container_of(gc, struct nsp_gpio, gc); -} - /* * Mapping from PINCONF pins to GPIO pins is 1-to-1 */ @@ -297,7 +292,7 @@ static void nsp_gpio_free(struct gpio_chip *gc, unsigned offset) static int nsp_gpio_direction_input(struct gpio_chip *gc, unsigned gpio) { - struct nsp_gpio *chip = to_nsp_gpio(gc); + struct nsp_gpio *chip = gpiochip_get_data(gc); unsigned long flags; spin_lock_irqsave(&chip->lock, flags); @@ -311,7 +306,7 @@ static int nsp_gpio_direction_input(struct gpio_chip *gc, unsigned gpio) static int nsp_gpio_direction_output(struct gpio_chip *gc, unsigned gpio, int val) { - struct nsp_gpio *chip = to_nsp_gpio(gc); + struct nsp_gpio *chip = gpiochip_get_data(gc); unsigned long flags; spin_lock_irqsave(&chip->lock, flags); @@ -325,7 +320,7 @@ static int nsp_gpio_direction_output(struct gpio_chip *gc, unsigned gpio, static void nsp_gpio_set(struct gpio_chip *gc, unsigned gpio, int val) { - struct nsp_gpio *chip = to_nsp_gpio(gc); + struct nsp_gpio *chip = gpiochip_get_data(gc); unsigned long flags; spin_lock_irqsave(&chip->lock, flags); @@ -337,14 +332,14 @@ static void nsp_gpio_set(struct gpio_chip *gc, unsigned gpio, int val) static int nsp_gpio_get(struct gpio_chip *gc, unsigned gpio) { - struct nsp_gpio *chip = to_nsp_gpio(gc); + struct nsp_gpio *chip = gpiochip_get_data(gc); return !!(readl(chip->base + NSP_GPIO_DATA_IN) & BIT(gpio)); } static int nsp_gpio_to_irq(struct gpio_chip *gc, unsigned offset) { - struct nsp_gpio *chip = to_nsp_gpio(gc); + struct nsp_gpio *chip = gpiochip_get_data(gc); return irq_linear_revmap(chip->irq_domain, offset); } @@ -669,7 +664,7 @@ static int nsp_gpio_probe(struct platform_device *pdev) gc->can_sleep = false; gc->ngpio = val; gc->label = dev_name(dev); - gc->dev = dev; + gc->parent = dev; gc->of_node = dev->of_node; gc->request = nsp_gpio_request; gc->free = nsp_gpio_free; @@ -714,7 +709,7 @@ static int nsp_gpio_probe(struct platform_device *pdev) writel(val, (chip->base + NSP_CHIP_A_INT_MASK)); } - ret = gpiochip_add(gc); + ret = gpiochip_add_data(gc, chip); if (ret < 0) { dev_err(dev, "unable to add GPIO chip\n"); return ret; |