aboutsummaryrefslogtreecommitdiff
path: root/drivers/rtc/rtc-ds1307.c
AgeCommit message (Collapse)AuthorFilesLines
2016-12-19rtc: ds1307: Add ACPI supportTin Huynh1-9/+43
This patch enables ACPI support for rtc-ds1307 driver. Signed-off-by: Tin Huynh <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2016-08-31rtc: ds1307: add Intersil ISL12057 supportAlexandre Belloni1-0/+6
Intersil ISL12057 is a drop-in replacement for DS1337. It can be supported by the ds1307 driver. Acked-by: Arnaud Ebalard <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2016-08-31rtc: ds1307: fix century bit supportAlexandre Belloni1-5/+43
Add an option to properly support the century bit of ds1337 and compatibles and ds1340. Because the driver had a bug until now, it is not possible to switch users to the fixed code directly as RTCs in the field will wrongly have the century bit set. Acked-by: Arnaud Ebalard <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2016-07-09rtc: simplify implementations of read_alarmUwe Kleine-König1-5/+0
Since commit d68778b80dd7 ("rtc: initialize output parameter for read alarm to "uninitialized"") there is no need to explicitly set unsupported members to -1. So drop the respective assignments from drivers. Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2016-07-09rtc: ds1307: Fix relying on reset value for weekdayKeerthy1-1/+27
The reset value of weekday is 0x1. This is wrong since the reset values of the day/month/year make up to Jan 1 2001. When computed weekday comes out to be Monday. On a scale of 1-7(Sunday - Saturday) it should be 0x2. So we should not be relying on the reset value. Hence compute the wday using the current date/month/year values. Check if reset wday is any different from the computed wday, If different then set the wday which we computed using date/month/year values. Document Referred: http://ww1.microchip.com/downloads/en/DeviceDoc/20002266F.pdf Fixes: 1d1945d261a2af "drivers/rtc/rtc-ds1307.c: add alarm support for mcp7941x chips" Signed-off-by: Keerthy <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2016-05-20rtc: ds1307: Remove CLK_IS_ROOTStephen Boyd1-2/+0
This flag is a no-op now (see commit 47b0eeb3dc8a "clk: Deprecate CLK_IS_ROOT", 2016-02-02) so remove it. Cc: Akinobu Mita <[email protected]> Cc: Michael Tatarinov <[email protected]> Signed-off-by: Stephen Boyd <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2016-05-20rtc: ds1307: ensure that any pending alarm is cleared before a new alarm is ↵Nicolas Boullis1-5/+8
enabled If a previously-set alarm was disabled and then triggered, it may still be pending when a new alarm is configured. Then, if the alarm is enabled before the pending alarm is cleared, then an interrupt is immediately raised. Unfortunately, when the alarm is cleared and enabled during the same I²C block write, the chip (at least the DS1339 I have) considers that the alarm is enabled before it is cleared, and raises an interrupt. This patch ensures that the pending alarm is cleared before the alarm is enabled. Signed-off-by: Nicolas Boullis <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2016-05-20rtc: ds1307: fix ds1307_native_smbus_read_block_data functionNicolas Boullis1-2/+6
The i2c_smbus_read_i2c_block_data function returns 0 on success, not the number of bytes written. Hence, when there are 32 bytes or less to send, the ds1307_native_smbus_write_block_data function returns 0 on success, while it returns the number of bytes when there are more than 32. The ds1307_write_block_data always returns the number of bytes on success. Signed-off-by: Nicolas Boullis <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2016-04-21rtc: ds1307: Use irq when available for wakeup-source deviceNishanth Menon1-1/+1
With commit 8bc2a40730ec ("rtc: ds1307: add support for the DT property 'wakeup-source'") we lost the ability for rtc irq functionality for devices that are actually hooked on a real IRQ line and have capability to wakeup as well. This is not an expected behavior. So, instead of just not requesting IRQ, skip the IRQ requirement only if interrupts are not defined for the device. Fixes: 8bc2a40730ec ("rtc: ds1307: add support for the DT property 'wakeup-source'") Reported-by: Tony Lindgren <[email protected]> Cc: Michael Lange <[email protected]> Cc: Alexandre Belloni <[email protected]> Signed-off-by: Nishanth Menon <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2016-04-21rtc: ds1307: ds3231 temperature s16 overflowZhuang Yuyao1-2/+2
while retrieving temperature from ds3231, the result may be overflow since s16 is too small for a multiplication with 250. ie. if temp_buf[0] == 0x2d, the result (s16 temp) will be negative. Signed-off-by: Akinobu Mita <[email protected]> Tested-by: Michael Tatarinov <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2016-03-14rtc: ds1307: add clock provider support for DS3231Akinobu Mita1-1/+295
DS3231 has programmable square-wave output signal. This enables to use this feature as a clock provider of common clock framework. Signed-off-by: Akinobu Mita <[email protected]> Reviewed-by: Michael Turquette <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2016-02-04rtc: ds1307: add temperature sensor support for ds3231Akinobu Mita1-0/+88
DS3231 has the temperature registers with a resolution of 0.25 degree celsius. This enables to get the value through hwmon. # cat /sys/class/i2c-adapter/i2c-2/2-0068/hwmon/hwmon0/temp1_input 21000 Signed-off-by: Akinobu Mita <[email protected]> Acked-by: Guenter Roeck <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2016-02-04rtc: ds1307: add support for the DT property 'wakeup-source'Michael Lange1-2/+27
For RTC chips with no IRQ directly connected to the SoC, the RTC chip can be forced as a wakeup source by stating that explicitly in the device's .dts file using the "wakeup-source" boolean property. This will guarantee the 'wakealarm' sysfs entry is available on the device, if supported by the RTC. With these changes to the driver rtc-ds1307 and the necessary entries in the .dts file, I get an working ds1337 RTC on the Witty Pi extension board by UUGear for the Raspberry Pi. An example for the entry in the .dts file: rtc: ds1337@68 { compatible = "dallas,ds1337"; reg = <0x68>; wakeup-source; If the "wakeup-source" property is set, do not request an IRQ. Set also UIE mode to unsupported, to get a working 'hwclock' binary. Signed-off-by: Michael Lange <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2016-01-11rtc: use %ph for short hex dumpsRasmus Villemoes1-13/+4
This makes the generated code slightly smaller. Signed-off-by: Rasmus Villemoes <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2015-11-26rtc: ds1307: fix alarm reading at probe timeSimon Guinot1-5/+7
With the actual code, read_alarm() always returns -EINVAL when called during the RTC device registration. This prevents from retrieving an already configured alarm in hardware. This patch fixes the issue by moving the HAS_ALARM bit configuration (if supported by the hardware) above the rtc_device_register() call. Signed-off-by: Simon Guinot <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2015-11-25rtc: ds1307: fix kernel splat due to wakeup irq handlingFelipe Balbi1-33/+3
Since commit 3fffd1283927 ("i2c: allow specifying separate wakeup interrupt in device tree") we have automatic wakeup irq support for i2c devices. That commit missed the fact that rtc-1307 had its own wakeup irq handling and ended up introducing a kernel splat for at least Beagle x15 boards. Fix that by reverting original commit _and_ passing correct interrupt names on DTS so i2c-core can choose correct IRQ as wakeup. Now that we have automatic wakeirq support, we can revert the original commit which did it manually. Fixes the following warning: [ 10.346582] WARNING: CPU: 1 PID: 263 at linux/drivers/base/power/wakeirq.c:43 dev_pm_attach_wake_irq+0xbc/0xd4() [ 10.359244] rtc-ds1307 2-006f: wake irq already initialized Cc: Tony Lindgren <[email protected]> Cc: Nishanth Menon <[email protected]> Signed-off-by: Felipe Balbi <[email protected]> Acked-by: Tony Lindgren <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2015-11-08rtc: ds1307: Fix alarm programming for mcp794xxTero Kristo1-2/+2
mcp794xx alarm registers must be written in BCD format. However, the alarm programming logic neglected this by adding one to the value after bin2bcd conversion has been already done, writing bad values to month register in case the alarm being set is in October. In this case, the alarm month value becomes 0x0a instead of the expected 0x10. Fix by moving the +1 addition within the bin2bcd call also. Fixes: 1d1945d261a2 ("drivers/rtc/rtc-ds1307.c: add alarm support for mcp7941x chips") Signed-off-by: Tero Kristo <[email protected]> Acked-by: Nishanth Menon <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2015-09-05rtc: ds1307: clean up ds1307_nvram_read()/ds1307_nvram_write()Vladimir Zapolskiy1-14/+0
The change removes redundant sysfs binary file boundary checks, since this task is already done on caller side in fs/sysfs/file.c Signed-off-by: Vladimir Zapolskiy <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2015-09-05rtc: Drop owner assignment from i2c_driverKrzysztof Kozlowski1-1/+0
i2c_driver does not need to set an owner because i2c_register_driver() will set it. Signed-off-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2015-09-05rtc: ds1307: Support optional wakeup interrupt sourceNishanth Menon1-3/+33
With the recent pinctrl-single changes, SoCs such as Texas Instrument's OMAP processors can treat wake-up events from deeper idle states as interrupts. Let's add support for the optional second interrupt for wake-up using the generic wakeirq support added in commit 4990d4fe327b ("PM / Wakeirq: Add automated device wake IRQ handling") Finally, to pass the wake-up interrupt in the dts file, interrupts-extended property needs to be passed. This is similar in approach to commit 2a0b965cfb6e ("serial: omap: Add support for optional wake-up") + ee83bd3b6483 ("serial: omap: Switch wake-up interrupt to generic wakeirq") Signed-off-by: Nishanth Menon <[email protected]> Reviewed-by: Grygorii Strashko <[email protected]> Acked-by: Tony Lindgren <[email protected]> Acked-by: Felipe Balbi <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2015-09-05rtc: ds1307: Sort the headersNishanth Menon1-5/+5
It is always a good practice to keep the #includes sorted Signed-off-by: Nishanth Menon <[email protected]> Acked-by: Felipe Balbi <[email protected]> Reviewed-by: Grygorii Strashko <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2015-09-05rtc: ds1307: Switch to managed irq allocationNishanth Menon1-6/+4
Since we are not doing anything fancy in remove function that requires us to sequence IRQ free operation, we might as well switch over to devm_ equivalent of managed IRQ allocation and remove the explicit free_irq since it'd be done automatically at remove. Signed-off-by: Nishanth Menon <[email protected]> Acked-by: Felipe Balbi <[email protected]> Reviewed-by: Grygorii Strashko <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2015-09-05rtc: ds1307: Convert to threaded IRQFelipe Balbi1-40/+19
The driver currently emulates the concept of threaded IRQ using a workqueue, which it really does not need to. Instead, switch over to threaded_irq handlers which is meant precisely for the same purpose. Signed-off-by: Felipe Balbi <[email protected]> Signed-off-by: Nishanth Menon <[email protected]> Reviewed-by: Grygorii Strashko <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2015-06-25rtc: ds1307: Enable the mcp794xx alarm after programming timeNishanth Menon1-6/+6
Alarm interrupt enable register is at offset 0x7, while the time registers for the alarm follow that. When we program Alarm interrupt enable prior to programming the time, it is possible that previous time value could be close or match at the time of alarm enable resulting in interrupt trigger which is unexpected (and does not match the time we expect it to trigger). To prevent this scenario from occuring, program the ALM0_EN bit only after the alarm time is appropriately programmed. Ofcourse, I2C programming is non-atomic, so there are loopholes where the interrupt wont trigger if the time requested is in the past at the time of programming the ALM0_EN bit. However, we will not have unexpected interrupts while the time is programmed after the interrupt are enabled. Signed-off-by: Nishanth Menon <[email protected]> Reviewed-by: Grygorii Strashko <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
2014-12-10rtc: ds1307: add support for mcp7940x chipsTomas Novotny1-63/+64
MCP7940x is same RTC as MCP7941x. The difference is that MCP7941x chips contain additional EEPROM on a different i2c address. DS1307 driver already supports MCP7941x, so just add a new i2c device id and rename functions and defines accordingly. Signed-off-by: Tomas Novotny <[email protected]> Cc: Alessandro Zummo <[email protected]> Cc: Grant Likely <[email protected]> Cc: Rob Herring <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2014-10-14rtc: ds1307: add trickle charger device tree bindingMatti Vaittinen1-4/+63
Some DS13XX devices have "trickle chargers". Introduce a device tree binding for specifying the trickle charger configuration for ds1339. Only ds1339 dt binding is supported because this is the only chip I have. I _assume_ the code would have worked on other allready supported chips. However I cannot check the resistor values for the other chips or test them. For other chips the driver code works as earlier Eg. it does not check the dt bindings at all Signed-off-by: Matti Vaittinen <[email protected]> Cc: Rob Herring <[email protected]> Cc: Pawel Moll <[email protected]> Cc: Jason Cooper <[email protected]> Cc: Guenter Roeck <[email protected]> Cc: Alessandro Zummo <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Pavel Machek <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2014-04-03drivers/rtc/rtc-ds1307.c: add alarm support for mcp7941x chipsSimon Guinot1-1/+182
Add alarm support for the Microchip RTC devices MCP794xx. Note that two programmable alarms are provided by the chip but only one is used by the driver. Signed-off-by: Simon Guinot <[email protected]> Cc: Jason Cooper <[email protected]> Cc: Andrew Lunn <[email protected]> Cc: Gregory Clement <[email protected]> Cc: Sebastian Hesselbarth <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2014-04-03drivers/rtc/rtc-ds1307.c: fix sysfs wakealarm attribute creationSimon Guinot1-1/+1
In order to allow the creation of the sysfs attribute wakealarm, this patch moves the device_set_wakeup_capable() call above the RTC device registration. Signed-off-by: Simon Guinot <[email protected]> Cc: Jason Cooper <[email protected]> Cc: Andrew Lunn <[email protected]> Cc: Gregory Clement <[email protected]> Cc: Sebastian Hesselbarth <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2014-04-03rtc: fix potential race conditionAlessandro Zummo1-27/+33
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-11-13drivers/rtc/rtc-ds1307.c: change variable type to boolPeter Senna Tschudin1-1/+1
The variable want_irq is only assigned the values true and false. Change its type to bool. The simplified semantic patch that find this problem is as follows (http://coccinelle.lip6.fr/): @exists@ type T; identifier b; @@ - T + bool b = ...; ... when any b = \(true\|false\) Signed-off-by: Peter Senna Tschudin <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-11-13drivers/rtc/rtc-ds1307.c: use dev_get_platdata()Jingoo Han1-1/+1
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 <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-11-13drivers/rtc/rtc-ds1307.c: release irq on errorSachin Kamat1-2/+4
'client->irq' was not released on error. Fix it. Signed-off-by: Sachin Kamat <[email protected]> Cc: Jingoo Han <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-03rtc: rtc-ds1307: use devm_*() functionsJingoo Han1-26/+17
Use devm_*() functions to make cleanup paths simpler. Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-04-29drivers/rtc/rtc-ds1307.c: change sysfs function pointer assignmentSteffen Trumtrar1-2/+2
The current usage of commas instead of semicolons is not wrong, but affects the readability of the code. Also, the code would break, if someone puts something between those two assignments. Signed-off-by: Steffen Trumtrar <[email protected]> Cc: Austin Boyle <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-04-29rtc: rtc-ds1307: use dev_dbg() instead of pr_debug()Jingoo Han1-5/+5
dev_dbg() is preferred to pr_debug(). Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-04-29drivers/rtc/rtc-ds1307.c: long block operations bugfixBertrand Achard1-4/+56
The rtc-ds1307 driver does not properly handle block operations bigger than 32 bytes in either of the two modes supported (SMbus native, or emulated if not supported by the SMbus platform driver). It also does not properly handle userland-supplied input (block operation length) through sysfs and may suffer a type of buffer overrun. The driver has been modified with proper input validation, buffer sizes, and now splits block transfers bigger than 32 bytes into separate transfers. Explanation : Buffer size allocated is I2C_SMBUS_BLOCK_MAX which equals to 32 as per the SMbus spec. Reads and write may be up to 56 bytes (to the NVRAM). This patch allocated a 255 byte buffer, the maximum allowable (address is an u8). It's not only a buffer problem, SMbus only supports up to 32 bytes transfer at once, so it's needed to split bigger transfers. Patch successfully tested on 3.2.27; cleanly applies on 3.7-rc4. [[email protected]: rework code to avoid 80-column overflows] Signed-off-by: Bertrand Achard <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-02-21drivers/rtc: dump small buffers via %*phAndy Shevchenko1-9/+2
Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-01-03Drivers: rtc: remove __dev* attributes.Greg Kroah-Hartman1-4/+4
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 <[email protected]> Cc: Alessandro Zummo <[email protected]> Cc: Srinidhi Kasagar <[email protected]> Cc: Linus Walleij <[email protected]> Cc: Mike Frysinger <[email protected]> Cc: Wan ZongShun <[email protected]> Cc: Guan Xuetao <[email protected]> Cc: Mark Brown <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-05-29rtc: ds1307: add trickle charger supportWolfram Sang1-3/+16
Some DS13XX devices have "trickle chargers". Its configuration register is at different locations, the setup is the same, though. Since the configuration is board specific, introduce a platform_data to this driver. Tested with a DS1339 on a custom board. Signed-off-by: Wolfram Sang <[email protected]> Cc: Alessandro Zummo <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-05-29rtc: ds1307: remove superfluous initializationWolfram Sang1-1/+0
ds1307 was kzalloced, so no need to zero members of the struct. Signed-off-by: Wolfram Sang <[email protected]> Acked-by: Joakim Tjernlund <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-04-25drivers/rtc/rtc-ds1307.c: fix BUG shown with lock debugging enabledAnatolij Gustschin1-0/+1
Add struct bin_attribute initialization to fix the following bug: rtc-ds1307 3-0068: rtc core: registered ds1307 as rtc0 BUG: key cfb14fcc not in .data! ------------[ cut here ]------------ WARNING: at kernel/lockdep.c:2986 sysfs_add_file_mode+0x84/0xdc() Modules linked in: [<c0018d94>] (unwind_backtrace+0x0/0xf8) from [<c0031f7c>] (warn_slowpath_common+0x4c/0x64) [<c0031f7c>] (warn_slowpath_common+0x4c/0x64) from [<c0031fb0>] (warn_slowpath_null+0x1c/0x24) [<c0031fb0>] (warn_slowpath_null+0x1c/0x24) from [<c012f7ac>] (sysfs_add_file_mode+0x84/0xdc) [<c012f7ac>] (sysfs_add_file_mode+0x84/0xdc) from [<c04b11e4>] (ds1307_probe+0x5e4/0x6ac) [<c04b11e4>] (ds1307_probe+0x5e4/0x6ac) from [<c036e600>] (i2c_device_probe+0xdc/0x108) [<c036e600>] (i2c_device_probe+0xdc/0x108) from [<c02cdf84>] (driver_probe_device+0x90/0x210) [<c02cdf84>] (driver_probe_device+0x90/0x210) from [<c02ce198>] (__driver_attach+0x94/0x98) [<c02ce198>] (__driver_attach+0x94/0x98) from [<c02cc824>] (bus_for_each_dev+0x50/0x7c) [<c02cc824>] (bus_for_each_dev+0x50/0x7c) from [<c02cd780>] (bus_add_driver+0x184/0x244) [<c02cd780>] (bus_add_driver+0x184/0x244) from [<c02ce43c>] (driver_register+0x78/0x12c) [<c02ce43c>] (driver_register+0x78/0x12c) from [<c03701ac>] (i2c_register_driver+0x2c/0xb4) [<c03701ac>] (i2c_register_driver+0x2c/0xb4) from [<c0008798>] (do_one_initcall+0x34/0x178) [<c0008798>] (do_one_initcall+0x34/0x178) from [<c0691860>] (kernel_init+0xdc/0x194) [<c0691860>] (kernel_init+0xdc/0x194) from [<c0013cf0>] (kernel_thread_exit+0x0/0x8) Since commit 6992f5334995af4 ("sysfs: Use one lockdep class per sysfs attribute") this initialization is required. Reported-by: Stefano Babic <[email protected]> Tested-by: Stefano Babic <[email protected]> Signed-off-by: Anatolij Gustschin <[email protected]> Cc: Alessandro Zummo <[email protected]> Cc: Stefano Babic <[email protected]> Cc: Eric W. Biederman <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Acked-by: Wolfram Sang <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-03-23rtc: ds1307: generalise ram size and offsetAustin Boyle1-31/+47
Generalise NVRAM to support RAM with other size and offset, such as the 64 bytes of SRAM on the mcp7941x. [[email protected]: fix printk format warning] Signed-off-by: Austin Boyle <[email protected]> Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Randy Dunlap <[email protected]> Cc: David Anders <[email protected]> Cc: Alessandro Zummo <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-03-23rtc: ds1307: comment and format cleanupDavid Anders1-13/+24
Do some cleanup of the comment sections as well as correct some formatting issues reported by checkpatch.pl. Signed-off-by: David Anders <[email protected]> Signed-off-by: Wolfram Sang <[email protected]> Cc: Austin Boyle <[email protected]> Cc: Alessandro Zummo <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-03-23rtc: ds1307: simplify irq setup codeWolfram Sang1-6/+5
No need to have two seperate if-blocks for setting up the irq. Signed-off-by: Wolfram Sang <[email protected]> Tested-by: David Anders <[email protected]> Cc: Austin Boyle <[email protected]> Cc: Alessandro Zummo <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-03-23rtc: ds1307: refactor chip_desc tableWolfram Sang1-29/+19
The chip_desc table is suboptimal. Currently it requires an entry for every new chip type, even if it is empty. This has already been forgotten for the ds1388. Refactor the code, so new entries are only needed, when they chip type really needs a (non-empty) description. Also make the table visually more appealing. Signed-off-by: Wolfram Sang <[email protected]> Cc: Austin Boyle <[email protected]> Cc: David Anders <[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-11/+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-11-02rtc: add initial support for mcp7941x partsDavid Anders1-0/+27
Add initial support for the microchip mcp7941x series of real time clocks. The mcp7941x series is generally compatible with the ds1307 and ds1337 rtc devices from dallas semiconductor. minor differences include a backup battery enable bit, and the polarity of the oscillator enable bit. Signed-off-by: David Anders <[email protected]> Cc: Alessandro Zummo <[email protected]> Reviewed-by: Wolfram Sang <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-06-27drivers/rtc/rtc-ds1307.c: add support for RTC device pt7c4338Priyanka Jain1-0/+1
PT7C4338 chip is being manufactured by Pericom Technology Inc. It is a serial real-time clock which provides: 1) Low-power clock/calendar. 2) Programmable square-wave output. It has 56 bytes of nonvolatile RAM. Its register set is same as that of rtc device: DS1307. Signed-off-by: Priyanka Jain <[email protected]> Acked-by: Timur Tabi <[email protected]> Reviewed-by: Wolfram Sang <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-02-03RTC: Convert rtc drivers to use the alarm_irq_enable methodJohn Stultz1-36/+13
Some rtc drivers use the ioctl method instead of the alarm_irq_enable method for enabling alarm interupts. With the new virtualized RTC rework, its important for drivers to use the alarm_irq_enable instead. This patch converts the drivers that use the AIE ioctl method to use the alarm_irq_enable method. Other ioctl cmds are left untouched. I have not been able to test or even compile most of these drivers. Any help to make sure this change is correct would be appreciated! CC: Alessandro Zummo <[email protected]> CC: Thomas Gleixner <[email protected]> CC: Marcelo Roberto Jimenez <[email protected]> Reported-by: Marcelo Roberto Jimenez <[email protected]> Tested-by: Marcelo Roberto Jimenez <[email protected]> Signed-off-by: John Stultz <[email protected]>
2011-01-10i2c: Constify i2c_client where possibleJean Delvare1-6/+6
Helper functions for I2C and SMBus transactions don't modify the i2c_client that is passed to them, so it can be marked const. Signed-off-by: Jean Delvare <[email protected]>