From: "Lothar Waßmann" <LW@KARO-electronics.de>
To: "Michal Vokáč" <michal.vokac@ysoft.com>
Cc: Thierry Reding <thierry.reding@gmail.com>,
Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
devicetree@vger.kernel.org, linux-pwm@vger.kernel.org,
linux-kernel@vger.kernel.org,
Lukasz Majewski <l.majewski@majess.pl>,
Fabio Estevam <fabio.estevam@nxp.com>
Subject: Re: [RFC PATCH 1/2] dt-bindings: pwm: imx: Allow switching PWM output between PWM and GPIO
Date: Thu, 23 Aug 2018 13:18:16 +0200 [thread overview]
Message-ID: <20180823131816.741c09cc@ipc1.ka-ro> (raw)
In-Reply-To: <5b13d21c-f83f-49b0-eedd-9a4995dbd469@ysoft.com>
Michal Vokáč <michal.vokac@ysoft.com> wrote:
> On 22.8.2018 16:10, Lothar Waßmann wrote:
> > My use case is attaching different displays to the same baseboard,
> > where some displays have the brightness control pin inverted with
> > respect to the others. It's easy to change the compatible string for
> > the simple-panel driver and the PWM polarity setting for the
> > pwm-backlight driver from U-Boot according to the display model, but
> > it's not so easy, to edit the pinctrl settings from pull-up to
> > pull-down or vice versa.
>
> OK, I got it. Though that is something different than having two clients,
> right?
>
> You do not actually need to change the pinctrl pull-up/down configuration
> in bootloader. You define the two pinctrl groups as I suggested in the
> example. Or more precisely, you add a new pinctrl group where the PWM
> output pad is configured as a GPIO with pull-up. You add this group to
> all your common device trees. This does no harm as the group is not used
> yet.
>
> In bootloader you detect the type of the panel. Normal PWM polarity? OK,
> do nothing and boot. Inverted PWM polarity? Set the pinctrl-names property
> to "default", "pwm". Set the pinctrl-0 property to point to the GPIO group
> and set pinctrl-1 property to point to the old PWM group.
>
> E.g. something like:
>
> => fdt set /soc/aips-bus@2000000/pwm@2080000 pinctrl-names default pwm
> => fdt get value gpio-phandle /soc/aips-bus@2000000/iomuxc@20e0000/pwm1grp-gpio phandle
> => fdt get value pwm-phandle /soc/aips-bus@2000000/iomuxc@20e0000/pwm1grp-pwm phandle
> => fdt set /soc/aips-bus@2000000/pwm@2080000 pinctrl-0 ${gpio-phandle}
> => fdt set /soc/aips-bus@2000000/pwm@2080000 pinctrl-1 ${pwm-phandle}
>
> Will this work for you?
>
This would probably work, but it's quite ugly.
I'd still prefer to set the pin output state to the desired level
rather than relying on the chip internal pullup/pulldown facility.
Lothar Waßmann
--
___________________________________________________________
Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Geschäftsführer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996
www.karo-electronics.de | info@karo-electronics.de
___________________________________________________________
next prev parent reply other threads:[~2018-08-23 11:18 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-21 14:38 [RFC PATCH 0/2] pwm: imx: Configure output to GPIO in disabled state Michal Vokáč
2018-08-21 14:38 ` [RFC PATCH 1/2] dt-bindings: pwm: imx: Allow switching PWM output between PWM and GPIO Michal Vokáč
2018-08-22 6:14 ` Lothar Waßmann
2018-08-22 7:01 ` Michal Vokáč
2018-08-22 11:17 ` Lothar Waßmann
2018-08-22 13:20 ` Michal Vokáč
2018-08-22 14:10 ` Lothar Waßmann
2018-08-23 9:13 ` Michal Vokáč
2018-08-23 11:18 ` Lothar Waßmann [this message]
2018-08-23 12:38 ` Michal Vokáč
2018-08-23 10:40 ` Lukasz Majewski
2018-08-23 11:19 ` Lothar Waßmann
2018-08-23 11:21 ` Michal Vokáč
2018-08-23 12:36 ` Lukasz Majewski
2018-10-09 11:03 ` Vokáč Michal
2018-08-31 12:18 ` Rob Herring
2018-08-31 12:45 ` Lothar Waßmann
2018-08-31 13:17 ` Michal Vokáč
2018-08-31 13:30 ` Lothar Waßmann
2018-10-09 10:30 ` Vokáč Michal
2018-08-21 14:38 ` [RFC PATCH 2/2] pmw: imx: Configure output to GPIO in disabled state Michal Vokáč
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180823131816.741c09cc@ipc1.ka-ro \
--to=lw@karo-electronics.de \
--cc=devicetree@vger.kernel.org \
--cc=fabio.estevam@nxp.com \
--cc=l.majewski@majess.pl \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=michal.vokac@ysoft.com \
--cc=robh+dt@kernel.org \
--cc=thierry.reding@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®