- 05 9月, 2017 4 次提交
-
-
由 Alexandre Belloni 提交于
Use the BIT macro were possbiel. Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com> -
由 Alexandre Belloni 提交于
u32 should be used instead of uint32_t Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com> -
由 Alexandre Belloni 提交于
Use sizeof where possible to ensure we don't read/write more than the allocated buffer. Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com> -
由 Alexandre Belloni 提交于
ds1307->regs is never used before being read or initialized locally. There is no point in keeping a copy in memory. Also limit the size of the read buffer to what is really used, rename buf to regs for consistency and use sizeof() where possible. Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
- 01 9月, 2017 10 次提交
-
-
由 Nikita Yushchenko 提交于
This adds support for reading and writing date/time from/to ds1341 chip. ds1341 chip has other features - alarms, input clock (can be used instead of intercal oscillator for better accuracy), output clock ("square wave generation"). However, not all of that is available at the same time. Same chip pins, CLKIN/nINTA and SQW/nINTB, can be used either for input/output clocks, or for alarm interrupts. Role of these pins on particular board depends on hardware wiring. We can add device tree properties that describe if each of pins is wired as clock, or as interrupt, or left unconnected, and enable support for corresponding functionality based on that. But that is cumbersome, requires hardware for testing, and has to deal with bit enabling/disabling output clock also affects which pins alarm interrupts are routed to. Another factor is that there are hardware setups (i.e. ZII RDU2) that power DS1341 from SuperCap, which makes power saving critical. For such setups, kernel driver should leave register bits that control mentioned pins in the state configured by bootloader. Given all that, it was decided to limit support to "only date/time" for now. That is enough for common use case. Full (and cumbersome) implementation can be added later if ever needed. Signed-off-by: NNikita Yushchenko <nikita.yoush@cogentembedded.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Tested-by: NAleksander Morgado <aleksander@aleksander.es> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com> -
由 Heiner Kallweit 提交于
Remove member nvram_offset from struct ds1307 and use the value stored in struct chip_desc directly. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
由 Heiner Kallweit 提交于
Factor out offset to struct chip_desc and remove it from struct ds1307. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
由 Heiner Kallweit 提交于
Factor out rtc_ops to struct chip_desc and use ds13xx_rtc_ops as default. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
由 Heiner Kallweit 提交于
Factor out irq_handler to struct chip_desc and use ds1307_irq as default. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
由 Heiner Kallweit 提交于
Change the usage of variable want_irq to reflect its name. Don't set it to true in case wakeup is enabled but no interrupt number is given. In addition set variable ds1307_can_wakeup_device if chip->alarm is set only. This allows to simplify the code and make it better understandable. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
由 Heiner Kallweit 提交于
Constify struct chip_desc variables. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
由 Heiner Kallweit 提交于
Instead of storing the trickle_charger_setup value in struct chip_desc we can let function ds1307_trickle_init return it because it's used in the probe function only. This allows us to constify struct chip_desc variables in a next step. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
由 Heiner Kallweit 提交于
Factor out the bbsqi bit to struct chip_desc. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
由 Heiner Kallweit 提交于
The irq number is used in the probe function only, so we don't have to store it in struct ds1307. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
- 31 7月, 2017 1 次提交
-
-
由 Heiner Kallweit 提交于
Commit 8b44f5be ("ARM: dts: armada: replace isil,irq2-can-wakeup-machine with wakeup-source property") removed the last usage of "isil,irq2-can-wakeup-machine" almost two years ago. So I think we can get rid of supporting this legacy binding. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Acked-by: NRob Herring <robh@kernel.org> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
- 07 7月, 2017 5 次提交
-
-
由 Alexandre Belloni 提交于
ds1307_remove() is now empty, remove it Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com> -
由 Alexandre Belloni 提交于
Instead of adding a binary sysfs attribute from the driver (which suffers from a race condition as the attribute appears after the device), use the core to register an nvmem device. Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com> -
由 Alexandre Belloni 提交于
This removes a possible race condition and crash and allows for further improvement of the driver. Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com> -
由 Sean Nyekjaer 提交于
The ds1308 variant is very similar to the already supported ds1338 variant, it have more debug registers and a square wave clock output. Signed-off-by: NSean Nyekjaer <sean.nyekjaer@prevas.dk> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
由 Heiner Kallweit 提交于
The driver has lots of places with chip-specific code what doesn't necessarily facilitate maintenance. Let's describe chip-specific differences in century bit handling in struct chip_desc to improve this. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
- 06 7月, 2017 1 次提交
-
-
由 Heiner Kallweit 提交于
After the switch to regmap we can now make use of regmap_update_bits to simplify read/modify/write ops. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
- 25 6月, 2017 1 次提交
-
-
由 Marek Vasut 提交于
Add support for yet another RTC chip, Epson RX8130CE. This time around, the chip has slightly permutated registers and also the register starts at 0x10 instead of 0x0 . So far, we only support the RTC and NVRAM parts of the chip, Alarm and Timer is not supported. Signed-off-by: NMarek Vasut <marex@denx.de> Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Felipe Balbi <balbi@ti.com> Cc: Nishanth Menon <nm@ti.com> Cc: Tony Lindgren <tony@atomide.com> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
- 03 6月, 2017 1 次提交
-
-
由 Alexandre Belloni 提交于
ds1307->rtc->name is a copy of ds1307->name, use it instead. Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
- 31 5月, 2017 1 次提交
-
-
由 David Lowe 提交于
This patch extends the fixes for ds1337, ds1339, ds3231 in commit 8bc2a407 ("rtc: ds1307: add support for the DT property 'wakeup-source'") to mcp794xx devices, so that those parts can similarly be used as a wakeup source without an IRQ to the processor. Tested on Raspberry Pi ZeroW with MCP79400. Signed-off-by: NDavid Lowe <dave-lowe@ntlworld.com> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
- 26 5月, 2017 1 次提交
-
-
由 Heiner Kallweit 提交于
This patch converts the ds1307 driver to using regmap. It's a rather big patch and I can test with DS3231 only. With this chip it's working fine. I'd appreciate if people with other supported hardware could test as well. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
- 14 4月, 2017 2 次提交
-
-
由 Alexandre Belloni 提交于
m41t0 was added to the I2C device ID table but not the OF table. Fix that. Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com> -
由 Stefan Agner 提交于
The m41t0 variant is very similar to the already supported m41t00 variant, with the notable exception of the oscillator fail bit. The data sheet notes: If the oscillator fail (OF) bit is internally set to a '1,' this indicates that the oscillator has either stopped, or was stopped for some period of time and can be used to judge the validity of the clock and date data. The bit will get cleared with a regular write of the system time, so no changes are needed to clear it. Signed-off-by: NStefan Agner <stefan@agner.ch> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
- 09 3月, 2017 1 次提交
-
-
由 Javier Martinez Canillas 提交于
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: NJavier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
- 19 12月, 2016 1 次提交
-
-
由 Tin Huynh 提交于
This patch enables ACPI support for rtc-ds1307 driver. Signed-off-by: NTin Huynh <tnhuynh@apm.com> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
- 01 9月, 2016 2 次提交
-
-
由 Alexandre Belloni 提交于
Intersil ISL12057 is a drop-in replacement for DS1337. It can be supported by the ds1307 driver. Acked-by: NArnaud Ebalard <arno@natisbad.org> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
由 Alexandre Belloni 提交于
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: NArnaud Ebalard <arno@natisbad.org> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
- 09 7月, 2016 2 次提交
-
-
由 Uwe Kleine-König 提交于
Since commit d68778b8 ("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: NUwe Kleine-König <uwe@kleine-koenig.org> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
由 Keerthy 提交于
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: 1d1945d2 "drivers/rtc/rtc-ds1307.c: add alarm support for mcp7941x chips" Signed-off-by: NKeerthy <j-keerthy@ti.com> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
- 20 5月, 2016 3 次提交
-
-
由 Stephen Boyd 提交于
This flag is a no-op now (see commit 47b0eeb3 "clk: Deprecate CLK_IS_ROOT", 2016-02-02) so remove it. Cc: Akinobu Mita <akinobu.mita@gmail.com> Cc: Michael Tatarinov <kukabu@gmail.com> Signed-off-by: NStephen Boyd <sboyd@codeaurora.org> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
由 Nicolas Boullis 提交于
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: NNicolas Boullis <nboullis@debian.org> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
由 Nicolas Boullis 提交于
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: NNicolas Boullis <nboullis@debian.org> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
- 22 4月, 2016 2 次提交
-
-
由 Nishanth Menon 提交于
With commit 8bc2a407 ("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: 8bc2a407 ("rtc: ds1307: add support for the DT property 'wakeup-source'") Reported-by: NTony Lindgren <tony@atomide.com> Cc: Michael Lange <linuxstuff@milaw.biz> Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: NNishanth Menon <nm@ti.com> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
由 Zhuang Yuyao 提交于
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: NAkinobu Mita <akinobu.mita@gmail.com> Tested-by: NMichael Tatarinov <kukabu@gmail.com> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
- 15 3月, 2016 1 次提交
-
-
由 Akinobu Mita 提交于
DS3231 has programmable square-wave output signal. This enables to use this feature as a clock provider of common clock framework. Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com> Reviewed-by: NMichael Turquette <mturquette@baylibre.com> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-
- 05 2月, 2016 1 次提交
-
-
由 Akinobu Mita 提交于
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: NAkinobu Mita <akinobu.mita@gmail.com> Acked-by: NGuenter Roeck <linux@roeck-us.net> Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
-