Age | Commit message (Collapse) | Author | Files | Lines |
|
The header was simply moved from the arm mach folder to drivers/rtc but
there is not point in having it separated from the driver.
Also remove unused bit definitions and use BIT and GENMASK.
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
Both the sama5d4 and sama5d2 RTCs have more features than the previous
RTCs, add a compatible string for them.
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
The RTC procfs interface is deprecated and hasn't been used by userspace
for years.
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
Our chosen byte swapping, which is what firmware already uses, is to
do readl/writel by normal lw/sw intructions (data invariance). This
also means we need to mangle addresses for u8 and u16 accesses. The
mangling for 16bit has been done aready, but 8bit one was missing.
Correcting this causes different addresses for accesses to the
SuperIO and local bus of the IOC3 chip. This is fixed by changing
byte order in ioc3 and m48rtc_rtc structs.
Acked-by: Alexandre Belloni <[email protected]>
Signed-off-by: Thomas Bogendoerfer <[email protected]>
Signed-off-by: Paul Burton <[email protected]>
Cc: Ralf Baechle <[email protected]>
Cc: James Hogan <[email protected]>
Cc: David S. Miller <[email protected]>
Cc: Alessandro Zummo <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
|
|
This header file now only includes the cros_ec_dev struct, however, is the
'include/linux/platform_data/cros_ec_proto.h' who contains the definition of
all the Chrome OS EC related structs. There is no reason to have a
separate include for this struct so move to the place where other
structs are defined. That way, we can remove the include itself, but also
simplify the common pattern
#include <linux/mfd/cros_ec.h>
#include <linux/platform_data/cros_ec_proto.h>
for a single include
#include <linux/platform_data/cros_ec_proto.h>
The changes to remove the cros_ec.h include were generated with the
following shell script:
git grep -l "<linux/mfd/cros_ec.h>" | xargs sed -i '/<linux\/mfd\/cros_ec.h>/d'
Signed-off-by: Enric Balletbo i Serra <[email protected]>
Acked-by: Lee Jones <[email protected]>
Acked-by: Alexandre Belloni <[email protected]>
Acked-by: Jonathan Cameron <[email protected]>
Acked-by: Sebastian Reichel <[email protected]>
Acked-by: Hans Verkuil <[email protected]>
|
|
ioremap has provided non-cached semantics by default since the Linux 2.6
days, so remove the additional ioremap_nocache interface.
Signed-off-by: Christoph Hellwig <[email protected]>
Acked-by: Arnd Bergmann <[email protected]>
|
|
There are multiple reports of this patch breaking RTC time setting for AMD
platforms.
This reverts commit 7ad295d5196a58c22abecef62dd4f99e2f86e831.
Cc: Jinke Fan <[email protected]>
Link: https://lore.kernel.org/r/CABXGCsMLob0DC25JS8wwAYydnDoHBSoMh2_YLPfqm3TTvDE-Zw@mail.gmail.com
Fixes: 7ad295d5196a ("rtc: Fix the AltCentury value on AMD/Hygon platform")
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
Replace (1 << ...) with BIT().
CC: Alessandro Zummo <[email protected]>
CC: Alexandre Belloni <[email protected]>
Signed-off-by: Nobuhiro Iwamatsu <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
Use SPDX-License-Identifier instead of a verbose license text.
CC: Alessandro Zummo <[email protected]>
CC: Alexandre Belloni <[email protected]>
CC: Jonas Jensen <[email protected]>
Signed-off-by: Nobuhiro Iwamatsu <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
struct spi_device in struct ds1343_priv is not used, remove it.
CC: Alessandro Zummo <[email protected]>
CC: Alexandre Belloni <[email protected]>
CC: Raghavendra Chandra Ganiga <[email protected]>
CC: Ankur Srivastava <[email protected]>
Signed-off-by: Nobuhiro Iwamatsu <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
struct i2c_client can be referenced from the device structure, so this
doesn't need to have it in struct rx8025_data.
Remove struct i2c_client from struct rx8025_data.
CC: Alessandro Zummo <[email protected]>
CC: Alexandre Belloni <[email protected]>
CC: Wolfgang Grandegger <[email protected]>
Signed-off-by: Nobuhiro Iwamatsu <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
The RTC has a valid bit in the seconds register that indicates whether
power was lost since the pevious time set. This bit is currently read
once at probe time, cached and updated with set_time.
Howeever, caching the bit may prevent detecting power loss at runtime
(which can happen if the RTC's supply is distinct from the the platform's).
Writing the seconds register when setting time will clear the bit,
so there should be no downside in reading the bit directly instead of
caching it.
Signed-off-by: Paul Kocialkowski <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
The current code returns -EPERM when the voltage loss bit is set.
Since the bit indicates that the time value is not valid, return
-EINVAL instead, which is the appropriate error code for this
situation.
Fixes: dcaf03849352 ("rtc: add hym8563 rtc-driver")
Signed-off-by: Paul Kocialkowski <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
In the current code, the return value of devm_request_threaded_irq may be
returned. This fixes it.
CC: Alessandro Zummo <[email protected]>
CC: Alexandre Belloni <[email protected]>
CC: Akshay Bhat <[email protected]>
Signed-off-by: Nobuhiro Iwamatsu <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
Fixes coccicheck warning:
drivers/rtc/rtc-omap.c:619:2-3: Unneeded semicolon
Reported-by: Hulk Robot <[email protected]>
Signed-off-by: zhengbin <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
The driver misses a check for devm_clk_get().
Add the check to fix it.
Signed-off-by: Chuhong Yuan <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
Remove redundant messages or messages that would not add any value because
the information is already conveyed properly using errno.
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
rv30{2,4}9_register_driver and rv30{2,4}9_unregister_driver are only called
from the init and exit functions of the module. Annotate them properly.
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
The compatibles have been marked obsolete for more that 2 years, drop them
now. Note that this doesn't currently prevent the driver from probing
because the i2c core will still match using the i2c_device_id table.
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
Export the 8 byte RAM using nvmem.
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
Despite the comment, the RV3029 uses a 7bit BCD register for the year,
making 2079 the last supported year.
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
This allows further improvement of the driver.
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
In case the data is invalid (PON or VLOW2 are set in STATUS, explicitly
tell userspace that the time is invalid. Only remove VLOW2 when setting a
new valid time.
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
The RV3029 can report three different conditions: power on, voltage dropped
and data is lost and voltage is low and temperature compensation has
stopped. The first two conditions amount to the same status, the RTC data
is invalid.
VLOW1 has to be cleared manually to resume temperature compensation, this
is achieved using RTC_VL_CLEAR.
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
rv3029_read_regs and rv3029_write_regs are simply calling
regmap_bulk_{read,write}. Drop them and call regmap_{,bulk}_{read,write} as
appropriate.
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
It is unecessay to test alarm->enabled before calling
rv3029_alarm_irq_enable.
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
Use regmap_update_bits instead of open coding it in
rv3029_alarm_irq_enable.
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
There is no point in having 2 indirections before calling regmap_read,
especially since rv3029_get_sr also changes the return value without any
good reason. Call regmap_read directly.
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
RV3029_STATUS is read in multiple location but its value is never used
afterwards. Avoid this register access when not necessary.
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
There is no lock preventing concurrent access to the status register from
bth the rtc subsystem and the hwmon subsystem. Use regmap_update_bits to
ensure updating RV3029_STATUS is properly locked.
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
rv3029_update_bits open codes regmap_update_bits and forgets to properly
lock the register range while doing so. Use regmap_update_bits instead.
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
Instead of trying to validate the accessed registers in custom functions,
let regmap handle that. This allows to defines all the holes in the
register range and gives access to the regmap debugfs register dump.
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
The correct name for the rtc is rv3029. c2 is actually the package form
factor rv3029c3 exists and simply has a smaller form factor.
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
RX8010_FLAG_VLF means the voltage dropped too low and data has been lost.
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
Remove RTC_VL_CLR handling because it is a disservice to userspace as it
removes the important information that the RTC data is invalid. This may
lead userspace to set an invalid system time later on.
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
RV8803_FLAG_V1F means the voltage is too low to keep the temperature
compensation running and the accuracy of the RTC is affected.
RV8803_FLAG_V2F means the voltage dropped so low that data is now invalid.
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
Stop clearing RV8803_FLAG_V2F in RTC_VL_CLR because it is a disservice to
userspace as it removes the important information that the RTC data is
invalid. This may lead userspace to set an invalid system time later on.
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
RV3028_STATUS_PORF means the voltage dropped too low and data has been
lost.
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
Remove RTC_VL_CLR handling because it is a disservice to userspace as it
removes the important information that the RTC data is invalid. This may
lead userspace to set an invalid system time later on.
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
PCF85063_REG_SC_OS means the voltage dropped too low and data has been
lost.
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
Remove RTC_VL_CLR handling because it is a disservice to userspace as it
removes the important information that the RTC data is invalid. This may
lead userspace to set an invalid system time later on.
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
PCF8563_SC_LV means the voltage dropped too low and data has been lost.
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
voltage_low is only updated when reading the time, this means that using
RTC_VL_READ will miss the VL flag if the time has not been read before
using the ioctl. Always read the status from the hardware.
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
Always compile pcf8563_rtc_ioctl as we are sure that CONFIG_RTC_INTF_DEV is
selected on actual kernel configurations.
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
Remove RTC_VL_CLR handling because it is a disservice to userspace as it
removes the important information that the RTC data is invalid. This may
lead userspace to set an invalid system time later on.
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
REG_CONTROL3_BLF indicates the battery is low and needs to be replaced
soon.
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
PCF2127_BIT_CTRL3_BLF indicates the battery is low and needs to be replaced
soon.
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
ABX8XX_STATUS_BLF indicates the battery is low and needs to be replaced
soon.
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
Alarm registers high byte was reserved for other functions.
This add mask in alarm registers operation functions.
This also fix error condition in interrupt handler.
Fixes: fc2979118f3f ("rtc: mediatek: Add MT6397 RTC driver")
Signed-off-by: Ran Bi <[email protected]>
Signed-off-by: Hsin-Hsiung Wang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|
|
The current use of mode flags to us SPI_MODE_3 and
SPI_CS_HIGH is fragile: it overwrites anything already
assigned by the SPI core. Change it thusly:
- Just |= the SPI_MODE_3 so we keep other flags
- Assign ^= SPI_CS_HIGH since we might be active high
already, and that is usually the case with GPIOs used
for chip select, even if they are in practice active low.
Add a comment clarifying why ^= SPI_CS_HIGH is the right
choice here.
Reported-by: Mark Brown <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
|