diff options
Diffstat (limited to 'zephyr/drivers/cros_rtc')
-rw-r--r-- | zephyr/drivers/cros_rtc/Kconfig | 7 | ||||
-rw-r--r-- | zephyr/drivers/cros_rtc/nxp_rtc_pcf85063a.c | 10 | ||||
-rw-r--r-- | zephyr/drivers/cros_rtc/nxp_rtc_pcf85063a.h | 1 |
3 files changed, 18 insertions, 0 deletions
diff --git a/zephyr/drivers/cros_rtc/Kconfig b/zephyr/drivers/cros_rtc/Kconfig index fb84416d70..2f064b4db8 100644 --- a/zephyr/drivers/cros_rtc/Kconfig +++ b/zephyr/drivers/cros_rtc/Kconfig @@ -45,4 +45,11 @@ config CROS_RTC_RENESAS_IDT1337AG endchoice # CROS_RTC_TYPE +config PLATFORM_EC_PCF85063A_CAP_SEL + bool "Set CAP_SEL of PCF85063A" + depends on CROS_RTC_NXP_PCF85063A + help + This option select the internal oscillator capacitor to 12.5 pF, + default is 7 pF. + endif # PLATFORM_EC_RTC diff --git a/zephyr/drivers/cros_rtc/nxp_rtc_pcf85063a.c b/zephyr/drivers/cros_rtc/nxp_rtc_pcf85063a.c index 34c2cbe0a7..298c8cd64f 100644 --- a/zephyr/drivers/cros_rtc/nxp_rtc_pcf85063a.c +++ b/zephyr/drivers/cros_rtc/nxp_rtc_pcf85063a.c @@ -363,6 +363,16 @@ static int nxp_rtc_pcf85063a_init(const struct device *dev) } } +#ifdef CONFIG_PLATFORM_EC_PCF85063A_CAP_SEL + ret = pcf85063a_write_reg(dev, REG_CONTROL_1, + (CONTROL_1_DEFAULT_VALUE | CAP_SEL)); + + if (ret < 0) { + LOG_ERR("PCF85063A set CAP_SEL Fail!"); + return ret; + } +#endif + /* * Read Seconds register and check if oscillator is stopped. * If so, clear the bit. diff --git a/zephyr/drivers/cros_rtc/nxp_rtc_pcf85063a.h b/zephyr/drivers/cros_rtc/nxp_rtc_pcf85063a.h index 54b1fbd2ea..c0139db631 100644 --- a/zephyr/drivers/cros_rtc/nxp_rtc_pcf85063a.h +++ b/zephyr/drivers/cros_rtc/nxp_rtc_pcf85063a.h @@ -10,6 +10,7 @@ #define SOFT_RESET 0x58 #define CONTROL_1_DEFAULT_VALUE 0 #define OS_BIT 0x80 +#define CAP_SEL 0x01 #define DISABLE_ALARM 0x80 #define ENABLE_ALARM_INTERRUPT 0x80 #define RTC_STOP_CLOCKS 0x20 |