From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A1972CA1010 for ; Thu, 4 Sep 2025 02:10:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=SMNUha3xD+Rt2dAgtb0zQ4SvE9n+JpMWof0kjfU/cXc=; b=M1xR39kFqeUnrdBanbkK/iIp0Q o+2JxirANAVioR2GSu2CsK+65w7giPhHEcbki2o5ap3BlBXHcXjUWdr9pcP58wPuTA0PkPL97inaH St9lJ5SjHVRwg2c69e1UKxORtL7fmPXYe39STXOl+YFpwiOjVGMn5i2UEXBDwtK1xNJMlgmRoiCFh PbCEY7qz0LgpRfft5E9YmKWsVcbFhdKpeol7lrOUGgkBKmXQqnwN/9ogRgVCO6iQqkqAJfh/EiGHU vtmunOpn6vrZuysFvSQDw9l1D8cGXDI9StgnI/1JsdyQZPP91jtO7JZMYsWpKatunt60B6RynczqD RFIsILmA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1utzQU-00000008E20-2zHV; Thu, 04 Sep 2025 02:10:15 +0000 Received: from out-183.mta0.migadu.com ([2001:41d0:1004:224b::b7]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1utt2R-00000007RZP-0c75 for linux-arm-kernel@lists.infradead.org; Wed, 03 Sep 2025 19:21:01 +0000 Date: Wed, 3 Sep 2025 21:20:46 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=grimler.se; s=key1; t=1756927251; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=SMNUha3xD+Rt2dAgtb0zQ4SvE9n+JpMWof0kjfU/cXc=; b=QVg0UfJLMlv1In1mpr0Y++srvzXc85BR+8GHcS2uVNMyRe55/mbrA5+W6Y3uAm9rwXhnML G49K0tMJe3BizoEd51XH+pyu06fYzYVd+y1chcd431EM7kuEvpeeKdYH+sZzy4SBxfad5E 55FjIDBYTfjxUTEmsC7HHp64ojgww0g= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Henrik Grimler To: Devang Tailor Cc: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, alim.akhtar@samsung.com, alexandre.belloni@bootlin.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rtc@vger.kernel.org, faraz.ata@samsung.com Subject: Re: [PATCH v2 2/3] rtc: s3c: support for exynosautov9 on-chip RTC Message-ID: <20250903192046.GA4126@l14.localdomain> References: <20250710083434.1821671-1-dev.tailor@samsung.com> <20250710083434.1821671-3-dev.tailor@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250710083434.1821671-3-dev.tailor@samsung.com> X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250903_122059_932355_1C852BB8 X-CRM114-Status: GOOD ( 22.21 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Devang, On Thu, Jul 10, 2025 at 02:04:33PM +0530, Devang Tailor wrote: > The on-chip RTC of this SoC is almost similar to the previous > versions of SoC. Hence re-use the existing driver with platform specific > change to enable RTC. Could you please describe what the differences are to previous SoCs? You write almost similar, please elaborate in what way in commit message. > This has been tested with 'hwclock' & 'date' utilities > > Signed-off-by: Devang Tailor > --- > > drivers/rtc/rtc-s3c.c | 18 ++++++++++++++++++ > 1 file changed, 18 insertions(+) > > diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c > index 5dd575865adf..8db24b6360b8 100644 > --- a/drivers/rtc/rtc-s3c.c > +++ b/drivers/rtc/rtc-s3c.c > @@ -384,6 +384,15 @@ static void s3c6410_rtc_disable(struct s3c_rtc *info) > writew(con, info->base + S3C2410_RTCCON); > } > > +static void exynosautov9_rtc_disable(struct s3c_rtc *info) > +{ > + unsigned int con; > + > + con = readb(info->base + S3C2410_RTCCON); > + con &= ~S3C2410_RTCCON_RTCEN; > + writeb(con, info->base + S3C2410_RTCCON); > +} Rather than adding a new rtc_disable variant I think this could be handled in existing s3c24xx_rtc_disable (and I think that is what Krzysztof meant). How about adding a new bool to rtc_data that describes if S3C2410_TICNT reg is supported or not, and checking it in s3c24xx_rtc_disable? Best regards, Henrik Grimler > static void s3c_rtc_remove(struct platform_device *pdev) > { > struct s3c_rtc *info = platform_get_drvdata(pdev); > @@ -574,6 +583,12 @@ static struct s3c_rtc_data const s3c6410_rtc_data = { > .disable = s3c6410_rtc_disable, > }; > > +static const struct s3c_rtc_data exynosautov9_rtc_data = { > + .irq_handler = s3c6410_rtc_irq, > + .enable = s3c24xx_rtc_enable, > + .disable = exynosautov9_rtc_disable, > +}; > + > static const __maybe_unused struct of_device_id s3c_rtc_dt_match[] = { > { > .compatible = "samsung,s3c2410-rtc", > @@ -590,6 +605,9 @@ static const __maybe_unused struct of_device_id s3c_rtc_dt_match[] = { > }, { > .compatible = "samsung,exynos3250-rtc", > .data = &s3c6410_rtc_data, > + }, { > + .compatible = "samsung,exynosautov9-rtc", > + .data = &exynosautov9_rtc_data, > }, > { /* sentinel */ }, > }; > -- > 2.34.1 > >