History

gpio: pcf857x: Fix missing first interrupt

If no n_latch value will be provided at driver probe then all pins will be used as an input: gpio->out = ~n_latch; In that case initial state for all pins is "one": gpio->status = gpio->out; So if pcf857x IRQ happens with change pin value from "zero" to "one" then we miss it, because of "one" from IRQ and "one" from initial state leaves corresponding pin unchanged: change = (gpio->status ^ status) & gpio->irq_enabled; The right solution will be to read actual state at driver probe.

Maxim Kiselev committed 5 years ago

Commit a8002a31 parent 35d9e691 file · +1 −1Browse files

Unified · Split

drivers/gpio/gpio-pcf857x.c+1−1
@@ -332,7 +332,7 @@ static int pcf857x_probe(struct i2c_client *client, · 331 unmodified lines
332332 * reset state. Otherwise it flags pins to be driven low.
333333 */
334334 gpio->out = ~n_latch;
335− gpio->status = gpio->out;
335+ gpio->status = gpio->read(gpio->client);
336336
337337 /* Enable irqchip if we have an interrupt */
338338 if (client->irq) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t