lkml.org 
[lkml]   [2011]   [Mar]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    SubjectRe: [PWM v6 1/3] PWM: Implement a generic PWM framework
    From
    Lars-Peter:

    On Mon, Mar 7, 2011 at 1:26 PM, Lars-Peter Clausen <lars@metafoo.de> wrote:
    > I was thinking about an interface similar to gpio_to_irq. So you could map a
    > PWM device to a IRQ number and use the existing the existing genirq framework
    > to manage the callback handler.

    I really like this idea, though at the moment I don't see clearly how
    to implement it. I'm just a little rusty on those data structures,
    that's all.

    I'm going to pull all of the callback functionality out of the API,
    and will take it as a task to make something like this possible in a
    future update:

    struct pwm_device *p;
    request_irq(pwm_to_irq(p), my_pwm_callback, ...);

    > Maybe I'm on the wrong track here though. Could you explain what your expected
    > use case is for this part of the API? For example what would a driver using a
    > PWM device normally be doing in the handler it passed to the PWM device?

    Honestly, I'm not really sure how useful the callback functionality
    is. In fact, it's probably a bad idea to offer it because it allows
    someone to do pulse counting for things like stepper motors, and I'm
    already thinking about an API for that. Abusing a PWM to do pulse
    counting is pretty CPU-intensive.

    The only time end-of-period interrupts come up is when someone wants
    to do a coordinated stop i.e. doesn't want a short pulse. But that's
    really a concern for the driver, not users.

    So in the above where I said that I might put the callback-like
    functionality back into the API, actually I might not. :)


    b.g.
    --
    Bill Gatliff
    bgat@billgatliff.com


    \
     
     \ /
      Last update: 2011-03-09 17:19    [W:0.020 / U:60.512 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site