@@ -558,7 +558,7 @@ static const struct attribute_group pcf2127_attr_group = {
558558};
559559
560560static int pcf2127_probe (struct device * dev , struct regmap * regmap ,
561- int alarm_irq , const char * name , bool has_nvmem )
561+ int alarm_irq , const char * name , bool is_pcf2127 )
562562{
563563 struct pcf2127 * pcf2127 ;
564564 int ret = 0 ;
@@ -601,7 +601,7 @@ static int pcf2127_probe(struct device *dev, struct regmap *regmap,
601601 set_bit (RTC_FEATURE_ALARM , pcf2127 -> rtc -> features );
602602 }
603603
604- if (has_nvmem ) {
604+ if (is_pcf2127 ) {
605605 struct nvmem_config nvmem_cfg = {
606606 .priv = pcf2127 ,
607607 .reg_read = pcf2127_nvmem_read ,
@@ -636,14 +636,18 @@ static int pcf2127_probe(struct device *dev, struct regmap *regmap,
636636 * Watchdog timer enabled and reset pin /RST activated when timed out.
637637 * Select 1Hz clock source for watchdog timer.
638638 * Note: Countdown timer disabled and not available.
639+ * For pca2129, pcf2129, only bit[7] is for Symbol WD_CD
640+ * of register watchdg_tim_ctl. The bit[6] is labeled
641+ * as T. Bits labeled as T must always be written with
642+ * logic 0.
639643 */
640644 ret = regmap_update_bits (pcf2127 -> regmap , PCF2127_REG_WD_CTL ,
641645 PCF2127_BIT_WD_CTL_CD1 |
642646 PCF2127_BIT_WD_CTL_CD0 |
643647 PCF2127_BIT_WD_CTL_TF1 |
644648 PCF2127_BIT_WD_CTL_TF0 ,
645649 PCF2127_BIT_WD_CTL_CD1 |
646- PCF2127_BIT_WD_CTL_CD0 |
650+ ( is_pcf2127 ? PCF2127_BIT_WD_CTL_CD0 : 0 ) |
647651 PCF2127_BIT_WD_CTL_TF1 );
648652 if (ret ) {
649653 dev_err (dev , "%s: watchdog config (wd_ctl) failed\n" , __func__ );
0 commit comments