summaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-m41t80.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/rtc-m41t80.c')
-rw-r--r--drivers/rtc/rtc-m41t80.c32
1 files changed, 20 insertions, 12 deletions
diff --git a/drivers/rtc/rtc-m41t80.c b/drivers/rtc/rtc-m41t80.c
index 89128fc29ccc..f736f8c22e96 100644
--- a/drivers/rtc/rtc-m41t80.c
+++ b/drivers/rtc/rtc-m41t80.c
@@ -544,10 +544,22 @@ static struct clk *m41t80_sqw_register_clk(struct m41t80_data *m41t80)
{
struct i2c_client *client = m41t80->client;
struct device_node *node = client->dev.of_node;
+ struct device_node *fixed_clock;
struct clk *clk;
struct clk_init_data init;
int ret;
+ fixed_clock = of_get_child_by_name(node, "clock");
+ if (fixed_clock) {
+ /*
+ * skip registering square wave clock when a fixed
+ * clock has been registered. The fixed clock is
+ * registered automatically when being referenced.
+ */
+ of_node_put(fixed_clock);
+ return 0;
+ }
+
/* First disable the clock */
ret = i2c_smbus_read_byte_data(client, M41T80_REG_ALARM_MON);
if (ret < 0)
@@ -599,10 +611,8 @@ static unsigned long wdt_is_open;
static int boot_flag;
/**
- * wdt_ping:
- *
- * Reload counter one with the watchdog timeout. We don't bother reloading
- * the cascade counter.
+ * wdt_ping - Reload counter one with the watchdog timeout.
+ * We don't bother reloading the cascade counter.
*/
static void wdt_ping(void)
{
@@ -638,9 +648,7 @@ static void wdt_ping(void)
}
/**
- * wdt_disable:
- *
- * disables watchdog.
+ * wdt_disable - disables watchdog.
*/
static void wdt_disable(void)
{
@@ -677,7 +685,7 @@ static void wdt_disable(void)
}
/**
- * wdt_write:
+ * wdt_write - write to watchdog.
* @file: file handle to the watchdog
* @buf: buffer to write (unused as data does not matter here
* @count: count of bytes
@@ -703,7 +711,7 @@ static ssize_t wdt_read(struct file *file, char __user *buf,
}
/**
- * wdt_ioctl:
+ * wdt_ioctl - ioctl handler to set watchdog.
* @file: file handle to the device
* @cmd: watchdog command
* @arg: argument pointer
@@ -778,7 +786,7 @@ static long wdt_unlocked_ioctl(struct file *file, unsigned int cmd,
}
/**
- * wdt_open:
+ * wdt_open - open a watchdog.
* @inode: inode of device
* @file: file handle to device
*
@@ -802,7 +810,7 @@ static int wdt_open(struct inode *inode, struct file *file)
}
/**
- * wdt_close:
+ * wdt_release - release a watchdog.
* @inode: inode to board
* @file: file handle to board
*
@@ -815,7 +823,7 @@ static int wdt_release(struct inode *inode, struct file *file)
}
/**
- * notify_sys:
+ * wdt_notify_sys - notify to watchdog.
* @this: our notifier block
* @code: the event being reported
* @unused: unused