<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/pwm, branch linux-3.17.y</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>pwm: Fix uninitialized warnings in pwm_get()</title>
<updated>2014-11-21T17:23:14+00:00</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert+renesas@glider.be</email>
</author>
<published>2014-08-28T09:03:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=0d146f6c3319f7f5bb4f39bbda996a385ae8584c'/>
<id>0d146f6c3319f7f5bb4f39bbda996a385ae8584c</id>
<content type='text'>
commit 70145f87139fbc43b726f873813cd91dce371899 upstream.

With some versions of gcc (e.g. 4.1.2):

drivers/pwm/core.c: In function ‘pwm_get’:
drivers/pwm/core.c:610: warning: ‘polarity’ may be used uninitialized in this function
drivers/pwm/core.c:609: warning: ‘period’ may be used uninitialized in this function

While these are false positives, we can get rid of them by refactoring
the code to store a pointer to the best match, as suggested before by
Thierry Reding. This does require moving the mutex_unlock() down.

Fixes: d717ea73e36dd565 ("pwm: Fix period and polarity in pwm_get() for non-perfect matches")
Signed-off-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Signed-off-by: Thierry Reding &lt;thierry.reding@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 70145f87139fbc43b726f873813cd91dce371899 upstream.

With some versions of gcc (e.g. 4.1.2):

drivers/pwm/core.c: In function ‘pwm_get’:
drivers/pwm/core.c:610: warning: ‘polarity’ may be used uninitialized in this function
drivers/pwm/core.c:609: warning: ‘period’ may be used uninitialized in this function

While these are false positives, we can get rid of them by refactoring
the code to store a pointer to the best match, as suggested before by
Thierry Reding. This does require moving the mutex_unlock() down.

Fixes: d717ea73e36dd565 ("pwm: Fix period and polarity in pwm_get() for non-perfect matches")
Signed-off-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Signed-off-by: Thierry Reding &lt;thierry.reding@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>pwm: Fix period and polarity in pwm_get() for non-perfect matches</title>
<updated>2014-08-18T08:58:43+00:00</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert+renesas@glider.be</email>
</author>
<published>2014-08-13T15:18:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=d717ea73e36dd5659640fae82605ad85c4117f4d'/>
<id>d717ea73e36dd5659640fae82605ad85c4117f4d</id>
<content type='text'>
If pwm_get() finds a look-up entry with a perfect match (both dev_id and
con_id match), the loop is aborted, and "p" still points to the correct
struct pwm_lookup.

If only an entry with a matching dev_id or con_id is found, the loop
terminates after traversing the whole list, and "p" now points to
arbitrary memory, not part of the pwm_lookup list.
Then pwm_set_period() and pwm_set_polarity() will set random values for
period resp. polarity.

To fix this, save period and polarity when finding a new best match,
just like is done for chip (for the provider) and index.

This fixes the LCD backlight on r8a7740/armadillo-legacy, which was fed
period 0 and polarity -1068821144 instead of 33333 resp. 1.

Fixes: 3796ce1d4d4b ("pwm: add period and polarity to struct pwm_lookup")
Signed-off-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Thierry Reding &lt;thierry.reding@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If pwm_get() finds a look-up entry with a perfect match (both dev_id and
con_id match), the loop is aborted, and "p" still points to the correct
struct pwm_lookup.

If only an entry with a matching dev_id or con_id is found, the loop
terminates after traversing the whole list, and "p" now points to
arbitrary memory, not part of the pwm_lookup list.
Then pwm_set_period() and pwm_set_polarity() will set random values for
period resp. polarity.

To fix this, save period and polarity when finding a new best match,
just like is done for chip (for the provider) and index.

This fixes the LCD backlight on r8a7740/armadillo-legacy, which was fed
period 0 and polarity -1068821144 instead of 33333 resp. 1.

Fixes: 3796ce1d4d4b ("pwm: add period and polarity to struct pwm_lookup")
Signed-off-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Thierry Reding &lt;thierry.reding@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge tag 'pwm/for-3.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm</title>
<updated>2014-08-09T01:06:29+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2014-08-09T01:06:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=34b20e6df6970e36b93f445669ba5ef7a05fe01a'/>
<id>34b20e6df6970e36b93f445669ba5ef7a05fe01a</id>
<content type='text'>
Pull pwm changes from Thierry Reding:
 "The set of changes for this merge window contains two new drivers: one
  for Rockchip SoCs and another for STMicroelectronics STiH4xx SoCs.

  The remainder of the changes are the usual small cleanups such as
  removing redundant OOM messages, signalling that a PWM chip's
  operations can sleep and removing an unneeded dependency"

* tag 'pwm/for-3.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm:
  pwm: rockchip: Added to support for RK3288 SoC
  pwm: rockchip: document RK3288 SoC compatible
  pwm: sti: Remove PWM period table
  pwm: sti: Sync between enable/disable calls
  pwm: sti: Ensure same period values for all channels
  pwm: sti: Fix PWM prescaler handling
  pwm: sti: Supply Device Tree binding documentation for ST's PWM IP
  pwm: sti: Add new driver for ST's PWM IP
  pwm: imx: set can_sleep flag for imx_pwm
  pwm: lpss: remove dependency on clk framework
  pwm: pwm-tipwmss: remove unnecessary OOM messages
  pwm: rockchip: document device tree bindings
  pwm: add Rockchip SoC PWM support
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull pwm changes from Thierry Reding:
 "The set of changes for this merge window contains two new drivers: one
  for Rockchip SoCs and another for STMicroelectronics STiH4xx SoCs.

  The remainder of the changes are the usual small cleanups such as
  removing redundant OOM messages, signalling that a PWM chip's
  operations can sleep and removing an unneeded dependency"

* tag 'pwm/for-3.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm:
  pwm: rockchip: Added to support for RK3288 SoC
  pwm: rockchip: document RK3288 SoC compatible
  pwm: sti: Remove PWM period table
  pwm: sti: Sync between enable/disable calls
  pwm: sti: Ensure same period values for all channels
  pwm: sti: Fix PWM prescaler handling
  pwm: sti: Supply Device Tree binding documentation for ST's PWM IP
  pwm: sti: Add new driver for ST's PWM IP
  pwm: imx: set can_sleep flag for imx_pwm
  pwm: lpss: remove dependency on clk framework
  pwm: pwm-tipwmss: remove unnecessary OOM messages
  pwm: rockchip: document device tree bindings
  pwm: add Rockchip SoC PWM support
</pre>
</div>
</content>
</entry>
<entry>
<title>pwm: rockchip: Added to support for RK3288 SoC</title>
<updated>2014-08-08T11:12:47+00:00</updated>
<author>
<name>Caesar Wang</name>
<email>caesar.wang@rock-chips.com</email>
</author>
<published>2014-08-08T07:28:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=f6306299080bbb1a77ad39494203f5397a5c2630'/>
<id>f6306299080bbb1a77ad39494203f5397a5c2630</id>
<content type='text'>
This patch added to support the PWM controller found on
RK3288 SoC.

Signed-off-by: Caesar Wang &lt;caesar.wang@rock-chips.com&gt;
Signed-off-by: Thierry Reding &lt;thierry.reding@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch added to support the PWM controller found on
RK3288 SoC.

Signed-off-by: Caesar Wang &lt;caesar.wang@rock-chips.com&gt;
Signed-off-by: Thierry Reding &lt;thierry.reding@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>pwm: sti: Remove PWM period table</title>
<updated>2014-08-08T11:12:46+00:00</updated>
<author>
<name>Ajit Pal Singh</name>
<email>ajitpal.singh@st.com</email>
</author>
<published>2014-07-14T14:33:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=3aacd3e1879a5359ce1483b82c9cdd31ebb348b7'/>
<id>3aacd3e1879a5359ce1483b82c9cdd31ebb348b7</id>
<content type='text'>
Removes the PWM period table. Instead the prescaler is computed
from the period value passed in the config() function.

Signed-off-by: Ajit Pal Singh &lt;ajitpal.singh@st.com&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
Signed-off-by: Thierry Reding &lt;thierry.reding@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Removes the PWM period table. Instead the prescaler is computed
from the period value passed in the config() function.

Signed-off-by: Ajit Pal Singh &lt;ajitpal.singh@st.com&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
Signed-off-by: Thierry Reding &lt;thierry.reding@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>pwm: sti: Sync between enable/disable calls</title>
<updated>2014-08-08T11:12:45+00:00</updated>
<author>
<name>Ajit Pal Singh</name>
<email>ajitpal.singh@st.com</email>
</author>
<published>2014-07-14T14:33:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=6ad6b838e11d8d67950716e0715b1d71bdd0769e'/>
<id>6ad6b838e11d8d67950716e0715b1d71bdd0769e</id>
<content type='text'>
ST PWM IP has a common enable/disable control for all the PWM
channels on a PWM cell. Disables PWM output on the PWM HW only
when disable is called for the last channel.

Signed-off-by: Ajit Pal Singh &lt;ajitpal.singh@st.com&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
Signed-off-by: Thierry Reding &lt;thierry.reding@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ST PWM IP has a common enable/disable control for all the PWM
channels on a PWM cell. Disables PWM output on the PWM HW only
when disable is called for the last channel.

Signed-off-by: Ajit Pal Singh &lt;ajitpal.singh@st.com&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
Signed-off-by: Thierry Reding &lt;thierry.reding@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>pwm: sti: Ensure same period values for all channels</title>
<updated>2014-08-08T11:12:45+00:00</updated>
<author>
<name>Ajit Pal Singh</name>
<email>ajitpal.singh@st.com</email>
</author>
<published>2014-07-14T14:33:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=5165166e8a1551fb80afa5fdaad6f2ea34d92285'/>
<id>5165166e8a1551fb80afa5fdaad6f2ea34d92285</id>
<content type='text'>
ST PWM IP shares the same clock prescaler across all the PWM
channels. Hence configuration requests which change the period
will affect all the channels. Do not allow period changes which
will stomp period settings of the already configured channels.

Signed-off-by: Ajit Pal Singh &lt;ajitpal.singh@st.com&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
Signed-off-by: Thierry Reding &lt;thierry.reding@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ST PWM IP shares the same clock prescaler across all the PWM
channels. Hence configuration requests which change the period
will affect all the channels. Do not allow period changes which
will stomp period settings of the already configured channels.

Signed-off-by: Ajit Pal Singh &lt;ajitpal.singh@st.com&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
Signed-off-by: Thierry Reding &lt;thierry.reding@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>pwm: sti: Fix PWM prescaler handling</title>
<updated>2014-08-08T11:12:40+00:00</updated>
<author>
<name>Ajit Pal Singh</name>
<email>ajitpal.singh@st.com</email>
</author>
<published>2014-07-14T14:33:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=bf9cc80b6c3ec2754b570d377ed7f7e2ec96868a'/>
<id>bf9cc80b6c3ec2754b570d377ed7f7e2ec96868a</id>
<content type='text'>
This patch fixes the pwm driver to write the complete 8 bits of
the prescaler value to the PWM Control register.

Signed-off-by: Ajit Pal Singh &lt;ajitpal.singh@st.com&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
Signed-off-by: Thierry Reding &lt;thierry.reding@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch fixes the pwm driver to write the complete 8 bits of
the prescaler value to the PWM Control register.

Signed-off-by: Ajit Pal Singh &lt;ajitpal.singh@st.com&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
Signed-off-by: Thierry Reding &lt;thierry.reding@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>pwm: sti: Add new driver for ST's PWM IP</title>
<updated>2014-08-07T14:18:27+00:00</updated>
<author>
<name>Lee Jones</name>
<email>lee.jones@linaro.org</email>
</author>
<published>2014-07-14T14:33:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=378fe115d19d6ab9e9210a2ac330159afabf0237'/>
<id>378fe115d19d6ab9e9210a2ac330159afabf0237</id>
<content type='text'>
This driver supports all current STi platforms' PWM IPs.

Signed-off-by: Ajit Pal Singh &lt;ajitpal.singh@st.com&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
[thierry.reding: rename module to pwm-sti, fix build breakage]
Signed-off-by: Thierry Reding &lt;thierry.reding@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This driver supports all current STi platforms' PWM IPs.

Signed-off-by: Ajit Pal Singh &lt;ajitpal.singh@st.com&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
[thierry.reding: rename module to pwm-sti, fix build breakage]
Signed-off-by: Thierry Reding &lt;thierry.reding@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>pwm: imx: set can_sleep flag for imx_pwm</title>
<updated>2014-08-07T11:22:44+00:00</updated>
<author>
<name>Shawn Guo</name>
<email>shawn.guo@freescale.com</email>
</author>
<published>2014-05-23T08:41:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=31c4fa3442570d001f58303dea36d81693bc199c'/>
<id>31c4fa3442570d001f58303dea36d81693bc199c</id>
<content type='text'>
The .config() hook imx_pwm_config() calls clk APIs like clk_prepare()
and clk_get_rate(), which might sleep, so we need to set can_sleep flag
on pwm_chip.

Signed-off-by: Shawn Guo &lt;shawn.guo@freescale.com&gt;
Acked-by: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Signed-off-by: Thierry Reding &lt;thierry.reding@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The .config() hook imx_pwm_config() calls clk APIs like clk_prepare()
and clk_get_rate(), which might sleep, so we need to set can_sleep flag
on pwm_chip.

Signed-off-by: Shawn Guo &lt;shawn.guo@freescale.com&gt;
Acked-by: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Signed-off-by: Thierry Reding &lt;thierry.reding@gmail.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
