linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Davis <afd@ti.com>
To: Nishanth Menon <nm@ti.com>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Alessandro Zummo <a.zummo@towertech.it>
Cc: <linux-kernel@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<linux-rtc@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	Vignesh Raghavendra <vigneshr@ti.com>
Subject: Re: [PATCH 2/2] rtc: Introduce ti-k3-rtc
Date: Wed, 13 Apr 2022 19:45:44 -0500	[thread overview]
Message-ID: <8c824a2c-383c-ba0e-b924-d7cdaf68ff0c@ti.com> (raw)
In-Reply-To: <20220412073138.25027-3-nm@ti.com>

On 4/12/22 2:31 AM, Nishanth Menon wrote:
[...]

> +
> +static inline u32 k3rtc_readl(struct ti_k3_rtc *priv, u32 offset)
> +{
> +	return readl(priv->rtc_base + offset);


Could we use regmap in this driver?

[...]


> +
> +	reg = k3rtc_readl(priv, REG_K3RTC_IRQENABLE_SET_SYS);
> +	reg &= K3RTC_EVENT_ON_OFF_BIT;


regmap fields to get rid of all the bitmasking

[...]



> +		return 0;
> +
> +	k3rtc_writel(priv, offset, K3RTC_EVENT_ON_OFF_BIT);
> +
> +	for (i = 0; i < bytes / 4; i++) {
> +		val[i] = k3rtc_readl(priv,
> +				     REG_K3RTC_SCRATCH0 + offset + (i * 4));
> +	}
> +


regmap_bulk_read()

[...]


> +
> +	priv->rtc_base = devm_platform_ioremap_resource(pdev, 0);
> +	if (IS_ERR(priv->rtc_base))
> +		return PTR_ERR(priv->rtc_base);
> +


devm_regmap_init_mmio(dev, priv->rtc_base, ...)

[...]


> +static struct platform_driver ti_k3_rtc_driver = {
> +	.probe = ti_k3_rtc_probe,
> +	.driver = {
> +		   .name = "rtc-ti-k3",
> +		   .of_match_table = ti_k3_rtc_of_match_table,
> +		   .pm = &ti_k3_rtc_pm_ops,
> +		   },
> +};
> +module_platform_driver(ti_k3_rtc_driver);
> +
> +MODULE_LICENSE("GPL");
> +MODULE_DESCRIPTION("TI K3 RTC driver");
> +MODULE_AUTHOR("Nishanth Menon");
> +MODULE_ALIAS("platform:rtc-ti-k3");


Is MODULE_ALIAS needed here? The MODULE_DEVICE_TABLE above will
build the MOD ALIAS table needed for OF loading.

Andrew


  reply	other threads:[~2022-04-14  0:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-12  7:31 [PATCH 0/2] rtc: Introduce rtc-ti-k3 Nishanth Menon
2022-04-12  7:31 ` [PATCH 1/2] dt-bindings: rtc: Add TI K3 RTC devicetree bindings documentation Nishanth Menon
2022-04-12 12:06   ` Krzysztof Kozlowski
2022-04-12 22:17     ` Nishanth Menon
2022-04-13  6:42       ` Krzysztof Kozlowski
2022-04-13 15:45         ` Nishanth Menon
2022-04-14 15:53   ` Rob Herring
2022-04-12  7:31 ` [PATCH 2/2] rtc: Introduce ti-k3-rtc Nishanth Menon
2022-04-14  0:45   ` Andrew Davis [this message]
2022-04-15  8:03   ` Vignesh Raghavendra
2022-04-15  8:14     ` Alexandre Belloni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8c824a2c-383c-ba0e-b924-d7cdaf68ff0c@ti.com \
    --to=afd@ti.com \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@bootlin.com \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=robh+dt@kernel.org \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).