linux-embedded.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Sugumar Natarajan" <sugumar@ti.com>
To: 'Bill Gatliff' <bgat@billgatliff.com>,
	'sugumar' <sugumar.embedded@gmail.com>
Cc: linux-embedded@vger.kernel.org
Subject: RE: [PWM 01/10] API to consolidate PWM devices behind a common user and kernel interface
Date: Thu, 7 Oct 2010 13:28:22 +0530	[thread overview]
Message-ID: <023101cb65f5$69b93750$3d2ba5f0$@com> (raw)
In-Reply-To: <AANLkTi=LiUooyUaYw_pKAHp+23ADKXdsAwTo_6zSaX0s@mail.gmail.com>

On Thu, Oct 07, 2010 at 00:20:25, Bill Gatliff wrote:
> On Tue, Oct 5, 2010 at 5:35 AM, sugumar <sugumar.embedded@gmail.com> 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
> bgat@billgatliff.com
> --
> To unsubscribe from this list: send the line "unsubscribe linux-embedded" in the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 



  parent reply	other threads:[~2010-10-07  7:58 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-01 15:17 [PWM 01/10] API to consolidate PWM devices behind a common user and kernel interface Bill Gatliff
2010-10-01 15:17 ` [PWM 02/10] Emulates PWM hardware using a high-resolution timer and a GPIO pin Bill Gatliff
2010-10-16  6:54   ` Grant Likely
2010-10-01 15:17 ` [PWM 03/10] Expunge old Atmel PWMC driver, replacing it with one that conforms to the PWM API Bill Gatliff
2010-10-16  7:50   ` Grant Likely
2010-10-01 15:17 ` [PWM 04/10] Implements PWM-based LED control Bill Gatliff
2010-10-16  7:58   ` Grant Likely
2010-10-01 15:17 ` [PWM 05/10] LED "dim" trigger based on PWM control of the LED Bill Gatliff
2010-10-16  8:00   ` Grant Likely
2010-10-01 15:17 ` [PWM 06/10] Incorporate PWM API code into KBuild Bill Gatliff
2010-10-16  8:02   ` Grant Likely
2010-10-19  2:17     ` Bill Gatliff
2010-10-01 15:17 ` [PWM 07/10] PWM API driver for MPC52xx GPT peripheral Bill Gatliff
2010-10-01 15:17 ` [PWM 08/10] Initial support for PXA PWM peripheral; compile-tested only Bill Gatliff
2010-10-01 15:17 ` Bill Gatliff
2010-10-01 15:17 ` [PWM 09/10] Build pwm.o only if CONFIG_GENERIC_PWM is set Bill Gatliff
2010-10-01 15:17 ` [PWM 10/10] Expunge previous driver for PXA PWM Bill Gatliff
2010-10-01 22:00 ` [PWM 01/10] API to consolidate PWM devices behind a common user and kernel interface Kevin Hilman
2010-10-02  5:13   ` Jason Kridner
2010-10-06 18:45   ` Bill Gatliff
2010-10-06 19:08     ` Kevin Hilman
2010-10-02 12:25 ` Hector Oron
2010-10-06 18:48   ` Bill Gatliff
2010-10-16  6:05     ` Grant Likely
2010-10-05 10:35 ` sugumar
2010-10-06 18:50   ` Bill Gatliff
2010-10-06 19:02     ` Grosen, Mark
2010-10-07  7:58     ` Sugumar Natarajan [this message]
2010-10-16  7:42 ` Grant Likely
2010-10-20 18:13   ` Bill Gatliff
2010-10-20 18:34     ` Grant Likely
2010-10-20 19:32       ` Bill Gatliff
2010-10-21 13:18         ` Bill Gatliff

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='023101cb65f5$69b93750$3d2ba5f0$@com' \
    --to=sugumar@ti.com \
    --cc=bgat@billgatliff.com \
    --cc=linux-embedded@vger.kernel.org \
    --cc=sugumar.embedded@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).