Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp550717pxu; Tue, 1 Dec 2020 19:14:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJxb88rrdJee5fVVoaoKKRZOj22EYJ0jK6y+3f6oGtRCFvG5WoBALTWTC9PF7JGSwSv2OPs8 X-Received: by 2002:a17:906:7fca:: with SMTP id r10mr440623ejs.24.1606878850674; Tue, 01 Dec 2020 19:14:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606878850; cv=none; d=google.com; s=arc-20160816; b=SLCQc8YkUXwMIQrcJCBL/SSD3w3GpbrEW9Al3jJfdAmUKnSodYKBQis6go2GCMnRab DReZMqTON1yHcm1IquUHaZ3AgBJ88OUEZ5MyAHz4kw7EYTsssDyDweSUtihSrD+kguu2 qJ8W1BlLIJD6BmKKNtiBwRx0L+0S3S5tBwJYvPU3QJIXjjF61glWRuHVtHjtBNHphunX e3urDEW6KpBYERpvFMphmba6uhy0uzvqBRvRwB5pBtGgew3XewLkN9ODyfppceHljfLk zoGR1kDKpZk2dR+gYqiYmywPb4+aDBt8p66/Jl2u8Cx3HNjWOuuTxy5C/ezt4gdms+NT qH7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=vP/qXlwpHrMRn0N+hGJeW7JW5aBsdcb+ioPoWDU1Jvk=; b=NUpsbPXAYIco7w/ZWpZuFMkORNOm0SW0fyTmTQ07qattvfIcx36MjqMSbp/b18Zo5a a3/mLokb8RPfa5VqIwIS4pxF/nWyUFIDpiN2vvRVWXkZuv/Kib90dajqT0wJcj9cbn3c Ou90BCwzFCayT/TfsoxMOzUQkNk1YJGI3xMAycw+hoCF41twrVm+7pS6D2hffQemEihT mSX032S7i15WzPjLiI9EyZjzvN+E4PfmyR84YxmO8PoObMQbRqKAYftvS4nJsvyo8q/4 t8wR6Dfwq0YtwBc8LqFPaDz4Kbmq6wv2bUCob8YB8yq6DQAiYbjgdTZvE5tfj3dHFiJp k9Ig== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hq35si72835ejc.633.2020.12.01.19.13.47; Tue, 01 Dec 2020 19:14:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727941AbgLBDL1 (ORCPT + 99 others); Tue, 1 Dec 2020 22:11:27 -0500 Received: from inva021.nxp.com ([92.121.34.21]:49378 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727132AbgLBDL0 (ORCPT ); Tue, 1 Dec 2020 22:11:26 -0500 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 2661B200C86; Wed, 2 Dec 2020 04:10:40 +0100 (CET) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id B5F2D200C78; Wed, 2 Dec 2020 04:10:36 +0100 (CET) Received: from localhost.localdomain (mega.ap.freescale.net [10.192.208.232]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 3559E402C7; Wed, 2 Dec 2020 04:10:32 +0100 (CET) From: Biwen Li To: leoyang.li@nxp.com, alexandre.belloni@bootlin.com, anson.huang@nxp.com, aisheng.dong@nxp.com Cc: linux-kernel@vger.kernel.org, jiafei.pan@nxp.com, linux-rtc@vger.kernel.org, Biwen Li Subject: [v2 1/2] rtc: pcf2127: properly set flag WD_CD for rtc chips(pcf2129, pca2129) Date: Wed, 2 Dec 2020 11:18:39 +0800 Message-Id: <20201202031840.15582-1-biwen.li@oss.nxp.com> X-Mailer: git-send-email 2.17.1 X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Biwen Li Properly set flag WD_CD for rtc chips(pcf2129, pca2129) Signed-off-by: Biwen Li --- Change in v2: - set flag WD_CD according to compatible drivers/rtc/rtc-pcf2127.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/rtc/rtc-pcf2127.c b/drivers/rtc/rtc-pcf2127.c index 03c9cb6b0b6e..a5418b657c50 100644 --- a/drivers/rtc/rtc-pcf2127.c +++ b/drivers/rtc/rtc-pcf2127.c @@ -620,6 +620,10 @@ static int pcf2127_probe(struct device *dev, struct regmap *regmap, * Watchdog timer enabled and reset pin /RST activated when timed out. * Select 1Hz clock source for watchdog timer. * Note: Countdown timer disabled and not available. + * For pca2129, pcf2129, only bit[7] is for Symbol WD_CD + * of register watchdg_tim_ctl. The bit[6] is labeled + * as T. Bits labeled as T must always be written with + * logic 0. */ ret = regmap_update_bits(pcf2127->regmap, PCF2127_REG_WD_CTL, PCF2127_BIT_WD_CTL_CD1 | @@ -627,7 +631,8 @@ static int pcf2127_probe(struct device *dev, struct regmap *regmap, PCF2127_BIT_WD_CTL_TF1 | PCF2127_BIT_WD_CTL_TF0, PCF2127_BIT_WD_CTL_CD1 | - PCF2127_BIT_WD_CTL_CD0 | + (device_property_match_string(dev, "compatible", "nxp,pcf2127") + ? (PCF2127_BIT_WD_CTL_CD0) : (0)) | PCF2127_BIT_WD_CTL_TF1); if (ret) { dev_err(dev, "%s: watchdog config (wd_ctl) failed\n", __func__); -- 2.17.1