Re: [PATCH] gpio: New driver for GPO emulation using PWM generators

2012-11-30 Thread Grant Likely
On Fri, Nov 30, 2012 at 11:04 AM, Thierry Reding wrote: >> > One other problem is that some PWM devices cannot be setup to achieve a >> > 0% or 100% duty-cycle but instead will toggle for at least one period. >> > This would be another argument in favour of moving the functionality to >> > the

Re: [PATCH] gpio: New driver for GPO emulation using PWM generators

2012-11-30 Thread Thierry Reding
On Fri, Nov 30, 2012 at 10:20:38AM +, Grant Likely wrote: > On Fri, 30 Nov 2012 07:47:52 +0100, Thierry Reding > wrote: > > On Thu, Nov 29, 2012 at 04:10:24PM +, Grant Likely wrote: > > > On Wed, 28 Nov 2012 09:54:57 +0100, Peter Ujfalusi > > > wrote: > > > > Hi Grant, Lars, Thierry, >

Re: [PATCH] gpio: New driver for GPO emulation using PWM generators

2012-11-30 Thread Peter Ujfalusi
On 11/29/2012 05:10 PM, Grant Likely wrote: >> /* Enable GPIO us of the PWMs */ >> gpio-controller = <1>; > > This line should be simply (the property shouldn't have any data): > gpio-controller; Yes I know. It is like this already in my code. I just mixed up things while hacking

Re: [PATCH] gpio: New driver for GPO emulation using PWM generators

2012-11-30 Thread Peter Ujfalusi
On 11/30/2012 11:20 AM, Grant Likely wrote: > Umm, I agree with you on duty cycle, but that's got nothing to do with > period. 100% duty cycle looks exactly the same whether the period is > 10ns or 100s. Yes this is true. But some PWM hw can select it's clock based on the period_ns provided. In

Re: [PATCH] gpio: New driver for GPO emulation using PWM generators

2012-11-30 Thread Grant Likely
On Fri, 30 Nov 2012 07:47:52 +0100, Thierry Reding wrote: > On Thu, Nov 29, 2012 at 04:10:24PM +, Grant Likely wrote: > > On Wed, 28 Nov 2012 09:54:57 +0100, Peter Ujfalusi > > wrote: > > > Hi Grant, Lars, Thierry, > > > > > > On 11/26/2012 04:46 PM, Grant Likely wrote: > > > > You're

Re: [PATCH] gpio: New driver for GPO emulation using PWM generators

2012-11-30 Thread Grant Likely
On Fri, 30 Nov 2012 07:47:52 +0100, Thierry Reding thierry.red...@avionic-design.de wrote: On Thu, Nov 29, 2012 at 04:10:24PM +, Grant Likely wrote: On Wed, 28 Nov 2012 09:54:57 +0100, Peter Ujfalusi peter.ujfal...@ti.com wrote: Hi Grant, Lars, Thierry, On 11/26/2012 04:46 PM,

Re: [PATCH] gpio: New driver for GPO emulation using PWM generators

2012-11-30 Thread Peter Ujfalusi
On 11/30/2012 11:20 AM, Grant Likely wrote: Umm, I agree with you on duty cycle, but that's got nothing to do with period. 100% duty cycle looks exactly the same whether the period is 10ns or 100s. Yes this is true. But some PWM hw can select it's clock based on the period_ns provided. In most

Re: [PATCH] gpio: New driver for GPO emulation using PWM generators

2012-11-30 Thread Peter Ujfalusi
On 11/29/2012 05:10 PM, Grant Likely wrote: /* Enable GPIO us of the PWMs */ gpio-controller = 1; This line should be simply (the property shouldn't have any data): gpio-controller; Yes I know. It is like this already in my code. I just mixed up things while hacking it

Re: [PATCH] gpio: New driver for GPO emulation using PWM generators

2012-11-30 Thread Thierry Reding
On Fri, Nov 30, 2012 at 10:20:38AM +, Grant Likely wrote: On Fri, 30 Nov 2012 07:47:52 +0100, Thierry Reding thierry.red...@avionic-design.de wrote: On Thu, Nov 29, 2012 at 04:10:24PM +, Grant Likely wrote: On Wed, 28 Nov 2012 09:54:57 +0100, Peter Ujfalusi

Re: [PATCH] gpio: New driver for GPO emulation using PWM generators

2012-11-30 Thread Grant Likely
On Fri, Nov 30, 2012 at 11:04 AM, Thierry Reding thierry.red...@avionic-design.de wrote: One other problem is that some PWM devices cannot be setup to achieve a 0% or 100% duty-cycle but instead will toggle for at least one period. This would be another argument in favour of moving the

Re: [PATCH] gpio: New driver for GPO emulation using PWM generators

2012-11-29 Thread Thierry Reding
On Thu, Nov 29, 2012 at 04:10:24PM +, Grant Likely wrote: > On Wed, 28 Nov 2012 09:54:57 +0100, Peter Ujfalusi > wrote: > > Hi Grant, Lars, Thierry, > > > > On 11/26/2012 04:46 PM, Grant Likely wrote: > > > You're effectively asking the pwm layer to behave like a gpio (which > > > is

Re: [PATCH] gpio: New driver for GPO emulation using PWM generators

2012-11-29 Thread Grant Likely
On Wed, 28 Nov 2012 09:54:57 +0100, Peter Ujfalusi wrote: > Hi Grant, Lars, Thierry, > > On 11/26/2012 04:46 PM, Grant Likely wrote: > > You're effectively asking the pwm layer to behave like a gpio (which > > is completely reasonable). Having a completely separate translation node > > really

Re: [PATCH] gpio: New driver for GPO emulation using PWM generators

2012-11-29 Thread Peter Ujfalusi
On 11/28/2012 08:30 PM, Thierry Reding wrote: > I must say I'm not terribly thrilled to integrate something like this > into the PWM subsystem. I agree. I would not really want to add my name to something like this either... > I wish hardware engineers wouldn't come up with such designs. I have

Re: [PATCH] gpio: New driver for GPO emulation using PWM generators

2012-11-29 Thread Peter Ujfalusi
On 11/28/2012 08:30 PM, Thierry Reding wrote: I must say I'm not terribly thrilled to integrate something like this into the PWM subsystem. I agree. I would not really want to add my name to something like this either... I wish hardware engineers wouldn't come up with such designs. I have

Re: [PATCH] gpio: New driver for GPO emulation using PWM generators

2012-11-29 Thread Grant Likely
On Wed, 28 Nov 2012 09:54:57 +0100, Peter Ujfalusi peter.ujfal...@ti.com wrote: Hi Grant, Lars, Thierry, On 11/26/2012 04:46 PM, Grant Likely wrote: You're effectively asking the pwm layer to behave like a gpio (which is completely reasonable). Having a completely separate translation

Re: [PATCH] gpio: New driver for GPO emulation using PWM generators

2012-11-29 Thread Thierry Reding
On Thu, Nov 29, 2012 at 04:10:24PM +, Grant Likely wrote: On Wed, 28 Nov 2012 09:54:57 +0100, Peter Ujfalusi peter.ujfal...@ti.com wrote: Hi Grant, Lars, Thierry, On 11/26/2012 04:46 PM, Grant Likely wrote: You're effectively asking the pwm layer to behave like a gpio (which is

Re: [PATCH] gpio: New driver for GPO emulation using PWM generators

2012-11-28 Thread Lars-Peter Clausen
On 11/28/2012 09:54 AM, Peter Ujfalusi wrote: > Hi Grant, Lars, Thierry, > > On 11/26/2012 04:46 PM, Grant Likely wrote: >> You're effectively asking the pwm layer to behave like a gpio (which >> is completely reasonable). Having a completely separate translation node >> really doesn't make sense

Re: [PATCH] gpio: New driver for GPO emulation using PWM generators

2012-11-28 Thread Thierry Reding
On Wed, Nov 28, 2012 at 09:54:57AM +0100, Peter Ujfalusi wrote: > Hi Grant, Lars, Thierry, > > On 11/26/2012 04:46 PM, Grant Likely wrote: > > You're effectively asking the pwm layer to behave like a gpio (which > > is completely reasonable). Having a completely separate translation node > >

Re: [PATCH] gpio: New driver for GPO emulation using PWM generators

2012-11-28 Thread Peter Ujfalusi
Hi Grant, Lars, Thierry, On 11/26/2012 04:46 PM, Grant Likely wrote: > You're effectively asking the pwm layer to behave like a gpio (which > is completely reasonable). Having a completely separate translation node > really doesn't make sense because it is entirely a software construct. > In

Re: [PATCH] gpio: New driver for GPO emulation using PWM generators

2012-11-28 Thread Peter Ujfalusi
Hi Grant, Lars, Thierry, On 11/26/2012 04:46 PM, Grant Likely wrote: You're effectively asking the pwm layer to behave like a gpio (which is completely reasonable). Having a completely separate translation node really doesn't make sense because it is entirely a software construct. In fact,

Re: [PATCH] gpio: New driver for GPO emulation using PWM generators

2012-11-28 Thread Thierry Reding
On Wed, Nov 28, 2012 at 09:54:57AM +0100, Peter Ujfalusi wrote: Hi Grant, Lars, Thierry, On 11/26/2012 04:46 PM, Grant Likely wrote: You're effectively asking the pwm layer to behave like a gpio (which is completely reasonable). Having a completely separate translation node really

Re: [PATCH] gpio: New driver for GPO emulation using PWM generators

2012-11-28 Thread Lars-Peter Clausen
On 11/28/2012 09:54 AM, Peter Ujfalusi wrote: Hi Grant, Lars, Thierry, On 11/26/2012 04:46 PM, Grant Likely wrote: You're effectively asking the pwm layer to behave like a gpio (which is completely reasonable). Having a completely separate translation node really doesn't make sense because

Re: [PATCH] gpio: New driver for GPO emulation using PWM generators

2012-11-26 Thread Grant Likely
On Fri, 23 Nov 2012 10:44:36 +0100, Peter Ujfalusi wrote: > Hi Grant, > > On 11/23/2012 10:13 AM, Peter Ujfalusi wrote: > > Hi Grant, > > > > On 11/23/2012 08:55 AM, Grant Likely wrote: > >> Ugh. and this is why I wanted the PWM and GPIO subsystems to use the > >> same namespace and binding.

Re: [PATCH] gpio: New driver for GPO emulation using PWM generators

2012-11-26 Thread Peter Ujfalusi
hi, On 11/26/2012 11:30 AM, Lars-Peter Clausen wrote: > The difference here is that the LED, backlight, etc are all different > physical devices begin driven by the pwm pin, so it makes sense to have a > device tree node for them, while using the pwm as gpio is just a different > function of the

Re: [PATCH] gpio: New driver for GPO emulation using PWM generators

2012-11-26 Thread Lars-Peter Clausen
On 11/23/2012 10:44 AM, Peter Ujfalusi wrote: > Hi Grant, > > On 11/23/2012 10:13 AM, Peter Ujfalusi wrote: >> Hi Grant, >> >> On 11/23/2012 08:55 AM, Grant Likely wrote: >>> Ugh. and this is why I wanted the PWM and GPIO subsystems to use the >>> same namespace and binding. But that's not your

Re: [PATCH] gpio: New driver for GPO emulation using PWM generators

2012-11-26 Thread Lars-Peter Clausen
On 11/23/2012 10:44 AM, Peter Ujfalusi wrote: Hi Grant, On 11/23/2012 10:13 AM, Peter Ujfalusi wrote: Hi Grant, On 11/23/2012 08:55 AM, Grant Likely wrote: Ugh. and this is why I wanted the PWM and GPIO subsystems to use the same namespace and binding. grumble, mutter But that's not your

Re: [PATCH] gpio: New driver for GPO emulation using PWM generators

2012-11-26 Thread Peter Ujfalusi
hi, On 11/26/2012 11:30 AM, Lars-Peter Clausen wrote: The difference here is that the LED, backlight, etc are all different physical devices begin driven by the pwm pin, so it makes sense to have a device tree node for them, while using the pwm as gpio is just a different function of the same

Re: [PATCH] gpio: New driver for GPO emulation using PWM generators

2012-11-26 Thread Grant Likely
On Fri, 23 Nov 2012 10:44:36 +0100, Peter Ujfalusi peter.ujfal...@ti.com wrote: Hi Grant, On 11/23/2012 10:13 AM, Peter Ujfalusi wrote: Hi Grant, On 11/23/2012 08:55 AM, Grant Likely wrote: Ugh. and this is why I wanted the PWM and GPIO subsystems to use the same namespace and

Re: [PATCH] gpio: New driver for GPO emulation using PWM generators

2012-11-23 Thread Peter Ujfalusi
Hi Grant, On 11/23/2012 10:13 AM, Peter Ujfalusi wrote: > Hi Grant, > > On 11/23/2012 08:55 AM, Grant Likely wrote: >> Ugh. and this is why I wanted the PWM and GPIO subsystems to use the >> same namespace and binding. But that's not your fault. >> >> It's pretty horrible to have a separate

Re: [PATCH] gpio: New driver for GPO emulation using PWM generators

2012-11-23 Thread Peter Ujfalusi
Hi Grant, On 11/23/2012 08:55 AM, Grant Likely wrote: > Ugh. and this is why I wanted the PWM and GPIO subsystems to use the > same namespace and binding. But that's not your fault. > > It's pretty horrible to have a separate translator node to convert a PWM > into a GPIO (with output only of

Re: [PATCH] gpio: New driver for GPO emulation using PWM generators

2012-11-23 Thread Peter Ujfalusi
Hi Grant, On 11/23/2012 08:55 AM, Grant Likely wrote: Ugh. and this is why I wanted the PWM and GPIO subsystems to use the same namespace and binding. grumble, mutter But that's not your fault. It's pretty horrible to have a separate translator node to convert a PWM into a GPIO (with output

Re: [PATCH] gpio: New driver for GPO emulation using PWM generators

2012-11-23 Thread Peter Ujfalusi
Hi Grant, On 11/23/2012 10:13 AM, Peter Ujfalusi wrote: Hi Grant, On 11/23/2012 08:55 AM, Grant Likely wrote: Ugh. and this is why I wanted the PWM and GPIO subsystems to use the same namespace and binding. grumble, mutter But that's not your fault. It's pretty horrible to have a separate

Re: [PATCH] gpio: New driver for GPO emulation using PWM generators

2012-11-22 Thread Grant Likely
On Thu, 22 Nov 2012 14:42:03 +0100, Peter Ujfalusi wrote: > There seams to be board designs using PWM generators as enable/disable > signals. > For these boards we used to have custom code as hacks to deal with such a > situations. > With the gpio-pwm driver we can emulate the GPIO

[PATCH] gpio: New driver for GPO emulation using PWM generators

2012-11-22 Thread Peter Ujfalusi
There seams to be board designs using PWM generators as enable/disable signals. For these boards we used to have custom code as hacks to deal with such a situations. With the gpio-pwm driver we can emulate the GPIO functionality using PWM generators via standard interfaces. The PWM will be

[PATCH] gpio: New driver for GPO emulation using PWM generators

2012-11-22 Thread Peter Ujfalusi
There seams to be board designs using PWM generators as enable/disable signals. For these boards we used to have custom code as hacks to deal with such a situations. With the gpio-pwm driver we can emulate the GPIO functionality using PWM generators via standard interfaces. The PWM will be

Re: [PATCH] gpio: New driver for GPO emulation using PWM generators

2012-11-22 Thread Grant Likely
On Thu, 22 Nov 2012 14:42:03 +0100, Peter Ujfalusi peter.ujfal...@ti.com wrote: There seams to be board designs using PWM generators as enable/disable signals. For these boards we used to have custom code as hacks to deal with such a situations. With the gpio-pwm driver we can emulate the