diff mbox

[v2,3/3] gpio: twl4030: TODO comment to remove the PWMA/B (LEDA/B) handling

Message ID 1354791127-20545-4-git-send-email-peter.ujfalusi@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

Peter Ujfalusi Dec. 6, 2012, 10:52 a.m. UTC
This GPIO driver should not configure anything else then GPIOs.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 drivers/gpio/gpio-twl4030.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Grant Likely Dec. 19, 2012, 5:07 p.m. UTC | #1
On Thu, 6 Dec 2012 11:52:07 +0100, Peter Ujfalusi <peter.ujfalusi@ti.com> wrote:
> This GPIO driver should not configure anything else then GPIOs.
> 
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>

I'm not sure if this is the right direction. I actually have no problem
with a single driver that registers itself with multiple interfaces (ie.
GPIO and PWM) if it makes sense for it to do so. I suspec that a lot of
the multifunction device drivers break things up more than is strictly
necessary.

I'll still apply this if you think it is the right direction, but I
wanted to throw that though out there for consideration.

g.

> ---
>  drivers/gpio/gpio-twl4030.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/gpio/gpio-twl4030.c b/drivers/gpio/gpio-twl4030.c
> index a38e6e9c..1e9f08c4 100644
> --- a/drivers/gpio/gpio-twl4030.c
> +++ b/drivers/gpio/gpio-twl4030.c
> @@ -47,6 +47,7 @@
>   * intended to support multiple hosts.
>   *
>   * There are also two LED pins used sometimes as output-only GPIOs.
> + * TODO: Handling of PWMA/B (LEDA/B) should be removed from this GPIO driver!
>   */
>  
>  /* genirq interfaces are not available to modules */
> @@ -131,6 +132,7 @@ static inline int gpio_twl4030_read(u8 address)
>  
>  /*----------------------------------------------------------------------*/
>  
> +/* TODO: Handling of PWMA/B (LEDA/B) should be removed from this GPIO driver! */
>  static u8 cached_leden;
>  
>  /* The LED lines are open drain outputs ... a FET pulls to GND, so an
> -- 
> 1.8.0
>
Peter Ujfalusi Dec. 20, 2012, 9:23 a.m. UTC | #2
On 12/19/2012 06:07 PM, Grant Likely wrote:
> On Thu, 6 Dec 2012 11:52:07 +0100, Peter Ujfalusi <peter.ujfalusi@ti.com> wrote:
>> This GPIO driver should not configure anything else then GPIOs.
>>
>> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
> 
> I'm not sure if this is the right direction. I actually have no problem
> with a single driver that registers itself with multiple interfaces (ie.
> GPIO and PWM) if it makes sense for it to do so. I suspec that a lot of
> the multifunction device drivers break things up more than is strictly
> necessary.

We have PWM drivers for these IPs. As you remember this is the reason I
started to work on the gpio-pwm driver so we can have cleaner, more generic
way to map a PWM as a gpio. I really don't like the idea of having the same
PWM code sitting in various places in the kernel just because it was easier to
hack it like that rather then to make an effort for a clean implementation.
The PWM handling in the gpio-twl4030 driver is a prime example of this IMHO.
It is just a shortcut, nothing else.

> I'll still apply this if you think it is the right direction, but I
> wanted to throw that though out there for consideration.
Grant Likely Dec. 20, 2012, 9:45 a.m. UTC | #3
On Thu, Dec 20, 2012 at 9:23 AM, Peter Ujfalusi <peter.ujfalusi@ti.com> wrote:
> On 12/19/2012 06:07 PM, Grant Likely wrote:
>> On Thu, 6 Dec 2012 11:52:07 +0100, Peter Ujfalusi <peter.ujfalusi@ti.com> wrote:
>>> This GPIO driver should not configure anything else then GPIOs.
>>>
>>> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
>>
>> I'm not sure if this is the right direction. I actually have no problem
>> with a single driver that registers itself with multiple interfaces (ie.
>> GPIO and PWM) if it makes sense for it to do so. I suspec that a lot of
>> the multifunction device drivers break things up more than is strictly
>> necessary.
>
> We have PWM drivers for these IPs. As you remember this is the reason I
> started to work on the gpio-pwm driver so we can have cleaner, more generic
> way to map a PWM as a gpio. I really don't like the idea of having the same
> PWM code sitting in various places in the kernel just because it was easier to
> hack it like that rather then to make an effort for a clean implementation.
> The PWM handling in the gpio-twl4030 driver is a prime example of this IMHO.
> It is just a shortcut, nothing else.

Ah, right. (there's nothing wrong with my memory, it's just short)  :-p

g.
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/gpio/gpio-twl4030.c b/drivers/gpio/gpio-twl4030.c
index a38e6e9c..1e9f08c4 100644
--- a/drivers/gpio/gpio-twl4030.c
+++ b/drivers/gpio/gpio-twl4030.c
@@ -47,6 +47,7 @@ 
  * intended to support multiple hosts.
  *
  * There are also two LED pins used sometimes as output-only GPIOs.
+ * TODO: Handling of PWMA/B (LEDA/B) should be removed from this GPIO driver!
  */
 
 /* genirq interfaces are not available to modules */
@@ -131,6 +132,7 @@  static inline int gpio_twl4030_read(u8 address)
 
 /*----------------------------------------------------------------------*/
 
+/* TODO: Handling of PWMA/B (LEDA/B) should be removed from this GPIO driver! */
 static u8 cached_leden;
 
 /* The LED lines are open drain outputs ... a FET pulls to GND, so an