@@ -558,7 +558,7 @@ static const struct attribute_group pcf2127_attr_group = {
558
558
};
559
559
560
560
static 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 )
562
562
{
563
563
struct pcf2127 * pcf2127 ;
564
564
int ret = 0 ;
@@ -601,7 +601,7 @@ static int pcf2127_probe(struct device *dev, struct regmap *regmap,
601
601
set_bit (RTC_FEATURE_ALARM , pcf2127 -> rtc -> features );
602
602
}
603
603
604
- if (has_nvmem ) {
604
+ if (is_pcf2127 ) {
605
605
struct nvmem_config nvmem_cfg = {
606
606
.priv = pcf2127 ,
607
607
.reg_read = pcf2127_nvmem_read ,
@@ -636,14 +636,18 @@ static int pcf2127_probe(struct device *dev, struct regmap *regmap,
636
636
* Watchdog timer enabled and reset pin /RST activated when timed out.
637
637
* Select 1Hz clock source for watchdog timer.
638
638
* 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.
639
643
*/
640
644
ret = regmap_update_bits (pcf2127 -> regmap , PCF2127_REG_WD_CTL ,
641
645
PCF2127_BIT_WD_CTL_CD1 |
642
646
PCF2127_BIT_WD_CTL_CD0 |
643
647
PCF2127_BIT_WD_CTL_TF1 |
644
648
PCF2127_BIT_WD_CTL_TF0 ,
645
649
PCF2127_BIT_WD_CTL_CD1 |
646
- PCF2127_BIT_WD_CTL_CD0 |
650
+ ( is_pcf2127 ? PCF2127_BIT_WD_CTL_CD0 : 0 ) |
647
651
PCF2127_BIT_WD_CTL_TF1 );
648
652
if (ret ) {
649
653
dev_err (dev , "%s: watchdog config (wd_ctl) failed\n" , __func__ );
0 commit comments