[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8c824a2c-383c-ba0e-b924-d7cdaf68ff0c@ti.com>
Date: Wed, 13 Apr 2022 19:45:44 -0500
From: Andrew Davis <afd@...com>
To: Nishanth Menon <nm@...com>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Rob Herring <robh+dt@...nel.org>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
Alessandro Zummo <a.zummo@...ertech.it>
CC: <linux-kernel@...r.kernel.org>, <devicetree@...r.kernel.org>,
<linux-rtc@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
Vignesh Raghavendra <vigneshr@...com>
Subject: Re: [PATCH 2/2] rtc: Introduce ti-k3-rtc
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
Powered by blists - more mailing lists