On Thu, Oct 07, 2010 at 00:20:25, Bill Gatliff wrote:
> On Tue, Oct 5, 2010 at 5:35 AM, sugumar <[email protected]> wrote:
> > I have been working on writing generic PWM driver that provides
> > common interface to all the PWM devices. I hadn't come across this
> > thread until kevin pointed out. It looks like a very good
> > implementation and i would like to make my eHRPWM driver to fit into
> > this framework. eHRPWM (enhanced high resolution
> > pwm) module has other features such as Dead Band, PWM chopper and Trip
> > Zone and i am not sure how to incorporate these in the generic
> > framework. I really need you help here.
>
> Ok. Can you point me to a datasheet for the part?
>
> > I am sure the generic framework should support all the features
> > provided by the PWM devices. For eg, eHRPWM has Trip-Zone feature
> > where an asynchronous input (incase of short circuit .) can be configured
> > to generate an interrupt.
> > I am interested in finding a way to handle this. Kindly give your comments.
>
> Well, we could handle it in the generic framework by adding to the
> synchronization callback mechanism. Or we could leave it as a
feature unique to the eHRPWM device, and a device-specific solution.
>
> Maybe I will have a better idea once I look at the hardware.
Bill,
Thanks for your comments. Also, I am not particularly clear about the
pwm_set_handler function.
As far my understanding goes, in order to defer the work,
1. Set the "set_callback" variable in the pwm_device structure to the callback
function.
2. Call the "pwm_set_handler" function to set the bottom halve handler and the
data.
3. "pwm_set_handler" inturn invokes the call back function defined in step 1
.The latter
would set the PWM channel call back to "pwm_handler" function which is local
to the PWM
framework.
4.Call the pwm_channel callback in the interrupt handler to queue the work for
later processing.
1. Is my above understanding correct?
2. Single channel may support multiple interrupts.
For eg.,
pwm_set_handler(handler_1)
pwm_set_handler(handler_2)
How to handle multiple interrupts with the above framework?
3. pwm_set_handler() -- Defines an end-of-period callback.
Is the pwm_set_handler only used for the end-of-period interrupt.
Can't it be used for other events ?
4. Various applications may require different actions to be handled in the
interrupt
handler (Eg. Motor Control, Backlight control ..). so, we cannot have a
generic
interrupt handler in the pwm device driver. How to handle this?
Regards,
N.Sugumar.
> b.g.
> --
> Bill Gatliff
> [email protected]
> --
> To unsubscribe from this list: send the line "unsubscribe linux-embedded" in
> the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe linux-embedded" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html