2013-07-16 02:38:26

by Kim, Milo

[permalink] [raw]
Subject: [PATCH 0/3] LP3943 MFD driver for a GPIO expander and a PWM generator

LP3943 is an integrated device capable of driving 16 output channels.
It supports a GPIO expander and a PWM generator.
LP3493 registers are controlled via the I2C interface.

Patch-set consists of three parts - MFD, GPIO and PWM
Device tree documentation is updated also.

Milo Kim (3):
mfd: add LP3943 MFD driver
gpio: add LP3943 I2C GPIO expander driver
pwm: add LP3943 PWM driver

Documentation/devicetree/bindings/mfd/lp3943.txt | 23 +++
drivers/gpio/Kconfig | 6 +
drivers/gpio/Makefile | 1 +
drivers/gpio/gpio-lp3943.c | 224 ++++++++++++++++++++++
drivers/mfd/Kconfig | 8 +
drivers/mfd/Makefile | 1 +
drivers/mfd/lp3943.c | 206 ++++++++++++++++++++
drivers/pwm/Kconfig | 10 +
drivers/pwm/Makefile | 1 +
drivers/pwm/pwm-lp3943.c | 192 +++++++++++++++++++
include/linux/mfd/lp3943.h | 98 ++++++++++
11 files changed, 770 insertions(+)
create mode 100644 Documentation/devicetree/bindings/mfd/lp3943.txt
create mode 100644 drivers/gpio/gpio-lp3943.c
create mode 100644 drivers/mfd/lp3943.c
create mode 100644 drivers/pwm/pwm-lp3943.c
create mode 100644 include/linux/mfd/lp3943.h

--
1.7.9.5


Best Regards,
Milo


2013-07-20 20:04:16

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 0/3] LP3943 MFD driver for a GPIO expander and a PWM generator

On Tue, Jul 16, 2013 at 4:38 AM, Kim, Milo <[email protected]> wrote:

> LP3943 is an integrated device capable of driving 16 output channels.
> It supports a GPIO expander and a PWM generator.

But actually the data sheet describes it as a LED driver with PWM
chip.

Do you have use cases not using it for LEDs but other thing or why
do you want to model the 16 LED lines as GPIO lines?
Why can't you just have a drivers/leds/* as for any other LED
chip?

Atleast some good explanation of this needs to be found in the
patch text and also as comments in Kconfig and the code I think.

I'm just fearing that this is some way to satisfy a userspace that
wants to use the sysfs interface to GPIO to control LEDs and these
are much better off using the LED sysfs ABI.

Yours,
Linus Walleij

2013-07-20 20:09:34

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 0/3] LP3943 MFD driver for a GPIO expander and a PWM generator

On Sat, Jul 20, 2013 at 10:04 PM, Linus Walleij
<[email protected]> wrote:

> Do you have use cases not using it for LEDs but other thing or why
> do you want to model the 16 LED lines as GPIO lines?
> Why can't you just have a drivers/leds/* as for any other LED
> chip?

Bah forget this. Now I saw that application note in the GPIO
portion patch.

But don't you want a drivers/leds/* driver for this as well?

I imagine the MFD core should send a mask to GPIO and
LEDs drivers stating which lines can be used for GPIO and
which lines can be used for LEDs.

Yours,
Linus Walleij

2013-07-22 01:19:23

by Kim, Milo

[permalink] [raw]
Subject: RE: [PATCH 0/3] LP3943 MFD driver for a GPIO expander and a PWM generator

Hi Linus,
Thanks for your review.

> On Tue, Jul 16, 2013 at 4:38 AM, Kim, Milo <[email protected]> wrote:
>
> > LP3943 is an integrated device capable of driving 16 output channels.
> > It supports a GPIO expander and a PWM generator.
>
> But actually the data sheet describes it as a LED driver with PWM
> chip.
>
> Do you have use cases not using it for LEDs but other thing or why
> do you want to model the 16 LED lines as GPIO lines?
> Why can't you just have a drivers/leds/* as for any other LED
> chip?

We have two ways to provide LED functions.

(a) Creating LP3943 LED driver.
This is what you mentioned.
LP3943 MFD will consist of GPIO, LED and PWM drivers

(b) Using a LED PWM driver with the PWM generator
With LP3943 PWM driver, we can control LEDs by using LED PWM driver
under drivers/leds/leds-pwm.c
Then, the MFD consists of just two drivers - GPIO and PWM.
LP3943 PWM driver can be used as general usages -
Not only simple LED drivers but also the PWM signal input for a backlight device.
That's why I prefer to the second way.

> Atleast some good explanation of this needs to be found in the
> patch text and also as comments in Kconfig and the code I think.

I should describe the usage of the 'leds-pwm' driver for LED lighting.
Thanks for this guideline.

Regards,
Milo