Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpio-f7188x: add support Fintek F81804 & F81966

Basic implementation of driver is used to support Fintek
F81804 & F81966 gpios with custom register set.

Signed-off-by: Steffen Kothe <steffen.kothe.gc1993@googlemail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Steffen Kothe and committed by
Linus Walleij
b0c3e54e 3ae4f3aa

+23 -1
+23 -1
drivers/gpio/gpio-f7188x.c
··· 39 39 #define SIO_F71889_ID 0x0909 /* F71889 chipset ID */ 40 40 #define SIO_F71889A_ID 0x1005 /* F71889A chipset ID */ 41 41 #define SIO_F81866_ID 0x1010 /* F81866 chipset ID */ 42 + #define SIO_F81804_ID 0x1502 /* F81804 chipset ID, same for f81966 */ 42 43 43 - enum chips { f71869, f71869a, f71882fg, f71889a, f71889f, f81866 }; 44 + 45 + enum chips { f71869, f71869a, f71882fg, f71889a, f71889f, f81866, f81804 }; 44 46 45 47 static const char * const f7188x_names[] = { 46 48 "f71869", ··· 51 49 "f71889a", 52 50 "f71889f", 53 51 "f81866", 52 + "f81804", 54 53 }; 55 54 56 55 struct f7188x_sio { ··· 225 222 F7188X_GPIO_BANK(70, 8, 0x80), 226 223 F7188X_GPIO_BANK(80, 8, 0x88), 227 224 }; 225 + 226 + 227 + static struct f7188x_gpio_bank f81804_gpio_bank[] = { 228 + F7188X_GPIO_BANK(0, 8, 0xF0), 229 + F7188X_GPIO_BANK(10, 8, 0xE0), 230 + F7188X_GPIO_BANK(20, 8, 0xD0), 231 + F7188X_GPIO_BANK(50, 8, 0xA0), 232 + F7188X_GPIO_BANK(60, 8, 0x90), 233 + F7188X_GPIO_BANK(70, 8, 0x80), 234 + F7188X_GPIO_BANK(90, 8, 0x98), 235 + }; 236 + 228 237 229 238 static int f7188x_gpio_get_direction(struct gpio_chip *chip, unsigned offset) 230 239 { ··· 422 407 data->nr_bank = ARRAY_SIZE(f81866_gpio_bank); 423 408 data->bank = f81866_gpio_bank; 424 409 break; 410 + case f81804: 411 + data->nr_bank = ARRAY_SIZE(f81804_gpio_bank); 412 + data->bank = f81804_gpio_bank; 413 + break; 425 414 default: 426 415 return -ENODEV; 427 416 } ··· 487 468 break; 488 469 case SIO_F81866_ID: 489 470 sio->type = f81866; 471 + break; 472 + case SIO_F81804_ID: 473 + sio->type = f81804; 490 474 break; 491 475 default: 492 476 pr_info(DRVNAME ": Unsupported Fintek device 0x%04x\n", devid);