aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-fm3130.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/rtc-fm3130.c')
-rw-r--r--drivers/rtc/rtc-fm3130.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/rtc/rtc-fm3130.c b/drivers/rtc/rtc-fm3130.c
index 3a7be11cc6b9..ff6fce61ea41 100644
--- a/drivers/rtc/rtc-fm3130.c
+++ b/drivers/rtc/rtc-fm3130.c
@@ -13,6 +13,7 @@
13#include <linux/i2c.h> 13#include <linux/i2c.h>
14#include <linux/rtc.h> 14#include <linux/rtc.h>
15#include <linux/bcd.h> 15#include <linux/bcd.h>
16#include <linux/slab.h>
16 17
17#define FM3130_RTC_CONTROL (0x0) 18#define FM3130_RTC_CONTROL (0x0)
18#define FM3130_CAL_CONTROL (0x1) 19#define FM3130_CAL_CONTROL (0x1)
@@ -376,20 +377,22 @@ static int __devinit fm3130_probe(struct i2c_client *client,
376 } 377 }
377 378
378 /* Disabling calibration mode */ 379 /* Disabling calibration mode */
379 if (fm3130->regs[FM3130_RTC_CONTROL] & FM3130_RTC_CONTROL_BIT_CAL) 380 if (fm3130->regs[FM3130_RTC_CONTROL] & FM3130_RTC_CONTROL_BIT_CAL) {
380 i2c_smbus_write_byte_data(client, FM3130_RTC_CONTROL, 381 i2c_smbus_write_byte_data(client, FM3130_RTC_CONTROL,
381 fm3130->regs[FM3130_RTC_CONTROL] & 382 fm3130->regs[FM3130_RTC_CONTROL] &
382 ~(FM3130_RTC_CONTROL_BIT_CAL)); 383 ~(FM3130_RTC_CONTROL_BIT_CAL));
383 dev_warn(&client->dev, "Disabling calibration mode!\n"); 384 dev_warn(&client->dev, "Disabling calibration mode!\n");
385 }
384 386
385 /* Disabling read and write modes */ 387 /* Disabling read and write modes */
386 if (fm3130->regs[FM3130_RTC_CONTROL] & FM3130_RTC_CONTROL_BIT_WRITE || 388 if (fm3130->regs[FM3130_RTC_CONTROL] & FM3130_RTC_CONTROL_BIT_WRITE ||
387 fm3130->regs[FM3130_RTC_CONTROL] & FM3130_RTC_CONTROL_BIT_READ) 389 fm3130->regs[FM3130_RTC_CONTROL] & FM3130_RTC_CONTROL_BIT_READ) {
388 i2c_smbus_write_byte_data(client, FM3130_RTC_CONTROL, 390 i2c_smbus_write_byte_data(client, FM3130_RTC_CONTROL,
389 fm3130->regs[FM3130_RTC_CONTROL] & 391 fm3130->regs[FM3130_RTC_CONTROL] &
390 ~(FM3130_RTC_CONTROL_BIT_READ | 392 ~(FM3130_RTC_CONTROL_BIT_READ |
391 FM3130_RTC_CONTROL_BIT_WRITE)); 393 FM3130_RTC_CONTROL_BIT_WRITE));
392 dev_warn(&client->dev, "Disabling READ or WRITE mode!\n"); 394 dev_warn(&client->dev, "Disabling READ or WRITE mode!\n");
395 }
393 396
394 /* oscillator off? turn it on, so clock can tick. */ 397 /* oscillator off? turn it on, so clock can tick. */
395 if (fm3130->regs[FM3130_CAL_CONTROL] & FM3130_CAL_CONTROL_BIT_nOSCEN) 398 if (fm3130->regs[FM3130_CAL_CONTROL] & FM3130_CAL_CONTROL_BIT_nOSCEN)