Re: [PATCH] OMAP: add pwm driver using dmtimers.

2013-01-07 Thread Jon Hunter
On 01/06/2013 03:12 PM, NeilBrown wrote: [snip] > I've been playing with off-mode and discovered that the first attempt to set > the PWM after resume didn't work, but subsequent ones did. > I did some digging and came up with the following patch. > With this in place, the omap_pwm_suspend()

Re: [PATCH] OMAP: add pwm driver using dmtimers.

2013-01-07 Thread Jon Hunter
On 01/06/2013 03:12 PM, NeilBrown wrote: [snip] I've been playing with off-mode and discovered that the first attempt to set the PWM after resume didn't work, but subsequent ones did. I did some digging and came up with the following patch. With this in place, the omap_pwm_suspend() above

Re: [PATCH] OMAP: add pwm driver using dmtimers.

2013-01-06 Thread NeilBrown
On Thu, 13 Dec 2012 11:07:25 -0600 Jon Hunter wrote: > > On 12/12/2012 09:06 PM, NeilBrown wrote: > > > >>> + > >>> +#if CONFIG_PM > >>> +static int omap_pwm_suspend(struct platform_device *pdev, pm_message_t > >>> state) > >>> +{ > >>> + struct omap_chip *omap = platform_get_drvdata(pdev);

Re: [PATCH] OMAP: add pwm driver using dmtimers.

2013-01-06 Thread NeilBrown
On Thu, 13 Dec 2012 11:07:25 -0600 Jon Hunter jon-hun...@ti.com wrote: On 12/12/2012 09:06 PM, NeilBrown wrote: + +#if CONFIG_PM +static int omap_pwm_suspend(struct platform_device *pdev, pm_message_t state) +{ + struct omap_chip *omap = platform_get_drvdata(pdev); + /* No

Re: [PATCH] OMAP: add pwm driver using dmtimers.

2012-12-14 Thread NeilBrown
On Thu, 13 Dec 2012 11:42:18 -0600 Jon Hunter wrote: > > On 12/12/2012 10:33 PM, NeilBrown wrote: > > On Thu, 13 Dec 2012 14:06:35 +1100 NeilBrown wrote: > > > +omap_dm_timer_enable(omap->dm_timer); > >>> > >>> Do you need to call omap_dm_timer_enable here? _set_load and

Re: [PATCH] OMAP: add pwm driver using dmtimers.

2012-12-14 Thread NeilBrown
On Thu, 13 Dec 2012 11:42:18 -0600 Jon Hunter jon-hun...@ti.com wrote: On 12/12/2012 10:33 PM, NeilBrown wrote: On Thu, 13 Dec 2012 14:06:35 +1100 NeilBrown ne...@suse.de wrote: +omap_dm_timer_enable(omap-dm_timer); Do you need to call omap_dm_timer_enable here? _set_load

Re: [PATCH] OMAP: add pwm driver using dmtimers.

2012-12-13 Thread Jon Hunter
On 12/12/2012 10:33 PM, NeilBrown wrote: > On Thu, 13 Dec 2012 14:06:35 +1100 NeilBrown wrote: > + omap_dm_timer_enable(omap->dm_timer); >>> >>> Do you need to call omap_dm_timer_enable here? _set_load and _set_match >>> will enable the timer. So this should not be necessary. >> >> True.

Re: [PATCH] OMAP: add pwm driver using dmtimers.

2012-12-13 Thread Tony Lindgren
* NeilBrown [121212 19:09]: > On Wed, 12 Dec 2012 10:08:28 -0600 Jon Hunter wrote: > > On 12/12/2012 02:24 AM, NeilBrown wrote: > > > + > > > + /* Request the OMAP dual-mode timer that will be bound to and > > > + * associated with this generic PWM. > > > + */ > > > + > > > + omap->dm_timer =

Re: [PATCH] OMAP: add pwm driver using dmtimers.

2012-12-13 Thread Tony Lindgren
* Jon Hunter [121213 09:11]: > On 12/12/2012 09:06 PM, NeilBrown wrote: > > On Wed, 12 Dec 2012 10:08:28 -0600 Jon Hunter wrote: > >> On 12/12/2012 02:24 AM, NeilBrown wrote: > >>> + > >>> +#include > >> > >> This is going to be a problem for the single zImage work, because we > >> cannot

Re: [PATCH] OMAP: add pwm driver using dmtimers.

2012-12-13 Thread Jon Hunter
On 12/12/2012 09:06 PM, NeilBrown wrote: > > [Thierry: question for you near the end - thanks] > > On Wed, 12 Dec 2012 10:08:28 -0600 Jon Hunter wrote: > >> Hi Neil, >> >> On 12/12/2012 02:24 AM, NeilBrown wrote: >>> >>> >>> This patch is based on an earlier patch by Grant Erickson >>> which

Re: [PATCH] OMAP: add pwm driver using dmtimers.

2012-12-13 Thread Jon Hunter
On 12/12/2012 09:06 PM, NeilBrown wrote: [Thierry: question for you near the end - thanks] On Wed, 12 Dec 2012 10:08:28 -0600 Jon Hunter jon-hun...@ti.com wrote: Hi Neil, On 12/12/2012 02:24 AM, NeilBrown wrote: This patch is based on an earlier patch by Grant Erickson which

Re: [PATCH] OMAP: add pwm driver using dmtimers.

2012-12-13 Thread Tony Lindgren
* Jon Hunter jon-hun...@ti.com [121213 09:11]: On 12/12/2012 09:06 PM, NeilBrown wrote: On Wed, 12 Dec 2012 10:08:28 -0600 Jon Hunter jon-hun...@ti.com wrote: On 12/12/2012 02:24 AM, NeilBrown wrote: + +#include plat/dmtimer.h This is going to be a problem for the single zImage work,

Re: [PATCH] OMAP: add pwm driver using dmtimers.

2012-12-13 Thread Tony Lindgren
* NeilBrown ne...@suse.de [121212 19:09]: On Wed, 12 Dec 2012 10:08:28 -0600 Jon Hunter jon-hun...@ti.com wrote: On 12/12/2012 02:24 AM, NeilBrown wrote: + + /* Request the OMAP dual-mode timer that will be bound to and + * associated with this generic PWM. + */ + +

Re: [PATCH] OMAP: add pwm driver using dmtimers.

2012-12-13 Thread Jon Hunter
On 12/12/2012 10:33 PM, NeilBrown wrote: On Thu, 13 Dec 2012 14:06:35 +1100 NeilBrown ne...@suse.de wrote: + omap_dm_timer_enable(omap-dm_timer); Do you need to call omap_dm_timer_enable here? _set_load and _set_match will enable the timer. So this should not be necessary. True. That

Re: [PATCH] OMAP: add pwm driver using dmtimers.

2012-12-12 Thread Thierry Reding
On Thu, Dec 13, 2012 at 01:38:28PM +1100, NeilBrown wrote: > On Wed, 12 Dec 2012 12:31:45 +0100 Thierry Reding > wrote: > > > On Wed, Dec 12, 2012 at 07:24:30PM +1100, NeilBrown wrote: [...] > > > + struct omap_dm_timer*dm_timer; > > > + unsigned intpolarity; > > > > The PWM

Re: [PATCH] OMAP: add pwm driver using dmtimers.

2012-12-12 Thread Thierry Reding
On Thu, Dec 13, 2012 at 02:06:35PM +1100, NeilBrown wrote: > > [Thierry: question for you near the end - thanks] > > On Wed, 12 Dec 2012 10:08:28 -0600 Jon Hunter wrote: > > > Hi Neil, > > > > On 12/12/2012 02:24 AM, NeilBrown wrote: [...] > > > +{ > > > + struct omap_chip *omap =

Re: [PATCH] OMAP: add pwm driver using dmtimers.

2012-12-12 Thread NeilBrown
On Thu, 13 Dec 2012 14:06:35 +1100 NeilBrown wrote: > > > + omap_dm_timer_enable(omap->dm_timer); > > > > Do you need to call omap_dm_timer_enable here? _set_load and _set_match > > will enable the timer. So this should not be necessary. > > True. That is what you get for copying someone

Re: [PATCH] OMAP: add pwm driver using dmtimers.

2012-12-12 Thread NeilBrown
[Thierry: question for you near the end - thanks] On Wed, 12 Dec 2012 10:08:28 -0600 Jon Hunter wrote: > Hi Neil, > > On 12/12/2012 02:24 AM, NeilBrown wrote: > > > > > > This patch is based on an earlier patch by Grant Erickson > > which provided pwm devices using the 'legacy' interface. >

Re: [PATCH] OMAP: add pwm driver using dmtimers.

2012-12-12 Thread NeilBrown
On Wed, 12 Dec 2012 10:20:34 -0600 Jon Hunter wrote: > > On 12/12/2012 05:31 AM, Thierry Reding wrote: > > On Wed, Dec 12, 2012 at 07:24:30PM +1100, NeilBrown wrote: > > [snip] > > >> +static int omap_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm) > >> +{ > >> + struct omap_chip

Re: [PATCH] OMAP: add pwm driver using dmtimers.

2012-12-12 Thread NeilBrown
On Wed, 12 Dec 2012 12:31:45 +0100 Thierry Reding wrote: > On Wed, Dec 12, 2012 at 07:24:30PM +1100, NeilBrown wrote: > > > > > > This patch is based on an earlier patch by Grant Erickson > > which provided pwm devices using the 'legacy' interface. > > > > This driver instead uses the new

Re: [PATCH] OMAP: add pwm driver using dmtimers.

2012-12-12 Thread Jon Hunter
On 12/12/2012 05:31 AM, Thierry Reding wrote: > On Wed, Dec 12, 2012 at 07:24:30PM +1100, NeilBrown wrote: [snip] >> +static int omap_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm) >> +{ >> +struct omap_chip *omap = to_omap_chip(chip); >> +int status = 0; >> + >> +/*

Re: [PATCH] OMAP: add pwm driver using dmtimers.

2012-12-12 Thread Jon Hunter
Hi Neil, On 12/12/2012 02:24 AM, NeilBrown wrote: > > > This patch is based on an earlier patch by Grant Erickson > which provided pwm devices using the 'legacy' interface. > > This driver instead uses the new framework interface. > > Cc: Grant Erickson > Signed-off-by: NeilBrown > > diff

Re: [PATCH] OMAP: add pwm driver using dmtimers.

2012-12-12 Thread Thierry Reding
On Wed, Dec 12, 2012 at 07:24:30PM +1100, NeilBrown wrote: > > > This patch is based on an earlier patch by Grant Erickson > which provided pwm devices using the 'legacy' interface. > > This driver instead uses the new framework interface. I'd prefer some kind of description about the driver

[PATCH] OMAP: add pwm driver using dmtimers.

2012-12-12 Thread NeilBrown
This patch is based on an earlier patch by Grant Erickson which provided pwm devices using the 'legacy' interface. This driver instead uses the new framework interface. Cc: Grant Erickson Signed-off-by: NeilBrown diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig index ed81720..7df573a

[PATCH] OMAP: add pwm driver using dmtimers.

2012-12-12 Thread NeilBrown
This patch is based on an earlier patch by Grant Erickson which provided pwm devices using the 'legacy' interface. This driver instead uses the new framework interface. Cc: Grant Erickson maratho...@gmail.com Signed-off-by: NeilBrown ne...@suse.de diff --git a/drivers/pwm/Kconfig

Re: [PATCH] OMAP: add pwm driver using dmtimers.

2012-12-12 Thread Thierry Reding
On Wed, Dec 12, 2012 at 07:24:30PM +1100, NeilBrown wrote: This patch is based on an earlier patch by Grant Erickson which provided pwm devices using the 'legacy' interface. This driver instead uses the new framework interface. I'd prefer some kind of description about the driver here.

Re: [PATCH] OMAP: add pwm driver using dmtimers.

2012-12-12 Thread Jon Hunter
Hi Neil, On 12/12/2012 02:24 AM, NeilBrown wrote: This patch is based on an earlier patch by Grant Erickson which provided pwm devices using the 'legacy' interface. This driver instead uses the new framework interface. Cc: Grant Erickson maratho...@gmail.com Signed-off-by: NeilBrown

Re: [PATCH] OMAP: add pwm driver using dmtimers.

2012-12-12 Thread Jon Hunter
On 12/12/2012 05:31 AM, Thierry Reding wrote: On Wed, Dec 12, 2012 at 07:24:30PM +1100, NeilBrown wrote: [snip] +static int omap_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm) +{ +struct omap_chip *omap = to_omap_chip(chip); +int status = 0; + +/* Enable the

Re: [PATCH] OMAP: add pwm driver using dmtimers.

2012-12-12 Thread NeilBrown
On Wed, 12 Dec 2012 12:31:45 +0100 Thierry Reding thierry.red...@avionic-design.de wrote: On Wed, Dec 12, 2012 at 07:24:30PM +1100, NeilBrown wrote: This patch is based on an earlier patch by Grant Erickson which provided pwm devices using the 'legacy' interface. This driver

Re: [PATCH] OMAP: add pwm driver using dmtimers.

2012-12-12 Thread NeilBrown
On Wed, 12 Dec 2012 10:20:34 -0600 Jon Hunter jon-hun...@ti.com wrote: On 12/12/2012 05:31 AM, Thierry Reding wrote: On Wed, Dec 12, 2012 at 07:24:30PM +1100, NeilBrown wrote: [snip] +static int omap_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm) +{ + struct omap_chip

Re: [PATCH] OMAP: add pwm driver using dmtimers.

2012-12-12 Thread NeilBrown
[Thierry: question for you near the end - thanks] On Wed, 12 Dec 2012 10:08:28 -0600 Jon Hunter jon-hun...@ti.com wrote: Hi Neil, On 12/12/2012 02:24 AM, NeilBrown wrote: This patch is based on an earlier patch by Grant Erickson which provided pwm devices using the 'legacy'

Re: [PATCH] OMAP: add pwm driver using dmtimers.

2012-12-12 Thread NeilBrown
On Thu, 13 Dec 2012 14:06:35 +1100 NeilBrown ne...@suse.de wrote: + omap_dm_timer_enable(omap-dm_timer); Do you need to call omap_dm_timer_enable here? _set_load and _set_match will enable the timer. So this should not be necessary. True. That is what you get for copying someone

Re: [PATCH] OMAP: add pwm driver using dmtimers.

2012-12-12 Thread Thierry Reding
On Thu, Dec 13, 2012 at 02:06:35PM +1100, NeilBrown wrote: [Thierry: question for you near the end - thanks] On Wed, 12 Dec 2012 10:08:28 -0600 Jon Hunter jon-hun...@ti.com wrote: Hi Neil, On 12/12/2012 02:24 AM, NeilBrown wrote: [...] +{ + struct omap_chip *omap =

Re: [PATCH] OMAP: add pwm driver using dmtimers.

2012-12-12 Thread Thierry Reding
On Thu, Dec 13, 2012 at 01:38:28PM +1100, NeilBrown wrote: On Wed, 12 Dec 2012 12:31:45 +0100 Thierry Reding thierry.red...@avionic-design.de wrote: On Wed, Dec 12, 2012 at 07:24:30PM +1100, NeilBrown wrote: [...] + struct omap_dm_timer*dm_timer; + unsigned intpolarity;