Skip to content

Commit d69843e

Browse files
Marty Plummerlinusw
authored andcommitted
gpio: f7188x: Add F71889A GPIO support.
Add F71889A GPIO support. Fintek F71889A is a SuperIO. It contains HWMON/GPIO/Serial Ports. Datasheet: http://www.alldatasheet.com/datasheet-pdf/pdf/459076/FINTEK/F71889A.html Its virtually identical to the F71889F superio as far as gpios go. One oddity is GPIO2 at index 0xD0; the datasheet only lists gpio's 7-5, but it logically seems that it should continue down to 0. I'm not sure if the driver can handle gpios that are shifted away from index 0 as it currently stands. Signed-off-by: Marty Plummer <netz.kernel@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent 4c0facd commit d69843e

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

drivers/gpio/gpio-f7188x.c

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,16 @@
3737
#define SIO_F71869A_ID 0x1007 /* F71869A chipset ID */
3838
#define SIO_F71882_ID 0x0541 /* F71882 chipset ID */
3939
#define SIO_F71889_ID 0x0909 /* F71889 chipset ID */
40+
#define SIO_F71889A_ID 0x1005 /* F71889A chipset ID */
4041
#define SIO_F81866_ID 0x1010 /* F81866 chipset ID */
4142

42-
enum chips { f71869, f71869a, f71882fg, f71889f, f81866 };
43+
enum chips { f71869, f71869a, f71882fg, f71889a, f71889f, f81866 };
4344

4445
static const char * const f7188x_names[] = {
4546
"f71869",
4647
"f71869a",
4748
"f71882fg",
49+
"f71889a",
4850
"f71889f",
4951
"f81866",
5052
};
@@ -187,6 +189,17 @@ static struct f7188x_gpio_bank f71882_gpio_bank[] = {
187189
F7188X_GPIO_BANK(40, 4, 0xB0),
188190
};
189191

192+
static struct f7188x_gpio_bank f71889a_gpio_bank[] = {
193+
F7188X_GPIO_BANK(0, 7, 0xF0),
194+
F7188X_GPIO_BANK(10, 7, 0xE0),
195+
F7188X_GPIO_BANK(20, 8, 0xD0),
196+
F7188X_GPIO_BANK(30, 8, 0xC0),
197+
F7188X_GPIO_BANK(40, 8, 0xB0),
198+
F7188X_GPIO_BANK(50, 5, 0xA0),
199+
F7188X_GPIO_BANK(60, 8, 0x90),
200+
F7188X_GPIO_BANK(70, 8, 0x80),
201+
};
202+
190203
static struct f7188x_gpio_bank f71889_gpio_bank[] = {
191204
F7188X_GPIO_BANK(0, 7, 0xF0),
192205
F7188X_GPIO_BANK(10, 7, 0xE0),
@@ -382,6 +395,9 @@ static int f7188x_gpio_probe(struct platform_device *pdev)
382395
data->nr_bank = ARRAY_SIZE(f71882_gpio_bank);
383396
data->bank = f71882_gpio_bank;
384397
break;
398+
case f71889a:
399+
data->nr_bank = ARRAY_SIZE(f71889a_gpio_bank);
400+
data->bank = f71889a_gpio_bank;
385401
case f71889f:
386402
data->nr_bank = ARRAY_SIZE(f71889_gpio_bank);
387403
data->bank = f71889_gpio_bank;
@@ -443,6 +459,9 @@ static int __init f7188x_find(int addr, struct f7188x_sio *sio)
443459
case SIO_F71882_ID:
444460
sio->type = f71882fg;
445461
break;
462+
case SIO_F71889A_ID:
463+
sio->type = f71889a;
464+
break;
446465
case SIO_F71889_ID:
447466
sio->type = f71889f;
448467
break;
@@ -538,6 +557,6 @@ static void __exit f7188x_gpio_exit(void)
538557
}
539558
module_exit(f7188x_gpio_exit);
540559

541-
MODULE_DESCRIPTION("GPIO driver for Super-I/O chips F71869, F71869A, F71882FG, F71889F and F81866");
560+
MODULE_DESCRIPTION("GPIO driver for Super-I/O chips F71869, F71869A, F71882FG, F71889A, F71889F and F81866");
542561
MODULE_AUTHOR("Simon Guinot <simon.guinot@sequanux.org>");
543562
MODULE_LICENSE("GPL");

0 commit comments

Comments
 (0)