]> git.karo-electronics.de Git - karo-tx-linux.git/commit
pwm: jz4740: Let the pinctrl driver configure the pins
authorPaul Cercueil <paul@crapouillou.net>
Fri, 12 May 2017 16:53:06 +0000 (18:53 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 22 May 2017 15:21:06 +0000 (17:21 +0200)
commit47096d702c542b7cf4009e49cb492cab879d347f
tree98f621d65b4ed75a6e3367ff15faed007cefa1be
parentfa5ed6bc11153199b07b06a208a537e137df4e5d
pwm: jz4740: Let the pinctrl driver configure the pins

Now that the JZ4740 and similar SoCs have a pinctrl driver, we rely on
the pins being properly configured before the driver probes.

One inherent problem of this new approach is that the pinctrl framework
does not allow us to configure each pin on demand, when the various PWM
channels are requested or released. For instance, the PWM channels can
be configured from sysfs, which would require all PWM pins to be configured
properly beforehand for the PWM function, eventually causing conflicts
with other platform or board drivers.

The proper solution here would be to modify the pwm-jz4740 driver to
handle only one PWM channel, and create an instance of this driver
for each one of the 8 PWM channels. Then, it could use the pinctrl
framework to dynamically configure the PWM pin it controls.

Until this can be done, the only jz4740 board supported upstream
(Qi lb60) can configure all of its connected PWM pins in PWM function
mode, since those are not used by other drivers nor by GPIOs on the
board.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Acked-by: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pwm/pwm-jz4740.c