Commit dae77f75 authored by Ricardo Ribalda Delgado's avatar Ricardo Ribalda Delgado Committed by Greg Kroah-Hartman

serial/8250_fintek: Support for chip_ip 0x0501

There are some chips with the same interface but different chip ip.
Reported-by: default avatarPeter Hong <peter_hong@fintek.com.tw>
Reviewed-by: default avatarAlan Cox <alan@linux.intel.com>
Signed-off-by: default avatarRicardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 017bec38
...@@ -22,9 +22,9 @@ ...@@ -22,9 +22,9 @@
#define ENTRY_KEY 0x77 #define ENTRY_KEY 0x77
#define EXIT_KEY 0xAA #define EXIT_KEY 0xAA
#define CHIP_ID1 0x20 #define CHIP_ID1 0x20
#define CHIP_ID1_VAL 0x02
#define CHIP_ID2 0x21 #define CHIP_ID2 0x21
#define CHIP_ID2_VAL 0x16 #define CHIP_ID_0 0x1602
#define CHIP_ID_1 0x0501
#define VENDOR_ID1 0x23 #define VENDOR_ID1 0x23
#define VENDOR_ID1_VAL 0x19 #define VENDOR_ID1_VAL 0x19
#define VENDOR_ID2 0x24 #define VENDOR_ID2 0x24
...@@ -77,14 +77,7 @@ static int fintek_8250_get_index(resource_size_t base_addr) ...@@ -77,14 +77,7 @@ static int fintek_8250_get_index(resource_size_t base_addr)
static int fintek_8250_check_id(u16 base_port) static int fintek_8250_check_id(u16 base_port)
{ {
u16 chip;
outb(CHIP_ID1, base_port + ADDR_PORT);
if (inb(base_port + DATA_PORT) != CHIP_ID1_VAL)
return -ENODEV;
outb(CHIP_ID2, base_port + ADDR_PORT);
if (inb(base_port + DATA_PORT) != CHIP_ID2_VAL)
return -ENODEV;
outb(VENDOR_ID1, base_port + ADDR_PORT); outb(VENDOR_ID1, base_port + ADDR_PORT);
if (inb(base_port + DATA_PORT) != VENDOR_ID1_VAL) if (inb(base_port + DATA_PORT) != VENDOR_ID1_VAL)
...@@ -94,6 +87,14 @@ static int fintek_8250_check_id(u16 base_port) ...@@ -94,6 +87,14 @@ static int fintek_8250_check_id(u16 base_port)
if (inb(base_port + DATA_PORT) != VENDOR_ID2_VAL) if (inb(base_port + DATA_PORT) != VENDOR_ID2_VAL)
return -ENODEV; return -ENODEV;
outb(CHIP_ID1, base_port + ADDR_PORT);
chip = inb(base_port + DATA_PORT);
outb(CHIP_ID2, base_port + ADDR_PORT);
chip |= inb(base_port + DATA_PORT) << 8;
if (chip != CHIP_ID_0 && chip != CHIP_ID_1)
return -ENODEV;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment