alistair23-linux/drivers/gpio
Mika Westerberg 03c4749dd6 gpio / ACPI: Drop unnecessary ACPI GPIO to Linux GPIO translation
We added acpi_gpiochip_pin_to_gpio_offset() because there was a need to
translate from ACPI GpioIo/GpioInt number to Linux GPIO number in the
Cherryview pinctrl driver. This translation is necessary because
Cherryview has gaps in the pin list and the driver used continuous GPIO
number space in Linux side as follows:

  created GPIO range 0->7 ==> INT33FF:03 PIN 0->7
  created GPIO range 8->19 ==> INT33FF:03 PIN 15->26
  created GPIO range 20->25 ==> INT33FF:03 PIN 30->35
  created GPIO range 26->33 ==> INT33FF:03 PIN 45->52
  created GPIO range 34->43 ==> INT33FF:03 PIN 60->69
  created GPIO range 44->54 ==> INT33FF:03 PIN 75->85

For example when ACPI GpioInt resource refers to GPIO 81 (SDMMC3_CD_B)
we translate from pin 81 to the corresponding Linux GPIO number, which
is 50. This number is then used when the GPIO is accessed through gpiolib.

It turns out, this is not necessary at all. We can just pass 1:1 mapping
between Linux GPIO numbers and pin numbers (including gaps) and the
pinctrl core handles all the details automatically:

  created GPIO range 0->7 ==> INT33FF:03 PIN 0->7
  created GPIO range 15->26 ==> INT33FF:03 PIN 15->26
  created GPIO range 30->35 ==> INT33FF:03 PIN 30->35
  created GPIO range 45->52 ==> INT33FF:03 PIN 45->52
  created GPIO range 60->69 ==> INT33FF:03 PIN 60->69
  created GPIO range 75->85 ==> INT33FF:03 PIN 75->85

Here GPIO 81 is exactly same than the hardware pin 81 (SDMMC3_CD_B).

As an added bonus this simplifies both the ACPI GPIO core code and the
Cherryview pinctrl driver.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2017-11-29 13:41:46 +01:00
..
devres.c gpio: devres: Improve kerneldoc 2017-08-14 15:01:13 +02:00
gpio-74x164.c gpio: 74x164: Introduce 'enable-gpios' property 2017-08-14 16:24:02 +02:00
gpio-74xx-mmio.c
gpio-104-dio-48e.c gpio: Move irqdomain into struct gpio_irq_chip 2017-11-08 14:06:21 +01:00
gpio-104-idi-48.c gpio: Move irqdomain into struct gpio_irq_chip 2017-11-08 14:06:21 +01:00
gpio-104-idio-16.c gpio: Move irqdomain into struct gpio_irq_chip 2017-11-08 14:06:21 +01:00
gpio-adnp.c gpio: Move irqdomain into struct gpio_irq_chip 2017-11-08 14:06:21 +01:00
gpio-adp5520.c
gpio-adp5588.c gpio: adp5588: move header file out of I2C realm 2017-05-29 13:36:45 +02:00
gpio-altera-a10sr.c gpio: altera-a10sr: constify gpio_chip structure 2017-08-14 15:01:12 +02:00
gpio-altera.c gpio: Move irqdomain into struct gpio_irq_chip 2017-11-08 14:06:21 +01:00
gpio-amd8111.c
gpio-amdpt.c
gpio-arizona.c gpio: arizona: Add support for GPIOs that need to be maintained 2017-05-29 11:09:01 +02:00
gpio-aspeed.c Merge branch 'gpio-irqchip-rework' of /home/linus/linux-gpio into devel 2017-11-09 09:38:42 +01:00
gpio-ath79.c gpio: Move irqdomain into struct gpio_irq_chip 2017-11-08 14:06:21 +01:00
gpio-axp209.c
gpio-bcm-kona.c gpio: bcm-kona: make use of raw_spinlock variants 2017-03-16 21:52:07 +01:00
gpio-bd9571mwv.c gpio: Add ROHM BD9571MWV-M PMIC GPIO driver 2017-04-28 09:47:46 +02:00
gpio-brcmstb.c gpio: brcmstb: implement suspend/resume/shutdown 2017-10-31 10:51:40 +01:00
gpio-bt8xx.c
gpio-clps711x.c
gpio-crystalcove.c gpio: Move irqdomain into struct gpio_irq_chip 2017-11-08 14:06:21 +01:00
gpio-cs5535.c
gpio-da9052.c
gpio-da9055.c
gpio-davinci.c gpio: davinci: Handle the return value of davinci_gpio_irq_setup function 2017-08-14 15:03:39 +02:00
gpio-dln2.c gpio: Move irqdomain into struct gpio_irq_chip 2017-11-08 14:06:21 +01:00
gpio-dwapb.c gpio: dwapb: fix bgpio usage 2017-10-25 11:25:10 +02:00
gpio-em.c pinctrl/gpio: Unify namespace for cross-calls 2017-09-22 11:02:10 +02:00
gpio-ep93xx.c
gpio-etraxfs.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
gpio-exar.c gpio: exar: Use correct property prefix and document bindings 2017-08-01 13:43:55 +02:00
gpio-f7188x.c gpio: f7188x: Add a missing break 2017-04-28 10:09:16 +02:00
gpio-ftgpio010.c This is the bulk of GPIO changes for the v4.15 kernel cycle: 2017-11-14 17:23:44 -08:00
gpio-ge.c gpio: Convert to using %pOF instead of full_name 2017-08-14 15:01:12 +02:00
gpio-gpio-mm.c Annotate hardware config module parameters in drivers/gpio/ 2017-04-20 12:02:32 +01:00
gpio-grgpio.c gpio: grgpio: Do not use gc->pin2mask() 2017-10-25 11:25:38 +02:00
gpio-htc-egpio.c
gpio-ich.c
gpio-ingenic.c gpio: Move irqdomain into struct gpio_irq_chip 2017-11-08 14:06:21 +01:00
gpio-intel-mid.c gpio: Move irqdomain into struct gpio_irq_chip 2017-11-08 14:06:21 +01:00
gpio-iop.c
gpio-it87.c gpio: it87: add support for IT8772F Super I/O. 2017-08-14 15:03:38 +02:00
gpio-janz-ttl.c
gpio-kempld.c
gpio-ks8695.c
gpio-loongson.c
gpio-loongson1.c gpio: loongson1: fix bgpio usage 2017-10-25 11:25:38 +02:00
gpio-lp873x.c
gpio-lp3943.c
gpio-lp87565.c gpio: lp87565: Set proper output level and direction for direction_output 2017-07-31 15:26:57 +02:00
gpio-lpc18xx.c
gpio-lpc32xx.c
gpio-lynxpoint.c gpio: Move irqdomain into struct gpio_irq_chip 2017-11-08 14:06:21 +01:00
gpio-max730x.c
gpio-max732x.c gpio: Move irqdomain into struct gpio_irq_chip 2017-11-08 14:06:21 +01:00
gpio-max3191x.c gpio: Add driver for Maxim MAX3191x industrial serializer 2017-10-19 22:40:07 +02:00
gpio-max7300.c
gpio-max7301.c
gpio-max77620.c gpio: max77620: Make regmap_irq_chip const 2017-08-14 16:06:24 +02:00
gpio-mb86s7x.c gpio: mb86s70: Revert "Return error if requesting an already assigned gpio" 2017-10-31 13:13:34 +01:00
gpio-mc9s08dz60.c
gpio-mc33880.c
gpio-menz127.c
gpio-merrifield.c gpio: Move irqdomain into struct gpio_irq_chip 2017-11-08 14:06:21 +01:00
gpio-ml-ioh.c gpio: ml-ioh: use devres for irq generic chip 2017-08-21 00:06:35 +02:00
gpio-mm-lantiq.c
gpio-mmio.c gpio-mmio: Use the new .get_multiple() callback 2017-10-30 08:35:32 +01:00
gpio-mockup.c gpio: mockup: remove unused variable gc 2017-08-31 15:21:07 +02:00
gpio-mpc8xxx.c gpio: mpc8xxx: Do not reverse bits using bgpio 2017-10-25 11:25:40 +02:00
gpio-mpc5200.c
gpio-msic.c gpio: msic: fix error return code in platform_msic_gpio_probe() 2017-08-14 15:03:38 +02:00
gpio-mvebu.c gpio: mvebu: Fix cause computation in irq handler 2017-08-14 15:00:43 +02:00
gpio-mxc.c gpio: mxc: use devres for irq generic chip 2017-08-21 00:09:33 +02:00
gpio-mxs.c gpio: mxs: use devres for irq generic chip 2017-08-21 00:10:00 +02:00
gpio-octeon.c
gpio-omap.c This is the bulk of GPIO changes for the v4.15 kernel cycle: 2017-11-14 17:23:44 -08:00
gpio-palmas.c
gpio-pca953x.c gpio: Move irqdomain into struct gpio_irq_chip 2017-11-08 14:06:21 +01:00
gpio-pcf857x.c gpio: Move irqdomain into struct gpio_irq_chip 2017-11-08 14:06:21 +01:00
gpio-pch.c gpio: pch: use devres for irq generic chip 2017-08-21 00:08:52 +02:00
gpio-pci-idio-16.c gpio: Move irqdomain into struct gpio_irq_chip 2017-11-08 14:06:21 +01:00
gpio-pisosr.c
gpio-pl061.c gpio: Move irqdomain into struct gpio_irq_chip 2017-11-08 14:06:21 +01:00
gpio-pxa.c gpio: pxa: Use library functions 2017-10-07 00:01:08 +02:00
gpio-rc5t583.c
gpio-rcar.c Merge branch 'gpio-irqchip-rework' of /home/linus/linux-gpio into devel 2017-11-09 09:38:42 +01:00
gpio-rdc321x.c
gpio-reg.c gpio: Move irqdomain into struct gpio_irq_chip 2017-11-08 14:06:21 +01:00
gpio-sa1100.c gpio: sa1100: implement get_direction method 2017-03-24 14:04:37 +01:00
gpio-sch.c
gpio-sch311x.c
gpio-sodaville.c gpio: sodaville: use resource management for irqs 2017-03-15 11:16:36 +01:00
gpio-spear-spics.c
gpio-sta2x11.c gpio: sta2x11: use devres for irq generic chip 2017-08-21 00:06:04 +02:00
gpio-stmpe.c gpio: Move irq_valid_mask into struct gpio_irq_chip 2017-11-08 14:10:18 +01:00
gpio-stp-xway.c
gpio-syscon.c
gpio-tb10x.c gpio: tb10x: Handle return value of devm_kasprintf 2017-09-21 14:14:17 +02:00
gpio-tc3589x.c gpio: Move irqdomain into struct gpio_irq_chip 2017-11-08 14:06:21 +01:00
gpio-tegra.c pinctrl/gpio: Unify namespace for cross-calls 2017-09-22 11:02:10 +02:00
gpio-tegra186.c gpio: tegra186: Remove tegra186_gpio_lock_class 2017-11-13 11:43:10 +01:00
gpio-thunderx.c gpio: thunderx: remove unused .map() hook from irq_domain_ops 2017-09-22 15:31:55 +02:00
gpio-timberdale.c
gpio-tpic2810.c
gpio-tps6586x.c
gpio-tps65086.c
gpio-tps65218.c
gpio-tps65910.c
gpio-tps65912.c
gpio-tps68470.c gpio: Add support for TPS68470 GPIOs 2017-08-14 15:37:38 +02:00
gpio-ts4800.c
gpio-ts4900.c
gpio-ts5500.c
gpio-twl4030.c mfd: twl: Move header file out of I2C realm 2017-09-04 14:41:02 +01:00
gpio-twl6040.c gpio: twl6040: remove unneeded forward declaration 2017-08-23 10:20:16 +02:00
gpio-tz1090-pdc.c
gpio-tz1090.c pinctrl/gpio: Unify namespace for cross-calls 2017-09-22 11:02:10 +02:00
gpio-ucb1400.c
gpio-uniphier.c This is the bulk of GPIO changes for the v4.15 kernel cycle: 2017-11-14 17:23:44 -08:00
gpio-vf610.c gpio: Move irqdomain into struct gpio_irq_chip 2017-11-08 14:06:21 +01:00
gpio-viperboard.c
gpio-vr41xx.c
gpio-vx855.c
gpio-wcove.c gpio: Move irqdomain into struct gpio_irq_chip 2017-11-08 14:06:21 +01:00
gpio-wm831x.c gpio: wm831x: Add basic device tree support 2017-03-23 11:45:55 +00:00
gpio-wm8350.c
gpio-wm8994.c
gpio-ws16c48.c gpio: Move irqdomain into struct gpio_irq_chip 2017-11-08 14:06:21 +01:00
gpio-xgene-sb.c This is the bulk of GPIO changes for the v4.15 kernel cycle: 2017-11-14 17:23:44 -08:00
gpio-xgene.c gpio: xgene: mark PM functions as __maybe_unused 2017-03-06 14:35:22 +01:00
gpio-xilinx.c gpio: Convert to using %pOF instead of full_name 2017-08-14 15:01:12 +02:00
gpio-xlp.c gpio: Move irqdomain into struct gpio_irq_chip 2017-11-08 14:06:21 +01:00
gpio-xra1403.c gpio: xra1403: Add EXAR XRA1403 SPI GPIO expander driver 2017-05-22 17:48:41 +02:00
gpio-xtensa.c
gpio-zevio.c gpio: zevio: make gpio_chip const 2017-08-23 09:21:54 +02:00
gpio-zx.c gpio: Move irqdomain into struct gpio_irq_chip 2017-11-08 14:06:21 +01:00
gpio-zynq.c gpio: Move irqdomain into struct gpio_irq_chip 2017-11-08 14:06:21 +01:00
gpiolib-acpi.c gpio / ACPI: Drop unnecessary ACPI GPIO to Linux GPIO translation 2017-11-29 13:41:46 +01:00
gpiolib-devprop.c
gpiolib-legacy.c
gpiolib-of.c gpio: Fix loose spelling 2017-10-20 09:37:32 +02:00
gpiolib-sysfs.c This is the bulk of the GPIO changes for the v4.14 cycle: 2017-09-05 11:49:48 -07:00
gpiolib.c This is the bulk of pin control changes for the v4.15 2017-11-16 10:57:11 -08:00
gpiolib.h gpio: Fix loose spelling 2017-10-20 09:37:32 +02:00
Kconfig This is the bulk of pin control changes for the v4.15 2017-11-16 10:57:11 -08:00
Makefile This is the bulk of GPIO changes for the v4.15 kernel cycle: 2017-11-14 17:23:44 -08:00