aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sh_pfc.h
Commit message (Collapse)AuthorAge
* sh: pfc: Rudimentary pinctrl-backed GPIO support.Paul Mundt2012-07-09
| | | | | | | | | | | | | | | | | | | | | This begins the migration of the PFC core to the pinctrl subsystem. Initial support is very basic, with the bulk of the implementation simply being nopped out in such a way to allow registration with the pinctrl core to succeed. The gpio chip driver is stripped down considerably now relying purely on pinctrl API calls to manage the bulk of its operations. This provides a basis for further PFC refactoring, including decoupling pin functions from the GPIO API, establishing pin groups, and so forth. These will all be dealt with incrementally so as to introduce as few growing and migratory pains to tree-wide PFC pinmux users today. When the interfaces have been well established and in-tree users have been migrated off of the legacy interfaces it will be possible to strip down the core considerably, leading to eventual drivers/pinctrl rehoming. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: pfc: Dumb GPIO stringification.Paul Mundt2012-07-09
| | | | | | | | This implements fairly simplistic stringification of existing pinmux GPIOs for easy enum id -> string mapping, which will subsequently be used by the pinctrl support code. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: pfc: Shuffle PFC support core.Paul Mundt2012-07-09
| | | | | | | | This follows the intc/clk changes and shuffles the PFC support code under its own directory. This will facilitate better code sharing, and allow us to trim down the exported interface by quite a margin. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: pfc: Verify pin type encoding size at build time.Paul Mundt2012-06-20
| | | | | | | | | | The encoding is tightly packed, and future changes (such as pinconf-generic support) can easily lead to a situation where we violate the encoding constraints and trample data bit/reg bits. This plugs in some sanity checks by way of a BUILD_BUG_ON() to blow up if we fail to fit. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: pfc: Kill off unused pinmux bias flags.Paul Mundt2012-06-20
| | | | | | | WANT_PULLUP/DOWN were never interfaced with anything, so just kill them off. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: pfc: Split out gpio chip support.Paul Mundt2012-06-20
| | | | | | | | | | | | | | | | This implements a bit of rework for the PFC code, making the core itself slightly more pluggable and moving out the gpio chip handling completely. The API is preserved in such a way that platforms that depend on it for early configuration are still able to do so, while making it possible to migrate to alternate interfaces going forward. This is the first step of chainsawing necessary to support the pinctrl API, with the eventual goal being able to decouple pin function state from the gpio API while retaining gpio chip tie-in for gpio pin functions only, relying on the pinctrl/pinmux API for non-gpio function demux. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: pfc: Unlock register supportMagnus Damm2012-01-08
| | | | | | | | Add PFC support for a 32-bit unlock register. Needed to drive the r8a7779 PFC that comes with a funky PMMR register. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: pfc: Variable bitfield width config register supportMagnus Damm2012-01-08
| | | | | | | | | | | Add support for variable config reg hardware by adding the macro PINMUX_CFG_REG_VAR(). The width of each bitfield needs to be passed to the macro, and the correct space must be consumed by each bitfield in the enum table following the macro. Data registers still need to have fixed bitfields. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: pfc: ioremap() supportMagnus Damm2011-12-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for non-entity mapped PFC registers through the use of struct resource and ioremap()/iounmap(). The PFC main data structure gets updated with a pointer to a struct resources array that point out all register windows used by the PFC instance. The register definitions are kept as physical addresses but the PFC code will do transparent conversion into virtual addresses whenever register windows are specified using with struct resource. To introduce as little performance penalty as possible the virtual address of each data register is cached in memory. The virtual address of each configuration register is however calculated during run time. This because the configuration is considered slow path so focus is instead put on keeping memory foot print as small as possible. The PFC register access code is in this patch updated from __raw_readN() / __raw_writeN() into ioreadN() / iowriteN(). This patch is needed to support the PFC block in r8a7779. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* ARM: mach-shmobile: move helper macro PORTCR to sh_pfc.hKuninori Morimoto2011-11-11
| | | | | Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* ARM: mach-shmobile: move helper macro PORT_xx to sh_pfc.hKuninori Morimoto2011-11-11
| | | | | | | | This patch moves PORT_xx helper macro to sh_pfc.h, and it expects CPU_ALL_PORT() macro for each CPU Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* ARM: mach-shmobile: move helper macro PORT_DATA_xx to sh_pfc.hKuninori Morimoto2011-11-11
| | | | | | | | This patch move PORT_DATA_xx helper macro to sh_pfc.h. and pfc-sh7372.c used it Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: pfc: Add GPIO IRQ supportMagnus Damm2011-10-28
| | | | | | | | | | | | | | Add GPIO IRQ support to the shared PFC code in drivers/sh/pfc.c The enums pointed out by a certain GPIO will be matched against a table for IRQ to enum mappings. Only the shared PFC code is updated by this patch. SoC specific changes are also needed to allow platforms to make use of this feature. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: pfc: Remove unused gpio_in_use memberMagnus Damm2011-10-28
| | | | | | | Remove unused member gpio_in_use from struct pinmux_info. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: pfc: support pinmux deregistration.Paul Mundt2010-10-03
| | | | | | | | | | Presently the pinmux code is a one-way thing, but there's nothing preventing an unregistration if no one has grabbed any of the pins. This will permit us to save a bit of memory on systems that require pin demux for certain peripherals in the case where registration of those peripherals fails, or they are otherwise not attached to the system. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Break out SuperH PFC codeMagnus Damm2009-11-29
This file breaks out the SuperH PFC code from arch/sh/kernel/gpio.c + arch/sh/include/asm/gpio.h to drivers/sh/pfc.c + include/linux/sh_pfc.h. Similar to the INTC stuff. The non-SuperH specific file location makes it possible to share the code between multiple architectures. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>