diff options
21 files changed, 42 insertions, 290 deletions
diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c index 8efa235ca1c9..a1ea565fcd46 100644 --- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c +++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c | |||
@@ -330,16 +330,6 @@ static inline void bcm2835_pinctrl_fsel_set( | |||
330 | bcm2835_gpio_wr(pc, FSEL_REG(pin), val); | 330 | bcm2835_gpio_wr(pc, FSEL_REG(pin), val); |
331 | } | 331 | } |
332 | 332 | ||
333 | static int bcm2835_gpio_request(struct gpio_chip *chip, unsigned offset) | ||
334 | { | ||
335 | return pinctrl_request_gpio(chip->base + offset); | ||
336 | } | ||
337 | |||
338 | static void bcm2835_gpio_free(struct gpio_chip *chip, unsigned offset) | ||
339 | { | ||
340 | pinctrl_free_gpio(chip->base + offset); | ||
341 | } | ||
342 | |||
343 | static int bcm2835_gpio_direction_input(struct gpio_chip *chip, unsigned offset) | 333 | static int bcm2835_gpio_direction_input(struct gpio_chip *chip, unsigned offset) |
344 | { | 334 | { |
345 | return pinctrl_gpio_direction_input(chip->base + offset); | 335 | return pinctrl_gpio_direction_input(chip->base + offset); |
@@ -375,8 +365,8 @@ static int bcm2835_gpio_to_irq(struct gpio_chip *chip, unsigned offset) | |||
375 | static struct gpio_chip bcm2835_gpio_chip = { | 365 | static struct gpio_chip bcm2835_gpio_chip = { |
376 | .label = MODULE_NAME, | 366 | .label = MODULE_NAME, |
377 | .owner = THIS_MODULE, | 367 | .owner = THIS_MODULE, |
378 | .request = bcm2835_gpio_request, | 368 | .request = gpiochip_generic_request, |
379 | .free = bcm2835_gpio_free, | 369 | .free = gpiochip_generic_free, |
380 | .direction_input = bcm2835_gpio_direction_input, | 370 | .direction_input = bcm2835_gpio_direction_input, |
381 | .direction_output = bcm2835_gpio_direction_output, | 371 | .direction_output = bcm2835_gpio_direction_output, |
382 | .get = bcm2835_gpio_get, | 372 | .get = bcm2835_gpio_get, |
diff --git a/drivers/pinctrl/intel/pinctrl-cherryview.c b/drivers/pinctrl/intel/pinctrl-cherryview.c index 270c127e03ea..84936bae6e5e 100644 --- a/drivers/pinctrl/intel/pinctrl-cherryview.c +++ b/drivers/pinctrl/intel/pinctrl-cherryview.c | |||
@@ -1149,16 +1149,6 @@ static struct pinctrl_desc chv_pinctrl_desc = { | |||
1149 | .owner = THIS_MODULE, | 1149 | .owner = THIS_MODULE, |
1150 | }; | 1150 | }; |
1151 | 1151 | ||
1152 | static int chv_gpio_request(struct gpio_chip *chip, unsigned offset) | ||
1153 | { | ||
1154 | return pinctrl_request_gpio(chip->base + offset); | ||
1155 | } | ||
1156 | |||
1157 | static void chv_gpio_free(struct gpio_chip *chip, unsigned offset) | ||
1158 | { | ||
1159 | pinctrl_free_gpio(chip->base + offset); | ||
1160 | } | ||
1161 | |||
1162 | static unsigned chv_gpio_offset_to_pin(struct chv_pinctrl *pctrl, | 1152 | static unsigned chv_gpio_offset_to_pin(struct chv_pinctrl *pctrl, |
1163 | unsigned offset) | 1153 | unsigned offset) |
1164 | { | 1154 | { |
@@ -1238,8 +1228,8 @@ static int chv_gpio_direction_output(struct gpio_chip *chip, unsigned offset, | |||
1238 | 1228 | ||
1239 | static const struct gpio_chip chv_gpio_chip = { | 1229 | static const struct gpio_chip chv_gpio_chip = { |
1240 | .owner = THIS_MODULE, | 1230 | .owner = THIS_MODULE, |
1241 | .request = chv_gpio_request, | 1231 | .request = gpiochip_generic_request, |
1242 | .free = chv_gpio_free, | 1232 | .free = gpiochip_generic_free, |
1243 | .get_direction = chv_gpio_get_direction, | 1233 | .get_direction = chv_gpio_get_direction, |
1244 | .direction_input = chv_gpio_direction_input, | 1234 | .direction_input = chv_gpio_direction_input, |
1245 | .direction_output = chv_gpio_direction_output, | 1235 | .direction_output = chv_gpio_direction_output, |
diff --git a/drivers/pinctrl/intel/pinctrl-intel.c b/drivers/pinctrl/intel/pinctrl-intel.c index 54848b8decef..928a00b48d50 100644 --- a/drivers/pinctrl/intel/pinctrl-intel.c +++ b/drivers/pinctrl/intel/pinctrl-intel.c | |||
@@ -597,16 +597,6 @@ static const struct pinctrl_desc intel_pinctrl_desc = { | |||
597 | .owner = THIS_MODULE, | 597 | .owner = THIS_MODULE, |
598 | }; | 598 | }; |
599 | 599 | ||
600 | static int intel_gpio_request(struct gpio_chip *chip, unsigned offset) | ||
601 | { | ||
602 | return pinctrl_request_gpio(chip->base + offset); | ||
603 | } | ||
604 | |||
605 | static void intel_gpio_free(struct gpio_chip *chip, unsigned offset) | ||
606 | { | ||
607 | pinctrl_free_gpio(chip->base + offset); | ||
608 | } | ||
609 | |||
610 | static int intel_gpio_get(struct gpio_chip *chip, unsigned offset) | 600 | static int intel_gpio_get(struct gpio_chip *chip, unsigned offset) |
611 | { | 601 | { |
612 | struct intel_pinctrl *pctrl = gpiochip_to_pinctrl(chip); | 602 | struct intel_pinctrl *pctrl = gpiochip_to_pinctrl(chip); |
@@ -654,8 +644,8 @@ static int intel_gpio_direction_output(struct gpio_chip *chip, unsigned offset, | |||
654 | 644 | ||
655 | static const struct gpio_chip intel_gpio_chip = { | 645 | static const struct gpio_chip intel_gpio_chip = { |
656 | .owner = THIS_MODULE, | 646 | .owner = THIS_MODULE, |
657 | .request = intel_gpio_request, | 647 | .request = gpiochip_generic_request, |
658 | .free = intel_gpio_free, | 648 | .free = gpiochip_generic_free, |
659 | .direction_input = intel_gpio_direction_input, | 649 | .direction_input = intel_gpio_direction_input, |
660 | .direction_output = intel_gpio_direction_output, | 650 | .direction_output = intel_gpio_direction_output, |
661 | .get = intel_gpio_get, | 651 | .get = intel_gpio_get, |
diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c index 1b22f96ba839..f8fafc18d49a 100644 --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c | |||
@@ -723,16 +723,6 @@ static const struct pinmux_ops mtk_pmx_ops = { | |||
723 | .gpio_set_direction = mtk_pmx_gpio_set_direction, | 723 | .gpio_set_direction = mtk_pmx_gpio_set_direction, |
724 | }; | 724 | }; |
725 | 725 | ||
726 | static int mtk_gpio_request(struct gpio_chip *chip, unsigned offset) | ||
727 | { | ||
728 | return pinctrl_request_gpio(chip->base + offset); | ||
729 | } | ||
730 | |||
731 | static void mtk_gpio_free(struct gpio_chip *chip, unsigned offset) | ||
732 | { | ||
733 | pinctrl_free_gpio(chip->base + offset); | ||
734 | } | ||
735 | |||
736 | static int mtk_gpio_direction_input(struct gpio_chip *chip, | 726 | static int mtk_gpio_direction_input(struct gpio_chip *chip, |
737 | unsigned offset) | 727 | unsigned offset) |
738 | { | 728 | { |
@@ -1005,8 +995,8 @@ static int mtk_gpio_set_debounce(struct gpio_chip *chip, unsigned offset, | |||
1005 | 995 | ||
1006 | static struct gpio_chip mtk_gpio_chip = { | 996 | static struct gpio_chip mtk_gpio_chip = { |
1007 | .owner = THIS_MODULE, | 997 | .owner = THIS_MODULE, |
1008 | .request = mtk_gpio_request, | 998 | .request = gpiochip_generic_request, |
1009 | .free = mtk_gpio_free, | 999 | .free = gpiochip_generic_free, |
1010 | .direction_input = mtk_gpio_direction_input, | 1000 | .direction_input = mtk_gpio_direction_input, |
1011 | .direction_output = mtk_gpio_direction_output, | 1001 | .direction_output = mtk_gpio_direction_output, |
1012 | .get = mtk_gpio_get, | 1002 | .get = mtk_gpio_get, |
diff --git a/drivers/pinctrl/nomadik/pinctrl-abx500.c b/drivers/pinctrl/nomadik/pinctrl-abx500.c index 97681fac082e..b59fbb4b1fb1 100644 --- a/drivers/pinctrl/nomadik/pinctrl-abx500.c +++ b/drivers/pinctrl/nomadik/pinctrl-abx500.c | |||
@@ -654,25 +654,11 @@ static inline void abx500_gpio_dbg_show_one(struct seq_file *s, | |||
654 | #define abx500_gpio_dbg_show NULL | 654 | #define abx500_gpio_dbg_show NULL |
655 | #endif | 655 | #endif |
656 | 656 | ||
657 | static int abx500_gpio_request(struct gpio_chip *chip, unsigned offset) | ||
658 | { | ||
659 | int gpio = chip->base + offset; | ||
660 | |||
661 | return pinctrl_request_gpio(gpio); | ||
662 | } | ||
663 | |||
664 | static void abx500_gpio_free(struct gpio_chip *chip, unsigned offset) | ||
665 | { | ||
666 | int gpio = chip->base + offset; | ||
667 | |||
668 | pinctrl_free_gpio(gpio); | ||
669 | } | ||
670 | |||
671 | static struct gpio_chip abx500gpio_chip = { | 657 | static struct gpio_chip abx500gpio_chip = { |
672 | .label = "abx500-gpio", | 658 | .label = "abx500-gpio", |
673 | .owner = THIS_MODULE, | 659 | .owner = THIS_MODULE, |
674 | .request = abx500_gpio_request, | 660 | .request = gpiochip_generic_request, |
675 | .free = abx500_gpio_free, | 661 | .free = gpiochip_generic_free, |
676 | .direction_input = abx500_gpio_direction_input, | 662 | .direction_input = abx500_gpio_direction_input, |
677 | .get = abx500_gpio_get, | 663 | .get = abx500_gpio_get, |
678 | .direction_output = abx500_gpio_direction_output, | 664 | .direction_output = abx500_gpio_direction_output, |
diff --git a/drivers/pinctrl/nomadik/pinctrl-nomadik.c b/drivers/pinctrl/nomadik/pinctrl-nomadik.c index 96cf03908e93..eebfae0c9b7c 100644 --- a/drivers/pinctrl/nomadik/pinctrl-nomadik.c +++ b/drivers/pinctrl/nomadik/pinctrl-nomadik.c | |||
@@ -884,24 +884,6 @@ static void nmk_gpio_latent_irq_handler(struct irq_desc *desc) | |||
884 | 884 | ||
885 | /* I/O Functions */ | 885 | /* I/O Functions */ |
886 | 886 | ||
887 | static int nmk_gpio_request(struct gpio_chip *chip, unsigned offset) | ||
888 | { | ||
889 | /* | ||
890 | * Map back to global GPIO space and request muxing, the direction | ||
891 | * parameter does not matter for this controller. | ||
892 | */ | ||
893 | int gpio = chip->base + offset; | ||
894 | |||
895 | return pinctrl_request_gpio(gpio); | ||
896 | } | ||
897 | |||
898 | static void nmk_gpio_free(struct gpio_chip *chip, unsigned offset) | ||
899 | { | ||
900 | int gpio = chip->base + offset; | ||
901 | |||
902 | pinctrl_free_gpio(gpio); | ||
903 | } | ||
904 | |||
905 | static int nmk_gpio_make_input(struct gpio_chip *chip, unsigned offset) | 887 | static int nmk_gpio_make_input(struct gpio_chip *chip, unsigned offset) |
906 | { | 888 | { |
907 | struct nmk_gpio_chip *nmk_chip = | 889 | struct nmk_gpio_chip *nmk_chip = |
@@ -1267,8 +1249,8 @@ static int nmk_gpio_probe(struct platform_device *dev) | |||
1267 | spin_lock_init(&nmk_chip->lock); | 1249 | spin_lock_init(&nmk_chip->lock); |
1268 | 1250 | ||
1269 | chip = &nmk_chip->chip; | 1251 | chip = &nmk_chip->chip; |
1270 | chip->request = nmk_gpio_request; | 1252 | chip->request = gpiochip_generic_request; |
1271 | chip->free = nmk_gpio_free; | 1253 | chip->free = gpiochip_generic_free; |
1272 | chip->direction_input = nmk_gpio_make_input; | 1254 | chip->direction_input = nmk_gpio_make_input; |
1273 | chip->get = nmk_gpio_get_input; | 1255 | chip->get = nmk_gpio_get_input; |
1274 | chip->direction_output = nmk_gpio_make_output; | 1256 | chip->direction_output = nmk_gpio_make_output; |
diff --git a/drivers/pinctrl/pinctrl-adi2.c b/drivers/pinctrl/pinctrl-adi2.c index f6be68518c87..fd342dffe4dc 100644 --- a/drivers/pinctrl/pinctrl-adi2.c +++ b/drivers/pinctrl/pinctrl-adi2.c | |||
@@ -713,16 +713,6 @@ static struct pinctrl_desc adi_pinmux_desc = { | |||
713 | .owner = THIS_MODULE, | 713 | .owner = THIS_MODULE, |
714 | }; | 714 | }; |
715 | 715 | ||
716 | static int adi_gpio_request(struct gpio_chip *chip, unsigned offset) | ||
717 | { | ||
718 | return pinctrl_request_gpio(chip->base + offset); | ||
719 | } | ||
720 | |||
721 | static void adi_gpio_free(struct gpio_chip *chip, unsigned offset) | ||
722 | { | ||
723 | pinctrl_free_gpio(chip->base + offset); | ||
724 | } | ||
725 | |||
726 | static int adi_gpio_direction_input(struct gpio_chip *chip, unsigned offset) | 716 | static int adi_gpio_direction_input(struct gpio_chip *chip, unsigned offset) |
727 | { | 717 | { |
728 | struct gpio_port *port; | 718 | struct gpio_port *port; |
@@ -994,8 +984,8 @@ static int adi_gpio_probe(struct platform_device *pdev) | |||
994 | port->chip.get = adi_gpio_get_value; | 984 | port->chip.get = adi_gpio_get_value; |
995 | port->chip.direction_output = adi_gpio_direction_output; | 985 | port->chip.direction_output = adi_gpio_direction_output; |
996 | port->chip.set = adi_gpio_set_value; | 986 | port->chip.set = adi_gpio_set_value; |
997 | port->chip.request = adi_gpio_request; | 987 | port->chip.request = gpiochip_generic_request, |
998 | port->chip.free = adi_gpio_free; | 988 | port->chip.free = gpiochip_generic_free, |
999 | port->chip.to_irq = adi_gpio_to_irq; | 989 | port->chip.to_irq = adi_gpio_to_irq; |
1000 | if (pdata->port_gpio_base > 0) | 990 | if (pdata->port_gpio_base > 0) |
1001 | port->chip.base = pdata->port_gpio_base; | 991 | port->chip.base = pdata->port_gpio_base; |
diff --git a/drivers/pinctrl/pinctrl-as3722.c b/drivers/pinctrl/pinctrl-as3722.c index 4747e08f5389..56af28b95a44 100644 --- a/drivers/pinctrl/pinctrl-as3722.c +++ b/drivers/pinctrl/pinctrl-as3722.c | |||
@@ -536,21 +536,11 @@ static int as3722_gpio_to_irq(struct gpio_chip *chip, unsigned offset) | |||
536 | return as3722_irq_get_virq(as_pci->as3722, offset); | 536 | return as3722_irq_get_virq(as_pci->as3722, offset); |
537 | } | 537 | } |
538 | 538 | ||
539 | static int as3722_gpio_request(struct gpio_chip *chip, unsigned offset) | ||
540 | { | ||
541 | return pinctrl_request_gpio(chip->base + offset); | ||
542 | } | ||
543 | |||
544 | static void as3722_gpio_free(struct gpio_chip *chip, unsigned offset) | ||
545 | { | ||
546 | pinctrl_free_gpio(chip->base + offset); | ||
547 | } | ||
548 | |||
549 | static const struct gpio_chip as3722_gpio_chip = { | 539 | static const struct gpio_chip as3722_gpio_chip = { |
550 | .label = "as3722-gpio", | 540 | .label = "as3722-gpio", |
551 | .owner = THIS_MODULE, | 541 | .owner = THIS_MODULE, |
552 | .request = as3722_gpio_request, | 542 | .request = gpiochip_generic_request, |
553 | .free = as3722_gpio_free, | 543 | .free = gpiochip_generic_free, |
554 | .get = as3722_gpio_get, | 544 | .get = as3722_gpio_get, |
555 | .set = as3722_gpio_set, | 545 | .set = as3722_gpio_set, |
556 | .direction_input = as3722_gpio_direction_input, | 546 | .direction_input = as3722_gpio_direction_input, |
diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c index b0fde0f385e6..ce6e589f6433 100644 --- a/drivers/pinctrl/pinctrl-at91.c +++ b/drivers/pinctrl/pinctrl-at91.c | |||
@@ -1277,28 +1277,6 @@ static int at91_pinctrl_remove(struct platform_device *pdev) | |||
1277 | return 0; | 1277 | return 0; |
1278 | } | 1278 | } |
1279 | 1279 | ||
1280 | static int at91_gpio_request(struct gpio_chip *chip, unsigned offset) | ||
1281 | { | ||
1282 | /* | ||
1283 | * Map back to global GPIO space and request muxing, the direction | ||
1284 | * parameter does not matter for this controller. | ||
1285 | */ | ||
1286 | int gpio = chip->base + offset; | ||
1287 | int bank = chip->base / chip->ngpio; | ||
1288 | |||
1289 | dev_dbg(chip->dev, "%s:%d pio%c%d(%d)\n", __func__, __LINE__, | ||
1290 | 'A' + bank, offset, gpio); | ||
1291 | |||
1292 | return pinctrl_request_gpio(gpio); | ||
1293 | } | ||
1294 | |||
1295 | static void at91_gpio_free(struct gpio_chip *chip, unsigned offset) | ||
1296 | { | ||
1297 | int gpio = chip->base + offset; | ||
1298 | |||
1299 | pinctrl_free_gpio(gpio); | ||
1300 | } | ||
1301 | |||
1302 | static int at91_gpio_get_direction(struct gpio_chip *chip, unsigned offset) | 1280 | static int at91_gpio_get_direction(struct gpio_chip *chip, unsigned offset) |
1303 | { | 1281 | { |
1304 | struct at91_gpio_chip *at91_gpio = to_at91_gpio_chip(chip); | 1282 | struct at91_gpio_chip *at91_gpio = to_at91_gpio_chip(chip); |
@@ -1684,8 +1662,8 @@ static int at91_gpio_of_irq_setup(struct platform_device *pdev, | |||
1684 | 1662 | ||
1685 | /* This structure is replicated for each GPIO block allocated at probe time */ | 1663 | /* This structure is replicated for each GPIO block allocated at probe time */ |
1686 | static struct gpio_chip at91_gpio_template = { | 1664 | static struct gpio_chip at91_gpio_template = { |
1687 | .request = at91_gpio_request, | 1665 | .request = gpiochip_generic_request, |
1688 | .free = at91_gpio_free, | 1666 | .free = gpiochip_generic_free, |
1689 | .get_direction = at91_gpio_get_direction, | 1667 | .get_direction = at91_gpio_get_direction, |
1690 | .direction_input = at91_gpio_direction_input, | 1668 | .direction_input = at91_gpio_direction_input, |
1691 | .get = at91_gpio_get, | 1669 | .get = at91_gpio_get, |
diff --git a/drivers/pinctrl/pinctrl-coh901.c b/drivers/pinctrl/pinctrl-coh901.c index 9c9b88934bcc..813eb7c771ec 100644 --- a/drivers/pinctrl/pinctrl-coh901.c +++ b/drivers/pinctrl/pinctrl-coh901.c | |||
@@ -217,24 +217,6 @@ static inline struct u300_gpio *to_u300_gpio(struct gpio_chip *chip) | |||
217 | return container_of(chip, struct u300_gpio, chip); | 217 | return container_of(chip, struct u300_gpio, chip); |
218 | } | 218 | } |
219 | 219 | ||
220 | static int u300_gpio_request(struct gpio_chip *chip, unsigned offset) | ||
221 | { | ||
222 | /* | ||
223 | * Map back to global GPIO space and request muxing, the direction | ||
224 | * parameter does not matter for this controller. | ||
225 | */ | ||
226 | int gpio = chip->base + offset; | ||
227 | |||
228 | return pinctrl_request_gpio(gpio); | ||
229 | } | ||
230 | |||
231 | static void u300_gpio_free(struct gpio_chip *chip, unsigned offset) | ||
232 | { | ||
233 | int gpio = chip->base + offset; | ||
234 | |||
235 | pinctrl_free_gpio(gpio); | ||
236 | } | ||
237 | |||
238 | static int u300_gpio_get(struct gpio_chip *chip, unsigned offset) | 220 | static int u300_gpio_get(struct gpio_chip *chip, unsigned offset) |
239 | { | 221 | { |
240 | struct u300_gpio *gpio = to_u300_gpio(chip); | 222 | struct u300_gpio *gpio = to_u300_gpio(chip); |
@@ -417,8 +399,8 @@ int u300_gpio_config_set(struct gpio_chip *chip, unsigned offset, | |||
417 | static struct gpio_chip u300_gpio_chip = { | 399 | static struct gpio_chip u300_gpio_chip = { |
418 | .label = "u300-gpio-chip", | 400 | .label = "u300-gpio-chip", |
419 | .owner = THIS_MODULE, | 401 | .owner = THIS_MODULE, |
420 | .request = u300_gpio_request, | 402 | .request = gpiochip_generic_request, |
421 | .free = u300_gpio_free, | 403 | .free = gpiochip_generic_free, |
422 | .get = u300_gpio_get, | 404 | .get = u300_gpio_get, |
423 | .set = u300_gpio_set, | 405 | .set = u300_gpio_set, |
424 | .direction_input = u300_gpio_direction_input, | 406 | .direction_input = u300_gpio_direction_input, |
diff --git a/drivers/pinctrl/pinctrl-digicolor.c b/drivers/pinctrl/pinctrl-digicolor.c index 11f8b835d3b6..38a7799f8257 100644 --- a/drivers/pinctrl/pinctrl-digicolor.c +++ b/drivers/pinctrl/pinctrl-digicolor.c | |||
@@ -169,16 +169,6 @@ static struct pinmux_ops dc_pmxops = { | |||
169 | .gpio_request_enable = dc_pmx_request_gpio, | 169 | .gpio_request_enable = dc_pmx_request_gpio, |
170 | }; | 170 | }; |
171 | 171 | ||
172 | static int dc_gpio_request(struct gpio_chip *chip, unsigned gpio) | ||
173 | { | ||
174 | return pinctrl_request_gpio(chip->base + gpio); | ||
175 | } | ||
176 | |||
177 | static void dc_gpio_free(struct gpio_chip *chip, unsigned gpio) | ||
178 | { | ||
179 | pinctrl_free_gpio(chip->base + gpio); | ||
180 | } | ||
181 | |||
182 | static int dc_gpio_direction_input(struct gpio_chip *chip, unsigned gpio) | 172 | static int dc_gpio_direction_input(struct gpio_chip *chip, unsigned gpio) |
183 | { | 173 | { |
184 | struct dc_pinmap *pmap = container_of(chip, struct dc_pinmap, chip); | 174 | struct dc_pinmap *pmap = container_of(chip, struct dc_pinmap, chip); |
@@ -255,8 +245,8 @@ static int dc_gpiochip_add(struct dc_pinmap *pmap, struct device_node *np) | |||
255 | 245 | ||
256 | chip->label = DRIVER_NAME; | 246 | chip->label = DRIVER_NAME; |
257 | chip->dev = pmap->dev; | 247 | chip->dev = pmap->dev; |
258 | chip->request = dc_gpio_request; | 248 | chip->request = gpiochip_generic_request; |
259 | chip->free = dc_gpio_free; | 249 | chip->free = gpiochip_generic_free; |
260 | chip->direction_input = dc_gpio_direction_input; | 250 | chip->direction_input = dc_gpio_direction_input; |
261 | chip->direction_output = dc_gpio_direction_output; | 251 | chip->direction_output = dc_gpio_direction_output; |
262 | chip->get = dc_gpio_get; | 252 | chip->get = dc_gpio_get; |
diff --git a/drivers/pinctrl/pinctrl-pistachio.c b/drivers/pinctrl/pinctrl-pistachio.c index 952b1c623887..85c9046c690e 100644 --- a/drivers/pinctrl/pinctrl-pistachio.c +++ b/drivers/pinctrl/pinctrl-pistachio.c | |||
@@ -1171,16 +1171,6 @@ static struct pinctrl_desc pistachio_pinctrl_desc = { | |||
1171 | .confops = &pistachio_pinconf_ops, | 1171 | .confops = &pistachio_pinconf_ops, |
1172 | }; | 1172 | }; |
1173 | 1173 | ||
1174 | static int pistachio_gpio_request(struct gpio_chip *chip, unsigned offset) | ||
1175 | { | ||
1176 | return pinctrl_request_gpio(chip->base + offset); | ||
1177 | } | ||
1178 | |||
1179 | static void pistachio_gpio_free(struct gpio_chip *chip, unsigned offset) | ||
1180 | { | ||
1181 | pinctrl_free_gpio(chip->base + offset); | ||
1182 | } | ||
1183 | |||
1184 | static int pistachio_gpio_get_direction(struct gpio_chip *chip, unsigned offset) | 1174 | static int pistachio_gpio_get_direction(struct gpio_chip *chip, unsigned offset) |
1185 | { | 1175 | { |
1186 | struct pistachio_gpio_bank *bank = gc_to_bank(chip); | 1176 | struct pistachio_gpio_bank *bank = gc_to_bank(chip); |
@@ -1332,8 +1322,8 @@ static void pistachio_gpio_irq_handler(struct irq_desc *desc) | |||
1332 | .npins = _npins, \ | 1322 | .npins = _npins, \ |
1333 | .gpio_chip = { \ | 1323 | .gpio_chip = { \ |
1334 | .label = "GPIO" #_bank, \ | 1324 | .label = "GPIO" #_bank, \ |
1335 | .request = pistachio_gpio_request, \ | 1325 | .request = gpiochip_generic_request, \ |
1336 | .free = pistachio_gpio_free, \ | 1326 | .free = gpiochip_generic_free, \ |
1337 | .get_direction = pistachio_gpio_get_direction, \ | 1327 | .get_direction = pistachio_gpio_get_direction, \ |
1338 | .direction_input = pistachio_gpio_direction_input, \ | 1328 | .direction_input = pistachio_gpio_direction_input, \ |
1339 | .direction_output = pistachio_gpio_direction_output, \ | 1329 | .direction_output = pistachio_gpio_direction_output, \ |
diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c index 88bb707e107a..d79889a9d5d7 100644 --- a/drivers/pinctrl/pinctrl-rockchip.c +++ b/drivers/pinctrl/pinctrl-rockchip.c | |||
@@ -1374,16 +1374,6 @@ static int rockchip_pinctrl_register(struct platform_device *pdev, | |||
1374 | * GPIO handling | 1374 | * GPIO handling |
1375 | */ | 1375 | */ |
1376 | 1376 | ||
1377 | static int rockchip_gpio_request(struct gpio_chip *chip, unsigned offset) | ||
1378 | { | ||
1379 | return pinctrl_request_gpio(chip->base + offset); | ||
1380 | } | ||
1381 | |||
1382 | static void rockchip_gpio_free(struct gpio_chip *chip, unsigned offset) | ||
1383 | { | ||
1384 | pinctrl_free_gpio(chip->base + offset); | ||
1385 | } | ||
1386 | |||
1387 | static void rockchip_gpio_set(struct gpio_chip *gc, unsigned offset, int value) | 1377 | static void rockchip_gpio_set(struct gpio_chip *gc, unsigned offset, int value) |
1388 | { | 1378 | { |
1389 | struct rockchip_pin_bank *bank = gc_to_pin_bank(gc); | 1379 | struct rockchip_pin_bank *bank = gc_to_pin_bank(gc); |
@@ -1461,8 +1451,8 @@ static int rockchip_gpio_to_irq(struct gpio_chip *gc, unsigned offset) | |||
1461 | } | 1451 | } |
1462 | 1452 | ||
1463 | static const struct gpio_chip rockchip_gpiolib_chip = { | 1453 | static const struct gpio_chip rockchip_gpiolib_chip = { |
1464 | .request = rockchip_gpio_request, | 1454 | .request = gpiochip_generic_request, |
1465 | .free = rockchip_gpio_free, | 1455 | .free = gpiochip_generic_free, |
1466 | .set = rockchip_gpio_set, | 1456 | .set = rockchip_gpio_set, |
1467 | .get = rockchip_gpio_get, | 1457 | .get = rockchip_gpio_get, |
1468 | .direction_input = rockchip_gpio_direction_input, | 1458 | .direction_input = rockchip_gpio_direction_input, |
diff --git a/drivers/pinctrl/pinctrl-st.c b/drivers/pinctrl/pinctrl-st.c index 389526e704fb..b58d3f29148a 100644 --- a/drivers/pinctrl/pinctrl-st.c +++ b/drivers/pinctrl/pinctrl-st.c | |||
@@ -742,16 +742,6 @@ static void st_gpio_direction(struct st_gpio_bank *bank, | |||
742 | } | 742 | } |
743 | } | 743 | } |
744 | 744 | ||
745 | static int st_gpio_request(struct gpio_chip *chip, unsigned offset) | ||
746 | { | ||
747 | return pinctrl_request_gpio(chip->base + offset); | ||
748 | } | ||
749 | |||
750 | static void st_gpio_free(struct gpio_chip *chip, unsigned offset) | ||
751 | { | ||
752 | pinctrl_free_gpio(chip->base + offset); | ||
753 | } | ||
754 | |||
755 | static int st_gpio_get(struct gpio_chip *chip, unsigned offset) | 745 | static int st_gpio_get(struct gpio_chip *chip, unsigned offset) |
756 | { | 746 | { |
757 | struct st_gpio_bank *bank = gpio_chip_to_bank(chip); | 747 | struct st_gpio_bank *bank = gpio_chip_to_bank(chip); |
@@ -1490,8 +1480,8 @@ static void st_gpio_irqmux_handler(struct irq_desc *desc) | |||
1490 | } | 1480 | } |
1491 | 1481 | ||
1492 | static struct gpio_chip st_gpio_template = { | 1482 | static struct gpio_chip st_gpio_template = { |
1493 | .request = st_gpio_request, | 1483 | .request = gpiochip_generic_request, |
1494 | .free = st_gpio_free, | 1484 | .free = gpiochip_generic_free, |
1495 | .get = st_gpio_get, | 1485 | .get = st_gpio_get, |
1496 | .set = st_gpio_set, | 1486 | .set = st_gpio_set, |
1497 | .direction_input = st_gpio_direction_input, | 1487 | .direction_input = st_gpio_direction_input, |
diff --git a/drivers/pinctrl/pinctrl-xway.c b/drivers/pinctrl/pinctrl-xway.c index 779950c62e53..ae724bdab3d3 100644 --- a/drivers/pinctrl/pinctrl-xway.c +++ b/drivers/pinctrl/pinctrl-xway.c | |||
@@ -682,28 +682,14 @@ static int xway_gpio_dir_out(struct gpio_chip *chip, unsigned int pin, int val) | |||
682 | return 0; | 682 | return 0; |
683 | } | 683 | } |
684 | 684 | ||
685 | static int xway_gpio_req(struct gpio_chip *chip, unsigned offset) | ||
686 | { | ||
687 | int gpio = chip->base + offset; | ||
688 | |||
689 | return pinctrl_request_gpio(gpio); | ||
690 | } | ||
691 | |||
692 | static void xway_gpio_free(struct gpio_chip *chip, unsigned offset) | ||
693 | { | ||
694 | int gpio = chip->base + offset; | ||
695 | |||
696 | pinctrl_free_gpio(gpio); | ||
697 | } | ||
698 | |||
699 | static struct gpio_chip xway_chip = { | 685 | static struct gpio_chip xway_chip = { |
700 | .label = "gpio-xway", | 686 | .label = "gpio-xway", |
701 | .direction_input = xway_gpio_dir_in, | 687 | .direction_input = xway_gpio_dir_in, |
702 | .direction_output = xway_gpio_dir_out, | 688 | .direction_output = xway_gpio_dir_out, |
703 | .get = xway_gpio_get, | 689 | .get = xway_gpio_get, |
704 | .set = xway_gpio_set, | 690 | .set = xway_gpio_set, |
705 | .request = xway_gpio_req, | 691 | .request = gpiochip_generic_request, |
706 | .free = xway_gpio_free, | 692 | .free = gpiochip_generic_free, |
707 | .base = -1, | 693 | .base = -1, |
708 | }; | 694 | }; |
709 | 695 | ||
diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c index a0c7407c1cac..146264a41ec8 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm.c +++ b/drivers/pinctrl/qcom/pinctrl-msm.c | |||
@@ -458,18 +458,6 @@ static void msm_gpio_set(struct gpio_chip *chip, unsigned offset, int value) | |||
458 | spin_unlock_irqrestore(&pctrl->lock, flags); | 458 | spin_unlock_irqrestore(&pctrl->lock, flags); |
459 | } | 459 | } |
460 | 460 | ||
461 | static int msm_gpio_request(struct gpio_chip *chip, unsigned offset) | ||
462 | { | ||
463 | int gpio = chip->base + offset; | ||
464 | return pinctrl_request_gpio(gpio); | ||
465 | } | ||
466 | |||
467 | static void msm_gpio_free(struct gpio_chip *chip, unsigned offset) | ||
468 | { | ||
469 | int gpio = chip->base + offset; | ||
470 | return pinctrl_free_gpio(gpio); | ||
471 | } | ||
472 | |||
473 | #ifdef CONFIG_DEBUG_FS | 461 | #ifdef CONFIG_DEBUG_FS |
474 | #include <linux/seq_file.h> | 462 | #include <linux/seq_file.h> |
475 | 463 | ||
@@ -527,8 +515,8 @@ static struct gpio_chip msm_gpio_template = { | |||
527 | .direction_output = msm_gpio_direction_output, | 515 | .direction_output = msm_gpio_direction_output, |
528 | .get = msm_gpio_get, | 516 | .get = msm_gpio_get, |
529 | .set = msm_gpio_set, | 517 | .set = msm_gpio_set, |
530 | .request = msm_gpio_request, | 518 | .request = gpiochip_generic_request, |
531 | .free = msm_gpio_free, | 519 | .free = gpiochip_generic_free, |
532 | .dbg_show = msm_gpio_dbg_show, | 520 | .dbg_show = msm_gpio_dbg_show, |
533 | }; | 521 | }; |
534 | 522 | ||
diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c index bd1e24598e12..6c42ca14d2fd 100644 --- a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c +++ b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c | |||
@@ -546,16 +546,6 @@ static void pmic_gpio_set(struct gpio_chip *chip, unsigned pin, int value) | |||
546 | pmic_gpio_config_set(state->ctrl, pin, &config, 1); | 546 | pmic_gpio_config_set(state->ctrl, pin, &config, 1); |
547 | } | 547 | } |
548 | 548 | ||
549 | static int pmic_gpio_request(struct gpio_chip *chip, unsigned base) | ||
550 | { | ||
551 | return pinctrl_request_gpio(chip->base + base); | ||
552 | } | ||
553 | |||
554 | static void pmic_gpio_free(struct gpio_chip *chip, unsigned base) | ||
555 | { | ||
556 | pinctrl_free_gpio(chip->base + base); | ||
557 | } | ||
558 | |||
559 | static int pmic_gpio_of_xlate(struct gpio_chip *chip, | 549 | static int pmic_gpio_of_xlate(struct gpio_chip *chip, |
560 | const struct of_phandle_args *gpio_desc, | 550 | const struct of_phandle_args *gpio_desc, |
561 | u32 *flags) | 551 | u32 *flags) |
@@ -595,8 +585,8 @@ static const struct gpio_chip pmic_gpio_gpio_template = { | |||
595 | .direction_output = pmic_gpio_direction_output, | 585 | .direction_output = pmic_gpio_direction_output, |
596 | .get = pmic_gpio_get, | 586 | .get = pmic_gpio_get, |
597 | .set = pmic_gpio_set, | 587 | .set = pmic_gpio_set, |
598 | .request = pmic_gpio_request, | 588 | .request = gpiochip_generic_request, |
599 | .free = pmic_gpio_free, | 589 | .free = gpiochip_generic_free, |
600 | .of_xlate = pmic_gpio_of_xlate, | 590 | .of_xlate = pmic_gpio_of_xlate, |
601 | .to_irq = pmic_gpio_to_irq, | 591 | .to_irq = pmic_gpio_to_irq, |
602 | .dbg_show = pmic_gpio_dbg_show, | 592 | .dbg_show = pmic_gpio_dbg_show, |
diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c b/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c index e3be3ce2cada..9ce0e30e33e8 100644 --- a/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c +++ b/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c | |||
@@ -604,16 +604,6 @@ static void pmic_mpp_set(struct gpio_chip *chip, unsigned pin, int value) | |||
604 | pmic_mpp_config_set(state->ctrl, pin, &config, 1); | 604 | pmic_mpp_config_set(state->ctrl, pin, &config, 1); |
605 | } | 605 | } |
606 | 606 | ||
607 | static int pmic_mpp_request(struct gpio_chip *chip, unsigned base) | ||
608 | { | ||
609 | return pinctrl_request_gpio(chip->base + base); | ||
610 | } | ||
611 | |||
612 | static void pmic_mpp_free(struct gpio_chip *chip, unsigned base) | ||
613 | { | ||
614 | pinctrl_free_gpio(chip->base + base); | ||
615 | } | ||
616 | |||
617 | static int pmic_mpp_of_xlate(struct gpio_chip *chip, | 607 | static int pmic_mpp_of_xlate(struct gpio_chip *chip, |
618 | const struct of_phandle_args *gpio_desc, | 608 | const struct of_phandle_args *gpio_desc, |
619 | u32 *flags) | 609 | u32 *flags) |
@@ -653,8 +643,8 @@ static const struct gpio_chip pmic_mpp_gpio_template = { | |||
653 | .direction_output = pmic_mpp_direction_output, | 643 | .direction_output = pmic_mpp_direction_output, |
654 | .get = pmic_mpp_get, | 644 | .get = pmic_mpp_get, |
655 | .set = pmic_mpp_set, | 645 | .set = pmic_mpp_set, |
656 | .request = pmic_mpp_request, | 646 | .request = gpiochip_generic_request, |
657 | .free = pmic_mpp_free, | 647 | .free = gpiochip_generic_free, |
658 | .of_xlate = pmic_mpp_of_xlate, | 648 | .of_xlate = pmic_mpp_of_xlate, |
659 | .to_irq = pmic_mpp_to_irq, | 649 | .to_irq = pmic_mpp_to_irq, |
660 | .dbg_show = pmic_mpp_dbg_show, | 650 | .dbg_show = pmic_mpp_dbg_show, |
diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c index c760bf43d116..3f622ccd8eab 100644 --- a/drivers/pinctrl/samsung/pinctrl-samsung.c +++ b/drivers/pinctrl/samsung/pinctrl-samsung.c | |||
@@ -888,19 +888,9 @@ static int samsung_pinctrl_register(struct platform_device *pdev, | |||
888 | return 0; | 888 | return 0; |
889 | } | 889 | } |
890 | 890 | ||
891 | static int samsung_gpio_request(struct gpio_chip *chip, unsigned offset) | ||
892 | { | ||
893 | return pinctrl_request_gpio(chip->base + offset); | ||
894 | } | ||
895 | |||
896 | static void samsung_gpio_free(struct gpio_chip *chip, unsigned offset) | ||
897 | { | ||
898 | pinctrl_free_gpio(chip->base + offset); | ||
899 | } | ||
900 | |||
901 | static const struct gpio_chip samsung_gpiolib_chip = { | 891 | static const struct gpio_chip samsung_gpiolib_chip = { |
902 | .request = samsung_gpio_request, | 892 | .request = gpiochip_generic_request, |
903 | .free = samsung_gpio_free, | 893 | .free = gpiochip_generic_free, |
904 | .set = samsung_gpio_set, | 894 | .set = samsung_gpio_set, |
905 | .get = samsung_gpio_get, | 895 | .get = samsung_gpio_get, |
906 | .direction_input = samsung_gpio_direction_input, | 896 | .direction_input = samsung_gpio_direction_input, |
diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c b/drivers/pinctrl/sunxi/pinctrl-sunxi.c index 38e0c7bdd2ac..f9c7a05541d8 100644 --- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c +++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c | |||
@@ -446,16 +446,6 @@ static const struct pinmux_ops sunxi_pmx_ops = { | |||
446 | .gpio_set_direction = sunxi_pmx_gpio_set_direction, | 446 | .gpio_set_direction = sunxi_pmx_gpio_set_direction, |
447 | }; | 447 | }; |
448 | 448 | ||
449 | static int sunxi_pinctrl_gpio_request(struct gpio_chip *chip, unsigned offset) | ||
450 | { | ||
451 | return pinctrl_request_gpio(chip->base + offset); | ||
452 | } | ||
453 | |||
454 | static void sunxi_pinctrl_gpio_free(struct gpio_chip *chip, unsigned offset) | ||
455 | { | ||
456 | pinctrl_free_gpio(chip->base + offset); | ||
457 | } | ||
458 | |||
459 | static int sunxi_pinctrl_gpio_direction_input(struct gpio_chip *chip, | 449 | static int sunxi_pinctrl_gpio_direction_input(struct gpio_chip *chip, |
460 | unsigned offset) | 450 | unsigned offset) |
461 | { | 451 | { |
@@ -956,8 +946,8 @@ int sunxi_pinctrl_init(struct platform_device *pdev, | |||
956 | 946 | ||
957 | last_pin = pctl->desc->pins[pctl->desc->npins - 1].pin.number; | 947 | last_pin = pctl->desc->pins[pctl->desc->npins - 1].pin.number; |
958 | pctl->chip->owner = THIS_MODULE; | 948 | pctl->chip->owner = THIS_MODULE; |
959 | pctl->chip->request = sunxi_pinctrl_gpio_request, | 949 | pctl->chip->request = gpiochip_generic_request, |
960 | pctl->chip->free = sunxi_pinctrl_gpio_free, | 950 | pctl->chip->free = gpiochip_generic_free, |
961 | pctl->chip->direction_input = sunxi_pinctrl_gpio_direction_input, | 951 | pctl->chip->direction_input = sunxi_pinctrl_gpio_direction_input, |
962 | pctl->chip->direction_output = sunxi_pinctrl_gpio_direction_output, | 952 | pctl->chip->direction_output = sunxi_pinctrl_gpio_direction_output, |
963 | pctl->chip->get = sunxi_pinctrl_gpio_get, | 953 | pctl->chip->get = sunxi_pinctrl_gpio_get, |
diff --git a/drivers/pinctrl/vt8500/pinctrl-wmt.c b/drivers/pinctrl/vt8500/pinctrl-wmt.c index c15316b003c5..fb22d3f62480 100644 --- a/drivers/pinctrl/vt8500/pinctrl-wmt.c +++ b/drivers/pinctrl/vt8500/pinctrl-wmt.c | |||
@@ -486,16 +486,6 @@ static struct pinctrl_desc wmt_desc = { | |||
486 | .confops = &wmt_pinconf_ops, | 486 | .confops = &wmt_pinconf_ops, |
487 | }; | 487 | }; |
488 | 488 | ||
489 | static int wmt_gpio_request(struct gpio_chip *chip, unsigned offset) | ||
490 | { | ||
491 | return pinctrl_request_gpio(chip->base + offset); | ||
492 | } | ||
493 | |||
494 | static void wmt_gpio_free(struct gpio_chip *chip, unsigned offset) | ||
495 | { | ||
496 | pinctrl_free_gpio(chip->base + offset); | ||
497 | } | ||
498 | |||
499 | static int wmt_gpio_get_direction(struct gpio_chip *chip, unsigned offset) | 489 | static int wmt_gpio_get_direction(struct gpio_chip *chip, unsigned offset) |
500 | { | 490 | { |
501 | struct wmt_pinctrl_data *data = dev_get_drvdata(chip->dev); | 491 | struct wmt_pinctrl_data *data = dev_get_drvdata(chip->dev); |
@@ -560,8 +550,8 @@ static int wmt_gpio_direction_output(struct gpio_chip *chip, unsigned offset, | |||
560 | static struct gpio_chip wmt_gpio_chip = { | 550 | static struct gpio_chip wmt_gpio_chip = { |
561 | .label = "gpio-wmt", | 551 | .label = "gpio-wmt", |
562 | .owner = THIS_MODULE, | 552 | .owner = THIS_MODULE, |
563 | .request = wmt_gpio_request, | 553 | .request = gpiochip_generic_request, |
564 | .free = wmt_gpio_free, | 554 | .free = gpiochip_generic_free, |
565 | .get_direction = wmt_gpio_get_direction, | 555 | .get_direction = wmt_gpio_get_direction, |
566 | .direction_input = wmt_gpio_direction_input, | 556 | .direction_input = wmt_gpio_direction_input, |
567 | .direction_output = wmt_gpio_direction_output, | 557 | .direction_output = wmt_gpio_direction_output, |