]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commit
rtc: honor device tree /alias entries when assigning IDs
authorStephen Warren <swarren@nvidia.com>
Thu, 23 Jan 2014 23:55:14 +0000 (15:55 -0800)
committermobile promotions <svcmobile_promotions@nvidia.com>
Wed, 24 Feb 2016 01:35:54 +0000 (17:35 -0800)
commit7d698628c89648df4c8d2bddb9e9c2c4a47f7379
tree8c4ccc3b66337d457b42b2c7af367602600318b1
parentc499a3cdf61231452e181eed3aa2691f0bf071cf
rtc: honor device tree /alias entries when assigning IDs

Assign RTC device IDs based on device tree /aliases entries if present,
falling back to the existing numbering scheme if there is no /aliases
entry (which includes when the system isn't booted using DT), or there is
a numbering conflict.

This is useful in systems with multiple RTC devices, to ensure that the
best RTC device is selected as /dev/rtc0, which provides the overall
system time.

For example, Tegra has an on-SoC RTC that is not battery backed, typically
coupled with an off-SoC RTC that is battery backed.  Only the latter is
useful for populating the system time, yet the former is useful e.g.  for
wakeup timing, since the time is not lost when the system is sleeps.

Change-Id: I64806f3c908e36e0565fe80968e338c2e915c255
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 9d2b7e532da8aadfcc1bd85b62ec5dd853e870e3 in mainline v3.14)
Signed-off-by: Krishna Yarlagadda <kyarlagadda@nvidia.com>
Reviewed-on: http://git-master/r/1012786
GVS: Gerrit_Virtual_Submit
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
drivers/rtc/class.c