<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/rtc/rtc-sysfs.c, branch v4.13-rc4</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: sysfs: make name uniform</title>
<updated>2017-06-03T08:52:04+00:00</updated>
<author>
<name>Alexandre Belloni</name>
<email>alexandre.belloni@free-electrons.com</email>
</author>
<published>2017-06-02T11:57:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=77a73f3caece06d1d17268f43ec39c5779e6ce24'/>
<id>77a73f3caece06d1d17268f43ec39c5779e6ce24</id>
<content type='text'>
The name sysfs attribute is not useful in its current form because of all
the drivers:
 - 3 are using the feature correctly
 - 2 are clearly misusing it
 - 60 are using driver.name, either directly or indirectly
 - 46 are using pdev-&gt;name
 - 8 are using client-&gt;name
 - 31 are using a variation of driver.name (addition or removal of rtc-,
   -rtc, _rtc, rtc_)

Make it uniform and use the driver name and the device name.

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 name sysfs attribute is not useful in its current form because of all
the drivers:
 - 3 are using the feature correctly
 - 2 are clearly misusing it
 - 60 are using driver.name, either directly or indirectly
 - 46 are using pdev-&gt;name
 - 8 are using client-&gt;name
 - 31 are using a variation of driver.name (addition or removal of rtc-,
   -rtc, _rtc, rtc_)

Make it uniform and use the driver name and the device name.

Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rtc: sysfs: fix a cast removing the const attribute</title>
<updated>2016-08-31T16:21:35+00:00</updated>
<author>
<name>LABBE Corentin</name>
<email>clabbe.montjoie@gmail.com</email>
</author>
<published>2016-08-12T12:46:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=84281c2d72a70456a3ba8d1e49548dd469f2e9d8'/>
<id>84281c2d72a70456a3ba8d1e49548dd469f2e9d8</id>
<content type='text'>
The char pointer buf_ptr is assigned an address from a const char
pointer buf (parameter of wakealarm_store).
The data pointer by buf_ptr is never modified.
So casting it to a (char *) is useless.

This patch remove this cast, and transform buf_ptr to a const char pointer.

Signed-off-by: LABBE Corentin &lt;clabbe.montjoie@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 char pointer buf_ptr is assigned an address from a const char
pointer buf (parameter of wakealarm_store).
The data pointer by buf_ptr is never modified.
So casting it to a (char *) is useless.

This patch remove this cast, and transform buf_ptr to a const char pointer.

Signed-off-by: LABBE Corentin &lt;clabbe.montjoie@gmail.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rtc: implement a sysfs interface for clock offset</title>
<updated>2016-03-14T16:08:16+00:00</updated>
<author>
<name>Joshua Clayton</name>
<email>stillcompiling@gmail.com</email>
</author>
<published>2016-02-05T20:41:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5495a4159f7413f0367e8c9727ba9facd40ade7f'/>
<id>5495a4159f7413f0367e8c9727ba9facd40ade7f</id>
<content type='text'>
clock offset may be set and read in decimal parts per billion
attribute is /sys/class/rtc/rtcN/offset
The attribute is only visible for rtcs that have set_offset implemented.

Signed-off-by: Joshua Clayton &lt;stillcompiling@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>
clock offset may be set and read in decimal parts per billion
attribute is /sys/class/rtc/rtcN/offset
The attribute is only visible for rtcs that have set_offset implemented.

Signed-off-by: Joshua Clayton &lt;stillcompiling@gmail.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rtc: Replace simple_strtoul by kstrtoul</title>
<updated>2016-01-11T19:20:02+00:00</updated>
<author>
<name>LABBE Corentin</name>
<email>clabbe.montjoie@gmail.com</email>
</author>
<published>2015-12-17T13:11:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f571287bda5390751ab4e4d5e3f54fa2d1788667'/>
<id>f571287bda5390751ab4e4d5e3f54fa2d1788667</id>
<content type='text'>
The simple_strtoul function is obsolete.
This patch replace it by kstrtoul.

Since kstrtoul is more strict, it permits to filter some invalid input that
simple_strtoul accept. For example:
echo '1022xxx' &gt; /sys/devices/pnp0/00:03/rtc/rtc0/max_user_freq
cat /sys/devices/pnp0/00:03/rtc/rtc0/max_user_freq
1022

Signed-off-by: LABBE Corentin &lt;clabbe.montjoie@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 simple_strtoul function is obsolete.
This patch replace it by kstrtoul.

Since kstrtoul is more strict, it permits to filter some invalid input that
simple_strtoul accept. For example:
echo '1022xxx' &gt; /sys/devices/pnp0/00:03/rtc/rtc0/max_user_freq
cat /sys/devices/pnp0/00:03/rtc/rtc0/max_user_freq
1022

Signed-off-by: LABBE Corentin &lt;clabbe.montjoie@gmail.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rtc: switch to using is_visible() to control sysfs attributes</title>
<updated>2015-09-05T11:19:07+00:00</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dmitry.torokhov@gmail.com</email>
</author>
<published>2015-07-23T23:01:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=3ee2c40b7ac2bf121aaa1176d8ac25b6a26e3a94'/>
<id>3ee2c40b7ac2bf121aaa1176d8ac25b6a26e3a94</id>
<content type='text'>
Instead of creating wakealarm attribute manually, after the device has been
registered, let's rely on facilities provided by the attribute groups to
control which attributes are visible and which are not. This allows to
create all needed attributes at once, at the same time that we register RTC
class device.

Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
Reviewed-by: Krzysztof Kozlowski &lt;k.kozlowski@samsung.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>
Instead of creating wakealarm attribute manually, after the device has been
registered, let's rely on facilities provided by the attribute groups to
control which attributes are visible and which are not. This allows to
create all needed attributes at once, at the same time that we register RTC
class device.

Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
Reviewed-by: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rtc: switch wakealarm attribute to DEVICE_ATTR_RW</title>
<updated>2015-09-05T11:19:07+00:00</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dmitry.torokhov@gmail.com</email>
</author>
<published>2015-07-23T23:01:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a17ccd1c6a327e5b468358e8352a6af004261473'/>
<id>a17ccd1c6a327e5b468358e8352a6af004261473</id>
<content type='text'>
Instead of using older style DEVICE_ATTR for wakealarm attribute let's
switch to using DEVICE_ATTR_RW that ensures consistent across the kernel
permissions on the attribute.

Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
Reviewed-by: Krzysztof Kozlowski &lt;k.kozlowski@samsung.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>
Instead of using older style DEVICE_ATTR for wakealarm attribute let's
switch to using DEVICE_ATTR_RW that ensures consistent across the kernel
permissions on the attribute.

Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
Reviewed-by: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rtc: make rtc_does_wakealarm() return boolean</title>
<updated>2015-09-05T11:19:07+00:00</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dmitry.torokhov@gmail.com</email>
</author>
<published>2015-07-23T23:01:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=df100c017ea9f1a6a517c3fba84f8507973c004e'/>
<id>df100c017ea9f1a6a517c3fba84f8507973c004e</id>
<content type='text'>
Users of rtc_does_wakealarm() return value treat it as boolean so let's
change the signature accordingly.

Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
Reviewed-by: Krzysztof Kozlowski &lt;k.kozlowski@samsung.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>
Users of rtc_does_wakealarm() return value treat it as boolean so let's
change the signature accordingly.

Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
Reviewed-by: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rtc: convert class code to use dev_groups</title>
<updated>2013-07-29T20:10:58+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2013-07-24T22:05:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f21e683508ead3ad8db7ffef3d8b5802c3b43e9a'/>
<id>f21e683508ead3ad8db7ffef3d8b5802c3b43e9a</id>
<content type='text'>
The dev_attrs field of struct class is going away soon, dev_groups
should be used instead.  This converts the rtc class code to use the
correct field.

Acked-by: Alessandro Zummo &lt;a.zummo@towertech.it&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>
The dev_attrs field of struct class is going away soon, dev_groups
should be used instead.  This converts the rtc class code to use the
correct field.

Acked-by: Alessandro Zummo &lt;a.zummo@towertech.it&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rtc: add ability to push out an existing wakealarm using sysfs</title>
<updated>2013-07-03T23:07:54+00:00</updated>
<author>
<name>Bernie Thompson</name>
<email>bhthompson@chromium.org</email>
</author>
<published>2013-07-03T22:07:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=1df0a4711f6e93c1073dd82f6e7905748842e2b3'/>
<id>1df0a4711f6e93c1073dd82f6e7905748842e2b3</id>
<content type='text'>
This adds the ability for the rtc sysfs code to handle += characters at
the beginning of a wakealarm setting string.  This will allow the user
to attempt to push out an existing wakealarm by a provided amount.

In the case that the += characters are provided but the alarm is not
active -EINVAL is returned.

his is useful, at least for my purposes in suspend/resume testing.  The
basic test goes something like:

1. Set a wake alarm from userspace 5 seconds in the future

2. Start the suspend process (echo mem &gt; /sys/power/state)

3. After ~2.5 seconds if userspace is still running (using another
   thread to check this), move the wake alarm 5 more seconds

If the "move" involves an unset of the wakealarm then there's a period
   of time where the system is midway through suspending but has no wake
   alarm.  It will get stuck.

We'd rather not remove the "move" since the idea is to avoid a cancelled
suspend when the alarm fires _during_ suspend.  It is difficult for the
test to tell the difference between a suspend that was cancelled because
the alarm fired too early and a suspend that was

Signed-off-by: Bernie Thompson &lt;bhthompson@chromium.org&gt;
Cc: Alessandro Zummo &lt;a.zummo@towertech.it&gt;
Cc: Doug Anderson &lt;dianders@chromium.org&gt;
Cc: "Rafael J. Wysocki" &lt;rjw@sisk.pl&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This adds the ability for the rtc sysfs code to handle += characters at
the beginning of a wakealarm setting string.  This will allow the user
to attempt to push out an existing wakealarm by a provided amount.

In the case that the += characters are provided but the alarm is not
active -EINVAL is returned.

his is useful, at least for my purposes in suspend/resume testing.  The
basic test goes something like:

1. Set a wake alarm from userspace 5 seconds in the future

2. Start the suspend process (echo mem &gt; /sys/power/state)

3. After ~2.5 seconds if userspace is still running (using another
   thread to check this), move the wake alarm 5 more seconds

If the "move" involves an unset of the wakealarm then there's a period
   of time where the system is midway through suspending but has no wake
   alarm.  It will get stuck.

We'd rather not remove the "move" since the idea is to avoid a cancelled
suspend when the alarm fires _during_ suspend.  It is difficult for the
test to tell the difference between a suspend that was cancelled because
the alarm fired too early and a suspend that was

Signed-off-by: Bernie Thompson &lt;bhthompson@chromium.org&gt;
Cc: Alessandro Zummo &lt;a.zummo@towertech.it&gt;
Cc: Doug Anderson &lt;dianders@chromium.org&gt;
Cc: "Rafael J. Wysocki" &lt;rjw@sisk.pl&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rtc_sysfs_show_hctosys(): display 0 if resume failed</title>
<updated>2012-10-05T18:05:04+00:00</updated>
<author>
<name>David Fries</name>
<email>david@fries.net</email>
</author>
<published>2012-10-05T00:14:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=4c24e29e65843ed912c14cdc293ed922e33efdcc'/>
<id>4c24e29e65843ed912c14cdc293ed922e33efdcc</id>
<content type='text'>
Without this patch /sys/class/rtc/$CONFIG_RTC_HCTOSYS_DEVICE/hctosys
contains a 1 (meaning "This rtc was used to initialize the system
clock") even if setting the time by do_settimeofday() at bootup failed.
The RTC can also be used to set the clock on resume, if it did 1,
otherwise 0.  Previously there was no indication if the RTC was used
to set the clock in resume.

This uses only CONFIG_RTC_HCTOSYS_DEVICE for conditional compilation
instead of it and CONFIG_RTC_HCTOSYS to be more consistent.
rtc_hctosys_ret was moved to class.c so class.c no longer depends on
hctosys.c.

[sfr@canb.auug.org.au: fix build]
Signed-off-by: David Fries &lt;David@Fries.net&gt;
Cc: Matthew Garrett &lt;mjg@redhat.com&gt;
Cc: Alessandro Zummo &lt;a.zummo@towertech.it&gt;
Cc: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Signed-off-by: Stephen Rothwell &lt;sfr@canb.auug.org.au&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Without this patch /sys/class/rtc/$CONFIG_RTC_HCTOSYS_DEVICE/hctosys
contains a 1 (meaning "This rtc was used to initialize the system
clock") even if setting the time by do_settimeofday() at bootup failed.
The RTC can also be used to set the clock on resume, if it did 1,
otherwise 0.  Previously there was no indication if the RTC was used
to set the clock in resume.

This uses only CONFIG_RTC_HCTOSYS_DEVICE for conditional compilation
instead of it and CONFIG_RTC_HCTOSYS to be more consistent.
rtc_hctosys_ret was moved to class.c so class.c no longer depends on
hctosys.c.

[sfr@canb.auug.org.au: fix build]
Signed-off-by: David Fries &lt;David@Fries.net&gt;
Cc: Matthew Garrett &lt;mjg@redhat.com&gt;
Cc: Alessandro Zummo &lt;a.zummo@towertech.it&gt;
Cc: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Signed-off-by: Stephen Rothwell &lt;sfr@canb.auug.org.au&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
