aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-ds1307.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-06-25 18:55:33 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2015-06-25 18:55:33 -0700
commitc13c81006314ad76c2b31824960a900385601b8b (patch)
tree749f71b07f252960775c42bd1141d21cb35a768d /drivers/rtc/rtc-ds1307.c
parentMerge branch 'i2c/for-4.2' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux (diff)
parentrtc: remove useless I2C dependencies (diff)
downloadlinux-dev-c13c81006314ad76c2b31824960a900385601b8b.tar.xz
linux-dev-c13c81006314ad76c2b31824960a900385601b8b.zip
Merge tag 'rtc-v4.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux
Pull RTC updates from Alexandre Belloni: "Core: - Coding style and whitespace fixes (interface, Makefile and Kconfig) - New rtc_tm_sub() helper - New CONFIG_RTC_SYSTOHC_DEVICE option - Removed rtc_set_mmss() New drivers: - Mediatek MT6397 - Cortina Gemini Drivers: - Year 2106 fixes for isl1208, pcf8563 and sunxi - update author email for at32ap700x and efi - ds1307: alarm fix - efi: use correct EFI 'epoch' - hym8563: make irq optional - imxdi: cleanups and better handling of the security/tamper monitoring - snvs: fix wakealarm - Compilation fixes or warning removal for gemini, mt6397, palmas, pfc8563 - Trivial cleanups for ab8500, ds1216, ds1286, ds1672, ep93xx, hid-sensor-time, max6900, max8998, max77686, max77802, mc13xxx, mv, mxc, s3c, spear, v3020 - Kconfig fixes for stmp3xxx and xgene" * tag 'rtc-v4.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (48 commits) rtc: remove useless I2C dependencies rtc: whitespace fixes rtc: Properly sort Makefile MAINTAINERS: Add RTC subsystem repository rtc: pfc8563: fix uninitialized variable warning rtc: ds1307: Enable the mcp794xx alarm after programming time rtc: hym8563: make the irq optional rtc: gemini: fix cocci warnings rtc: mv: correct 24 hour error message rtc: mv: use BIT() rtc: efi: use correct EFI 'epoch' rtc: interface: Remove rtc_set_mmss() sparc: time: Replace update_persistent_clock() with CONFIG_RTC_SYSTOHC rtc: NTP: Add CONFIG_RTC_SYSTOHC_DEVICE for NTP synchronization rtc: sunxi: Replace deprecated rtc_tm_to_time() rtc: isl1208: Replace deprecated rtc_tm_to_time() rtc: Introduce rtc_tm_sub() helper function rtc: pcf8563: Replace deprecated rtc_time_to_tm() and rtc_tm_to_time() rtc: palmas: Initialise bb_charging flag before using it rtc: simplify use of devm_ioremap_resource ...
Diffstat (limited to 'drivers/rtc/rtc-ds1307.c')
-rw-r--r--drivers/rtc/rtc-ds1307.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c
index 4ffabb322a9a..6e76de1856fc 100644
--- a/drivers/rtc/rtc-ds1307.c
+++ b/drivers/rtc/rtc-ds1307.c
@@ -742,17 +742,17 @@ static int mcp794xx_set_alarm(struct device *dev, struct rtc_wkalrm *t)
regs[6] &= ~MCP794XX_BIT_ALMX_IF;
/* Set alarm match: second, minute, hour, day, date, month. */
regs[6] |= MCP794XX_MSK_ALMX_MATCH;
-
- if (t->enabled)
- regs[0] |= MCP794XX_BIT_ALM0_EN;
- else
- regs[0] &= ~MCP794XX_BIT_ALM0_EN;
+ /* Disable interrupt. We will not enable until completely programmed */
+ regs[0] &= ~MCP794XX_BIT_ALM0_EN;
ret = ds1307->write_block_data(client, MCP794XX_REG_CONTROL, 10, regs);
if (ret < 0)
return ret;
- return 0;
+ if (!t->enabled)
+ return 0;
+ regs[0] |= MCP794XX_BIT_ALM0_EN;
+ return i2c_smbus_write_byte_data(client, MCP794XX_REG_CONTROL, regs[0]);
}
static int mcp794xx_alarm_irq_enable(struct device *dev, unsigned int enabled)