<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/pwm, branch v4.7</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.7</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.7'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2016-06-14T08:51:45Z</updated>
<entry>
<title>pwm: atmel-hlcdc: Fix default PWM polarity</title>
<updated>2016-06-14T08:51:45Z</updated>
<author>
<name>Boris Brezillon</name>
<email>boris.brezillon@free-electrons.com</email>
</author>
<published>2016-05-17T09:12:32Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=cc51846ba81ca179a3be20f6313e3b72531888c1'/>
<id>urn:sha1:cc51846ba81ca179a3be20f6313e3b72531888c1</id>
<content type='text'>
The PWM device exposed by the HLCDC IP is configured with an inverted
polarity by default. Registering the PWM chip with the normal polarity
was not a problem before commit 42e8992c58d4 ("pwm: Add core
infrastructure to allow atomic updates") because the -&gt;set_polarity()
hook was called no matter the current polarity state, but this is no longer
the case.

Signed-off-by: Boris Brezillon &lt;boris.brezillon@free-electrons.com&gt;
Signed-off-by: Thierry Reding &lt;thierry.reding@gmail.com&gt;
</content>
</entry>
<entry>
<title>pwm: sysfs: Get return value from pwm_apply_state()</title>
<updated>2016-06-10T12:24:40Z</updated>
<author>
<name>Ryo Kodama</name>
<email>ryo.kodama.vz@renesas.com</email>
</author>
<published>2016-06-08T01:58:23Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=fe5aa34d6eb9c4d34071845f70f3714b41c8a77d'/>
<id>urn:sha1:fe5aa34d6eb9c4d34071845f70f3714b41c8a77d</id>
<content type='text'>
This patch adds to check the return value from pwm_apply_state()
used in enable_store(). The error of enable_store() doesn't work
if the return value doesn't received.

Signed-off-by: Ryo Kodama &lt;ryo.kodama.vz@renesas.com&gt;
Signed-off-by: Yoshihiro Shimoda &lt;yoshihiro.shimoda.uh@renesas.com&gt;
Fixes: 39100ceea79f ("pwm: Switch to the atomic API")
Signed-off-by: Thierry Reding &lt;thierry.reding@gmail.com&gt;
</content>
</entry>
<entry>
<title>pwm: Improve args checking in pwm_apply_state()</title>
<updated>2016-06-10T12:21:00Z</updated>
<author>
<name>Brian Norris</name>
<email>briannorris@chromium.org</email>
</author>
<published>2016-05-27T16:45:49Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ef2bf4997f7da6efa8540d9cf726c44bf2b863af'/>
<id>urn:sha1:ef2bf4997f7da6efa8540d9cf726c44bf2b863af</id>
<content type='text'>
It seems like in the process of refactoring pwm_config() to utilize the
newly-introduced pwm_apply_state() API, some args/bounds checking was
dropped.

In particular, I noted that we are now allowing invalid period
selections, e.g.:

  # echo 1 &gt; /sys/class/pwm/pwmchip0/export
  # cat /sys/class/pwm/pwmchip0/pwm1/period
  100
  # echo 101 &gt; /sys/class/pwm/pwmchip0/pwm1/duty_cycle
  [... driver may or may not reject the value, or trigger some logic bug ...]

It's better to see:

  # echo 1 &gt; /sys/class/pwm/pwmchip0/export
  # cat /sys/class/pwm/pwmchip0/pwm1/period
  100
  # echo 101 &gt; /sys/class/pwm/pwmchip0/pwm1/duty_cycle
  -bash: echo: write error: Invalid argument

This patch reintroduces some bounds checks in both pwm_config() (for its
signed parameters; we don't want to convert negative values into large
unsigned values) and in pwm_apply_state() (which fix the above described
behavior, as well as other potential API misuses).

Fixes: 5ec803edcb70 ("pwm: Add core infrastructure to allow atomic updates")
Signed-off-by: Brian Norris &lt;briannorris@chromium.org&gt;
Acked-by: Boris Brezillon &lt;boris.brezillon@free-electrons.com&gt;
Signed-off-by: Thierry Reding &lt;thierry.reding@gmail.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'pwm/for-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm</title>
<updated>2016-05-25T17:40:15Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2016-05-25T17:40:15Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ecc5fbd5ef472a4c659dc56a5739b3f041c0530c'/>
<id>urn:sha1:ecc5fbd5ef472a4c659dc56a5739b3f041c0530c</id>
<content type='text'>
Pull pwm updates from Thierry Reding:
 "This set of changes introduces an atomic API to the PWM subsystem.
  This is influenced by the DRM atomic API that was introduced a while
  back, though it is obviously a lot simpler.  The fundamental idea
  remains the same, though: drivers provide a single callback to
  implement the atomic configuration of a PWM channel.

  As a side-effect the PWM subsystem gains the ability for initial state
  retrieval, so that the logical state mirrors that of the hardware.
  Many use-cases don't care about this, but for others it is essential.

  These new features require changes in all users, which these patches
  take care of.  The core is transitioned to use the atomic callback if
  available and provides a fallback mechanism for other drivers.

  Changes to transition users and drivers to the atomic API are
  postponed to v4.8"

* tag 'pwm/for-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm: (30 commits)
  pwm: Add information about polarity, duty cycle and period to debugfs
  pwm: Switch to the atomic API
  pwm: Update documentation
  pwm: Add core infrastructure to allow atomic updates
  pwm: Add hardware readout infrastructure
  pwm: Move the enabled/disabled info into pwm_state
  pwm: Introduce the pwm_state concept
  pwm: Keep PWM state in sync with hardware state
  ARM: Explicitly apply PWM config extracted from pwm_args
  drm: i915: Explicitly apply PWM config extracted from pwm_args
  input: misc: pwm-beeper: Explicitly apply PWM config extracted from pwm_args
  input: misc: max8997: Explicitly apply PWM config extracted from pwm_args
  backlight: lm3630a: explicitly apply PWM config extracted from pwm_args
  backlight: lp855x: Explicitly apply PWM config extracted from pwm_args
  backlight: lp8788: Explicitly apply PWM config extracted from pwm_args
  backlight: pwm_bl: Use pwm_get_args() where appropriate
  fbdev: ssd1307fb: Use pwm_get_args() where appropriate
  regulator: pwm: Use pwm_get_args() where appropriate
  leds: pwm: Use pwm_get_args() where appropriate
  input: misc: max77693: Use pwm_get_args() where appropriate
  ...
</content>
</entry>
<entry>
<title>Merge branch 'for-4.7/pwm-atomic' into for-next</title>
<updated>2016-05-17T12:57:58Z</updated>
<author>
<name>Thierry Reding</name>
<email>thierry.reding@gmail.com</email>
</author>
<published>2016-05-17T12:57:58Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=18c588786c08458f5d965d8735ab48f9e51e0b4b'/>
<id>urn:sha1:18c588786c08458f5d965d8735ab48f9e51e0b4b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Merge branch 'for-4.7/pwm-args' into for-next</title>
<updated>2016-05-17T12:57:47Z</updated>
<author>
<name>Thierry Reding</name>
<email>thierry.reding@gmail.com</email>
</author>
<published>2016-05-17T12:57:47Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=bf5dd9abcb4443bbab8cb63b9d82b96a4a45c802'/>
<id>urn:sha1:bf5dd9abcb4443bbab8cb63b9d82b96a4a45c802</id>
<content type='text'>
</content>
</entry>
<entry>
<title>pwm: Add information about polarity, duty cycle and period to debugfs</title>
<updated>2016-05-17T12:48:05Z</updated>
<author>
<name>Heiko Stübner</name>
<email>heiko@sntech.de</email>
</author>
<published>2016-04-14T19:17:44Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=23e3523f5d3a980edf7f189743cf4bb9490400a9'/>
<id>urn:sha1:23e3523f5d3a980edf7f189743cf4bb9490400a9</id>
<content type='text'>
The PWM states make it possible to also output the polarity, duty cycle
and period information in the debugfs summary output. This simplifies
gathering information about PWMs without needing to walk through the
sysfs attributes of every PWM.

Signed-off-by: Heiko Stuebner &lt;heiko@sntech.de&gt;
Signed-off-by: Boris Brezillon &lt;boris.brezillon@free-electrons.com&gt;
[thierry.reding@gmail.com: use more spaces in debugfs output]
Signed-off-by: Thierry Reding &lt;thierry.reding@gmail.com&gt;
</content>
</entry>
<entry>
<title>pwm: Switch to the atomic API</title>
<updated>2016-05-17T12:48:04Z</updated>
<author>
<name>Boris Brezillon</name>
<email>boris.brezillon@free-electrons.com</email>
</author>
<published>2016-04-14T19:17:43Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=39100ceea79ff2efeb2fb094baf120c73d5ccf47'/>
<id>urn:sha1:39100ceea79ff2efeb2fb094baf120c73d5ccf47</id>
<content type='text'>
Replace legacy pwm_get/set_xxx() and pwm_config/enable/disable() calls
by pwm_get/apply_state().

Signed-off-by: Boris Brezillon &lt;boris.brezillon@free-electrons.com&gt;
Signed-off-by: Thierry Reding &lt;thierry.reding@gmail.com&gt;
</content>
</entry>
<entry>
<title>pwm: Add core infrastructure to allow atomic updates</title>
<updated>2016-05-17T12:48:03Z</updated>
<author>
<name>Boris Brezillon</name>
<email>boris.brezillon@free-electrons.com</email>
</author>
<published>2016-04-14T19:17:41Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=5ec803edcb703fe379836f13560b79dfac79b01d'/>
<id>urn:sha1:5ec803edcb703fe379836f13560b79dfac79b01d</id>
<content type='text'>
Add an -&gt;apply() method to the pwm_ops struct to allow PWM drivers to
implement atomic updates. This method is preferred over the -&gt;enable(),
-&gt;disable() and -&gt;config() methods if available.

Add the pwm_apply_state() function to the PWM user API.

Note that the pwm_apply_state() does not guarantee the atomicity of the
update operation, it all depends on the availability and implementation
of the -&gt;apply() method.

pwm_enable/disable/set_polarity/config() are now implemented as wrappers
around the pwm_apply_state() function.

pwm_adjust_config() is allowing smooth handover between the bootloader
and the kernel. This function tries to adapt the current PWM state to
the PWM arguments coming from a PWM lookup table or a DT definition
without changing the duty_cycle/period proportion.

Signed-off-by: Boris Brezillon &lt;boris.brezillon@free-electrons.com&gt;
[thierry.reding@gmail.com: fix a couple of typos]
Signed-off-by: Thierry Reding &lt;thierry.reding@gmail.com&gt;
</content>
</entry>
<entry>
<title>pwm: Add hardware readout infrastructure</title>
<updated>2016-05-17T12:48:03Z</updated>
<author>
<name>Boris Brezillon</name>
<email>boris.brezillon@free-electrons.com</email>
</author>
<published>2016-04-14T19:17:40Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=15fa8a43c147213a9563903c87b29671035eb6e8'/>
<id>urn:sha1:15fa8a43c147213a9563903c87b29671035eb6e8</id>
<content type='text'>
Add a -&gt;get_state() function to the pwm_ops struct to let PWM drivers
initialize the PWM state attached to a PWM device.

Signed-off-by: Boris Brezillon &lt;boris.brezillon@free-electrons.com&gt;
Signed-off-by: Thierry Reding &lt;thierry.reding@gmail.com&gt;
</content>
</entry>
</feed>
