Skip to content

Commit 0a29345

Browse files
Kartik Rajputalexandrebelloni
authored andcommitted
rtc: tegra: Add ACPI support
Add ACPI support for Tegra RTC, which is available on Tegra241 and Tegra410. Both Tegra241 and Tegra410 use the same ACPI ID 'NVDA0280'. When ACPI boot is used, the RTC clock is configured by UEFI before the kernel boots. On device-tree boot, the probe must fail if clocks are not provided in the device-tree. Signed-off-by: Kartik Rajput <kkartik@nvidia.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Jon Hunter <jonathanh@nvidia.com> Link: https://patch.msgid.link/20251024064952.775883-2-kkartik@nvidia.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
1 parent b665c1b commit 0a29345

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

drivers/rtc/rtc-tegra.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,12 @@ static const struct of_device_id tegra_rtc_dt_match[] = {
274274
};
275275
MODULE_DEVICE_TABLE(of, tegra_rtc_dt_match);
276276

277+
static const struct acpi_device_id tegra_rtc_acpi_match[] = {
278+
{ "NVDA0280" },
279+
{ }
280+
};
281+
MODULE_DEVICE_TABLE(acpi, tegra_rtc_acpi_match);
282+
277283
static int tegra_rtc_probe(struct platform_device *pdev)
278284
{
279285
struct tegra_rtc_info *info;
@@ -300,9 +306,11 @@ static int tegra_rtc_probe(struct platform_device *pdev)
300306
info->rtc->ops = &tegra_rtc_ops;
301307
info->rtc->range_max = U32_MAX;
302308

303-
info->clk = devm_clk_get_enabled(&pdev->dev, NULL);
304-
if (IS_ERR(info->clk))
305-
return PTR_ERR(info->clk);
309+
if (dev_of_node(&pdev->dev)) {
310+
info->clk = devm_clk_get_enabled(&pdev->dev, NULL);
311+
if (IS_ERR(info->clk))
312+
return PTR_ERR(info->clk);
313+
}
306314

307315
/* set context info */
308316
info->pdev = pdev;
@@ -386,6 +394,7 @@ static struct platform_driver tegra_rtc_driver = {
386394
.driver = {
387395
.name = "tegra_rtc",
388396
.of_match_table = tegra_rtc_dt_match,
397+
.acpi_match_table = tegra_rtc_acpi_match,
389398
.pm = &tegra_rtc_pm_ops,
390399
},
391400
};

0 commit comments

Comments
 (0)