<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/counter, branch linux-6.10.y</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>counter: ti-eqep: enable clock at probe</title>
<updated>2024-06-22T04:48:11+00:00</updated>
<author>
<name>David Lechner</name>
<email>dlechner@baylibre.com</email>
</author>
<published>2024-06-21T22:22:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=0cf81c73e4c6a4861128a8f27861176ec312af4e'/>
<id>0cf81c73e4c6a4861128a8f27861176ec312af4e</id>
<content type='text'>
The TI eQEP clock is both a functional and interface clock. Since it is
required for the device to function, we should be enabling it at probe.

Up to now, we've just been lucky that the clock was enabled by something
else on the system already.

Fixes: f213729f6796 ("counter: new TI eQEP driver")
Reviewed-by: Judith Mendez &lt;jm@ti.com&gt;
Signed-off-by: David Lechner &lt;dlechner@baylibre.com&gt;
Link: https://lore.kernel.org/r/20240621-ti-eqep-enable-clock-v2-1-edd3421b54d4@baylibre.com
Signed-off-by: William Breathitt Gray &lt;wbg@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The TI eQEP clock is both a functional and interface clock. Since it is
required for the device to function, we should be enabling it at probe.

Up to now, we've just been lucky that the clock was enabled by something
else on the system already.

Fixes: f213729f6796 ("counter: new TI eQEP driver")
Reviewed-by: Judith Mendez &lt;jm@ti.com&gt;
Signed-off-by: David Lechner &lt;dlechner@baylibre.com&gt;
Link: https://lore.kernel.org/r/20240621-ti-eqep-enable-clock-v2-1-edd3421b54d4@baylibre.com
Signed-off-by: William Breathitt Gray &lt;wbg@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>counter: ti-ecap-capture: Utilize COUNTER_COMP_FREQUENCY macro</title>
<updated>2024-04-02T17:15:03+00:00</updated>
<author>
<name>William Breathitt Gray</name>
<email>wbg@kernel.org</email>
</author>
<published>2024-03-21T16:32:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=916baadd293a4d11e08a7ca1e2968314451ade6c'/>
<id>916baadd293a4d11e08a7ca1e2968314451ade6c</id>
<content type='text'>
Reduce boilerplate by leveraging the COUNTER_COMP_FREQUENCY() macro to
define the "frequency" extension.

Link: https://lore.kernel.org/r/ZfxhEKdSi1amfcJC@ishi
Signed-off-by: William Breathitt Gray &lt;wbg@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reduce boilerplate by leveraging the COUNTER_COMP_FREQUENCY() macro to
define the "frequency" extension.

Link: https://lore.kernel.org/r/ZfxhEKdSi1amfcJC@ishi
Signed-off-by: William Breathitt Gray &lt;wbg@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>counter: ti-eqep: Convert to platform remove callback returning void</title>
<updated>2024-04-02T17:10:35+00:00</updated>
<author>
<name>Uwe Kleine-König</name>
<email>u.kleine-koenig@pengutronix.de</email>
</author>
<published>2024-03-10T08:06:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=4b986b68e6993c512106548ed712aebe40d3605e'/>
<id>4b986b68e6993c512106548ed712aebe40d3605e</id>
<content type='text'>
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Acked-by: David Lechner &lt;david@lechnology.com&gt;
Link: https://lore.kernel.org/r/bf78595f6a49be0b6bb403b466c13177d72c02b7.1710057753.git.u.kleine-koenig@pengutronix.de
Signed-off-by: William Breathitt Gray &lt;wbg@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Acked-by: David Lechner &lt;david@lechnology.com&gt;
Link: https://lore.kernel.org/r/bf78595f6a49be0b6bb403b466c13177d72c02b7.1710057753.git.u.kleine-koenig@pengutronix.de
Signed-off-by: William Breathitt Gray &lt;wbg@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>counter: ti-ecap-capture: Convert to platform remove callback returning void</title>
<updated>2024-04-02T17:10:34+00:00</updated>
<author>
<name>Uwe Kleine-König</name>
<email>u.kleine-koenig@pengutronix.de</email>
</author>
<published>2024-03-10T08:06:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=e9b4895fd171dfa961c570d31ef61f443b210ab1'/>
<id>e9b4895fd171dfa961c570d31ef61f443b210ab1</id>
<content type='text'>
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Link: https://lore.kernel.org/r/f70902b2aabecaa9295c28629cd7a8a0e6eb06d0.1710057753.git.u.kleine-koenig@pengutronix.de
Signed-off-by: William Breathitt Gray &lt;wbg@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Link: https://lore.kernel.org/r/f70902b2aabecaa9295c28629cd7a8a0e6eb06d0.1710057753.git.u.kleine-koenig@pengutronix.de
Signed-off-by: William Breathitt Gray &lt;wbg@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>counter: stm32-timer-cnt: add support for capture events</title>
<updated>2024-04-02T17:10:34+00:00</updated>
<author>
<name>Fabrice Gasnier</name>
<email>fabrice.gasnier@foss.st.com</email>
</author>
<published>2024-03-07T13:33:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=1aed15275b7ce17b5ebdfc112a76e0d7165ed46b'/>
<id>1aed15275b7ce17b5ebdfc112a76e0d7165ed46b</id>
<content type='text'>
Add support for capture events. Captured counter value for each channel
can be retrieved through CCRx register.
STM32 timers can have up to 4 capture channels (on input channel 1 to
channel 4), hence need to check the number of channels before reading
the capture data.
The capture configuration is hard-coded to capture signals on both edges
(non-inverted). Interrupts are used to report events independently for
each channel.

Reviewed-by: William Breathitt Gray &lt;william.gray@linaro.org&gt;
Acked-by: Lee Jones &lt;lee@kernel.org&gt;
Signed-off-by: Fabrice Gasnier &lt;fabrice.gasnier@foss.st.com&gt;
Link: https://lore.kernel.org/r/20240307133306.383045-11-fabrice.gasnier@foss.st.com
Signed-off-by: William Breathitt Gray &lt;william.gray@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add support for capture events. Captured counter value for each channel
can be retrieved through CCRx register.
STM32 timers can have up to 4 capture channels (on input channel 1 to
channel 4), hence need to check the number of channels before reading
the capture data.
The capture configuration is hard-coded to capture signals on both edges
(non-inverted). Interrupts are used to report events independently for
each channel.

Reviewed-by: William Breathitt Gray &lt;william.gray@linaro.org&gt;
Acked-by: Lee Jones &lt;lee@kernel.org&gt;
Signed-off-by: Fabrice Gasnier &lt;fabrice.gasnier@foss.st.com&gt;
Link: https://lore.kernel.org/r/20240307133306.383045-11-fabrice.gasnier@foss.st.com
Signed-off-by: William Breathitt Gray &lt;william.gray@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>counter: stm32-timer-cnt: add support for overflow events</title>
<updated>2024-04-02T17:10:34+00:00</updated>
<author>
<name>Fabrice Gasnier</name>
<email>fabrice.gasnier@foss.st.com</email>
</author>
<published>2024-03-07T13:33:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=2c70ccd45985f1e458f9785fc8cf9b8c48e3807f'/>
<id>2c70ccd45985f1e458f9785fc8cf9b8c48e3807f</id>
<content type='text'>
Add support overflow events. Also add the related validation and
configuration routine. Register and enable interrupts to push events.
STM32 Timers can have either 1 global interrupt, or 4 dedicated interrupt
lines. Request only the necessary interrupt, e.g. either global interrupt
that can report all event types, or update interrupt only for overflow
event.

Reviewed-by: William Breathitt Gray &lt;william.gray@linaro.org&gt;
Signed-off-by: Fabrice Gasnier &lt;fabrice.gasnier@foss.st.com&gt;
Link: https://lore.kernel.org/r/20240307133306.383045-10-fabrice.gasnier@foss.st.com
Signed-off-by: William Breathitt Gray &lt;william.gray@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add support overflow events. Also add the related validation and
configuration routine. Register and enable interrupts to push events.
STM32 Timers can have either 1 global interrupt, or 4 dedicated interrupt
lines. Request only the necessary interrupt, e.g. either global interrupt
that can report all event types, or update interrupt only for overflow
event.

Reviewed-by: William Breathitt Gray &lt;william.gray@linaro.org&gt;
Signed-off-by: Fabrice Gasnier &lt;fabrice.gasnier@foss.st.com&gt;
Link: https://lore.kernel.org/r/20240307133306.383045-10-fabrice.gasnier@foss.st.com
Signed-off-by: William Breathitt Gray &lt;william.gray@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>counter: stm32-timer-cnt: probe number of channels from registers</title>
<updated>2024-04-02T17:10:34+00:00</updated>
<author>
<name>Fabrice Gasnier</name>
<email>fabrice.gasnier@foss.st.com</email>
</author>
<published>2024-03-07T13:33:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=f7630270b67836bedc518e96fb4c64b11fe3fb5e'/>
<id>f7630270b67836bedc518e96fb4c64b11fe3fb5e</id>
<content type='text'>
Probe the number of capture compare channels, by writing CCER register bits
and read them back. Take care to restore the register original value.

This is a precursor patch to support capture channels.

Reviewed-by: William Breathitt Gray &lt;william.gray@linaro.org&gt;
Signed-off-by: Fabrice Gasnier &lt;fabrice.gasnier@foss.st.com&gt;
Link: https://lore.kernel.org/r/20240307133306.383045-9-fabrice.gasnier@foss.st.com
Signed-off-by: William Breathitt Gray &lt;william.gray@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Probe the number of capture compare channels, by writing CCER register bits
and read them back. Take care to restore the register original value.

This is a precursor patch to support capture channels.

Reviewed-by: William Breathitt Gray &lt;william.gray@linaro.org&gt;
Signed-off-by: Fabrice Gasnier &lt;fabrice.gasnier@foss.st.com&gt;
Link: https://lore.kernel.org/r/20240307133306.383045-9-fabrice.gasnier@foss.st.com
Signed-off-by: William Breathitt Gray &lt;william.gray@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>counter: stm32-timer-cnt: introduce channels</title>
<updated>2024-04-02T17:10:34+00:00</updated>
<author>
<name>Fabrice Gasnier</name>
<email>fabrice.gasnier@foss.st.com</email>
</author>
<published>2024-03-07T13:33:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=efec660d78f06cd1101b3300ebfef4918cc0f63f'/>
<id>efec660d78f06cd1101b3300ebfef4918cc0f63f</id>
<content type='text'>
Simply add channels 3 and 4 that can be used for capture. Statically
add them, despite some timers doesn't have them. Rather rely on
stm32_action_read that will report "none" action for these currently.

Reviewed-by: William Breathitt Gray &lt;william.gray@linaro.org&gt;
Signed-off-by: Fabrice Gasnier &lt;fabrice.gasnier@foss.st.com&gt;
Link: https://lore.kernel.org/r/20240307133306.383045-8-fabrice.gasnier@foss.st.com
Signed-off-by: William Breathitt Gray &lt;william.gray@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Simply add channels 3 and 4 that can be used for capture. Statically
add them, despite some timers doesn't have them. Rather rely on
stm32_action_read that will report "none" action for these currently.

Reviewed-by: William Breathitt Gray &lt;william.gray@linaro.org&gt;
Signed-off-by: Fabrice Gasnier &lt;fabrice.gasnier@foss.st.com&gt;
Link: https://lore.kernel.org/r/20240307133306.383045-8-fabrice.gasnier@foss.st.com
Signed-off-by: William Breathitt Gray &lt;william.gray@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>counter: stm32-timer-cnt: add checks on quadrature encoder capability</title>
<updated>2024-04-02T17:10:34+00:00</updated>
<author>
<name>Fabrice Gasnier</name>
<email>fabrice.gasnier@foss.st.com</email>
</author>
<published>2024-03-07T13:33:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=29646ee33cc34b322578e923a121a3ba5eedc22b'/>
<id>29646ee33cc34b322578e923a121a3ba5eedc22b</id>
<content type='text'>
This is a precursor patch to support capture channels on all possible
channels and stm32 timer types. Original driver was intended to be used
only as quadrature encoder and simple counter on internal clock.

So, add a check on encoder capability, so the driver may be probed for
timer instances without encoder feature. This way, all timers may be used
as simple counter on internal clock, starting from here.

Encoder capability is retrieved by using the timer index (originally in
stm32-timer-trigger driver and dt-bindings). The need to keep backward
compatibility with existing device tree lead to parse aside trigger node.

Reviewed-by: William Breathitt Gray &lt;william.gray@linaro.org&gt;
Signed-off-by: Fabrice Gasnier &lt;fabrice.gasnier@foss.st.com&gt;
Link: https://lore.kernel.org/r/20240307133306.383045-7-fabrice.gasnier@foss.st.com
Signed-off-by: William Breathitt Gray &lt;william.gray@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a precursor patch to support capture channels on all possible
channels and stm32 timer types. Original driver was intended to be used
only as quadrature encoder and simple counter on internal clock.

So, add a check on encoder capability, so the driver may be probed for
timer instances without encoder feature. This way, all timers may be used
as simple counter on internal clock, starting from here.

Encoder capability is retrieved by using the timer index (originally in
stm32-timer-trigger driver and dt-bindings). The need to keep backward
compatibility with existing device tree lead to parse aside trigger node.

Reviewed-by: William Breathitt Gray &lt;william.gray@linaro.org&gt;
Signed-off-by: Fabrice Gasnier &lt;fabrice.gasnier@foss.st.com&gt;
Link: https://lore.kernel.org/r/20240307133306.383045-7-fabrice.gasnier@foss.st.com
Signed-off-by: William Breathitt Gray &lt;william.gray@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>counter: stm32-timer-cnt: add counter prescaler extension</title>
<updated>2024-04-02T17:10:34+00:00</updated>
<author>
<name>Fabrice Gasnier</name>
<email>fabrice.gasnier@foss.st.com</email>
</author>
<published>2024-03-07T13:33:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=b73d03b3474212028f5b41675b0f30273c7ffa58'/>
<id>b73d03b3474212028f5b41675b0f30273c7ffa58</id>
<content type='text'>
There's a prescaler in between the selected input signal used for
counting (CK_PSC), and the counter input (CK_CNT).
So add the "prescaler" extension to the counter.

Reviewed-by: William Breathitt Gray &lt;william.gray@linaro.org&gt;
Signed-off-by: Fabrice Gasnier &lt;fabrice.gasnier@foss.st.com&gt;
Link: https://lore.kernel.org/r/20240307133306.383045-6-fabrice.gasnier@foss.st.com
Signed-off-by: William Breathitt Gray &lt;william.gray@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There's a prescaler in between the selected input signal used for
counting (CK_PSC), and the counter input (CK_CNT).
So add the "prescaler" extension to the counter.

Reviewed-by: William Breathitt Gray &lt;william.gray@linaro.org&gt;
Signed-off-by: Fabrice Gasnier &lt;fabrice.gasnier@foss.st.com&gt;
Link: https://lore.kernel.org/r/20240307133306.383045-6-fabrice.gasnier@foss.st.com
Signed-off-by: William Breathitt Gray &lt;william.gray@linaro.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
