<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/pwm/core.c, branch linux-4.8.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.8.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.8.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2016-11-10T15:38:56Z</updated>
<entry>
<title>pwm: Unexport children before chip removal</title>
<updated>2016-11-10T15:38:56Z</updated>
<author>
<name>David Hsu</name>
</author>
<published>2016-08-09T21:57:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fedede0963c48829992a810d9ae61f0424949373'/>
<id>urn:sha1:fedede0963c48829992a810d9ae61f0424949373</id>
<content type='text'>
commit 0733424c9ba9f42242409d1ece780777272f7ea1 upstream.

Exported pwm channels aren't removed before the pwmchip and are
leaked. This results in invalid sysfs files. This fix removes
all exported pwm channels before chip removal.

Signed-off-by: David Hsu &lt;davidhsu@google.com&gt;
Fixes: 76abbdde2d95 ("pwm: Add sysfs interface")
Signed-off-by: Thierry Reding &lt;thierry.reding@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>Merge branch 'for-4.8/capture' into for-next</title>
<updated>2016-07-25T14:23:39Z</updated>
<author>
<name>Thierry Reding</name>
</author>
<published>2016-07-25T14:23:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bd2686122d3b45db1398776921bd47fedfd6d6a5'/>
<id>urn:sha1:bd2686122d3b45db1398776921bd47fedfd6d6a5</id>
<content type='text'>
</content>
</entry>
<entry>
<title>pwm: Add PWM capture support</title>
<updated>2016-06-10T14:01:35Z</updated>
<author>
<name>Lee Jones</name>
</author>
<published>2016-06-08T09:21:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3a3d1a4e32ab47323d7b8c8b7631a8d36a3098b2'/>
<id>urn:sha1:3a3d1a4e32ab47323d7b8c8b7631a8d36a3098b2</id>
<content type='text'>
Supply a PWM capture callback op in order to pass back information
obtained by running analysis on a PWM signal. This would normally (at
least during testing) be called from the sysfs routines with a view to
printing out PWM capture data which has been encoded into a string.

Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
[thierry.reding@gmail.com: make capture data unsigned int for symmetry]
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>
</author>
<published>2016-05-27T16:45:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.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 branch 'for-4.7/pwm-atomic' into for-next</title>
<updated>2016-05-17T12:57:58Z</updated>
<author>
<name>Thierry Reding</name>
</author>
<published>2016-05-17T12:57:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.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>
</author>
<published>2016-05-17T12:57:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.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>
</author>
<published>2016-04-14T19:17:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.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>
</author>
<published>2016-04-14T19:17:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.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>
</author>
<published>2016-04-14T19:17:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.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>
</author>
<published>2016-04-14T19:17:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.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>
