From nobody Wed Sep 10 01:57:57 2025 Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E62C331196F for ; Fri, 5 Sep 2025 10:57:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.34 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757069840; cv=none; b=Avt5OXISiGjiBJMrGsrJ8ORn/nJBX1Tk04W6qbwAPBkDpvnIups9DeGRlAuWlSiNzZfSyKps1X8KtQdty4dv69N6XjmbCfJ6qR0XyPHg3SSOXPNM6vzc+YxTlDnNH9yY8H5/8qaeMwdDC3Qf6BvyEidBQ3JsuJZrawJnPCXqMmg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757069840; c=relaxed/simple; bh=y0fxstX70POgWyLYj4Oli9B/nfM1S2JwmH1qdfNILbM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:MIME-Version: Content-Type:References; b=mUNRFKsGoIPq7egNE6+ta5IxlvuyDGsHyihtpOZ73zZaZuMpWKh3PjEdKLK3STPRjoh6B8YR2vi9oYSLKCK0Qj+I2f80pTaR83RZ+8mQuuym5gwOCUlfd9nuuZ+/nH8xrZ0EZm/UDoe7jB0jkzDK/xNS4tc/MuZoQaHa6HS2BcU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=np7fmyJ5; arc=none smtp.client-ip=203.254.224.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="np7fmyJ5" Received: from epcas5p4.samsung.com (unknown [182.195.41.42]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20250905105715epoutp0431db32695af1a0a63a6ffe94815640b7~iXbTCZVvh1299012990epoutp046 for ; Fri, 5 Sep 2025 10:57:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20250905105715epoutp0431db32695af1a0a63a6ffe94815640b7~iXbTCZVvh1299012990epoutp046 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1757069835; bh=ooWfYBgMzL1HgRQvYlxiux0h/MzDlMT3KW8zBL4DMug=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=np7fmyJ5H9lGa1PORLtAIWKDb92ferHWfmhRaXTwdusrOLUZmZfSFeO8hldaUW2lW 4AXYN/aVqsQ99X5X3PPPxKLeTtdCJMyaL5vLRGj1zdJePPLLolGEMY1b7t1LVPRyyn 8/5UVhrrgKEbbHq1/mADOW3N/TylU6osBGRGvflE= Received: from epsnrtp01.localdomain (unknown [182.195.42.153]) by epcas5p4.samsung.com (KnoxPortal) with ESMTPS id 20250905105713epcas5p41d465581cf2290d58cd98c4b0a4c643c~iXbRWBSlb2479124791epcas5p4b; Fri, 5 Sep 2025 10:57:13 +0000 (GMT) Received: from epcas5p2.samsung.com (unknown [182.195.38.89]) by epsnrtp01.localdomain (Postfix) with ESMTP id 4cJCwS5XCdz6B9m5; Fri, 5 Sep 2025 10:57:12 +0000 (GMT) Received: from epsmtip2.samsung.com (unknown [182.195.34.31]) by epcas5p3.samsung.com (KnoxPortal) with ESMTPA id 20250905105712epcas5p35b5f24b8570c050b7ee675cb26f8ce43~iXbP9aZN20553305533epcas5p3r; Fri, 5 Sep 2025 10:57:12 +0000 (GMT) Received: from bose.samsungds.net (unknown [107.108.83.9]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20250905105710epsmtip26d1fd9792e6bbd2ec4ada09f930c876f~iXbOQqDrP0831308313epsmtip2T; Fri, 5 Sep 2025 10:57:10 +0000 (GMT) From: Devang Tailor To: alexandre.belloni@bootlin.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, alim.akhtar@samsung.com, linux-rtc@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, henrik@grimler.se, faraz.ata@samsung.com Cc: Devang Tailor Subject: [PATCH v3 2/3] rtc: s3c: support for exynosautov9 on-chip RTC Date: Fri, 5 Sep 2025 16:35:53 +0530 Message-Id: <20250905110554.2212304-3-dev.tailor@samsung.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250905110554.2212304-1-dev.tailor@samsung.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CMS-MailID: 20250905105712epcas5p35b5f24b8570c050b7ee675cb26f8ce43 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" CMS-TYPE: 105P cpgsPolicy: CPGSC10-542,Y X-CFilter-Loop: Reflected X-CMS-RootMailID: 20250905105712epcas5p35b5f24b8570c050b7ee675cb26f8ce43 References: <20250905110554.2212304-1-dev.tailor@samsung.com> The on-chip RTC of this SoC is almost similar to the previous version of SoCs except for S3C2410_TICNT tick time counter, which is used in this driver but not applicable for exynosautov9. So re-use the existing driver skipping disablement of S3C2410_TICNT in s3c24xx_rtc_disable() callback via a new boolean member of s3c_rtc_data. This has been tested with 'hwclock' & 'date' utilities Suggested-by: Henrik Grimler Signed-off-by: Devang Tailor Reviewed-by: Henrik Grimler --- drivers/rtc/rtc-s3c.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c index 79b2a16f15ad..8fc5b4582b6d 100644 --- a/drivers/rtc/rtc-s3c.c +++ b/drivers/rtc/rtc-s3c.c @@ -48,6 +48,7 @@ struct s3c_rtc { =20 struct s3c_rtc_data { bool needs_src_clk; + bool use_s3c2410_ticnt; =20 void (*irq_handler) (struct s3c_rtc *info, int mask); void (*enable) (struct s3c_rtc *info); @@ -369,9 +370,11 @@ static void s3c24xx_rtc_disable(struct s3c_rtc *info) con &=3D ~S3C2410_RTCCON_RTCEN; writew(con, info->base + S3C2410_RTCCON); =20 - con =3D readb(info->base + S3C2410_TICNT); - con &=3D ~S3C2410_TICNT_ENABLE; - writeb(con, info->base + S3C2410_TICNT); + if (info->data->use_s3c2410_ticnt) { + con =3D readb(info->base + S3C2410_TICNT); + con &=3D ~S3C2410_TICNT_ENABLE; + writeb(con, info->base + S3C2410_TICNT); + } } =20 static void s3c6410_rtc_disable(struct s3c_rtc *info) @@ -550,18 +553,21 @@ static void s3c6410_rtc_irq(struct s3c_rtc *info, int= mask) } =20 static const struct s3c_rtc_data s3c2410_rtc_data =3D { + .use_s3c2410_ticnt =3D true, .irq_handler =3D s3c24xx_rtc_irq, .enable =3D s3c24xx_rtc_enable, .disable =3D s3c24xx_rtc_disable, }; =20 static const struct s3c_rtc_data s3c2416_rtc_data =3D { + .use_s3c2410_ticnt =3D true, .irq_handler =3D s3c24xx_rtc_irq, .enable =3D s3c24xx_rtc_enable, .disable =3D s3c24xx_rtc_disable, }; =20 static const struct s3c_rtc_data s3c2443_rtc_data =3D { + .use_s3c2410_ticnt =3D true, .irq_handler =3D s3c24xx_rtc_irq, .enable =3D s3c24xx_rtc_enable, .disable =3D s3c24xx_rtc_disable, @@ -574,6 +580,12 @@ static const struct s3c_rtc_data s3c6410_rtc_data =3D { .disable =3D s3c6410_rtc_disable, }; =20 +static const struct s3c_rtc_data exynosautov9_rtc_data =3D { + .irq_handler =3D s3c6410_rtc_irq, + .enable =3D s3c24xx_rtc_enable, + .disable =3D s3c24xx_rtc_disable, +}; + static const __maybe_unused struct of_device_id s3c_rtc_dt_match[] =3D { { .compatible =3D "samsung,s3c2410-rtc", @@ -590,6 +602,9 @@ static const __maybe_unused struct of_device_id s3c_rtc= _dt_match[] =3D { }, { .compatible =3D "samsung,exynos3250-rtc", .data =3D &s3c6410_rtc_data, + }, { + .compatible =3D "samsung,exynosautov9-rtc", + .data =3D &exynosautov9_rtc_data, }, { /* sentinel */ }, }; --=20 2.34.1