aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio
diff options
context:
space:
mode:
authorAndreas Bofjall <andreas@gazonk.org>2015-03-09 16:55:13 -0400
committerLinus Walleij <linus.walleij@linaro.org>2015-03-17 12:56:42 -0400
commit24ccef359e8c540083a89a8f2347fae451fe8086 (patch)
tree7445cfb97c0107998f0504b929c549dce1cbcdbd /drivers/gpio
parent3f8f4f19b94cc50e8a3fa3f63815caa0677ff57a (diff)
gpio: f7188x: add GPIO support for F71869
Add support for the GPIOs found on the Fintek SuperI/O chip F71869, such as the one found on the Jetway NF96u-525 motherboard, to the f7188x gpio driver. Signed-off-by: Andreas Bofjall <andreas@gazonk.org> Tested-by: Les Schaffer <schaffer@optonline.net> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/Kconfig4
-rw-r--r--drivers/gpio/gpio-f7188x.c25
2 files changed, 24 insertions, 5 deletions
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index f563c883b887..0078cf045e71 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -198,11 +198,11 @@ config GPIO_MM_LANTIQ
198 created by attaching a 16bit latch to the bus. 198 created by attaching a 16bit latch to the bus.
199 199
200config GPIO_F7188X 200config GPIO_F7188X
201 tristate "F71882FG and F71889F GPIO support" 201 tristate "F71869, F71882FG and F71889F GPIO support"
202 depends on X86 202 depends on X86
203 help 203 help
204 This option enables support for GPIOs found on Fintek Super-I/O 204 This option enables support for GPIOs found on Fintek Super-I/O
205 chips F71882FG and F71889F. 205 chips F71869, F71882FG and F71889F.
206 206
207 To compile this driver as a module, choose M here: the module will 207 To compile this driver as a module, choose M here: the module will
208 be called f7188x-gpio. 208 be called f7188x-gpio.
diff --git a/drivers/gpio/gpio-f7188x.c b/drivers/gpio/gpio-f7188x.c
index fbd954ee5468..ac677bfeaa4d 100644
--- a/drivers/gpio/gpio-f7188x.c
+++ b/drivers/gpio/gpio-f7188x.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * GPIO driver for Fintek Super-I/O F71882 and F71889 2 * GPIO driver for Fintek Super-I/O F71869, F71882 and F71889
3 * 3 *
4 * Copyright (C) 2010-2013 LaCie 4 * Copyright (C) 2010-2013 LaCie
5 * 5 *
@@ -32,12 +32,14 @@
32#define SIO_LOCK_KEY 0xAA /* Key to disable Super-I/O */ 32#define SIO_LOCK_KEY 0xAA /* Key to disable Super-I/O */
33 33
34#define SIO_FINTEK_ID 0x1934 /* Manufacturer ID */ 34#define SIO_FINTEK_ID 0x1934 /* Manufacturer ID */
35#define SIO_F71869_ID 0x0814 /* F71869 chipset ID */
35#define SIO_F71882_ID 0x0541 /* F71882 chipset ID */ 36#define SIO_F71882_ID 0x0541 /* F71882 chipset ID */
36#define SIO_F71889_ID 0x0909 /* F71889 chipset ID */ 37#define SIO_F71889_ID 0x0909 /* F71889 chipset ID */
37 38
38enum chips { f71882fg, f71889f }; 39enum chips { f71869, f71882fg, f71889f };
39 40
40static const char * const f7188x_names[] = { 41static const char * const f7188x_names[] = {
42 "f71869",
41 "f71882fg", 43 "f71882fg",
42 "f71889f", 44 "f71889f",
43}; 45};
@@ -146,6 +148,16 @@ static void f7188x_gpio_set(struct gpio_chip *chip, unsigned offset, int value);
146/* Output mode register (0:open drain 1:push-pull). */ 148/* Output mode register (0:open drain 1:push-pull). */
147#define gpio_out_mode(base) (base + 3) 149#define gpio_out_mode(base) (base + 3)
148 150
151static struct f7188x_gpio_bank f71869_gpio_bank[] = {
152 F7188X_GPIO_BANK(0, 6, 0xF0),
153 F7188X_GPIO_BANK(10, 8, 0xE0),
154 F7188X_GPIO_BANK(20, 8, 0xD0),
155 F7188X_GPIO_BANK(30, 8, 0xC0),
156 F7188X_GPIO_BANK(40, 8, 0xB0),
157 F7188X_GPIO_BANK(50, 5, 0xA0),
158 F7188X_GPIO_BANK(60, 6, 0x90),
159};
160
149static struct f7188x_gpio_bank f71882_gpio_bank[] = { 161static struct f7188x_gpio_bank f71882_gpio_bank[] = {
150 F7188X_GPIO_BANK(0 , 8, 0xF0), 162 F7188X_GPIO_BANK(0 , 8, 0xF0),
151 F7188X_GPIO_BANK(10, 8, 0xE0), 163 F7188X_GPIO_BANK(10, 8, 0xE0),
@@ -281,6 +293,10 @@ static int f7188x_gpio_probe(struct platform_device *pdev)
281 return -ENOMEM; 293 return -ENOMEM;
282 294
283 switch (sio->type) { 295 switch (sio->type) {
296 case f71869:
297 data->nr_bank = ARRAY_SIZE(f71869_gpio_bank);
298 data->bank = f71869_gpio_bank;
299 break;
284 case f71882fg: 300 case f71882fg:
285 data->nr_bank = ARRAY_SIZE(f71882_gpio_bank); 301 data->nr_bank = ARRAY_SIZE(f71882_gpio_bank);
286 data->bank = f71882_gpio_bank; 302 data->bank = f71882_gpio_bank;
@@ -354,6 +370,9 @@ static int __init f7188x_find(int addr, struct f7188x_sio *sio)
354 370
355 devid = superio_inw(addr, SIO_DEVID); 371 devid = superio_inw(addr, SIO_DEVID);
356 switch (devid) { 372 switch (devid) {
373 case SIO_F71869_ID:
374 sio->type = f71869;
375 break;
357 case SIO_F71882_ID: 376 case SIO_F71882_ID:
358 sio->type = f71882fg; 377 sio->type = f71882fg;
359 break; 378 break;
@@ -450,6 +469,6 @@ static void __exit f7188x_gpio_exit(void)
450} 469}
451module_exit(f7188x_gpio_exit); 470module_exit(f7188x_gpio_exit);
452 471
453MODULE_DESCRIPTION("GPIO driver for Super-I/O chips F71882FG and F71889F"); 472MODULE_DESCRIPTION("GPIO driver for Super-I/O chips F71869, F71882FG and F71889F");
454MODULE_AUTHOR("Simon Guinot <simon.guinot@sequanux.org>"); 473MODULE_AUTHOR("Simon Guinot <simon.guinot@sequanux.org>");
455MODULE_LICENSE("GPL"); 474MODULE_LICENSE("GPL");