Commit Graph

9 Commits

Author SHA1 Message Date
Magnus Damm ad2a8e7ea4 sh: pfc: Add GPIO IRQ support
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>
2011-10-28 15:03:52 +09:00
Magnus Damm c63bcc6ff1 sh: pfc: get_config_reg() shift clean up
Clean up the f_width shift code in get_config_reg().

Reported-by: Ryusuke Sakato <ryusuke.sakato.bx@renesas.com>
Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2011-10-28 14:39:26 +09:00
Paul Mundt e8184a47c9 sh: pfc: Fix up BUG() triggered by gpiolib debugfs lookups.
The gpiolib debugfs entry takes a hammer approach and iterates over all
of the potential GPIOs, regardless of their type. The SH PFC code on the
other hand contains a variable mismash of input/output/function types
spread out sparsely, leading to situations where the debug code can
trigger an out of range enum for the type. Since we already have an error
path for out of range enums, we can just hand that up to the higher level
instead of the current BUG() behaviour.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-10-04 05:15:20 +09:00
Paul Mundt b72421d8aa sh: pfc: support pinmux deregistration.
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>
2010-10-04 03:54:56 +09:00
Magnus Damm 50dd3145a5 sh: update PFC to allow any enum in MARK lists
This patch updates the PFC code with some clarifying
comments together with a functional change. The change
allows function type of GPIO to select any type of enum
in their MARK lists. Without this patch only function
type of enums are allowed in MARK lists.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-20 02:50:57 +09:00
Paul Mundt ca6f2d7faf sh: pfc: Fixup type mismatch in debug printks.
!!value works out to an int while we were still using %ld, so fix this up
and shut gcc up.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-12-09 15:51:27 +09:00
Paul Mundt fd2cb0ce74 sh: pfc: pr_info() -> pr_debug() cleanups.
For some reason this was using pr_info() nested under an ifdef DEBUG.
While this is appealing in that it circumvents the effort necessary to
change ones loglevel, it's not terribly practical. So, convert it over
to pr_debug().

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-11-30 12:15:04 +09:00
Paul Mundt 9cdae914b2 sh: pfc: Convert from ctrl_xxx() to __raw_xxx() I/O routines.
Now that the PFC code is exposed for other architectures, use the common
__raw_xxx() routines instead of the ctrl_xxx() ones. This will be needed
for ARM-based SH-Mobiles amongst others.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-11-30 12:10:41 +09:00
Magnus Damm fae4339919 sh: Break out SuperH PFC code
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>
2009-11-30 12:02:53 +09:00