Skip to content

Commit b0c3e54

Browse files
s-kothelinusw
authored andcommitted
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>
1 parent 3ae4f3a commit b0c3e54

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

drivers/gpio/gpio-f7188x.c

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,10 @@
3939
#define SIO_F71889_ID 0x0909 /* F71889 chipset ID */
4040
#define SIO_F71889A_ID 0x1005 /* F71889A chipset ID */
4141
#define SIO_F81866_ID 0x1010 /* F81866 chipset ID */
42+
#define SIO_F81804_ID 0x1502 /* F81804 chipset ID, same for f81966 */
4243

43-
enum chips { f71869, f71869a, f71882fg, f71889a, f71889f, f81866 };
44+
45+
enum chips { f71869, f71869a, f71882fg, f71889a, f71889f, f81866, f81804 };
4446

4547
static const char * const f7188x_names[] = {
4648
"f71869",
@@ -49,6 +51,7 @@ static const char * const f7188x_names[] = {
4951
"f71889a",
5052
"f71889f",
5153
"f81866",
54+
"f81804",
5255
};
5356

5457
struct f7188x_sio {
@@ -223,6 +226,18 @@ static struct f7188x_gpio_bank f81866_gpio_bank[] = {
223226
F7188X_GPIO_BANK(80, 8, 0x88),
224227
};
225228

229+
230+
static 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+
226241
static int f7188x_gpio_get_direction(struct gpio_chip *chip, unsigned offset)
227242
{
228243
int err;
@@ -407,6 +422,10 @@ static int f7188x_gpio_probe(struct platform_device *pdev)
407422
data->nr_bank = ARRAY_SIZE(f81866_gpio_bank);
408423
data->bank = f81866_gpio_bank;
409424
break;
425+
case f81804:
426+
data->nr_bank = ARRAY_SIZE(f81804_gpio_bank);
427+
data->bank = f81804_gpio_bank;
428+
break;
410429
default:
411430
return -ENODEV;
412431
}
@@ -469,6 +488,9 @@ static int __init f7188x_find(int addr, struct f7188x_sio *sio)
469488
case SIO_F81866_ID:
470489
sio->type = f81866;
471490
break;
491+
case SIO_F81804_ID:
492+
sio->type = f81804;
493+
break;
472494
default:
473495
pr_info(DRVNAME ": Unsupported Fintek device 0x%04x\n", devid);
474496
goto err;

0 commit comments

Comments
 (0)