summaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-f7188x.c
diff options
context:
space:
mode:
authorSteffen Kothe <steffen.kothe.gc1993@googlemail.com>2019-01-16 02:31:25 -0500
committerLinus Walleij <linus.walleij@linaro.org>2019-01-22 09:48:44 -0500
commitb0c3e54e2496eb36cd3f28215992c4d6d708c921 (patch)
tree00d35708fa51ff0811ebb0472ab5ba70744464ba /drivers/gpio/gpio-f7188x.c
parent3ae4f3aac05ab9cc7d93ef3e87bb0bd159cb6bfa (diff)
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>
Diffstat (limited to 'drivers/gpio/gpio-f7188x.c')
-rw-r--r--drivers/gpio/gpio-f7188x.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-f7188x.c b/drivers/gpio/gpio-f7188x.c
index 13350c9d7f5e..0896c825b312 100644
--- a/drivers/gpio/gpio-f7188x.c
+++ b/drivers/gpio/gpio-f7188x.c
@@ -39,8 +39,10 @@
39#define SIO_F71889_ID 0x0909 /* F71889 chipset ID */ 39#define SIO_F71889_ID 0x0909 /* F71889 chipset ID */
40#define SIO_F71889A_ID 0x1005 /* F71889A chipset ID */ 40#define SIO_F71889A_ID 0x1005 /* F71889A chipset ID */
41#define SIO_F81866_ID 0x1010 /* F81866 chipset ID */ 41#define SIO_F81866_ID 0x1010 /* F81866 chipset ID */
42#define SIO_F81804_ID 0x1502 /* F81804 chipset ID, same for f81966 */
42 43
43enum chips { f71869, f71869a, f71882fg, f71889a, f71889f, f81866 }; 44
45enum chips { f71869, f71869a, f71882fg, f71889a, f71889f, f81866, f81804 };
44 46
45static const char * const f7188x_names[] = { 47static const char * const f7188x_names[] = {
46 "f71869", 48 "f71869",
@@ -49,6 +51,7 @@ static const char * const f7188x_names[] = {
49 "f71889a", 51 "f71889a",
50 "f71889f", 52 "f71889f",
51 "f81866", 53 "f81866",
54 "f81804",
52}; 55};
53 56
54struct f7188x_sio { 57struct f7188x_sio {
@@ -223,6 +226,18 @@ static struct f7188x_gpio_bank f81866_gpio_bank[] = {
223 F7188X_GPIO_BANK(80, 8, 0x88), 226 F7188X_GPIO_BANK(80, 8, 0x88),
224}; 227};
225 228
229
230static struct f7188x_gpio_bank f81804_gpio_bank[] = {
231 F7188X_GPIO_BANK(0, 8, 0xF0),
232 F7188X_GPIO_BANK(10, 8, 0xE0),
233 F7188X_GPIO_BANK(20, 8, 0xD0),
234 F7188X_GPIO_BANK(50, 8, 0xA0),
235 F7188X_GPIO_BANK(60, 8, 0x90),
236 F7188X_GPIO_BANK(70, 8, 0x80),
237 F7188X_GPIO_BANK(90, 8, 0x98),
238};
239
240
226static int f7188x_gpio_get_direction(struct gpio_chip *chip, unsigned offset) 241static int f7188x_gpio_get_direction(struct gpio_chip *chip, unsigned offset)
227{ 242{
228 int err; 243 int err;
@@ -407,6 +422,10 @@ static int f7188x_gpio_probe(struct platform_device *pdev)
407 data->nr_bank = ARRAY_SIZE(f81866_gpio_bank); 422 data->nr_bank = ARRAY_SIZE(f81866_gpio_bank);
408 data->bank = f81866_gpio_bank; 423 data->bank = f81866_gpio_bank;
409 break; 424 break;
425 case f81804:
426 data->nr_bank = ARRAY_SIZE(f81804_gpio_bank);
427 data->bank = f81804_gpio_bank;
428 break;
410 default: 429 default:
411 return -ENODEV; 430 return -ENODEV;
412 } 431 }
@@ -469,6 +488,9 @@ static int __init f7188x_find(int addr, struct f7188x_sio *sio)
469 case SIO_F81866_ID: 488 case SIO_F81866_ID:
470 sio->type = f81866; 489 sio->type = f81866;
471 break; 490 break;
491 case SIO_F81804_ID:
492 sio->type = f81804;
493 break;
472 default: 494 default:
473 pr_info(DRVNAME ": Unsupported Fintek device 0x%04x\n", devid); 495 pr_info(DRVNAME ": Unsupported Fintek device 0x%04x\n", devid);
474 goto err; 496 goto err;