Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1495290 > unrolled thread
| Started by | Lukasz Majewski <l.majewski@majess.pl> |
|---|---|
| First post | 2016-10-04 10:30 +0200 |
| Last post | 2016-10-06 09:10 +0200 |
| Articles | 3 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH v2 0/6] Support PWM polarity control Lukasz Majewski <l.majewski@majess.pl> - 2016-10-04 10:30 +0200
Re: [PATCH v2 0/6] Support PWM polarity control Stefan Agner <stefan@agner.ch> - 2016-10-05 19:00 +0200
Re: [PATCH v2 0/6] Support PWM polarity control Lukasz Majewski <l.majewski@majess.pl> - 2016-10-06 09:10 +0200
| From | Lukasz Majewski <l.majewski@majess.pl> |
|---|---|
| Date | 2016-10-04 10:30 +0200 |
| Subject | Re: [PATCH v2 0/6] Support PWM polarity control |
| Message-ID | <sotgX-95-23@gated-at.bofh.it> |
[Multipart message — attachments visible in raw view] — view raw
Dear Bhuvanchandra,
Thank you for your effort to send those patches to ML.
> Changes since v2:
>
> - Picked the stalled patchset[1] from Lothar Wassmann which adds the
> basic support for polarity control on imx-pwm driver and adds
> backward compatibility support for devices which does not have
> polarity control feature.
>
> Changes since Lothars v6:
>
> - Squash Lukasz patch[2].
>
> [1] http://thread.gmane.org/gmane.linux.pwm/1621
> [2] https://www.spinics.net/lists/arm-kernel/msg530818.html
>
> Bhuvanchandra DV (3):
> arm: dts: imx7: Update #pwm-cells for PWM polarity control
> arm: dts: imx7-colibri: Use pwm polarity control
> arm: dts: imx7-colibri: Use enable-gpios for BL_ON
>
> Lothar Wassmann (3):
> pwm: print error messages with pr_err() instead of pr_debug()
> pwm: core: make the PWM_POLARITY flag in DTB optional
> pwm: imx: support output polarity inversion
For some reason this patchset works differently than the one developed
by Lothar.
The difference is with the brightness level control.
My brightness definition in DTS:
pwms = <&pwm2 0 5000000 PWM_POLARITY_INVERTED>;
brightness-levels = < 0 1 2 3 4 5 6 7 8 9
.. ............
250 251 252 253 254 255>;
default-brightness-level = <50>;
enable-gpios = <&gpio1 2 GPIO_ACTIVE_LOW>;
When I go to the backlight sysfs entry:
cd /sys/devices/soc0/backlight/backlight/backlight
It seems like the brightness level control is inverted - i.e.
'echo 20 > brightness" makes picture on the screen very bright, and
'echo 200 > brightness' makes the picture diminish.
With my "internal" patches the situation is opposite (and I've checked it with
my HW connections).
Could you check on your setup if similar situation takes place? I mean
if the brightness control works as expected?
Thanks in advance,
Łukasz Majewski
>
> Documentation/devicetree/bindings/pwm/imx-pwm.txt | 6 +--
> arch/arm/boot/dts/imx7-colibri.dtsi | 12 +++++-
> arch/arm/boot/dts/imx7s.dtsi | 8 ++--
> drivers/pwm/core.c | 31 ++++++++------
> drivers/pwm/pwm-imx.c | 51
> +++++++++++++++++++++-- 5 files changed, 83 insertions(+), 25
> deletions(-)
>
[toc] | [next] | [standalone]
| From | Stefan Agner <stefan@agner.ch> |
|---|---|
| Date | 2016-10-05 19:00 +0200 |
| Message-ID | <soXHY-3Aj-25@gated-at.bofh.it> |
| In reply to | #1495290 |
Hi Lukasz, On 2016-10-04 00:48, Lukasz Majewski wrote: > Dear Bhuvanchandra, > > Thank you for your effort to send those patches to ML. > >> Changes since v2: >> >> - Picked the stalled patchset[1] from Lothar Wassmann which adds the >> basic support for polarity control on imx-pwm driver and adds >> backward compatibility support for devices which does not have >> polarity control feature. >> >> Changes since Lothars v6: >> >> - Squash Lukasz patch[2]. >> >> [1] http://thread.gmane.org/gmane.linux.pwm/1621 >> [2] https://www.spinics.net/lists/arm-kernel/msg530818.html >> >> Bhuvanchandra DV (3): >> arm: dts: imx7: Update #pwm-cells for PWM polarity control >> arm: dts: imx7-colibri: Use pwm polarity control >> arm: dts: imx7-colibri: Use enable-gpios for BL_ON >> >> Lothar Wassmann (3): >> pwm: print error messages with pr_err() instead of pr_debug() >> pwm: core: make the PWM_POLARITY flag in DTB optional >> pwm: imx: support output polarity inversion > > For some reason this patchset works differently than the one developed > by Lothar. > > The difference is with the brightness level control. > > My brightness definition in DTS: > > pwms = <&pwm2 0 5000000 PWM_POLARITY_INVERTED>; > > brightness-levels = < 0 1 2 3 4 5 6 7 8 9 > > .. ............ > 250 251 252 253 254 255>; > default-brightness-level = <50>; > enable-gpios = <&gpio1 2 GPIO_ACTIVE_LOW>; > If you are using something else than i.MX 7 you also want to update the SoC level device tree, specifically change the pwm-cells property: #pwm-cells = <3>; > When I go to the backlight sysfs entry: > > cd /sys/devices/soc0/backlight/backlight/backlight > > It seems like the brightness level control is inverted - i.e. > 'echo 20 > brightness" makes picture on the screen very bright, and > 'echo 200 > brightness' makes the picture diminish. > > With my "internal" patches the situation is opposite (and I've checked it with > my HW connections). Just to check whether the driver actually applies the polarity you can add a #define DEBUG at the top of the driver (drivers/pwm/pwm-imx.c) and pass ignore_loglevel as kernel command line. This should give you "PWM supports output inversion" at startup and a "... polarity set to .." message whenever the polarity is set. -- Stefan > > Could you check on your setup if similar situation takes place? I mean > if the brightness control works as expected? > > Thanks in advance, > Łukasz Majewski > >> >> Documentation/devicetree/bindings/pwm/imx-pwm.txt | 6 +-- >> arch/arm/boot/dts/imx7-colibri.dtsi | 12 +++++- >> arch/arm/boot/dts/imx7s.dtsi | 8 ++-- >> drivers/pwm/core.c | 31 ++++++++------ >> drivers/pwm/pwm-imx.c | 51 >> +++++++++++++++++++++-- 5 files changed, 83 insertions(+), 25 >> deletions(-) >>
[toc] | [prev] | [next] | [standalone]
| From | Lukasz Majewski <l.majewski@majess.pl> |
|---|---|
| Date | 2016-10-06 09:10 +0200 |
| Message-ID | <spaYx-5fl-19@gated-at.bofh.it> |
| In reply to | #1495968 |
[Multipart message — attachments visible in raw view] — view raw
Hi Stefan,
> Hi Lukasz,
>
> On 2016-10-04 00:48, Lukasz Majewski wrote:
> > Dear Bhuvanchandra,
> >
> > Thank you for your effort to send those patches to ML.
> >
> >> Changes since v2:
> >>
> >> - Picked the stalled patchset[1] from Lothar Wassmann which adds
> >> the basic support for polarity control on imx-pwm driver and adds
> >> backward compatibility support for devices which does not have
> >> polarity control feature.
> >>
> >> Changes since Lothars v6:
> >>
> >> - Squash Lukasz patch[2].
> >>
> >> [1] http://thread.gmane.org/gmane.linux.pwm/1621
> >> [2] https://www.spinics.net/lists/arm-kernel/msg530818.html
> >>
> >> Bhuvanchandra DV (3):
> >> arm: dts: imx7: Update #pwm-cells for PWM polarity control
> >> arm: dts: imx7-colibri: Use pwm polarity control
> >> arm: dts: imx7-colibri: Use enable-gpios for BL_ON
> >>
> >> Lothar Wassmann (3):
> >> pwm: print error messages with pr_err() instead of pr_debug()
> >> pwm: core: make the PWM_POLARITY flag in DTB optional
> >> pwm: imx: support output polarity inversion
> >
> > For some reason this patchset works differently than the one
> > developed by Lothar.
> >
> > The difference is with the brightness level control.
> >
> > My brightness definition in DTS:
> >
> > pwms = <&pwm2 0 5000000 PWM_POLARITY_INVERTED>;
> >
> > brightness-levels = < 0 1 2 3 4 5 6
> > 7 8 9
> >
> > .. ............
> > 250 251 252 253 254 255>;
> > default-brightness-level = <50>;
> > enable-gpios = <&gpio1 2 GPIO_ACTIVE_LOW>;
> >
>
> If you are using something else than i.MX 7 you also want to update
> the SoC level device tree, specifically change the pwm-cells property:
> #pwm-cells = <3>;
Good point. However, it is declared elsewhere (with pwm2 node)
&pwm2 {
#pwm-cells = <3>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_pwm2>;
status = "okay";
};
>
>
> > When I go to the backlight sysfs entry:
> >
> > cd /sys/devices/soc0/backlight/backlight/backlight
> >
> > It seems like the brightness level control is inverted - i.e.
> > 'echo 20 > brightness" makes picture on the screen very bright, and
> > 'echo 200 > brightness' makes the picture diminish.
> >
> > With my "internal" patches the situation is opposite (and I've
> > checked it with my HW connections).
>
> Just to check whether the driver actually applies the polarity you can
> add a #define DEBUG at the top of the driver (drivers/pwm/pwm-imx.c)
> and pass ignore_loglevel as kernel command line. This should give you
> "PWM supports output inversion" at startup and a "... polarity set
> to .." message whenever the polarity is set.
The problem is with the Bhuvanchandra original patch.
I will point it out when replying to original patch.
Thanks for support,
Łukasz Majewski
>
> --
> Stefan
>
> >
> > Could you check on your setup if similar situation takes place? I
> > mean if the brightness control works as expected?
> >
> > Thanks in advance,
> > Łukasz Majewski
> >
> >>
> >> Documentation/devicetree/bindings/pwm/imx-pwm.txt | 6 +--
> >> arch/arm/boot/dts/imx7-colibri.dtsi | 12 +++++-
> >> arch/arm/boot/dts/imx7s.dtsi | 8 ++--
> >> drivers/pwm/core.c | 31
> >> ++++++++------ drivers/pwm/pwm-imx.c |
> >> 51 +++++++++++++++++++++-- 5 files changed, 83 insertions(+), 25
> >> deletions(-)
> >>
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web