Skip to content

Commit 83ce440

Browse files
xry111KexyBiscuit
authored andcommitted
AOSCOS: gpio: loongson-64bit: Add LS7A GPIO interrupt support
On IPASON NL38-N11 laptops, the touchpad device (a HID multitouch device connected via I2C) uses GPIO 50 to send interrupts. Unfortunately, gpio-loongson-64bit does not support interrupt for LS7A yet, causing the touchpad fail to be probed with: i2c_hid_acpi i2c-PNP0C50:00: HID over i2c has not been provided an Int IRQ Add the offset of the GPIO_INT_EN controlling register to loongson_gpio_ls7a_data to support the interrupt. And, in LS7A the GPIO 4 ... 56 share the same interrupt pin, we need to take this fact into account when calling platform_get_irq or we'd fail with "IRQ index 50 not found." Signed-off-by: Xi Ruoyao <[email protected]>
1 parent 575f845 commit 83ce440

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/gpio/gpio-loongson-64bit.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ struct loongson_gpio_chip_data {
2727
unsigned int out_offset;
2828
unsigned int in_offset;
2929
unsigned int inten_offset;
30+
bool is_ls7a;
3031
};
3132

3233
struct loongson_gpio_chip {
@@ -132,6 +133,9 @@ static int loongson_gpio_to_irq(struct gpio_chip *chip, unsigned int offset)
132133
writeb(1, lgpio->reg_base + lgpio->chip_data->inten_offset + offset);
133134
}
134135

136+
if (lgpio->chip_data->is_ls7a)
137+
offset = MIN(offset, 4);
138+
135139
return platform_get_irq(pdev, offset);
136140
}
137141

@@ -258,6 +262,7 @@ static const struct loongson_gpio_chip_data loongson_gpio_ls7a_data = {
258262
.in_offset = 0xa00,
259263
.out_offset = 0x900,
260264
.inten_offset = 0xb00,
265+
.is_ls7a = true,
261266
};
262267

263268
/* LS7A2000 chipset GPIO */

0 commit comments

Comments
 (0)