mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stefan Agner <stefan@agner.ch>
To: Lukasz Majewski <l.majewski@majess.pl>
Cc: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com>,
	shawnguo@kernel.org, thierry.reding@gmail.com,
	mark.rutland@arm.com, linux-pwm@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	robh+dt@kernel.org, kernel@pengutronix.de, fabio.estevam@nxp.com,
	linux-arm-kernel@lists.infradead.org, l.majewski@samsung.com
Subject: Re: [PATCH v2 0/6] Support PWM polarity control
Date: Wed, 05 Oct 2016 09:50:27 -0700	[thread overview]
Message-ID: <be9c9f6b22788ca4d9c9243a46932945@agner.ch> (raw)
In-Reply-To: <20161004094805.466ebc6d@jawa>

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(-)
>>

  reply	other threads:[~2016-10-05 16:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-01 10:12 Bhuvanchandra DV
2016-10-01 10:12 ` [PATCH v2 1/6] pwm: print error messages with pr_err() instead of pr_debug() Bhuvanchandra DV
2016-10-01 10:12 ` [PATCH v2 2/6] pwm: core: make the PWM_POLARITY flag in DTB optional Bhuvanchandra DV
2016-10-06  6:36   ` Lukasz Majewski
2016-10-07  4:49     ` Bhuvanchandra DV
2016-10-06  6:49   ` [PATCH] pwm: core: Use pwm->args.polarity to setup PWM_POLARITY_INVERSED Lukasz Majewski
2016-10-01 10:12 ` [PATCH v2 3/6] pwm: imx: support output polarity inversion Bhuvanchandra DV
2016-10-01 10:12 ` [PATCH v2 4/6] arm: dts: imx7: Update #pwm-cells for PWM polarity control Bhuvanchandra DV
2016-10-01 10:12 ` [PATCH v2 5/6] arm: dts: imx7-colibri: Use pwm " Bhuvanchandra DV
2016-10-01 10:12 ` [PATCH v2 6/6] arm: dts: imx7-colibri: Use enable-gpios for BL_ON Bhuvanchandra DV
2016-10-04  7:48 ` [PATCH v2 0/6] Support PWM polarity control Lukasz Majewski
2016-10-05 16:50   ` Stefan Agner [this message]
2016-10-06  6:26     ` Lukasz Majewski

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=be9c9f6b22788ca4d9c9243a46932945@agner.ch \
    --to=stefan@agner.ch \
    --cc=bhuvanchandra.dv@toradex.com \
    --cc=devicetree@vger.kernel.org \
    --cc=fabio.estevam@nxp.com \
    --cc=kernel@pengutronix.de \
    --cc=l.majewski@majess.pl \
    --cc=l.majewski@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=shawnguo@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®