rtc: pcf8563: Enable or disable clock out due to clk_disable_unused hang.
authorJosep Orga <jorga@somdevices.com>
Tue, 21 Apr 2020 19:07:45 +0000 (21:07 +0200)
committerJosep Orga <jorga@somdevices.com>
Tue, 21 Apr 2020 19:07:45 +0000 (21:07 +0200)
Signed-off-by: Josep Orga <jorga@somdevices.com>
drivers/rtc/rtc-pcf8563.c

index 3efc86c..ee64ec8 100644 (file)
@@ -23,6 +23,9 @@
 #include <linux/of.h>
 #include <linux/err.h>
 
+/*Enable or disable clock out due to clk_disable_unused hang*/
+//#define PCF8563_ENABLE_CLKO
+
 #define PCF8563_REG_ST1                0x00 /* status */
 #define PCF8563_REG_ST2                0x01
 #define PCF8563_BIT_AIE                (1 << 1)
@@ -82,7 +85,7 @@ struct pcf8563 {
        int voltage_low; /* incicates if a low_voltage was detected */
 
        struct i2c_client *client;
-#ifdef CONFIG_COMMON_CLK
+#if defined(CONFIG_COMMON_CLK) && defined(PCF8563_ENABLE_CLKO)
        struct clk_hw           clkout_hw;
 #endif
 };
@@ -396,7 +399,7 @@ static int pcf8563_irq_enable(struct device *dev, unsigned int enabled)
        return pcf8563_set_alarm_mode(to_i2c_client(dev), !!enabled);
 }
 
-#ifdef CONFIG_COMMON_CLK
+#if defined(CONFIG_COMMON_CLK) && defined(PCF8563_ENABLE_CLKO)
 /*
  * Handling of the clkout
  */
@@ -615,7 +618,7 @@ static int pcf8563_probe(struct i2c_client *client,
 
        }
 
-#ifdef CONFIG_COMMON_CLK
+#if defined(CONFIG_COMMON_CLK) && defined(PCF8563_ENABLE_CLKO)
        /* register clk in common clk framework */
        pcf8563_clkout_register_clk(pcf8563);
 #endif