summaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/gpio.c
Commit message (Collapse)AuthorAgeFilesLines
* sh: use gpiolibMagnus Damm2009-01-271-53/+53
| | | | | | | | | | This patch updates the SuperH gpio code to make use of gpiolib. The gpiolib callbacks get() and set() are lockless, but we use our own spinlock for the other operations to make sure hardware register bitfield accesses stay atomic. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: lockless gpio_set_value()Magnus Damm2009-01-271-25/+81
| | | | | | | | | | | | | This patch optimizes the gpio data register handling for gpio_set_value(). Instead of using the good old spinlock-plus-read-modify-write strategy we now use a shadow register and atomic operations. This improves the bitbanging mmc performance on Migo-R from 26 Kbytes/s to 40 Kbytes/s. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: lockless gpio_get_value()Magnus Damm2009-01-271-63/+63
| | | | | | | | This patch separates the register read and write functions to allow lockless gpio_get_value(). Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: make gpio_get/set_value() O(1)Magnus Damm2009-01-271-11/+37
| | | | | | | | | | | | This patch modifies the table based SuperH gpio implementation to make use of direct table lookups. With this change the functions gpio_get_value() and gpio_set_value() are O(1). Tested on Migo-R using bitbanging mmc. Performance is improved from 11 KBytes/s to 26 Kbytes/s. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: improve pinmux support for single direction pinsMagnus Damm2008-10-221-1/+5
| | | | | | | | | | This patch improves the support for gpio pins that are hard wired to either input or output and lack control register association. A special force enum id is used to allow use without control register but still mark the gpio pin as input or output. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Update gpio_set_value() pin value handlingMagnus Damm2008-10-211-1/+1
| | | | | | | | | This patch updates the pinmux code to use the boolean value for the function gpio_set_value(). Without this patch values other than 0 and 1 will result in incorrect GPIO settings. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: GPIO and pinmux base codeMagnus Damm2008-10-201-0/+498
This patch adds gpio code together with the pinmux table parser. In the future we should optimize this and switch back to gpiolib. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
OpenPOWER on IntegriCloud