<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/rtc/rtc-pcf2127.c, branch v5.18</title>
<subtitle>Clone of https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git</subtitle>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/'/>
<entry>
<title>rtc: pcf2127: set RTC_FEATURE_ALARM_RES_2S</title>
<updated>2022-03-23T18:58:39+00:00</updated>
<author>
<name>Alexandre Belloni</name>
<email>alexandre.belloni@bootlin.com</email>
</author>
<published>2022-03-09T16:22:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=bda1027358e72e6255f11a4b59c375f138a2dd10'/>
<id>bda1027358e72e6255f11a4b59c375f138a2dd10</id>
<content type='text'>
The PCF2127 doesn't support UIE because setting an alarm to fire every
second confuses the chip and the fastest we can go is an alarm every 2
seconds.

Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Link: https://lore.kernel.org/r/20220309162301.61679-11-alexandre.belloni@bootlin.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The PCF2127 doesn't support UIE because setting an alarm to fire every
second confuses the chip and the fastest we can go is an alarm every 2
seconds.

Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Link: https://lore.kernel.org/r/20220309162301.61679-11-alexandre.belloni@bootlin.com
</pre>
</div>
</content>
</entry>
<entry>
<title>rtc: pcf2127: switch to RTC_FEATURE_UPDATE_INTERRUPT</title>
<updated>2022-03-23T18:58:39+00:00</updated>
<author>
<name>Alexandre Belloni</name>
<email>alexandre.belloni@bootlin.com</email>
</author>
<published>2022-03-09T16:22:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=689fafd5b53ac223ba7c7b83aebe1c78ce7db46c'/>
<id>689fafd5b53ac223ba7c7b83aebe1c78ce7db46c</id>
<content type='text'>
Stop using uie_unsupported and clear RTC_FEATURE_UPDATE_INTERRUPT instead.

Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Link: https://lore.kernel.org/r/20220309162301.61679-10-alexandre.belloni@bootlin.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Stop using uie_unsupported and clear RTC_FEATURE_UPDATE_INTERRUPT instead.

Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Link: https://lore.kernel.org/r/20220309162301.61679-10-alexandre.belloni@bootlin.com
</pre>
</div>
</content>
</entry>
<entry>
<title>rtc: pcf2127: fix bug when reading alarm registers</title>
<updated>2022-02-15T22:35:43+00:00</updated>
<author>
<name>Hugo Villeneuve</name>
<email>hvilleneuve@dimonoff.com</email>
</author>
<published>2022-02-08T16:29:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=73ce05302007eece23a6acb7dc124c92a2209087'/>
<id>73ce05302007eece23a6acb7dc124c92a2209087</id>
<content type='text'>
The first bug is that reading the 5 alarm registers results in a read
operation of 20 bytes. The reason is because the destination buffer is
defined as an array of "unsigned int", and we use the sizeof()
operator on this array to define the bulk read count.

The second bug is that the read value is invalid, because we are
indexing the destination buffer as integers (4 bytes), instead of
indexing it as u8.

Changing the destination buffer type to u8 fixes both problems.

Signed-off-by: Hugo Villeneuve &lt;hvilleneuve@dimonoff.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Link: https://lore.kernel.org/r/20220208162908.3182581-1-hugo@hugovil.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The first bug is that reading the 5 alarm registers results in a read
operation of 20 bytes. The reason is because the destination buffer is
defined as an array of "unsigned int", and we use the sizeof()
operator on this array to define the bulk read count.

The second bug is that the read value is invalid, because we are
indexing the destination buffer as integers (4 bytes), instead of
indexing it as u8.

Changing the destination buffer type to u8 fixes both problems.

Signed-off-by: Hugo Villeneuve &lt;hvilleneuve@dimonoff.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Link: https://lore.kernel.org/r/20220208162908.3182581-1-hugo@hugovil.com
</pre>
</div>
</content>
</entry>
<entry>
<title>rtc: pcf2127: use IRQ flags obtained from device tree if available</title>
<updated>2022-02-15T22:28:32+00:00</updated>
<author>
<name>Hugo Villeneuve</name>
<email>hvilleneuve@dimonoff.com</email>
</author>
<published>2022-01-17T22:57:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=d4785b46345cc9564f883c94acc4c4de6bbfeea5'/>
<id>d4785b46345cc9564f883c94acc4c4de6bbfeea5</id>
<content type='text'>
If the interrupt pin of the PCF2127 is routed to the input of a GPIO
expander using the pca953x driver, the later will only accept an IRQ
of type IRQ_TYPE_EDGE_FALLING or IRQ_TYPE_EDGE_RISING, and the IRQ
request will fail.

Therefore, allow the IRQ type to be passed from the device tree data
if available.

Signed-off-by: Hugo Villeneuve &lt;hvilleneuve@dimonoff.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Link: https://lore.kernel.org/r/20220117225742.1252362-1-hugo@hugovil.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If the interrupt pin of the PCF2127 is routed to the input of a GPIO
expander using the pca953x driver, the later will only accept an IRQ
of type IRQ_TYPE_EDGE_FALLING or IRQ_TYPE_EDGE_RISING, and the IRQ
request will fail.

Therefore, allow the IRQ type to be passed from the device tree data
if available.

Signed-off-by: Hugo Villeneuve &lt;hvilleneuve@dimonoff.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Link: https://lore.kernel.org/r/20220117225742.1252362-1-hugo@hugovil.com
</pre>
</div>
</content>
</entry>
<entry>
<title>rtc: pcf2127: Fix typo in comment</title>
<updated>2022-01-05T00:02:00+00:00</updated>
<author>
<name>Hugo Villeneuve</name>
<email>hvilleneuve@dimonoff.com</email>
</author>
<published>2021-12-07T21:56:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=7b69b54aaa48979f5e3cebb7225e11cbbdc9f5fb'/>
<id>7b69b54aaa48979f5e3cebb7225e11cbbdc9f5fb</id>
<content type='text'>
Replace TFS2 with TSF2.

Signed-off-by: Hugo Villeneuve &lt;hvilleneuve@dimonoff.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Link: https://lore.kernel.org/r/20211207215626.2619819-1-hugo@hugovil.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Replace TFS2 with TSF2.

Signed-off-by: Hugo Villeneuve &lt;hvilleneuve@dimonoff.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Link: https://lore.kernel.org/r/20211207215626.2619819-1-hugo@hugovil.com
</pre>
</div>
</content>
</entry>
<entry>
<title>rtc: pcf2127: handle timestamp interrupts</title>
<updated>2021-07-10T00:58:31+00:00</updated>
<author>
<name>Mian Yousaf Kaukab</name>
<email>ykaukab@suse.de</email>
</author>
<published>2021-06-29T15:06:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=2f8619846755176a6720c71d580ffd09394a74bc'/>
<id>2f8619846755176a6720c71d580ffd09394a74bc</id>
<content type='text'>
commit 03623b4b041c ("rtc: pcf2127: add tamper detection support")
added support for timestamp interrupts. However they are not being
handled in the irq handler. If a timestamp interrupt occurs it
results in kernel disabling the interrupt and displaying the call
trace:

[  121.145580] irq 78: nobody cared (try booting with the "irqpoll" option)
...
[  121.238087] [&lt;00000000c4d69393&gt;] irq_default_primary_handler threaded [&lt;000000000a90d25b&gt;] pcf2127_rtc_irq [rtc_pcf2127]
[  121.248971] Disabling IRQ #78

Handle timestamp interrupts in pcf2127_rtc_irq(). Save time stamp
before clearing TSF1 and TSF2 flags so that it can't be overwritten.
Set a flag to mark if the timestamp is valid and only report to sysfs
if the flag is set. To mimic the hardware behavior, don’t save
another timestamp until the first one has been read by the userspace.

However, if the alarm irq is not configured, keep the old way of
handling timestamp interrupt in the timestamp0 sysfs calls.

Signed-off-by: Mian Yousaf Kaukab &lt;ykaukab@suse.de&gt;
Reviewed-by: Bruno Thomsen &lt;bruno.thomsen@gmail.com&gt;
Tested-by: Bruno Thomsen &lt;bruno.thomsen@gmail.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Link: https://lore.kernel.org/r/20210629150643.31551-1-ykaukab@suse.de
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 03623b4b041c ("rtc: pcf2127: add tamper detection support")
added support for timestamp interrupts. However they are not being
handled in the irq handler. If a timestamp interrupt occurs it
results in kernel disabling the interrupt and displaying the call
trace:

[  121.145580] irq 78: nobody cared (try booting with the "irqpoll" option)
...
[  121.238087] [&lt;00000000c4d69393&gt;] irq_default_primary_handler threaded [&lt;000000000a90d25b&gt;] pcf2127_rtc_irq [rtc_pcf2127]
[  121.248971] Disabling IRQ #78

Handle timestamp interrupts in pcf2127_rtc_irq(). Save time stamp
before clearing TSF1 and TSF2 flags so that it can't be overwritten.
Set a flag to mark if the timestamp is valid and only report to sysfs
if the flag is set. To mimic the hardware behavior, don’t save
another timestamp until the first one has been read by the userspace.

However, if the alarm irq is not configured, keep the old way of
handling timestamp interrupt in the timestamp0 sysfs calls.

Signed-off-by: Mian Yousaf Kaukab &lt;ykaukab@suse.de&gt;
Reviewed-by: Bruno Thomsen &lt;bruno.thomsen@gmail.com&gt;
Tested-by: Bruno Thomsen &lt;bruno.thomsen@gmail.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Link: https://lore.kernel.org/r/20210629150643.31551-1-ykaukab@suse.de
</pre>
</div>
</content>
</entry>
<entry>
<title>rtc: pcf2127: Fix the datasheet URL</title>
<updated>2021-06-20T21:48:35+00:00</updated>
<author>
<name>Fabio Estevam</name>
<email>festevam@gmail.com</email>
</author>
<published>2021-06-03T14:34:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=836e9ea3ccc263d17fdeb90f28089ff1d945500d'/>
<id>836e9ea3ccc263d17fdeb90f28089ff1d945500d</id>
<content type='text'>
The current datasheet URL is no longer valid.

Replace with a valid one.

Signed-off-by: Fabio Estevam &lt;festevam@gmail.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Link: https://lore.kernel.org/r/20210603143447.2223353-1-festevam@gmail.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The current datasheet URL is no longer valid.

Replace with a valid one.

Signed-off-by: Fabio Estevam &lt;festevam@gmail.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Link: https://lore.kernel.org/r/20210603143447.2223353-1-festevam@gmail.com
</pre>
</div>
</content>
</entry>
<entry>
<title>rtc: pcf2127: properly set flag WD_CD for rtc chips(pcf2129, pca2129)</title>
<updated>2021-02-13T21:38:13+00:00</updated>
<author>
<name>Biwen Li</name>
<email>biwen.li@nxp.com</email>
</author>
<published>2020-12-02T03:18:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=2843d565dd78fd9117b9a18567cf68ac37a5dd1e'/>
<id>2843d565dd78fd9117b9a18567cf68ac37a5dd1e</id>
<content type='text'>
Properly set flag WD_CD for rtc chips(pcf2129, pca2129)

Signed-off-by: Biwen Li &lt;biwen.li@nxp.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Link: https://lore.kernel.org/r/20201202031840.15582-1-biwen.li@oss.nxp.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Properly set flag WD_CD for rtc chips(pcf2129, pca2129)

Signed-off-by: Biwen Li &lt;biwen.li@nxp.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Link: https://lore.kernel.org/r/20201202031840.15582-1-biwen.li@oss.nxp.com
</pre>
</div>
</content>
</entry>
<entry>
<title>rtc: pcf2127: Run a OTP refresh if not done before</title>
<updated>2021-01-25T23:27:06+00:00</updated>
<author>
<name>Philipp Rosenberger</name>
<email>p.rosenberger@kunbus.com</email>
</author>
<published>2021-01-18T08:57:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=15f57b3e3130790b6d06ea04f0c1edf0e5455bdd'/>
<id>15f57b3e3130790b6d06ea04f0c1edf0e5455bdd</id>
<content type='text'>
The datasheet of the PCF2127 states, it is recommended to process an OTP
refresh once the power is up and the oscillator is operating stable. The
OTP refresh takes less than 100 ms to complete.

Signed-off-by: Philipp Rosenberger &lt;p.rosenberger@kunbus.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Link: https://lore.kernel.org/r/20210118085752.5759-3-p.rosenberger@kunbus.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The datasheet of the PCF2127 states, it is recommended to process an OTP
refresh once the power is up and the oscillator is operating stable. The
OTP refresh takes less than 100 ms to complete.

Signed-off-by: Philipp Rosenberger &lt;p.rosenberger@kunbus.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Link: https://lore.kernel.org/r/20210118085752.5759-3-p.rosenberger@kunbus.com
</pre>
</div>
</content>
</entry>
<entry>
<title>rtc: pcf2127: Disable Power-On Reset Override</title>
<updated>2021-01-25T23:26:16+00:00</updated>
<author>
<name>Philipp Rosenberger</name>
<email>p.rosenberger@kunbus.com</email>
</author>
<published>2021-01-18T08:57:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=b9ac079abefc1f1cbee8a0f7195bad1d32dc72c7'/>
<id>b9ac079abefc1f1cbee8a0f7195bad1d32dc72c7</id>
<content type='text'>
To resume normal operation after a total power loss (no or empty
battery) the "Power-On Reset Override (PORO)" facility needs to be
disabled.

The register reset value sets the PORO enabled and the data sheet
recommends setting it to disabled for normal operation.

From what I've seen on the PCF2127 and PCF2129 there is no event
generated at the interrupt pin (INT), as long the PORO bit is set. This
behavior is not documented in the manual.

Signed-off-by: Philipp Rosenberger &lt;p.rosenberger@kunbus.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Link: https://lore.kernel.org/r/20210118085752.5759-2-p.rosenberger@kunbus.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
To resume normal operation after a total power loss (no or empty
battery) the "Power-On Reset Override (PORO)" facility needs to be
disabled.

The register reset value sets the PORO enabled and the data sheet
recommends setting it to disabled for normal operation.

From what I've seen on the PCF2127 and PCF2129 there is no event
generated at the interrupt pin (INT), as long the PORO bit is set. This
behavior is not documented in the manual.

Signed-off-by: Philipp Rosenberger &lt;p.rosenberger@kunbus.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Link: https://lore.kernel.org/r/20210118085752.5759-2-p.rosenberger@kunbus.com
</pre>
</div>
</content>
</entry>
</feed>
