aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorBalaji Rao <balajirrao@openmoko.org>2009-01-08 19:49:37 -0500
committerSamuel Ortiz <samuel@sortiz.org>2009-01-10 19:34:24 -0500
commit6a3d119b4ce29cf32bfe91eb61d46e9dbd8ce38a (patch)
tree659c75a68731d368092a99adefecd66e754ffcb6 /include/linux
parent08c3e06a5eb27d43b712adef18379f8464425e71 (diff)
mfd: PCF50633 gpio support
What the PCF05633 calls as a 'GPIO' is much more than the GPIO in the linux sense and there are only 4 of them - which means, the gpiolib is not used here. Signed-off-by: Balaji Rao <balajirrao@openmoko.org> Cc: Andy Green <andy@openmoko.com> Signed-off-by: Samuel Ortiz <sameo@openedhand.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mfd/pcf50633/gpio.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/include/linux/mfd/pcf50633/gpio.h b/include/linux/mfd/pcf50633/gpio.h
new file mode 100644
index 000000000000..a42b845efc54
--- /dev/null
+++ b/include/linux/mfd/pcf50633/gpio.h
@@ -0,0 +1,52 @@
1/*
2 * gpio.h -- GPIO driver for NXP PCF50633
3 *
4 * (C) 2006-2008 by Openmoko, Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 */
12
13#ifndef __LINUX_MFD_PCF50633_GPIO_H
14#define __LINUX_MFD_PCF50633_GPIO_H
15
16#include <linux/mfd/pcf50633/core.h>
17
18#define PCF50633_GPIO1 1
19#define PCF50633_GPIO2 2
20#define PCF50633_GPIO3 3
21#define PCF50633_GPO 4
22
23#define PCF50633_REG_GPIO1CFG 0x14
24#define PCF50633_REG_GPIO2CFG 0x15
25#define PCF50633_REG_GPIO3CFG 0x16
26#define PCF50633_REG_GPOCFG 0x17
27
28#define PCF50633_GPOCFG_GPOSEL_MASK 0x07
29
30enum pcf50633_reg_gpocfg {
31 PCF50633_GPOCFG_GPOSEL_0 = 0x00,
32 PCF50633_GPOCFG_GPOSEL_LED_NFET = 0x01,
33 PCF50633_GPOCFG_GPOSEL_SYSxOK = 0x02,
34 PCF50633_GPOCFG_GPOSEL_CLK32K = 0x03,
35 PCF50633_GPOCFG_GPOSEL_ADAPUSB = 0x04,
36 PCF50633_GPOCFG_GPOSEL_USBxOK = 0x05,
37 PCF50633_GPOCFG_GPOSEL_ACTPH4 = 0x06,
38 PCF50633_GPOCFG_GPOSEL_1 = 0x07,
39 PCF50633_GPOCFG_GPOSEL_INVERSE = 0x08,
40};
41
42int pcf50633_gpio_set(struct pcf50633 *pcf, int gpio, u8 val);
43u8 pcf50633_gpio_get(struct pcf50633 *pcf, int gpio);
44
45int pcf50633_gpio_invert_set(struct pcf50633 *, int gpio, int invert);
46int pcf50633_gpio_invert_get(struct pcf50633 *pcf, int gpio);
47
48int pcf50633_gpio_power_supply_set(struct pcf50633 *,
49 int gpio, int regulator, int on);
50#endif /* __LINUX_MFD_PCF50633_GPIO_H */
51
52