21 Aug, 2019
9 commits
-
nxp,rtc-pcf2123 is not a proper compatible strong for this RTC. The part
name is only pcf2123 and is less confusing.Signed-off-by: Alexandre Belloni
Link: https://lore.kernel.org/r/20190819182656.29744-9-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni -
Set the RTC range properly and use the core windowing and offsetting to
(unfortunately) map back to a 1970-2069 range.Signed-off-by: Alexandre Belloni
Link: https://lore.kernel.org/r/20190819182656.29744-8-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni -
This allows further improvement of the driver. Also remove the unecessary
error string as the core will already display error messages.Signed-off-by: Alexandre Belloni
Link: https://lore.kernel.org/r/20190819182656.29744-7-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni -
kfree_exit only returns ret, remove it. This also fixes the
devm_regmap_init_spi error case where the probe wouldn't actually fail
because ret is initialized to 0.Signed-off-by: Alexandre Belloni
Link: https://lore.kernel.org/r/20190819182656.29744-6-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni -
Rename struct pcf2123_plat_data to struct pcf2123_data and pdata to
pcf2123 to make the driver use a more common subsystem style.Signed-off-by: Alexandre Belloni
Link: https://lore.kernel.org/r/20190819182656.29744-5-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni -
platform_data is for platform specific data, use driver_data instead.
Signed-off-by: Alexandre Belloni
Link: https://lore.kernel.org/r/20190819182656.29744-4-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni -
Implement .alarm_irq_enable so it is possible to use RTC_ALM_SET,
RTC_AIE_ON and RTC_AIE_OFF.Signed-off-by: Alexandre Belloni
Link: https://lore.kernel.org/r/20190819182656.29744-3-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni -
Clear the flag after disabling the alarm to ensure the alarm doesn't fire
between clearing the flag and disabling the alarm.Signed-off-by: Alexandre Belloni
Link: https://lore.kernel.org/r/20190819182656.29744-2-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni -
The week day may not be set properly by userspace. This would result is
missed alarms. Disable alarm matching on weekday.Signed-off-by: Alexandre Belloni
Link: https://lore.kernel.org/r/20190819182656.29744-1-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni
18 Jul, 2019
1 commit
-
Pull RTC updates from Alexandre Belloni:
"A quiet cycle this time.- ds1307: properly handle oscillator failure flags
- imx-sc: alarm support
- pcf2123: alarm support, correct offset handling
- sun6i: add R40 support
- simplify getting the adapter of an i2c client"
* tag 'rtc-5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (37 commits)
rtc: wm831x: Add IRQF_ONESHOT flag
rtc: stm32: remove one condition check in stm32_rtc_set_alarm()
rtc: pcf2123: Fix build error
rtc: interface: Change type of 'count' from int to u64
rtc: pcf8563: Clear event flags and disable interrupts before requesting irq
rtc: pcf8563: Fix interrupt trigger method
rtc: pcf2123: fix negative offset rounding
rtc: pcf2123: add alarm support
rtc: pcf2123: use %ptR
rtc: pcf2123: port to regmap
rtc: pcf2123: remove sysfs register view
rtc: rx8025: simplify getting the adapter of a client
rtc: rx8010: simplify getting the adapter of a client
rtc: rv8803: simplify getting the adapter of a client
rtc: m41t80: simplify getting the adapter of a client
rtc: fm3130: simplify getting the adapter of a client
rtc: tegra: Drop MODULE_ALIAS
rtc: sun6i: Add R40 compatible
dt-bindings: rtc: sun6i: Add the R40 RTC compatible
dt-bindings: rtc: Convert Allwinner A31 RTC to a schema
...
19 Jun, 2019
6 commits
-
Based on 2 normalized pattern(s):
this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license version 2 as
published by the free software foundationthis program is free software you can redistribute it and or modify
it under the terms of the gnu general public license version 2 as
published by the free software foundation #extracted by the scancode license scanner the SPDX license identifier
GPL-2.0-only
has been chosen to replace the boilerplate/reference in 4122 file(s).
Signed-off-by: Thomas Gleixner
Reviewed-by: Enrico Weigelt
Reviewed-by: Kate Stewart
Reviewed-by: Allison Randal
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
Signed-off-by: Greg Kroah-Hartman -
Using result = (value + divisor/2) / divisor is rounding values up and only
works well for positive values. Instead use DIV_ROUND_CLOSEST which does
the correct thing.Signed-off-by: Alexandre Belloni
-
Allows alarm to be controlled using, e.g., the RTC_WKALM_SET ioctl.
Signed-off-by: Dylan Howey
Signed-off-by: Alexandre Belloni -
Use %ptR to print date in human readable format.
Signed-off-by: Dylan Howey
Signed-off-by: Alexandre Belloni -
Also remove pcf2123_delay_trec. This claimed to add a 30ns delay to SPI
writes, but I could not see any reference to this requirement in the
datasheet. Closest thing I could find to a requirement are timings for the
SPI chip enable line, which cannot be controlled by this driver (the ndelay
came after the call to spi_write_then_read, which means it would sleep
after CE has already gone inactive). Things seem to work fine without it.Signed-off-by: Dylan Howey
Signed-off-by: Alexandre Belloni -
Use regmap debugfs register view instead.
Signed-off-by: Dylan Howey
Signed-off-by: Alexandre Belloni
19 Dec, 2018
1 commit
-
Add a compatible string for Microcrystal rv2123 as the reset procedure seem
to be differing. However, the current driver works just fine.Signed-off-by: Alexandre Belloni
02 Mar, 2018
1 commit
-
The RTC core is always calling rtc_valid_tm after the read_time callback.
It is not necessary to call it just before returning from the callback.Signed-off-by: Alexandre Belloni
01 Sep, 2016
1 commit
-
It is likely that checking the result of 'pcf2123_write_reg' is expected
here.
Also fix a small style issue. The '{' at the beginning of the function
is misplaced.Fixes: 809b453b76e15 ("rtc: pcf2123: clean up writes to the rtc chip")
Signed-off-by: Christophe JAILLET
Signed-off-by: Alexandre Belloni
04 Jun, 2016
1 commit
-
Use sign_extend32() instead of open coding sign extension.
Signed-off-by: Martin Kepplinger
Signed-off-by: Alexandre Belloni
20 May, 2016
1 commit
-
Many drivers are defining a DRV_VERSION. This is often only used for
MODULE_VERSION and sometimes to print an info message at probe time. This
is kind of pointless as they are all versionned with the kernel anyway.
Also the core will print a message when a new rtc is found.Signed-off-by: Alexandre Belloni
15 Mar, 2016
6 commits
-
pcf2123 has an offset register, which can be used to make minor
adjustments to the clock rate to compensate for temperature or
a crystal that is not exactly right.Signed-off-by: Joshua Clayton
Signed-off-by: Alexandre Belloni -
pcf2123 data sheet recommends a software reset when the chip
is first powered on. This change avoids resetting the chip
every time the driver is loaded, which has some negative effects.There are several registers including a clock rate adjustment that really
should survive a reload of the driver (or reboot).In addition, stopping and restarting the clock to verify the chip is
there is not a good thing once the time is set.According to the data sheet, the seconds register has a 1 in
the high bit when the voltage has gotten low. We check for this
condition, as well as whether the time retrieved from the chip is
valid. We reset the rtc only if the time is not reliable and valid.
This is sufficient for checking for the presence of the chip,
as either all zeros or all 0xff will result in an invalid time/dateSigned-off-by: Joshua Clayton
Signed-off-by: Alexandre Belloni -
Refactor chip reset items into its own function, isolating it from
the rest of the device probe.
Subsequent commits will avoid calling this code.Signed-off-by: Joshua Clayton
Signed-off-by: Alexandre Belloni -
Add new functions pcf2123_write(), and pcf2123_write_reg().
Use named defines for the values being written.This improves modularity and readability, and reduces lines of code.
Signed-off-by: Joshua Clayton
Signed-off-by: Alexandre Belloni -
Put read operations into a function.
This improves modularity and readability.Signed-off-by: Joshua Clayton
Signed-off-by: Alexandre Belloni -
Add defines for all 16 registers in the pcf2123.
Add defines for useful bits from several registers
I've tried to document all the registers, and
as best as possible, all the special bits they employUse BIT() wherever possible in the bit definitions
Signed-off-by: Joshua Clayton
Signed-off-by: Alexandre Belloni
28 Oct, 2015
1 commit
-
An spi_driver does not need to set an owner, it will be populated by the
driver core.Signed-off-by: Andrew F. Davis
Acked-by: Jonathan Cameron
Signed-off-by: Mark Brown
05 Sep, 2015
1 commit
-
There's a wrong comment in some RTC drivers that say it's better to ignore
rtc_valid_tm() when reading RTC timestamp. However this is wrong and is
better to return to the userspace the error if timestamp is not valid.Signed-off-by: Andrea Scian
Signed-off-by: Alexandre Belloni
14 Feb, 2015
1 commit
-
Add compatible string "nxp,rtc-pcf2123"
Document the bindingSigned-off-by: Joshua Clayton
Cc: Mark Rutland
Cc: Alessandro Zummo
Cc: Grant Likely
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
13 Nov, 2013
1 commit
-
Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly. This is a cosmetic change to make
the code simpler and enhance the readability.Signed-off-by: Jingoo Han
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
04 Jul, 2013
2 commits
-
The usage of strict_strtoul() is not preferred, because strict_strtoul()
is obsolete. Thus, kstrtoul() should be used.Signed-off-by: Jingoo Han
Reviewed-by: Andy Shevchenko
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Silences the following checkpatch warning:
WARNING: please, no space before tabs
Signed-off-by: Sachin Kamat
Cc: Jingoo Han
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
30 Apr, 2013
2 commits
-
Fix to return -ENODEV in the chip not found error handling
case instead of 0, as done elsewhere in this function.Signed-off-by: Wei Yongjun
Cc: Jingoo Han
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Use devm_*() functions to make cleanup paths simpler.
Signed-off-by: Jingoo Han
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
04 Jan, 2013
1 commit
-
CONFIG_HOTPLUG is going away as an option. As a result, the __dev*
markings need to be removed.This change removes the use of __devinit, __devexit_p, __devinitdata,
__devinitconst, and __devexit from these drivers.Based on patches originally written by Bill Pemberton, but redone by me
in order to handle some of the coding style issues better, by hand.Cc: Bill Pemberton
Cc: Alessandro Zummo
Cc: Srinidhi Kasagar
Cc: Linus Walleij
Cc: Mike Frysinger
Cc: Wan ZongShun
Cc: Guan Xuetao
Cc: Mark Brown
Signed-off-by: Greg Kroah-Hartman
22 Aug, 2012
1 commit
-
Dynamically allocated sysfs attributes must be initialized using
not in
sysfs_attr_init(), otherwise lockdep complains: BUG: key
.data!Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Ilya Shchepetkov
Cc: Chris Verges
Cc: Christian Pellegrin
Cc: Alessandro Zummo
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
24 Mar, 2012
1 commit
-
Factor out some boilerplate code for spi driver registration into
module_spi_driver.Signed-off-by: Axel Lin
Cc: Mark Jackson
Cc: Dennis Aberilla
Cc: Nikolaus Voss
Cc: "Kim B. Heino"
Cc: Raphael Assenat
Cc: Chris Verges
Cc: Magnus Damm
Cc: Atsushi Nemoto
Cc: Alessandro Zummo
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
11 Jan, 2012
1 commit
-
In ancient times it was necessary to manually initialize the bus field of
an spi_driver to spi_bus_type. These days this is done in
spi_driver_register(), so we can drop the manual assignment.The patch was generated using the following coccinelle semantic patch:
//
@@
identifier _driver;
@@
struct spi_driver _driver = {
.driver = {
- .bus = &spi_bus_type,
},
};
//Signed-off-by: Lars-Peter Clausen
Cc: John Stultz
Cc: Alessandro Zummo
Cc: Grant Likely
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
01 Nov, 2011
1 commit
-
The module.h was implicitly everywhere, but when we clean
that up, the implicit users will compile fail; fix them up
in advance.Signed-off-by: Paul Gortmaker