aboutsummaryrefslogtreecommitdiff
path: root/drivers/rtc/rtc-ds1672.c
AgeCommit message (Collapse)AuthorFilesLines
2019-08-21rtc: ds1672: remove unnecessary checkAlexandre Belloni1-3/+0
The rtc pointer is already checked earlier, it is not necessary to check it again. Signed-off-by: Alexandre Belloni <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-08rtc: ds1672: switch debug message to %ptRAlexandre Belloni1-4/+1
Use %ptR to simplify debug message. Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-08rtc: ds1672: convert to SPDX identifierAlexandre Belloni1-4/+1
Use SPDX-License-Identifier instead of a verbose license text. Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-08rtc: ds1672: use .set_timeAlexandre Belloni1-2/+3
Use .set_time instead of the deprecated .set_mmss. Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-08rtc: ds1672: use rtc_time64_to_tmAlexandre Belloni1-1/+1
Use the 64bit version of rtc_time_to_tm.rtc_time_to_tm. Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-08rtc: ds1672: remove useless indirectionAlexandre Belloni1-14/+6
ds1672_get_datetime and ds1672_set_mmss are only used after casting dev to an i2c_client. Remove that useless indirection. Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-08rtc: ds1672: remove sysfs debug interfaceAlexandre Belloni1-51/+0
Remove the control sysfs file as it is not documented, read only and was only used to provide the oscillator state. Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-08rtc: ds1672: move oscillator handling to .read_timeAlexandre Belloni1-13/+16
Return -EINVAL when trying to read an invalid time instead of just probe because this is a useful information for userspace. Signed-off-by: Alexandre Belloni <[email protected]>
2019-04-08rtc: ds1672: set rangeAlexandre Belloni1-5/+11
The ds1672 is a 32bit seconds counter. Also remove erroneous comment claiming that epoch is set to 2000, it was not. Signed-off-by: Alexandre Belloni <[email protected]>
2019-02-05rtc: ds1672: fix unintended sign extensionColin Ian King1-1/+2
Shifting a u8 by 24 will cause the value to be promoted to an integer. If the top bit of the u8 is set then the following conversion to an unsigned long will sign extend the value causing the upper 32 bits to be set in the result. Fix this by casting the u8 value to an unsigned long before the shift. Detected by CoverityScan, CID#138801 ("Unintended sign extension") Fixes: edf1aaa31fc5 ("[PATCH] RTC subsystem: DS1672 driver") Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2017-09-01rtc: constify i2c_device_idArvind Yadav1-1/+1
i2c_device_id are not supposed to change at runtime. All functions working with i2c_device_id provided by <linux/i2c.h> work with const i2c_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2017-03-09rtc: rtc-ds1672: Add OF device ID tableJavier Martinez Canillas1-1/+8
The driver doesn't have a struct of_device_id table but supported devices are registered via Device Trees. This is working on the assumption that a I2C device registered via OF will always match a legacy I2C device ID and that the MODALIAS reported will always be of the form i2c:<device>. But this could change in the future so the correct approach is to have an OF device ID table if the devices are registered via OF. Signed-off-by: Javier Martinez Canillas <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2016-05-20rtc: remove useless DRV_VERSIONAlexandre Belloni1-5/+0
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 <[email protected]>
2015-06-25rtc: ds1672, max6900, max8998: Add MODULE_DEVICE_TABLEAxel Lin1-0/+1
The device table is required to load modules based on modaliases. After adding MODULE_DEVICE_TABLE, below entries will be added to modules.alias: alias i2c:ds1672 rtc_ds1672 alias i2c:max6900 rtc_max6900 alias platform:lp3974-rtc rtc_max8998 alias platform:max8998-rtc rtc_max8998 Signed-off-by: Axel Lin <[email protected]> Cc: Alessandro Zummo <[email protected]> Cc: Dale Farnsworth <[email protected]> Cc: Minkyu Kang <[email protected]> Cc: Joonyoung Shim <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2014-04-03rtc: fix potential race conditionAlessandro Zummo1-6/+5
RTC drivers must not return an error after device registration. [[email protected]: coding-style fixes] Signed-off-by: Alessandro Zummo <[email protected]> Reported-by: Ales Novak <[email protected]> Cc: Alexander Shiyan <[email protected]> Cc: Atsushi Nemoto <[email protected]> Cc: Jiri Kosina <[email protected]> Cc: Srikanth Srinivasan <[email protected]> Cc: Lee Jones <[email protected]> Cc: Sascha Hauer <[email protected]> Cc: Joonsoo Kim <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03drivers/rtc/rtc-ds1672.c: remove empty functionSachin Kamat1-6/+0
After the switch to devm_* functions and the removal of rtc_device_unregister(), the 'remove' function does not do anything. Delete it. Signed-off-by: Sachin Kamat <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-04-29rtc: rtc-ds1672: use devm_rtc_device_register()Jingoo Han1-7/+1
devm_rtc_device_register() is device managed and makes cleanup paths simpler. Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-10-06drivers/rtc/rtc-ds1672.c: convert struct i2c_msg initialization to C99 formatShubhrajyoti D1-4/+22
Convert the struct i2c_msg initialization to C99 format. This makes maintaining and editing the code simpler. Also helps once other fields like transferred are added in future. Signed-off-by: Shubhrajyoti D <[email protected]> Reviewed-by: Felipe Balbi <[email protected]> Cc: Alessandro Zummo <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-03-23rtc: convert rtc i2c drivers to module_i2c_driverAxel Lin1-12/+1
Factor out some boilerplate code for i2c driver registration into module_i2c_driver. Signed-off-by: Axel Lin <[email protected]> Cc: Piotr Ziecik <[email protected]> Cc: Alessandro Zummo <[email protected]> Cc: Scott Wood <[email protected]> Cc: Srikanth Srinivasan <[email protected]> Cc: Mike Rapoport <[email protected]> Cc: Sergey Lapin <[email protected]> Cc: Roman Fietze <[email protected]> Cc: Herbert Valerio Riedel <[email protected]> Cc: Alexander Bigga <[email protected]> Cc: Dale Farnsworth <[email protected]> Cc: Gregory Hermant <[email protected]> Cc: Wolfgang Grandegger <[email protected]> Cc: Martyn Welch <[email protected]> Cc: Byron Bradley <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-10-31rtc: Add module.h to implicit users in drivers/rtcPaul Gortmaker1-0/+1
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 <[email protected]>
2009-01-06rtc: use set_mmss when set_time is not availableAlessandro Zummo1-22/+0
Drivers should only need to implement either set_mmss (counter based RTCs) or set_time (most RTCs). The RTC subsystem will handle them appropriately. Signed-off-by: Alessandro Zummo <[email protected]> Cc: Kumar Gala <[email protected]> Cc: David Brownell <[email protected]> Cc: Lennert Buytenhek <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-12-10rtc: fix missing id_table in rtc-ds1672 and rtc-max6900 driversAlessandro Zummo1-0/+6
Add missing id_table to the drivers in subject. Patch is against the latest git. It should go in with 2.6.28 if possible, the drivers won't work without the id_table bits. Signed-off-by: Alessandro Zummo <[email protected]> Reported-by: Imre Kaloz <[email protected]> Tested-by: Imre Kaloz <[email protected]> Cc: David Brownell <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-10-16rtc-ds1672 new style driverAlessandro Zummo1-80/+34
New style conversion and reformatting as per indent --linux-style Signed-off-by: Alessandro Zummo <[email protected]> Cc: David Brownell <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-04-28rtc: replace remaining __FUNCTION__ occurrencesHarvey Harrison1-7/+7
__FUNCTION__ is gcc-specific, use __func__ Signed-off-by: Harvey Harrison <[email protected]> Cc: David Brownell <[email protected]> Cc: Alessandro Zummo <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-01-27i2c: normal_i2c can be made const (rtc drivers)Jean Delvare1-1/+1
Signed-off-by: Jean Delvare <[email protected]> Acked-by: Alessandro Zummo <[email protected]>
2007-02-13i2c: Stop using i2c_adapter.class_devJean Delvare1-1/+1
Stop using i2c_adapter.class_dev, as it is going to be removed soon. Luckily, there are only 4 RTC drivers affected. Signed-off-by: Jean Delvare <[email protected]> Cc: Alessandro Zummo <[email protected]>
2006-12-10[PATCH] RTCs don't use i2c_adapter.devDavid Brownell1-1/+1
Update more I2C drivers that live outside drivers/i2c to understand that using adapter->dev is not The Way. When actually referring to the adapter hardware, adapter->class_dev.dev is the answer. When referring to a device connected to it, client->dev.dev is the answer. Signed-off-by: David Brownell <[email protected]> Acked-by: Alessandro Zummo <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2006-12-07[PATCH] RTC: handle sysfs errorsJeff Garzik1-2/+7
Signed-off-by: Jeff Garzik <[email protected]> Cc: Alessandro Zummo <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2006-10-04[PATCH] RTC: build fixesJeff Garzik1-2/+2
Fix obvious build breakage revealed by 'make allyesconfig' in current -git. Signed-off-by: Jeff Garzik <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2006-10-01[PATCH] constify rtc_class_ops: update driversDavid Brownell1-1/+1
Update RTC framework so that drivers can constify their method tables, moving them from ".data" to ".rodata". Then update the drivers. Signed-off-by: David Brownell <[email protected]> Cc: Alessandro Zummo <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2006-04-11[PATCH] RTC subsystem: compact error messagesAlessandro Zummo1-2/+0
Move registration error message from drivers to core. Signed-off-by: Alessandro Zummo <[email protected]> Cc: Lennert Buytenhek <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2006-04-11[PATCH] RTC subsystem: DS1672 cleanupAlessandro Zummo1-19/+10
- removed a duplicate error message - bumped driver version - removed some debugging messages in excess - refined the formatting - adjusted copyright notice Signed-off-by: Alessandro Zummo <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2006-04-11[PATCH] RTC subsystem: DS1672 oscillator handlingKumar Gala1-3/+58
* Always enable the oscillator when we set the time * If the oscillator is disable when we probe the RTC report back a warning to the user * Added sysfs attribute to represent the state of the oscillator Signed-off-by: Kumar Gala <[email protected]> Signed-off-by: Alessandro Zummo <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2006-03-27[PATCH] RTC subsystem: DS1672 driverAlessandro Zummo1-0/+233
Driver for the Dallas/Maxim DS1672 chip, found on the Loft (http://www.giantshoulderinc.com). Signed-off-by: Alessandro Zummo <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>