rtc: jz4740: Add support for JZ4760 SoC
The WENR feature (set a magic value to enable RTC registers read-write) first appeared on the JZ4760; the JZ4780 came much later. Since it would be dangerous to specify a newer SoC's compatible string as the fallback of an older SoC's compatible string, we add support for the "ingenic,jz4760-rtc" compatible string in the driver. This will permit to support the JZ4770 by having: compatible = "ingenic,jz4770-rtc", "ingenic,jz4760-rtc"; Instead of doing: compatible = "ingenic,jz4770-rtc", "ingenic,jz4780-rtc"; Signed-off-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20200311182318.22154-1-paul@crapouillou.net Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:
Родитель
f9b2a4d6a5
Коммит
5840748520
|
@ -46,6 +46,7 @@
|
||||||
|
|
||||||
enum jz4740_rtc_type {
|
enum jz4740_rtc_type {
|
||||||
ID_JZ4740,
|
ID_JZ4740,
|
||||||
|
ID_JZ4760,
|
||||||
ID_JZ4780,
|
ID_JZ4780,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -106,7 +107,7 @@ static inline int jz4740_rtc_reg_write(struct jz4740_rtc *rtc, size_t reg,
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if (rtc->type >= ID_JZ4780)
|
if (rtc->type >= ID_JZ4760)
|
||||||
ret = jz4780_rtc_enable_write(rtc);
|
ret = jz4780_rtc_enable_write(rtc);
|
||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
ret = jz4740_rtc_wait_write_ready(rtc);
|
ret = jz4740_rtc_wait_write_ready(rtc);
|
||||||
|
@ -298,6 +299,7 @@ static void jz4740_rtc_power_off(void)
|
||||||
|
|
||||||
static const struct of_device_id jz4740_rtc_of_match[] = {
|
static const struct of_device_id jz4740_rtc_of_match[] = {
|
||||||
{ .compatible = "ingenic,jz4740-rtc", .data = (void *)ID_JZ4740 },
|
{ .compatible = "ingenic,jz4740-rtc", .data = (void *)ID_JZ4740 },
|
||||||
|
{ .compatible = "ingenic,jz4760-rtc", .data = (void *)ID_JZ4760 },
|
||||||
{ .compatible = "ingenic,jz4780-rtc", .data = (void *)ID_JZ4780 },
|
{ .compatible = "ingenic,jz4780-rtc", .data = (void *)ID_JZ4780 },
|
||||||
{},
|
{},
|
||||||
};
|
};
|
||||||
|
|
Загрузка…
Ссылка в новой задаче