lkml.org 
[lkml]   [2018]   [Dec]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] gpio: mockup: use irq_sim_fire_edge()
Hello Bartosz,

On Mon, Dec 03, 2018 at 12:09:16PM +0100, Uwe Kleine-König wrote:
> On Tue, Nov 20, 2018 at 02:40:32PM +0100, Bartosz Golaszewski wrote:
> > @@ -213,7 +213,8 @@ static ssize_t gpio_mockup_event_write(struct file *file,
> > chip = priv->chip;
> >
> > gpiod_set_value_cansleep(desc, val);
> > - irq_sim_fire(&chip->irqsim, priv->offset);
> > + edge = val == 0 ? IRQ_TYPE_EDGE_FALLING : IRQ_TYPE_EDGE_RISING;
> > + irq_sim_fire_edge(&chip->irqsim, priv->offset, edge);
>
> If I write 0 twice into the debugfs file, does it fire two irqs or only
> one? I think it fires two but only one would be the right behaviour?!

If you still think that patch 1 of this series is the way to go, I think
this objection is still valid. Then you need to check the state of the
line by at least calling (something like) .get_value to determine if the
previous value was different.

Best regards
Uwe

--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |

\
 
 \ /
  Last update: 2018-12-11 15:16    [W:0.112 / U:2.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site