06 Sep, 2015
2 commits
-
Configure the clock source to external clock if available.
External clock is preferred as it can be ticking during suspend.Signed-off-by: Keerthy
Acked-by: Tony Lindgren
Signed-off-by: Alexandre Belloni -
The rtc can be clocked by an internal 32K clock. Adding the support
to enable the same.Signed-off-by: Keerthy
Acked-by: Tony Lindgren
Signed-off-by: Alexandre Belloni
17 Apr, 2015
2 commits
-
module_platform_driver_probe() prevents driver from requesting probe
deferral. So using module_platform_drive() to support probe deferral.Signed-off-by: Lokesh Vutla
Acked-by: Alexandre Belloni
Cc: Alessandro Zummo
Cc: Paul Walmsley
Cc: Tero Kristo
Cc: Sekhar Nori
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
RTC module contains a kicker mechanism to prevent any spurious writes from
changing the register values. This mechanism requires two MMR writes to
the KICK0 and KICK1 registers with exact data values before the kicker
lock mechanism is released.Currently the driver release the lock in the probe and leaves it enabled
until the rtc driver removal. This eliminates the idea of preventing
spurious writes when RTC driver is loaded. So implement rtc lock and
unlock functions before and after register writes.This is as advised by Paul to implement lock and unlock functions in the
driver and not to unlock and leave it in probe. The same discussion can
be seen here:
http://www.mail-archive.com/linux-omap%40vger.kernel.org/msg111588.htmlSigned-off-by: Lokesh Vutla
Acked-by: Alexandre Belloni
Cc: Alessandro Zummo
Cc: Paul Walmsley
Cc: Tero Kristo
Cc: Sekhar Nori
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
15 Dec, 2014
1 commit
-
Pull driver core update from Greg KH:
"Here's the set of driver core patches for 3.19-rc1.They are dominated by the removal of the .owner field in platform
drivers. They touch a lot of files, but they are "simple" changes,
just removing a line in a structure.Other than that, a few minor driver core and debugfs changes. There
are some ath9k patches coming in through this tree that have been
acked by the wireless maintainers as they relied on the debugfs
changes.Everything has been in linux-next for a while"
* tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (324 commits)
Revert "ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries"
fs: debugfs: add forward declaration for struct device type
firmware class: Deletion of an unnecessary check before the function call "vunmap"
firmware loader: fix hung task warning dump
devcoredump: provide a one-way disable function
device: Add dev__once variants
ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries
ath: use seq_file api for ath9k debugfs files
debugfs: add helper function to create device related seq_file
drivers/base: cacheinfo: remove noisy error boot message
Revert "core: platform: add warning if driver has no owner"
drivers: base: support cpu cache information interface to userspace via sysfs
drivers: base: add cpu_device_create to support per-cpu devices
topology: replace custom attribute macros with standard DEVICE_ATTR*
cpumask: factor out show_cpumap into separate helper function
driver core: Fix unbalanced device reference in drivers_probe
driver core: fix race with userland in device_add()
sysfs/kernfs: make read requests on pre-alloc files use the buffer.
sysfs/kernfs: allow attributes to request write buffer be pre-allocated.
fs: sysfs: return EGBIG on write if offset is larger than file size
...
11 Dec, 2014
19 commits
-
Drop the vendor-prefix from the "ti,system-power-controller" device-tree
property name.It has been agreed to make "system-power-controller" a standard property
and to drop the vendor-prefix that is currently used by several drivers.Note that drivers that have used ",system-power-controller" in a
released kernel will need to support both versions.Signed-off-by: Johan Hovold
Cc: Tony Lindgren
Cc: Benot Cousson
Cc: Alessandro Zummo
Cc: Felipe Balbi
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Add myself to the list of copyright holders.
Signed-off-by: Johan Hovold
Cc: Alessandro Zummo
Cc: Tony Lindgren
Cc: Benot Cousson
Cc: Lokesh Vutla
Cc: Guenter Roeck
Cc: Sekhar Nori
Cc: Tero Kristo
Cc: Keerthy J
Tested-by: Felipe Balbi
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Fix minor coding style issues like comment style, indentation and remove
a few unnecessary casts.Also drop the 1 from OMAP1 in the driver description.
Signed-off-by: Johan Hovold
Cc: Alessandro Zummo
Cc: Tony Lindgren
Cc: Benot Cousson
Cc: Lokesh Vutla
Cc: Guenter Roeck
Cc: Sekhar Nori
Cc: Tero Kristo
Cc: Keerthy J
Tested-by: Felipe Balbi
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
The ALARM interrupt must not be disabled during shutdown in order to be
able to power up the system using an RTC alarm.Signed-off-by: Johan Hovold
Cc: Alessandro Zummo
Cc: Tony Lindgren
Cc: Benot Cousson
Cc: Lokesh Vutla
Cc: Guenter Roeck
Cc: Sekhar Nori
Cc: Tero Kristo
Cc: Keerthy J
Tested-by: Felipe Balbi
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Add new property "ti,system-power-controller" to register the RTC as a
power-off handler.Some RTC IP revisions can control an external PMIC via the pmic_power_en
pin, which can be configured to transition to OFF on ALARM2 events and
back to ON on subsequent ALARM (wakealarm) events.This is based on earlier work by Colin Foe-Parker and AnilKumar Ch. [1]
[1] https://www.mail-archive.com/linux-omap@vger.kernel.org/msg82127.html
[akpm@linux-foundation.org: add comment]
Signed-off-by: Johan Hovold
Cc: Colin Foe-Parker
Cc: AnilKumar Ch
Cc: Alessandro Zummo
Cc: Tony Lindgren
Cc: Benot Cousson
Cc: Lokesh Vutla
Cc: Guenter Roeck
Cc: Sekhar Nori
Cc: Tero Kristo
Cc: Keerthy J
Tested-by: Felipe Balbi
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Add helper to read full register width.
Signed-off-by: Johan Hovold
Cc: Alessandro Zummo
Cc: Tony Lindgren
Cc: Benot Cousson
Cc: Lokesh Vutla
Cc: Guenter Roeck
Cc: Sekhar Nori
Cc: Tero Kristo
Cc: Keerthy J
Tested-by: Felipe Balbi
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Add helper to read raw BCD time that can be used in interrupt context.
Signed-off-by: Johan Hovold
Cc: Alessandro Zummo
Cc: Tony Lindgren
Cc: Benot Cousson
Cc: Lokesh Vutla
Cc: Guenter Roeck
Cc: Sekhar Nori
Cc: Tero Kristo
Cc: Keerthy J
Tested-by: Felipe Balbi
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Some legacy RTC IP revisions has a power-up reset flag in the status
register that later revisions lack.As this flag is always read back as set on later revisions (or is
overloaded with a different flag), make sure to only clear the flag and
print the info message on legacy platforms.Signed-off-by: Johan Hovold
Cc: Alessandro Zummo
Cc: Tony Lindgren
Cc: Benot Cousson
Cc: Lokesh Vutla
Cc: Guenter Roeck
Cc: Sekhar Nori
Cc: Tero Kristo
Cc: Keerthy J
Tested-by: Felipe Balbi
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Add structured device-type info to encode IP-block revision differences.
Signed-off-by: Johan Hovold
Cc: Alessandro Zummo
Cc: Tony Lindgren
Cc: Benot Cousson
Cc: Lokesh Vutla
Cc: Guenter Roeck
Cc: Sekhar Nori
Cc: Tero Kristo
Cc: Keerthy J
Tested-by: Felipe Balbi
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Remove DRIVER_NAME macro which was used for unrelated strings (e.g.
id-table entry and module name), but not for related ones (e.g. module
name and alias).Also move the module alias to the other module-info entries.
Signed-off-by: Johan Hovold
Cc: Alessandro Zummo
Cc: Tony Lindgren
Cc: Benot Cousson
Cc: Lokesh Vutla
Cc: Guenter Roeck
Cc: Sekhar Nori
Cc: Tero Kristo
Tested-by: Felipe Balbi
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Add struct omap_rtc to hold previously global data as well as the
IP-block feature flags.Also convert the register-access macros to proper inline helper functions.
Signed-off-by: Johan Hovold
Cc: Alessandro Zummo
Cc: Tony Lindgren
Cc: Benot Cousson
Cc: Lokesh Vutla
Cc: Guenter Roeck
Cc: Sekhar Nori
Cc: Tero Kristo
Cc: Keerthy J
Tested-by: Felipe Balbi
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Make platform-device id table const.
Signed-off-by: Johan Hovold
Cc: Alessandro Zummo
Cc: Tony Lindgren
Cc: Benot Cousson
Cc: Lokesh Vutla
Cc: Guenter Roeck
Cc: Sekhar Nori
Cc: Tero Kristo
Cc: Keerthy J
Tested-by: Felipe Balbi
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Use dev_info rather than pr_info.
Signed-off-by: Johan Hovold
Cc: Alessandro Zummo
Cc: Tony Lindgren
Cc: Benot Cousson
Cc: Lokesh Vutla
Cc: Guenter Roeck
Cc: Sekhar Nori
Cc: Tero Kristo
Cc: Keerthy J
Tested-by: Felipe Balbi
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Remove register-base define, which is no longer used.
Signed-off-by: Johan Hovold
Cc: Alessandro Zummo
Cc: Tony Lindgren
Cc: Benot Cousson
Cc: Lokesh Vutla
Cc: Guenter Roeck
Cc: Sekhar Nori
Cc: Tero Kristo
Cc: Keerthy J
Tested-by: Felipe Balbi
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Make sure not to register the class device until after the device has
been configured.Currently, the device is not fully configured (e.g. 24-hour mode) when
the class device is registered, something which involves driver
callbacks for example to read the current time.Signed-off-by: Johan Hovold
Cc: Alessandro Zummo
Cc: Tony Lindgren
Cc: Benot Cousson
Cc: Lokesh Vutla
Cc: Guenter Roeck
Cc: Sekhar Nori
Cc: Tero Kristo
Cc: Keerthy J
Tested-by: Felipe Balbi
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Remove some debug messages and return errors from subsystems rather than
always fail with -EIO.Note that the class-registration error has already been logged by rtc
core.Signed-off-by: Johan Hovold
Cc: Alessandro Zummo
Cc: Tony Lindgren
Cc: Benot Cousson
Cc: Lokesh Vutla
Cc: Guenter Roeck
Cc: Sekhar Nori
Cc: Tero Kristo
Cc: Keerthy J
Tested-by: Felipe Balbi
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Use writel instead of writeb when disabling interrupts at probe as
ALARM2 is not cleared otherwise on some IP-block revisions (e.g.
AM3352).Note that the driver currently never enables the ALARM2 interrupt.
Signed-off-by: Johan Hovold
Cc: Alessandro Zummo
Cc: Tony Lindgren
Cc: Benot Cousson
Cc: Lokesh Vutla
Cc: Guenter Roeck
Cc: Sekhar Nori
Cc: Tero Kristo
Cc: Keerthy J
Tested-by: Felipe Balbi
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
The platform device must be registered as wakeup capable before
registering the class device, or the wakealarm attribute will not be
created.Also make sure to unregister the wakeup source on probe errors.
Fixes: 1d2e2b65d098 ("rtc: omap: restore back (hard-code) wakeup support")
Signed-off-by: Johan Hovold
Reviewed-by: Felipe Balbi
Tested-by: Felipe Balbi
Cc: Alessandro Zummo
Cc: Tony Lindgren
Cc: Benot Cousson
Cc: Lokesh Vutla
Cc: Guenter Roeck
Cc: Sekhar Nori
Cc: Tero Kristo
Cc: Keerthy J
Cc:
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
This series fixes a few issues with the omap rtc-driver, cleans up a
bit, adds device abstraction, and finally adds support for the PMIC
control feature found in some revisions of this RTC IP block.Ultimately, this allows for powering off the Beaglebone and waking it up
again on RTC alarms.This patch (of 20):
Make sure not to reset the clock-source configuration when enabling the
32kHz clock mux.Until the clock source can be configured through device tree we must not
overwrite settings made by the bootloader (e.g. clock-source
selection).Fixes: cd914bba03d8 ("drivers/rtc/rtc-omap.c: add support for enabling 32khz clock")
Signed-off-by: Johan Hovold
Reviewed-by: Felipe Balbi
Tested-by: Felipe Balbi
Cc: Alessandro Zummo
Cc: Tony Lindgren
Cc: Benot Cousson
Cc: Lokesh Vutla
Cc: Guenter Roeck
Cc: Sekhar Nori
Cc: Tero Kristo
Cc: Keerthy J
Cc:
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
20 Oct, 2014
1 commit
-
A platform_driver does not need to set an owner, it will be populated by the
driver core.Signed-off-by: Wolfram Sang
07 Jun, 2014
4 commits
-
When RTC CLKTRCTRL bit is configured in HW_AUTO, module goes to sleep in
IDLE state.The Alarm SWakeup event can be used to wakeup the RTC when it is in IDLE
state. In order to do so, the alarm needs to be set and enabled before
RTC enters the IDLE state. Also the wakeup generation for alarm/timer
event needs to be set (bits [1:0] in RTC_IRQWAKEEN register).Currently RTC_IRQWAKEEN bits are set only in suspend/resume paths. With
this ALARM interrupts are not generated when it enters IDLE state. So
programming the RTC_IRQWAKEEN bits when ever ALARM is set.Signed-off-by: Lokesh Vutla
Acked-by: Sekhar Nori
Cc: Grant Likely
Cc: Rob Herring
Cc: Alessandro Zummo
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Newer versions of OMAP RTC IP such as those found in AM335x and DRA7x
need an explicit enable of 32khz functional clock which ticks the RTC.AM335x support was working so far because of settings done in U-Boot.
However, the DRA7x U-Boot does no such enable of 32khz clock and this
patch is need to get the RTC to work on DRA7x at least. In general, it
is better to not depend on settings done in U-Boot.Thanks to Lokesh Vutla for noticing this.
Signed-off-by: Sekhar Nori
Cc: Alessandro Zummo
Cc: Lokesh Vutla
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Use BIT() macro for RTC_HAS_ defines instead of hand-writing
bit masks.Use BIT() macros for register bit field definitions.
While at it, fix indentation done using spaces.
No functional change in this patch.
Signed-off-by: Sekhar Nori
Cc: Alessandro Zummo
Cc: Lokesh Vutla
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Remove multiple superfluous device id checks. Since an id_table is
present in the driver probe() should never encounter an empty device id
entry. In case of OF style match, of_match_device() returns an matching
entry.For paranoia sake, check for device id entry once and fail probe() if none
is found. This is much better than checking for it multiple times.Signed-off-by: Sekhar Nori
Cc: Alessandro Zummo
Cc: Lokesh Vutla
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
13 Nov, 2013
1 commit
-
The data structure of_match_ptr() protects is always compiled in.
Hence of_match_ptr() is not needed.Signed-off-by: Sachin Kamat
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
12 Sep, 2013
1 commit
-
On some platforms (like AM33xx), a special register (RTC_IRQWAKEEN) is
available to enable Alarm Wakeup feature. This register needs to be
properly handled for the rtcwake to work properly.Platforms using such IP should set "ti,am3352-rtc" in rtc device dt
compatibility node.Signed-off-by: Hebbar Gururaja
Acked-by: Kevin Hilman
Acked-by: Sekhar Nori
Cc: Grant Likely
Cc: Rob Herring
Cc: Rob Landley
Cc: Alessandro Zummo
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
04 Jul, 2013
2 commits
-
rtc-omap driver modules is used both by OMAP1/2, Davinci SoC platforms.
However, rtc wake support on OMAP1 is broken. Hence the
device_init_wakeup() was removed from rtc-omap driver and moved to
platform board files that supported it (DA850/OMAP-L138). [1]However, recently [2] it was suggested that driver should always do a
device_init_wakeup(dev, true). Platforms that don't want/need
wakeup support can disable it from userspace via:echo disabled > /sys/devices/.../power/wakeup
Also, with the new DT boot-up, board file doesn't exist and hence there
is no way to have device wakeup support rtc.The fix for above issues, is to hard code device_init_wakeup() inside
driver and let platforms that don't need this, handle it through the
sysfs power entry.[1]
https://patchwork.kernel.org/patch/136731/[2]
http://www.mail-archive.com/davinci-linux-open-source@linux.
davincidsp.com/msg26077.htmlSigned-off-by: Hebbar Gururaja
Cc: Alessandro Zummo
Acked-by: Kevin Hilman
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Use #include instead of as pointed out by
checkpatch.Signed-off-by: Sachin Kamat
Cc: George G. Davis
Cc: Jingoo Han
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
18 May, 2013
1 commit
-
devm_ioremap_resource does sanity checks on the given resource. No need to
duplicate this in the driver.Signed-off-by: Wolfram Sang
Acked-by: Stephen Warren
30 Apr, 2013
3 commits
-
Instead of using legacy suspend/resume methods, using newer dev_pm_ops
structure allows better control over power management.Signed-off-by: Jingoo Han
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Update the code to use devm_* API so that driver core will manage
resources.Signed-off-by: Vishwanathrao Badarkhe, Manish
Tested-by: Sekhar Nori
Cc: Jingoo Han
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Use module_platform_driver_probe() macro which makes the code smaller and
simpler.Signed-off-by: Jingoo Han
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
18 Dec, 2012
3 commits
-
OMAP1 RTC driver is used in multiple devices like, OMAPL138 and AM33XX.
Driver currently doesn't handle any clocks, which may be right for OMAP1
architecture but in case of AM33XX, the clock/module needs to be enabled
in order to access the registers.So convert this driver to runtime pm, which internally handles rest.
[afzal@ti.com: handle error path]
Signed-off-by: Vaibhav Hiremath
Signed-off-by: Afzal Mohammed
Acked-by: Sekhar Nori
Cc: Grant Likely
Cc: Sekhar Nori
Cc: Kevin Hilman
Cc: Russell King
Cc: Alessandro Zummo
Cc: Daniel Mack
Cc: Vaibhav Hiremath
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Enhance rtc-omap driver with DT capability
Signed-off-by: Afzal Mohammed
Acked-by: Sekhar Nori
Cc: Grant Likely
Cc: Sekhar Nori
Cc: Kevin Hilman
Cc: Russell King
Cc: Alessandro Zummo
Cc: Daniel Mack
Cc: Vaibhav Hiremath
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
OMAP RTC IP can have kicker feature. This prevents spurious writes to
register. To write to registers kicker lock has to be released.
Procedure to do it as follows,1. write to kick0 register, 0x83e70b13
2. write to kick1 register, 0x95a4f1e0Writing value other than 0x83e70b13 to kick0 enables write locking, more
details about kicker mechanism can be found in section 20.3.3.5.3 of
AM335X TRM @www.ti.com/am335xHere id table information is added and is used to distinguish those that
require kicker handling and the ones that doesn't need it. There are more
features in the newer IP's compared to legacy ones other than kicker,
which driver currently doesn't handle, supporting additional features
would be easier with the addition of id table.Older IP (of OMAP1) doesn't have revision register as per TRM, so revision
register can't be relied always to find features, hence id table is being
used.While at it, replace __raw_writeb/__raw_readb with writeb/readb; this
driver is used on ARMv7 (AM335X SoC)Signed-off-by: Afzal Mohammed
Acked-by: Sekhar Nori
Cc: Grant Likely
Cc: Sekhar Nori
Cc: Kevin Hilman
Cc: Russell King
Cc: Alessandro Zummo
Cc: Daniel Mack
Cc: Vaibhav Hiremath
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds