firefly-linux-kernel-4.4.55.git
11 years agosh-pfc: sh73a0: Remove LCD and LCD2 function GPIOS
Laurent Pinchart [Thu, 3 Jan 2013 12:07:05 +0000 (13:07 +0100)]
sh-pfc: sh73a0: Remove LCD and LCD2 function GPIOS

All sh73a0 platforms now use the pinctrl API to control the LCD and
LCD2 pins, the corresponding function GPIOS are unused. Remove them.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: sh7372: Remove SDHI and MMCIF function GPIOS
Laurent Pinchart [Wed, 6 Mar 2013 13:23:17 +0000 (14:23 +0100)]
sh-pfc: sh7372: Remove SDHI and MMCIF function GPIOS

All sh7372 platforms now use the pinctrl API to control the SDHI and
MMCIF pins, the corresponding function GPIOS are unused. Remove them.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agoARM: shmobile: marzen: Register pinctrl mappings for INTC
Laurent Pinchart [Thu, 7 Mar 2013 12:46:02 +0000 (13:46 +0100)]
ARM: shmobile: marzen: Register pinctrl mappings for INTC

Replace the GPIO-based INTC pinmux configuration by pinctrl mappings.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agoARM: shmobile: marzen: Register pinctrl mappings for LBSC
Laurent Pinchart [Thu, 7 Mar 2013 12:46:02 +0000 (13:46 +0100)]
ARM: shmobile: marzen: Register pinctrl mappings for LBSC

Replace the GPIO-based LBSC pinmux configuration by pinctrl mappings.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agoARM: shmobile: marzen: Register pinctrl mappings for USB
Laurent Pinchart [Thu, 7 Mar 2013 12:46:02 +0000 (13:46 +0100)]
ARM: shmobile: marzen: Register pinctrl mappings for USB

Replace the GPIO-based USB pinmux configuration by pinctrl mappings.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agoARM: shmobile: marzen: Register pinctrl mappings for HSPI
Laurent Pinchart [Wed, 6 Mar 2013 13:22:11 +0000 (14:22 +0100)]
ARM: shmobile: marzen: Register pinctrl mappings for HSPI

Replace the GPIO-based HSPI pinmux configuration by pinctrl mappings.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agoARM: shmobile: marzen: Register pinctrl mappings for SCIF
Laurent Pinchart [Wed, 6 Mar 2013 13:22:11 +0000 (14:22 +0100)]
ARM: shmobile: marzen: Register pinctrl mappings for SCIF

Replace the GPIO-based SCIF pinmux configuration by pinctrl mappings.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agoARM: shmobile: marzen: Register pinctrl mappings for SDHI and MMCIF
Laurent Pinchart [Wed, 6 Mar 2013 13:22:11 +0000 (14:22 +0100)]
ARM: shmobile: marzen: Register pinctrl mappings for SDHI and MMCIF

Replace the GPIO-based SDHI and MMCIF pinmux configuration by pinctrl
mappings

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agoARM: shmobile: mackerel: Register pinctrl mappings for SDHI and MMCIF
Laurent Pinchart [Wed, 6 Mar 2013 13:22:11 +0000 (14:22 +0100)]
ARM: shmobile: mackerel: Register pinctrl mappings for SDHI and MMCIF

Replace the GPIO-based SDHI and MMCIF pinmux configuration by pinctrl
mappings

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agoARM: shmobile: kzm9g: Register pinctrl mappings for USB
Laurent Pinchart [Wed, 13 Mar 2013 02:23:50 +0000 (03:23 +0100)]
ARM: shmobile: kzm9g: Register pinctrl mappings for USB

Replace the GPIO-based USB pinmux configuration by pinctrl mappings.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agoARM: shmobile: kzm9g: Register pinctrl mappings for BSC
Laurent Pinchart [Wed, 13 Mar 2013 02:21:36 +0000 (03:21 +0100)]
ARM: shmobile: kzm9g: Register pinctrl mappings for BSC

Replace the GPIO-based BSC pinmux configuration by pinctrl mappings.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agoARM: shmobile: kzm9g: Register pinctrl mappings for SDHI and MMCIF
Laurent Pinchart [Wed, 13 Mar 2013 02:23:50 +0000 (03:23 +0100)]
ARM: shmobile: kzm9g: Register pinctrl mappings for SDHI and MMCIF

Replace the GPIO-based SDHI and MMCIF pinmux configuration by pinctrl
mappings.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agoARM: shmobile: kzm9g: Register pinctrl mappings for FSI
Laurent Pinchart [Thu, 3 Jan 2013 11:54:28 +0000 (12:54 +0100)]
ARM: shmobile: kzm9g: Register pinctrl mappings for FSI

Replace the GPIO-based FSI pinmux configuration by pinctrl mappings.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agoARM: shmobile: kzm9g: Register pinctrl mappings for I2C
Laurent Pinchart [Thu, 3 Jan 2013 11:54:28 +0000 (12:54 +0100)]
ARM: shmobile: kzm9g: Register pinctrl mappings for I2C

Replace the GPIO-based I2C pinmux configuration by pinctrl mappings.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agoARM: shmobile: kzm9g: Register pinctrl mappings for SCIF
Laurent Pinchart [Thu, 3 Jan 2013 11:54:28 +0000 (12:54 +0100)]
ARM: shmobile: kzm9g: Register pinctrl mappings for SCIF

Replace the GPIO-based SCIF pinmux configuration by pinctrl mappings.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agoARM: shmobile: kzm9g: Register pinctrl mappings for LCD
Laurent Pinchart [Thu, 3 Jan 2013 11:54:28 +0000 (12:54 +0100)]
ARM: shmobile: kzm9g: Register pinctrl mappings for LCD

Replace the GPIO-based LCD pinmux configuration by pinctrl mappings.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agoARM: shmobile: kota2: Register pinctrl mappings for BSC
Laurent Pinchart [Wed, 13 Mar 2013 02:52:31 +0000 (03:52 +0100)]
ARM: shmobile: kota2: Register pinctrl mappings for BSC

Replace the GPIO-based BSC pinmux configuration by pinctrl mappings.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agoARM: shmobile: kota2: Register pinctrl mappings for KEYSC
Laurent Pinchart [Wed, 13 Mar 2013 02:52:31 +0000 (03:52 +0100)]
ARM: shmobile: kota2: Register pinctrl mappings for KEYSC

Replace the GPIO-based KEYSC pinmux configuration by pinctrl mappings.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agoARM: shmobile: kota2: Register pinctrl mappings for SDHI and MMCIF
Laurent Pinchart [Wed, 13 Mar 2013 02:52:31 +0000 (03:52 +0100)]
ARM: shmobile: kota2: Register pinctrl mappings for SDHI and MMCIF

Replace the GPIO-based SDHI and MMCIF pinmux configuration by pinctrl
mappings.

Board code used the non-pulled-up version of the function GPIOs, but
those are defined in the PFC driver as enabling the pull-ups anyway.
Enable pull-ups on the MMCIF data and command pins through the pinconf
API.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agoARM: shmobile: kota2: Register pinctrl mappings for SCIF
Laurent Pinchart [Thu, 3 Jan 2013 11:54:28 +0000 (12:54 +0100)]
ARM: shmobile: kota2: Register pinctrl mappings for SCIF

Replace the GPIO-based SCIF pinmux configuration by pinctrl mappings.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agoARM: shmobile: bonito: Register pinctrl mappings for LCDC0
Laurent Pinchart [Thu, 3 Jan 2013 11:54:28 +0000 (12:54 +0100)]
ARM: shmobile: bonito: Register pinctrl mappings for LCDC0

Replace the GPIO-based LCDC0 pinmux configuration by pinctrl mappings.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agoARM: shmobile: armadillo800eva: Register pinctrl mappings for SDHI and MMCIF
Laurent Pinchart [Wed, 6 Mar 2013 13:34:23 +0000 (14:34 +0100)]
ARM: shmobile: armadillo800eva: Register pinctrl mappings for SDHI and MMCIF

Replace the GPIO-based SDHI and MMCIF pinmux configuration by pinctrl
mappings.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agoARM: shmobile: armadillo800eva: Register pinctrl mappings for LCDC0
Laurent Pinchart [Thu, 3 Jan 2013 11:54:28 +0000 (12:54 +0100)]
ARM: shmobile: armadillo800eva: Register pinctrl mappings for LCDC0

Replace the GPIO-based LCDC0 pinmux configuration by pinctrl mappings.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agoARM: shmobile: ap4evb: Register pinctrl mappings for SDHI and MMCIF
Laurent Pinchart [Wed, 6 Mar 2013 13:21:27 +0000 (14:21 +0100)]
ARM: shmobile: ap4evb: Register pinctrl mappings for SDHI and MMCIF

Replace the GPIO-based SDHI and MMCIF pinmux configuration by pinctrl
mappings

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agoARM: shmobile: ag5evm: Register pinctrl mappings for IrDA
Laurent Pinchart [Wed, 13 Mar 2013 02:52:31 +0000 (03:52 +0100)]
ARM: shmobile: ag5evm: Register pinctrl mappings for IrDA

Replace the GPIO-based IrDA pinmux configuration by pinctrl mappings.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agoARM: shmobile: ag5evm: Register pinctrl mappings for KEYSC
Laurent Pinchart [Wed, 13 Mar 2013 02:52:31 +0000 (03:52 +0100)]
ARM: shmobile: ag5evm: Register pinctrl mappings for KEYSC

Replace the GPIO-based KEYSC pinmux configuration by pinctrl mappings.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agoARM: shmobile: ag5evm: Register pinctrl mappings for SDHI and MMCIF
Laurent Pinchart [Wed, 13 Mar 2013 02:52:31 +0000 (03:52 +0100)]
ARM: shmobile: ag5evm: Register pinctrl mappings for SDHI and MMCIF

Replace the GPIO-based SDHI and MMCIF pinmux configuration by pinctrl
mappings.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agoARM: shmobile: ag5evm: Register pinctrl mappings for FSI
Laurent Pinchart [Thu, 3 Jan 2013 11:54:28 +0000 (12:54 +0100)]
ARM: shmobile: ag5evm: Register pinctrl mappings for FSI

Replace the GPIO-based FSI pinmux configuration by pinctrl mappings.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agoARM: shmobile: ag5evm: Register pinctrl mappings for I2C
Laurent Pinchart [Thu, 3 Jan 2013 11:54:28 +0000 (12:54 +0100)]
ARM: shmobile: ag5evm: Register pinctrl mappings for I2C

Replace the GPIO-based I2C pinmux configuration by pinctrl mappings.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agoARM: shmobile: ag5evm: Register pinctrl mappings for SCIF
Laurent Pinchart [Thu, 3 Jan 2013 11:54:28 +0000 (12:54 +0100)]
ARM: shmobile: ag5evm: Register pinctrl mappings for SCIF

Replace the GPIO-based SCIF pinmux configuration by pinctrl mappings.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agosh-pfc: r8a7779: Add INTC pin groups and functions
Laurent Pinchart [Thu, 7 Mar 2013 12:38:51 +0000 (13:38 +0100)]
sh-pfc: r8a7779: Add INTC pin groups and functions

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: r8a7779: Add LBSC pin groups and functions
Laurent Pinchart [Thu, 7 Mar 2013 12:38:51 +0000 (13:38 +0100)]
sh-pfc: r8a7779: Add LBSC pin groups and functions

Only the CS pins and functions are currently handled.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: r8a7779: Add USB pin groups and functions
Laurent Pinchart [Thu, 7 Mar 2013 12:38:51 +0000 (13:38 +0100)]
sh-pfc: r8a7779: Add USB pin groups and functions

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: r8a7779: Add USB0 and USB1 PENC pinmux support
Laurent Pinchart [Thu, 7 Mar 2013 12:36:36 +0000 (13:36 +0100)]
sh-pfc: r8a7779: Add USB0 and USB1 PENC pinmux support

The USB0 and USB1 PENC functions were missing. Add them.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: r8a7779: Add HSPI pin groups and functions
Laurent Pinchart [Wed, 6 Mar 2013 18:04:43 +0000 (19:04 +0100)]
sh-pfc: r8a7779: Add HSPI pin groups and functions

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: r8a7779: Add SCIF pin groups and functions
Laurent Pinchart [Wed, 6 Mar 2013 18:04:43 +0000 (19:04 +0100)]
sh-pfc: r8a7779: Add SCIF pin groups and functions

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: r8a7779: Add SDHI and MMCIF pin groups and functions
Laurent Pinchart [Wed, 6 Mar 2013 18:04:43 +0000 (19:04 +0100)]
sh-pfc: r8a7779: Add SDHI and MMCIF pin groups and functions

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: r8a7779: Add DU pin groups and functions
Laurent Pinchart [Thu, 3 Jan 2013 12:07:05 +0000 (13:07 +0100)]
sh-pfc: r8a7779: Add DU pin groups and functions

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: r8a7740: Add SDHI and MMCIF pin groups and functions
Guennadi Liakhovetski [Wed, 23 Jan 2013 16:37:44 +0000 (17:37 +0100)]
sh-pfc: r8a7740: Add SDHI and MMCIF pin groups and functions

Add pin groups for the first two SDHI interfaces and two alternative pin
groups for the MMCIF interface on the r8a7740 SoC.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: r8a7740: Add LCDC0 and LCDC1 pin groups and functions
Laurent Pinchart [Thu, 3 Jan 2013 12:07:05 +0000 (13:07 +0100)]
sh-pfc: r8a7740: Add LCDC0 and LCDC1 pin groups and functions

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: sh73a0: Add IrDA pin groups and functions
Laurent Pinchart [Tue, 12 Mar 2013 00:55:08 +0000 (01:55 +0100)]
sh-pfc: sh73a0: Add IrDA pin groups and functions

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: sh73a0: Add USB pin groups and functions
Laurent Pinchart [Tue, 12 Mar 2013 00:55:08 +0000 (01:55 +0100)]
sh-pfc: sh73a0: Add USB pin groups and functions

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: sh73a0: Add BSC pin groups and functions
Laurent Pinchart [Tue, 12 Mar 2013 00:55:08 +0000 (01:55 +0100)]
sh-pfc: sh73a0: Add BSC pin groups and functions

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: sh73a0: Add KEYSC pin groups and functions
Laurent Pinchart [Tue, 12 Mar 2013 00:55:08 +0000 (01:55 +0100)]
sh-pfc: sh73a0: Add KEYSC pin groups and functions

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: sh73a0: Add SDHI and MMCIF pin groups and functions
Guennadi Liakhovetski [Tue, 12 Feb 2013 15:50:03 +0000 (16:50 +0100)]
sh-pfc: sh73a0: Add SDHI and MMCIF pin groups and functions

Add pin group definitions for SDHI0, SDHI1, SDHI2 and MMCIF interfaces on
sh73a0.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: sh73a0: Add FSI pin groups and functions
Laurent Pinchart [Thu, 3 Jan 2013 12:07:05 +0000 (13:07 +0100)]
sh-pfc: sh73a0: Add FSI pin groups and functions

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: sh73a0: Add I2C2 and I2C3 pin groups and functions
Laurent Pinchart [Thu, 3 Jan 2013 12:07:05 +0000 (13:07 +0100)]
sh-pfc: sh73a0: Add I2C2 and I2C3 pin groups and functions

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: sh73a0: Add SCIFA and SCIFB pin groups and functions
Laurent Pinchart [Thu, 3 Jan 2013 12:07:05 +0000 (13:07 +0100)]
sh-pfc: sh73a0: Add SCIFA and SCIFB pin groups and functions

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: sh73a0: Add LCD and LCD2 pin groups and functions
Laurent Pinchart [Thu, 3 Jan 2013 12:07:05 +0000 (13:07 +0100)]
sh-pfc: sh73a0: Add LCD and LCD2 pin groups and functions

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: sh73a0: Add bias (pull-up/down) pinconf support
Laurent Pinchart [Wed, 13 Mar 2013 00:31:23 +0000 (01:31 +0100)]
sh-pfc: sh73a0: Add bias (pull-up/down) pinconf support

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: sh7372: Add SDHCI and MMCIF pin groups and functions
Guennadi Liakhovetski [Wed, 23 Jan 2013 16:37:45 +0000 (17:37 +0100)]
sh-pfc: sh7372: Add SDHCI and MMCIF pin groups and functions

Add pin groups for all three SDHI interfaces and two alternative pin
groups for the MMCIF interface on the sh7372 SoC.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agosh-pfc: Return an error if a pin doesn't support the requested direction
Laurent Pinchart [Wed, 13 Mar 2013 17:18:30 +0000 (18:18 +0100)]
sh-pfc: Return an error if a pin doesn't support the requested direction

When setting a pin direction verify that the requested direction is
supported, and return an error if it isn't.

This requires pin configuration information to be supplied by SoC data.
The check is a no-op if the information is not supplied.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: Convert message printing from pr_* to dev_*
Laurent Pinchart [Sun, 10 Mar 2013 17:00:02 +0000 (18:00 +0100)]
sh-pfc: Convert message printing from pr_* to dev_*

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: Clean up pin configuration type handling
Laurent Pinchart [Sun, 10 Mar 2013 16:25:29 +0000 (17:25 +0100)]
sh-pfc: Clean up pin configuration type handling

Set pin configuration type to

- PINMUX_TYPE_NONE at initialization time and when disabling a function
  or freeing a GPIO

- PINMUX_TYPE_FUNCTION when enabling a function

- PINMUX_TYPE_INPUT or PINMUX_TYPE_OUTPUT when setting the GPIO
  direction

Verify that the type is PINMUX_TYPE_NONE when enabling a function or
requesting a GPIO and return -EBUSY if it isn't.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: Merge sh_pfc_reconfig_pin() into sh_pfc_gpio_set_direction()
Laurent Pinchart [Sun, 10 Mar 2013 15:55:19 +0000 (16:55 +0100)]
sh-pfc: Merge sh_pfc_reconfig_pin() into sh_pfc_gpio_set_direction()

The sh_pfc_reconfig_pin() is only called from a single location. Merge
it into its call site to make the code easier to follow.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: Implement generic pinconf support
Laurent Pinchart [Sun, 10 Mar 2013 15:44:02 +0000 (16:44 +0100)]
sh-pfc: Implement generic pinconf support

The existing PFC pinconf implementation, tied to the PFC-specific pin
types, isn't used by drivers or boards. Replace it with the generic
pinconf types to implement bias (pull-up/down) setup. Other pin
configuration options can be implemented later if needed.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: Use proper error codes
Laurent Pinchart [Sun, 10 Mar 2013 15:38:23 +0000 (16:38 +0100)]
sh-pfc: Use proper error codes

Return proper error codes instead of -1, and propagate the error codes.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: Constify all SoC data
Laurent Pinchart [Sat, 16 Feb 2013 17:47:05 +0000 (18:47 +0100)]
sh-pfc: Constify all SoC data

None of the SoC data need to be modified. Constify it.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: Remove configuration dry-run and free
Laurent Pinchart [Sun, 10 Mar 2013 14:29:14 +0000 (15:29 +0100)]
sh-pfc: Remove configuration dry-run and free

The purpose of the dry-run is to ensure that a pin about to be
configured isn't in use. However, the current implementation is a no-op.
This proves that the dry-run isn't essential. Remove it.

Freeing configuration then becomes a no-op as well. Remove it.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: Don't modify sh_pfc_pin SoC data
Laurent Pinchart [Fri, 8 Mar 2013 16:43:54 +0000 (17:43 +0100)]
sh-pfc: Don't modify sh_pfc_pin SoC data

The sh_pfc_pin structure supplied in SoC data contains information about
pin configuration and name. It's abused to store GPIO data registers
information and pin config type. Move those fields out of the
pinmux_data_reg structure into the new sh_pfc_gpio_pin and
sh_pfc_pin_config structures.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: Don't modify pinmux_data_reg SoC data
Laurent Pinchart [Sat, 16 Feb 2013 17:34:32 +0000 (18:34 +0100)]
sh-pfc: Don't modify pinmux_data_reg SoC data

The pinmux_data_reg structure supplied in SoC data contains information
about data registers. It's abused to store per-device mapped iomem and
shadow values. Move those fields out of the pinmux_data_reg structure
into the per-device sh_pfc_chip structure.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: Drop unused support for 1:1 physical to virtual memory mappings
Laurent Pinchart [Sat, 16 Feb 2013 22:39:07 +0000 (23:39 +0100)]
sh-pfc: Drop unused support for 1:1 physical to virtual memory mappings

Now that all PFC platform devices provide memory resources support for
registers without an associated memory resource isn't used anymore. Drop
it.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: Don't map data registers individually
Laurent Pinchart [Sat, 16 Feb 2013 23:26:33 +0000 (00:26 +0100)]
sh-pfc: Don't map data registers individually

All data registers are located in the same memory resource. Locate the
mapped resource at initializat time and use it directly instead of
computing a mapped address for each register. This gets rid of the
mapped_reg field of the pinmux_data_reg structure.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: Move GPIO registers access functions to gpio.c
Laurent Pinchart [Fri, 15 Feb 2013 01:04:55 +0000 (02:04 +0100)]
sh-pfc: Move GPIO registers access functions to gpio.c

Move the sh_pfc_setup_data_regs(), sh_pfc_setup_data_reg(),
sh_pfc_get_data_reg(), sh_pfc_read_bit() and sh_pfc_write_bit()
function to gpio.c as they belong to the GPIO implementation. Inline
sh_pfc_read_bit() and sh_pfc_write_bit() in their only call location.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: Fix return value check in sh_pfc_register_pinctrl()
Wei Yongjun [Mon, 11 Mar 2013 14:08:12 +0000 (22:08 +0800)]
sh-pfc: Fix return value check in sh_pfc_register_pinctrl()

In case of error, the function pinctrl_register() returns NULL not
ERR_PTR(). The IS_ERR() test in the return value check should be
replaced with NULL test.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh: shx3: Add pin control resources
Laurent Pinchart [Sat, 16 Feb 2013 18:23:58 +0000 (19:23 +0100)]
sh: shx3: Add pin control resources

Add memory resources for the pin control platform device to let the
sh-pfc driver ioremap() registers properly instead of evily casting
register physical addresses to virtual addresses.

The memory resource address range has been extracted from the config and
data registes lists in the sh-pfc driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agosh: sh7786: Add pin control resources
Laurent Pinchart [Sat, 16 Feb 2013 18:23:58 +0000 (19:23 +0100)]
sh: sh7786: Add pin control resources

Add memory resources for the pin control platform device to let the
sh-pfc driver ioremap() registers properly instead of evily casting
register physical addresses to virtual addresses.

The memory resource address range has been extracted from the config and
data registes lists in the sh-pfc driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agosh: sh7785: Add pin control resources
Laurent Pinchart [Sat, 16 Feb 2013 18:23:58 +0000 (19:23 +0100)]
sh: sh7785: Add pin control resources

Add memory resources for the pin control platform device to let the
sh-pfc driver ioremap() registers properly instead of evily casting
register physical addresses to virtual addresses.

The memory resource address range has been extracted from the config and
data registes lists in the sh-pfc driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agosh: sh7757: Add pin control resources
Laurent Pinchart [Sat, 16 Feb 2013 18:23:58 +0000 (19:23 +0100)]
sh: sh7757: Add pin control resources

Add memory resources for the pin control platform device to let the
sh-pfc driver ioremap() registers properly instead of evily casting
register physical addresses to virtual addresses.

The memory resource address range has been extracted from the config and
data registes lists in the sh-pfc driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agosh: sh7724: Add pin control resources
Laurent Pinchart [Sat, 16 Feb 2013 18:23:58 +0000 (19:23 +0100)]
sh: sh7724: Add pin control resources

Add memory resources for the pin control platform device to let the
sh-pfc driver ioremap() registers properly instead of evily casting
register physical addresses to virtual addresses.

The memory resource address range has been extracted from the config and
data registes lists in the sh-pfc driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agosh: sh7723: Add pin control resources
Laurent Pinchart [Sat, 16 Feb 2013 18:23:58 +0000 (19:23 +0100)]
sh: sh7723: Add pin control resources

Add memory resources for the pin control platform device to let the
sh-pfc driver ioremap() registers properly instead of evily casting
register physical addresses to virtual addresses.

The memory resource address range has been extracted from the config and
data registes lists in the sh-pfc driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agosh: sh7722: Add pin control resources
Laurent Pinchart [Sat, 16 Feb 2013 18:23:58 +0000 (19:23 +0100)]
sh: sh7722: Add pin control resources

Add memory resources for the pin control platform device to let the
sh-pfc driver ioremap() registers properly instead of evily casting
register physical addresses to virtual addresses.

The memory resource address range has been extracted from the config and
data registes lists in the sh-pfc driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agosh: sh7720: Add pin control resources
Laurent Pinchart [Sat, 16 Feb 2013 18:23:58 +0000 (19:23 +0100)]
sh: sh7720: Add pin control resources

Add memory resources for the pin control platform device to let the
sh-pfc driver ioremap() registers properly instead of evily casting
register physical addresses to virtual addresses.

The memory resource address range has been extracted from the config and
data registes lists in the sh-pfc driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agosh: sh7269: Add pin control resources
Laurent Pinchart [Sat, 16 Feb 2013 18:23:58 +0000 (19:23 +0100)]
sh: sh7269: Add pin control resources

Add memory resources for the pin control platform device to let the
sh-pfc driver ioremap() registers properly instead of evily casting
register physical addresses to virtual addresses.

The memory resource address range has been extracted from the config and
data registes lists in the sh-pfc driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agosh: sh7264: Add pin control resources
Laurent Pinchart [Sat, 16 Feb 2013 18:23:58 +0000 (19:23 +0100)]
sh: sh7264: Add pin control resources

Add memory resources for the pin control platform device to let the
sh-pfc driver ioremap() registers properly instead of evily casting
register physical addresses to virtual addresses.

The memory resource address range has been extracted from the config and
data registes lists in the sh-pfc driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agosh: sh7203: Add pin control resources
Laurent Pinchart [Sat, 16 Feb 2013 18:23:58 +0000 (19:23 +0100)]
sh: sh7203: Add pin control resources

Add memory resources for the pin control platform device to let the
sh-pfc driver ioremap() registers properly instead of evily casting
register physical addresses to virtual addresses.

The memory resource address range has been extracted from the config and
data registes lists in the sh-pfc driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
11 years agosh-pfc: Expose real groups and functions in pinctrl/pinmux operations
Laurent Pinchart [Thu, 3 Jan 2013 13:33:13 +0000 (14:33 +0100)]
sh-pfc: Expose real groups and functions in pinctrl/pinmux operations

The sh-pfc driver exposes one fake group and function per GPIO pin. As
the pinctrl and pinmux APIs are not used by any SuperH and SH Mobile
board or driver, drop the fake groups and functions and replace them by
a real pinctrl and pinmux implementation.

Groups and functions must now be explicitly provided by PFC SoC-specific
data.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agoARM: shmobile: mackerel: Replace GPIO_PORTx enum with GPIO port numbers
Laurent Pinchart [Sat, 16 Feb 2013 06:38:50 +0000 (07:38 +0100)]
ARM: shmobile: mackerel: Replace GPIO_PORTx enum with GPIO port numbers

The PFC GPIO API implementation moved to using port numbers. Replace all
GPIO_PORTx enum usage with the corresponding port number. The GPIO_PORTx
enum values are identical to the port number on this platform.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agoARM: shmobile: bonito: Replace GPIO_PORTx enum with GPIO port numbers
Laurent Pinchart [Sat, 16 Feb 2013 06:38:50 +0000 (07:38 +0100)]
ARM: shmobile: bonito: Replace GPIO_PORTx enum with GPIO port numbers

The PFC GPIO API implementation moved to using port numbers. Replace all
GPIO_PORTx enum usage with the corresponding port number. The GPIO_PORTx
enum values are identical to the port number on this platform.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agoARM: shmobile: armadillo: Replace GPIO_PORTx enum with GPIO port numbers
Laurent Pinchart [Sat, 16 Feb 2013 06:38:50 +0000 (07:38 +0100)]
ARM: shmobile: armadillo: Replace GPIO_PORTx enum with GPIO port numbers

The PFC GPIO API implementation moved to using port numbers. Replace all
GPIO_PORTx enum usage with the corresponding port number. The GPIO_PORTx
enum values are identical to the port number on this platform.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agoARM: shmobile: ap4-evb: Replace GPIO_PORTx enum with GPIO port numbers
Laurent Pinchart [Sat, 16 Feb 2013 06:38:50 +0000 (07:38 +0100)]
ARM: shmobile: ap4-evb: Replace GPIO_PORTx enum with GPIO port numbers

The PFC GPIO API implementation moved to using port numbers. Replace all
GPIO_PORTx enum usage with the corresponding port number. The GPIO_PORTx
enum values are identical to the port number on this platform.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agoARM: shmobile: sh73a0: Support sparse GPIO numbers
Guennadi Liakhovetski [Tue, 12 Feb 2013 15:50:02 +0000 (16:50 +0100)]
ARM: shmobile: sh73a0: Support sparse GPIO numbers

The SH73A0 SoC has sparse GPIO numbers. Declare the pin numbers ranges
in the PFC SoC data and use the pin numbers in the GPIO API.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: Add support for sparse pin numbers
Laurent Pinchart [Fri, 15 Feb 2013 00:33:38 +0000 (01:33 +0100)]
sh-pfc: Add support for sparse pin numbers

The PFC driver assumes that the value of the GPIO_PORTxxx enumeration
names are equal to the port number. This isn't true when the port number
space is sparse, as with the SH73A0.

Fix the issue by adding support for pin numbers ranges specified through
SoC data. When no range is specified the driver considers that the PFC
implements a single contiguous range for all pins.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: Replace pinctrl_add_gpio_range() with gpiochip_add_pin_range()
Laurent Pinchart [Thu, 7 Mar 2013 23:45:12 +0000 (00:45 +0100)]
sh-pfc: Replace pinctrl_add_gpio_range() with gpiochip_add_pin_range()

Adding a GPIO range to a pinctrl device logically belongs to the GPIO
driver. Switch to the right API.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: Add function to retrieve a pin instance from its pin number
Laurent Pinchart [Thu, 14 Feb 2013 21:35:09 +0000 (22:35 +0100)]
sh-pfc: Add function to retrieve a pin instance from its pin number

This prepares support for sparse pin numbering. The function currently
just performs and indexed lookup in the pins array.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: Simplify the sh_pfc_gpio_is_pin() logic
Laurent Pinchart [Thu, 14 Feb 2013 21:12:11 +0000 (22:12 +0100)]
sh-pfc: Simplify the sh_pfc_gpio_is_pin() logic

The function is guaranteed to be called with a gpio number smaller than
nr_pins. The condition can the be simplified, and the function inlined.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: Use pinmux identifiers in the pin muxing API
Laurent Pinchart [Thu, 14 Feb 2013 16:36:56 +0000 (17:36 +0100)]
sh-pfc: Use pinmux identifiers in the pin muxing API

The PFC core exposes a sh_pfc_config_gpio() function that configures
pinmuxing for a given GPIO (either a real GPIO or a function GPIO).
Handling of real and function GPIOs belong to the GPIO layer, move the
GPIO number to mark translation to the caller and rename the function to
sh_pfc_config_mux().

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: Share the PORT_10_REV, PORT_32 and PORT_32_REV definitions
Laurent Pinchart [Wed, 13 Feb 2013 21:09:27 +0000 (22:09 +0100)]
sh-pfc: Share the PORT_10_REV, PORT_32 and PORT_32_REV definitions

The macros are defined identically and used in two SoC-specific files,
share them.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: Look up IRQ table entries by GPIO number
Laurent Pinchart [Thu, 3 Jan 2013 13:12:14 +0000 (14:12 +0100)]
sh-pfc: Look up IRQ table entries by GPIO number

Instead of converting the GPIO number to an enum_id and looking up IRQ
table entries by enum_id, replace the pinmux_irq enum_ids field with a
gpios field and lookup entries using the GPIO number.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: Rename struct pinmux_pin to struct sh_pfc_pin
Laurent Pinchart [Wed, 2 Jan 2013 13:53:37 +0000 (14:53 +0100)]
sh-pfc: Rename struct pinmux_pin to struct sh_pfc_pin

And drop the pinmux_flag_t typedef.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: Split pins and functions into separate gpio_chip instances
Laurent Pinchart [Thu, 6 Dec 2012 13:49:25 +0000 (14:49 +0100)]
sh-pfc: Split pins and functions into separate gpio_chip instances

Register two GPIO chips, one for the real GPIOs and one for the function
GPIOs.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: Split pins and functions definition tables
Laurent Pinchart [Thu, 29 Nov 2012 12:24:07 +0000 (13:24 +0100)]
sh-pfc: Split pins and functions definition tables

Split the GPIOs table into a pins table for real GPIOs and a functions
table for function GPIOs.

Only register pins with the pinctrl core. The function GPIOs remain
accessible as GPIOs.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: Don't needlessly check GPIO type in sh_gpio_free()
Laurent Pinchart [Thu, 29 Nov 2012 17:00:32 +0000 (18:00 +0100)]
sh-pfc: Don't needlessly check GPIO type in sh_gpio_free()

The GPIO type is always PINMUX_TYPE_FUNCTION when freeing a function
GPIO. Hardcode the type value.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: Shrink the pinctrl GPIO range to include real GPIOs only
Laurent Pinchart [Thu, 29 Nov 2012 12:03:53 +0000 (13:03 +0100)]
sh-pfc: Shrink the pinctrl GPIO range to include real GPIOs only

As a step towards GPIO function removal, shorten the GPIO range
registered with the pinctrl core. Function GPIOs are now handled in the
GPIO handlers directly instead of going through the pinctrl API.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: Make struct pinmux_gpio enum_id field const
Laurent Pinchart [Wed, 28 Nov 2012 18:22:18 +0000 (19:22 +0100)]
sh-pfc: Make struct pinmux_gpio enum_id field const

This ensures that the field is not modified, which is a prerequisite for
the rest of the PFC refactoring work.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: Initialize pinmux_gpio flags statically
Laurent Pinchart [Thu, 29 Nov 2012 01:23:26 +0000 (02:23 +0100)]
sh-pfc: Initialize pinmux_gpio flags statically

All function GPIO entries are initialized with the GPIO_FN macro that
expands to the PINMUX_GPIO macro, used to initialize real GPIOs. Create
a PINMUX_GPIO_FN macro that duplicates PINMUX_GPIO and sets flags to
PINMUX_TYPE_FUNCTION and use it in GPIO_FN, and make PINMUX_GPIO set
flags to PINMUX_TYPE_GPIO.

This removes the need to initialize GPIO flags at runtime and thus
simplifies the code, preparing for the GPIO and functions split.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: Remove unused sh_pfc_soc_info reserved_id field
Laurent Pinchart [Thu, 29 Nov 2012 15:18:24 +0000 (16:18 +0100)]
sh-pfc: Remove unused sh_pfc_soc_info reserved_id field

The field is unused, remove it.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: Replace SoC info data and mark ranges with a number of pins
Laurent Pinchart [Thu, 29 Nov 2012 11:24:51 +0000 (12:24 +0100)]
sh-pfc: Replace SoC info data and mark ranges with a number of pins

The data and mark ranges are only used to check whether a GPIO
corresponds to a real pin or a function. As pins come first in the list
of GPIOs and in the platform-specific GPIO enumerations, we can replace
the data and mark ranges by a number of pins.

Add an nr_pins field to struct sh_pfc_soc_info to store the number of
pins implemented by the SoC, remove the data and mark range fields and
introduce sh_pfc_gpio_is_pin() and sh_pfc_gpio_is_function() functions
to replace range-based checks.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: Replace first_gpio and last_gpio with nr_gpios
Laurent Pinchart [Wed, 28 Nov 2012 16:51:00 +0000 (17:51 +0100)]
sh-pfc: Replace first_gpio and last_gpio with nr_gpios

The SoC information first_gpio field is always equal to 0, and the
last_gpio field is the index of the last entry in the pinmux_gpios
array. Replace the first_gpio and last_gpio fields by a nr_gpios field,
and initialize it to ARRAY_SIZE(pinmux_gpios).

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
11 years agosh-pfc: Use GPIO_FN instead of PINMUX_GPIO where possible
Laurent Pinchart [Wed, 28 Nov 2012 21:05:49 +0000 (22:05 +0100)]
sh-pfc: Use GPIO_FN instead of PINMUX_GPIO where possible

The GPIO_FN macro expands to the PINMUX_GPIO macro. The regular
expression to 'unexpand' PINMUX_GPIO to GPIO_FN is

s/\tPINMUX_GPIO(GPIO_FN_\([A-Z0-9_]*\),[ \t]*\1_MARK)/\tGPIO_FN(\1)/

This consolidates SoC-specific PFC information to use the same macros
for all SoCs.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>