[LinuxPPS] [PATCH 2/2] pps: new client driver using IRQs

Rodolfo Giometti giometti at enneenne.com
Fri Apr 29 10:15:32 CEST 2011


On Thu, Apr 28, 2011 at 04:03:59PM -0400, James Nuss wrote:
> >> +
> >> +     if (!(res->flags & (IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING))) {
> >> +             pr_err(PPS_IRQ_NAME ": given IRQ resource must be edge triggered");
> >> +             return -EINVAL;
> >> +     }
> >
> > I think it doesn't actually expect that both flags are set because it
> > always treats it as assert in the irq handler. What does your signal
> > look like?
> 
> The conditional logic is that one of either IRQF_TRIGGER_RISING or
> IRQF_TRIGGER_FALLING must be set. It doesn't make much sense to have
> neither set for PPS signals.
> My intention is that the driver is generic enough so you can register
> an IRQ resource with either IRQF_TRIGGER_RISING or
> IRQF_TRIGGER_FALLING and you will get and assert event for that edge.
> Clear events are not generated as you suggest but I believe this is
> OK.
> My signal is a simple low-to-high transition indicating the PPS. But I
> believe you could register a device using this driver referencing the
> other edge if required.

The driver is ok for me but if you say that your «intention is that
the driver is generic enough» you should consider adding CLEAR events
since some GPIOs controller can manager IRQs for both edges... ;)

Ciao,

Rodolfo

-- 

GNU/Linux Solutions                  e-mail: giometti at enneenne.com
Linux Device Driver                          giometti at linux.it
Embedded Systems                     phone:  +39 349 2432127
UNIX programming                     skype:  rodolfo.giometti
Freelance ICT Italia - Consulente ICT Italia - www.consulenti-ict.it



More information about the LinuxPPS mailing list