<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/rtc/rtc-ds3232.c, branch v4.9.64</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>rtc: simplify implementations of read_alarm</title>
<updated>2016-07-09T08:24:45+00:00</updated>
<author>
<name>Uwe Kleine-König</name>
<email>uwe@kleine-koenig.org</email>
</author>
<published>2016-06-28T08:43:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=56d86a7e799d3d893cb96f5b17b13de134af8de5'/>
<id>56d86a7e799d3d893cb96f5b17b13de134af8de5</id>
<content type='text'>
Since commit d68778b80dd7 ("rtc: initialize output parameter for read
alarm to "uninitialized"") there is no need to explicitly set
unsupported members to -1. So drop the respective assignments from
drivers.

Signed-off-by: Uwe Kleine-König &lt;uwe@kleine-koenig.org&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since commit d68778b80dd7 ("rtc: initialize output parameter for read
alarm to "uninitialized"") there is no need to explicitly set
unsupported members to -1. So drop the respective assignments from
drivers.

Signed-off-by: Uwe Kleine-König &lt;uwe@kleine-koenig.org&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rtc: ds3232: fix call trace when rtc-&gt;ops_lock is used as NULL</title>
<updated>2016-05-20T10:33:51+00:00</updated>
<author>
<name>Qianyu Gong</name>
<email>qianyu.gong@nxp.com</email>
</author>
<published>2016-04-21T06:55:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b4b77f3c280e38cec178f81d7a4d7e65f4045913'/>
<id>b4b77f3c280e38cec178f81d7a4d7e65f4045913</id>
<content type='text'>
The rtc-&gt;ops_lock would be accessed in ds3232_irq() without being
initialized as rtc_device_register() is called too late.

So move devm_rtc_device_register() just before registering irq handler
to initialize rtc-&gt;ops_lock earlier.

Signed-off-by: Gong Qianyu &lt;Qianyu.Gong@nxp.com&gt;
Reviewed-by: Akinobu Mita &lt;akinobu.mita@gmail.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The rtc-&gt;ops_lock would be accessed in ds3232_irq() without being
initialized as rtc_device_register() is called too late.

So move devm_rtc_device_register() just before registering irq handler
to initialize rtc-&gt;ops_lock earlier.

Signed-off-by: Gong Qianyu &lt;Qianyu.Gong@nxp.com&gt;
Reviewed-by: Akinobu Mita &lt;akinobu.mita@gmail.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rtc: ds3232: use rtc-&gt;ops_lock to protect alarm operations</title>
<updated>2016-03-14T16:08:38+00:00</updated>
<author>
<name>Akinobu Mita</name>
<email>akinobu.mita@gmail.com</email>
</author>
<published>2016-03-06T15:27:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=fc1dcb0b39dbb10d3290f2fcd6e154670f699166'/>
<id>fc1dcb0b39dbb10d3290f2fcd6e154670f699166</id>
<content type='text'>
ds3232-&gt;mutex is used to protect for alarm operations which
need to access status and control registers.

But we can use rtc-&gt;ops_lock instead.  rtc-&gt;ops_lock is held when most
of rtc_class_ops methods are called, so we only need to explicitly
acquire it from irq handler in order to protect form concurrent
accesses.

Signed-off-by: Akinobu Mita &lt;akinobu.mita@gmail.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ds3232-&gt;mutex is used to protect for alarm operations which
need to access status and control registers.

But we can use rtc-&gt;ops_lock instead.  rtc-&gt;ops_lock is held when most
of rtc_class_ops methods are called, so we only need to explicitly
acquire it from irq handler in order to protect form concurrent
accesses.

Signed-off-by: Akinobu Mita &lt;akinobu.mita@gmail.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rtc: ds3232: fix issue when irq is shared several devices</title>
<updated>2016-03-14T16:08:37+00:00</updated>
<author>
<name>Akinobu Mita</name>
<email>akinobu.mita@gmail.com</email>
</author>
<published>2016-03-06T15:27:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=95c60c1c8f51521e7f2174fd0fff4dae6d522b83'/>
<id>95c60c1c8f51521e7f2174fd0fff4dae6d522b83</id>
<content type='text'>
ds3232-core requests irq with IRQF_SHARED, so irq can be shared by
several devices.  But the irq handler for ds3232 unconditionally
disables the irq at first and the irq is re-enabled only when the
interrupt source was the ds3232's alarm.  This behaviour breaks the
devices sharing the same irq in the various scenarios.

This converts to use threaded irq and remove outdated code in
suspend/resume paths.

Signed-off-by: Akinobu Mita &lt;akinobu.mita@gmail.com&gt;
Suggested-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ds3232-core requests irq with IRQF_SHARED, so irq can be shared by
several devices.  But the irq handler for ds3232 unconditionally
disables the irq at first and the irq is re-enabled only when the
interrupt source was the ds3232's alarm.  This behaviour breaks the
devices sharing the same irq in the various scenarios.

This converts to use threaded irq and remove outdated code in
suspend/resume paths.

Signed-off-by: Akinobu Mita &lt;akinobu.mita@gmail.com&gt;
Suggested-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rtc: ds3232: remove unused UIE code</title>
<updated>2016-03-14T16:08:37+00:00</updated>
<author>
<name>Akinobu Mita</name>
<email>akinobu.mita@gmail.com</email>
</author>
<published>2016-03-06T15:27:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7522297e1638f985e5d52f34b871e742b10586d4'/>
<id>7522297e1638f985e5d52f34b871e742b10586d4</id>
<content type='text'>
UIE mode irqs are handled by the generic rtc core now.  But there are
remaining unused code fragments for it.

Signed-off-by: Akinobu Mita &lt;akinobu.mita@gmail.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
UIE mode irqs are handled by the generic rtc core now.  But there are
remaining unused code fragments for it.

Signed-off-by: Akinobu Mita &lt;akinobu.mita@gmail.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rtc: ds3232: add register access error checks</title>
<updated>2016-03-14T16:08:36+00:00</updated>
<author>
<name>Akinobu Mita</name>
<email>akinobu.mita@gmail.com</email>
</author>
<published>2016-03-06T15:27:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7b4393a62f784bdd295c397c640cd93238ded0be'/>
<id>7b4393a62f784bdd295c397c640cd93238ded0be</id>
<content type='text'>
Add missing register access error checks and make it return error code
or print error message.

Signed-off-by: Akinobu Mita &lt;akinobu.mita@gmail.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add missing register access error checks and make it return error code
or print error message.

Signed-off-by: Akinobu Mita &lt;akinobu.mita@gmail.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rtc: ds3232: fix read on /dev/rtc after RTC_AIE_ON</title>
<updated>2016-03-14T16:08:36+00:00</updated>
<author>
<name>Akinobu Mita</name>
<email>akinobu.mita@gmail.com</email>
</author>
<published>2016-03-06T15:27:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=dfc2532b55a4989930d0d67cdf83da9ccb2a1b5b'/>
<id>dfc2532b55a4989930d0d67cdf83da9ccb2a1b5b</id>
<content type='text'>
The rtctest (tools/testing/selftests/timers/rtctest.c) found that
reading ds3232 rtc device immediately return the value 0x20 (RTC_AF)
without waiting alarm interrupt.

This is because alarm_irq_enable() of ds3232 driver changes RTC_AF
flag in rtc-&gt;irq_data.  So calling ioctl with RTC_AIE_ON generates
invalid value in rtc device.

The lower-level driver should not touch rtc-&gt;irq_data directly.

Signed-off-by: Akinobu Mita &lt;akinobu.mita@gmail.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The rtctest (tools/testing/selftests/timers/rtctest.c) found that
reading ds3232 rtc device immediately return the value 0x20 (RTC_AF)
without waiting alarm interrupt.

This is because alarm_irq_enable() of ds3232 driver changes RTC_AF
flag in rtc-&gt;irq_data.  So calling ioctl with RTC_AIE_ON generates
invalid value in rtc device.

The lower-level driver should not touch rtc-&gt;irq_data directly.

Signed-off-by: Akinobu Mita &lt;akinobu.mita@gmail.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rtc: merge ds3232 and ds3234</title>
<updated>2016-03-14T16:08:35+00:00</updated>
<author>
<name>Akinobu Mita</name>
<email>akinobu.mita@gmail.com</email>
</author>
<published>2016-03-06T15:27:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=080481f54ef621211d6c75a03dc652fb6ed04222'/>
<id>080481f54ef621211d6c75a03dc652fb6ed04222</id>
<content type='text'>
According to "Feature Comparison of the DS323x Real-Time Clocks"
(http://pdfserv.maximintegrated.com/en/an/AN5143.pdf), DS3232 and
DS3234 are very similar.

This merges rtc-ds3232 and rtc-ds3234 with using regmap.
This change also enables to support alarm for ds3234.

Signed-off-by: Akinobu Mita &lt;akinobu.mita@gmail.com&gt;
Suggested-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
According to "Feature Comparison of the DS323x Real-Time Clocks"
(http://pdfserv.maximintegrated.com/en/an/AN5143.pdf), DS3232 and
DS3234 are very similar.

This merges rtc-ds3232 and rtc-ds3234 with using regmap.
This change also enables to support alarm for ds3234.

Signed-off-by: Akinobu Mita &lt;akinobu.mita@gmail.com&gt;
Suggested-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rtc: ds3232: convert to use regmap</title>
<updated>2016-03-14T16:08:35+00:00</updated>
<author>
<name>Akinobu Mita</name>
<email>akinobu.mita@gmail.com</email>
</author>
<published>2016-03-06T15:27:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=370927c4b651539c65dd8d17dd5079526cd8401d'/>
<id>370927c4b651539c65dd8d17dd5079526cd8401d</id>
<content type='text'>
This is preparation for merging rtc-ds3232 i2c driver and rtc-ds3234
spi driver.

Signed-off-by: Akinobu Mita &lt;akinobu.mita@gmail.com&gt;
Cc: Alessandro Zummo &lt;a.zummo@towertech.it&gt;
Cc: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
Cc: Dennis Aberilla &lt;denzzzhome@yahoo.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is preparation for merging rtc-ds3232 i2c driver and rtc-ds3234
spi driver.

Signed-off-by: Akinobu Mita &lt;akinobu.mita@gmail.com&gt;
Cc: Alessandro Zummo &lt;a.zummo@towertech.it&gt;
Cc: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
Cc: Dennis Aberilla &lt;denzzzhome@yahoo.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rtc: ds3232: fix WARNING trace in resume function</title>
<updated>2015-09-05T17:36:21+00:00</updated>
<author>
<name>Wang Dongsheng</name>
<email>dongsheng.wang@freescale.com</email>
</author>
<published>2015-08-12T09:14:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=dc2280ebf45bfa4fbc4b1588a6642aa33454a9b8'/>
<id>dc2280ebf45bfa4fbc4b1588a6642aa33454a9b8</id>
<content type='text'>
If ds3232 work on some platform that is not implementing
irq_set_wake, ds3232 will get a WARNING trace in resume.
So fix ds3232-&gt;suspended state to false when irq_set_irq_wake
return error.

WARNING: CPU: 0 PID: 729 at kernel/irq/manage.c:604 irq_set_irq_wake+0x4b/0x8c()
Unbalanced IRQ 201 wake disable
Modules linked in:
CPU: 0 PID: 729 Comm: sh Not tainted 3.12.19-rt30+ #25
[&lt;800107d9&gt;] (unwind_backtrace+0x1/0x88) from [&lt;8000e4ef&gt;] (show_stack+0xb/0xc)
[&lt;8000e4ef&gt;] (show_stack+0xb/0xc) from [&lt;802b5fa9&gt;] (dump_stack+0x4d/0x60)
[&lt;802b5fa9&gt;] (dump_stack+0x4d/0x60) from [&lt;800186dd&gt;] (warn_slowpath_common+0x45/0x64)
[&lt;800186dd&gt;] (warn_slowpath_common+0x45/0x64) from [&lt;80018717&gt;] (warn_slowpath_fmt+0x1b/0x24)
[&lt;80018717&gt;] (warn_slowpath_fmt+0x1b/0x24) from [&lt;8003a8d3&gt;] (irq_set_irq_wake+0x4b/0x8c)
[&lt;8003a8d3&gt;] (irq_set_irq_wake+0x4b/0x8c) from [&lt;80204fcb&gt;] (ds3232_resume+0x2d/0x36)
[&lt;80204fcb&gt;] (ds3232_resume+0x2d/0x36) from [&lt;801954c7&gt;] (dpm_run_callback.isra.13+0xb/0x28)
[&lt;801954c7&gt;] (dpm_run_callback.isra.13+0xb/0x28) from [&lt;80195b1b&gt;] (device_resume+0x7b/0xa2)
[&lt;80195b1b&gt;] (device_resume+0x7b/0xa2) from [&lt;80195f0f&gt;] (dpm_resume+0xbb/0x19c)
[&lt;80195f0f&gt;] (dpm_resume+0xbb/0x19c) from [&lt;801960d9&gt;] (dpm_resume_end+0x9/0x12)
[&lt;801960d9&gt;] (dpm_resume_end+0x9/0x12) from [&lt;80037e1d&gt;] (suspend_devices_and_enter+0x17d/0x1d0)
[&lt;80037e1d&gt;] (suspend_devices_and_enter+0x17d/0x1d0) from [&lt;80037ee1&gt;] (pm_suspend+0x71/0x128)
[&lt;80037ee1&gt;] (pm_suspend+0x71/0x128) from [&lt;80037449&gt;] (state_store+0x6d/0x80)
[&lt;80037449&gt;] (state_store+0x6d/0x80) from [&lt;800af4d5&gt;] (sysfs_write_file+0x9f/0xde)
[&lt;800af4d5&gt;] (sysfs_write_file+0x9f/0xde) from [&lt;8007a437&gt;] (vfs_write+0x7b/0x104)
[&lt;8007a437&gt;] (vfs_write+0x7b/0x104) from [&lt;8007a7f7&gt;] (SyS_write+0x27/0x48)
[&lt;8007a7f7&gt;] (SyS_write+0x27/0x48) from [&lt;8000c121&gt;] (ret_fast_syscall+0x1/0x44)

Signed-off-by: Wang Dongsheng &lt;dongsheng.wang@freescale.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If ds3232 work on some platform that is not implementing
irq_set_wake, ds3232 will get a WARNING trace in resume.
So fix ds3232-&gt;suspended state to false when irq_set_irq_wake
return error.

WARNING: CPU: 0 PID: 729 at kernel/irq/manage.c:604 irq_set_irq_wake+0x4b/0x8c()
Unbalanced IRQ 201 wake disable
Modules linked in:
CPU: 0 PID: 729 Comm: sh Not tainted 3.12.19-rt30+ #25
[&lt;800107d9&gt;] (unwind_backtrace+0x1/0x88) from [&lt;8000e4ef&gt;] (show_stack+0xb/0xc)
[&lt;8000e4ef&gt;] (show_stack+0xb/0xc) from [&lt;802b5fa9&gt;] (dump_stack+0x4d/0x60)
[&lt;802b5fa9&gt;] (dump_stack+0x4d/0x60) from [&lt;800186dd&gt;] (warn_slowpath_common+0x45/0x64)
[&lt;800186dd&gt;] (warn_slowpath_common+0x45/0x64) from [&lt;80018717&gt;] (warn_slowpath_fmt+0x1b/0x24)
[&lt;80018717&gt;] (warn_slowpath_fmt+0x1b/0x24) from [&lt;8003a8d3&gt;] (irq_set_irq_wake+0x4b/0x8c)
[&lt;8003a8d3&gt;] (irq_set_irq_wake+0x4b/0x8c) from [&lt;80204fcb&gt;] (ds3232_resume+0x2d/0x36)
[&lt;80204fcb&gt;] (ds3232_resume+0x2d/0x36) from [&lt;801954c7&gt;] (dpm_run_callback.isra.13+0xb/0x28)
[&lt;801954c7&gt;] (dpm_run_callback.isra.13+0xb/0x28) from [&lt;80195b1b&gt;] (device_resume+0x7b/0xa2)
[&lt;80195b1b&gt;] (device_resume+0x7b/0xa2) from [&lt;80195f0f&gt;] (dpm_resume+0xbb/0x19c)
[&lt;80195f0f&gt;] (dpm_resume+0xbb/0x19c) from [&lt;801960d9&gt;] (dpm_resume_end+0x9/0x12)
[&lt;801960d9&gt;] (dpm_resume_end+0x9/0x12) from [&lt;80037e1d&gt;] (suspend_devices_and_enter+0x17d/0x1d0)
[&lt;80037e1d&gt;] (suspend_devices_and_enter+0x17d/0x1d0) from [&lt;80037ee1&gt;] (pm_suspend+0x71/0x128)
[&lt;80037ee1&gt;] (pm_suspend+0x71/0x128) from [&lt;80037449&gt;] (state_store+0x6d/0x80)
[&lt;80037449&gt;] (state_store+0x6d/0x80) from [&lt;800af4d5&gt;] (sysfs_write_file+0x9f/0xde)
[&lt;800af4d5&gt;] (sysfs_write_file+0x9f/0xde) from [&lt;8007a437&gt;] (vfs_write+0x7b/0x104)
[&lt;8007a437&gt;] (vfs_write+0x7b/0x104) from [&lt;8007a7f7&gt;] (SyS_write+0x27/0x48)
[&lt;8007a7f7&gt;] (SyS_write+0x27/0x48) from [&lt;8000c121&gt;] (ret_fast_syscall+0x1/0x44)

Signed-off-by: Wang Dongsheng &lt;dongsheng.wang@freescale.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
