Merge tag 'rtc-6.2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux
Pull RTC fixes from Alexandre Belloni: "Here are a few fixes for 6.2. The EFI one is the most important as it allows some RTCs to actually work. The other two are warnings that are worth fixing. - efi: make WAKEUP services optional - sunplus: fix format string warning" * tag 'rtc-6.2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: rtc: sunplus: fix format string for printing resource dt-bindings: rtc: qcom-pm8xxx: allow 'wakeup-source' property rtc: efi: Enable SET/GET WAKEUP services as optional
This commit is contained in:
@ -40,6 +40,8 @@ properties:
|
|||||||
description:
|
description:
|
||||||
Indicates that the setting of RTC time is allowed by the host CPU.
|
Indicates that the setting of RTC time is allowed by the host CPU.
|
||||||
|
|
||||||
|
wakeup-source: true
|
||||||
|
|
||||||
required:
|
required:
|
||||||
- compatible
|
- compatible
|
||||||
- reg
|
- reg
|
||||||
|
@ -188,9 +188,10 @@ static int efi_set_time(struct device *dev, struct rtc_time *tm)
|
|||||||
|
|
||||||
static int efi_procfs(struct device *dev, struct seq_file *seq)
|
static int efi_procfs(struct device *dev, struct seq_file *seq)
|
||||||
{
|
{
|
||||||
efi_time_t eft, alm;
|
efi_time_t eft, alm;
|
||||||
efi_time_cap_t cap;
|
efi_time_cap_t cap;
|
||||||
efi_bool_t enabled, pending;
|
efi_bool_t enabled, pending;
|
||||||
|
struct rtc_device *rtc = dev_get_drvdata(dev);
|
||||||
|
|
||||||
memset(&eft, 0, sizeof(eft));
|
memset(&eft, 0, sizeof(eft));
|
||||||
memset(&alm, 0, sizeof(alm));
|
memset(&alm, 0, sizeof(alm));
|
||||||
@ -213,23 +214,25 @@ static int efi_procfs(struct device *dev, struct seq_file *seq)
|
|||||||
/* XXX fixme: convert to string? */
|
/* XXX fixme: convert to string? */
|
||||||
seq_printf(seq, "Timezone\t: %u\n", eft.timezone);
|
seq_printf(seq, "Timezone\t: %u\n", eft.timezone);
|
||||||
|
|
||||||
seq_printf(seq,
|
if (test_bit(RTC_FEATURE_ALARM, rtc->features)) {
|
||||||
"Alarm Time\t: %u:%u:%u.%09u\n"
|
seq_printf(seq,
|
||||||
"Alarm Date\t: %u-%u-%u\n"
|
"Alarm Time\t: %u:%u:%u.%09u\n"
|
||||||
"Alarm Daylight\t: %u\n"
|
"Alarm Date\t: %u-%u-%u\n"
|
||||||
"Enabled\t\t: %s\n"
|
"Alarm Daylight\t: %u\n"
|
||||||
"Pending\t\t: %s\n",
|
"Enabled\t\t: %s\n"
|
||||||
alm.hour, alm.minute, alm.second, alm.nanosecond,
|
"Pending\t\t: %s\n",
|
||||||
alm.year, alm.month, alm.day,
|
alm.hour, alm.minute, alm.second, alm.nanosecond,
|
||||||
alm.daylight,
|
alm.year, alm.month, alm.day,
|
||||||
enabled == 1 ? "yes" : "no",
|
alm.daylight,
|
||||||
pending == 1 ? "yes" : "no");
|
enabled == 1 ? "yes" : "no",
|
||||||
|
pending == 1 ? "yes" : "no");
|
||||||
|
|
||||||
if (eft.timezone == EFI_UNSPECIFIED_TIMEZONE)
|
if (eft.timezone == EFI_UNSPECIFIED_TIMEZONE)
|
||||||
seq_puts(seq, "Timezone\t: unspecified\n");
|
seq_puts(seq, "Timezone\t: unspecified\n");
|
||||||
else
|
else
|
||||||
/* XXX fixme: convert to string? */
|
/* XXX fixme: convert to string? */
|
||||||
seq_printf(seq, "Timezone\t: %u\n", alm.timezone);
|
seq_printf(seq, "Timezone\t: %u\n", alm.timezone);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* now prints the capabilities
|
* now prints the capabilities
|
||||||
@ -269,7 +272,10 @@ static int __init efi_rtc_probe(struct platform_device *dev)
|
|||||||
|
|
||||||
rtc->ops = &efi_rtc_ops;
|
rtc->ops = &efi_rtc_ops;
|
||||||
clear_bit(RTC_FEATURE_UPDATE_INTERRUPT, rtc->features);
|
clear_bit(RTC_FEATURE_UPDATE_INTERRUPT, rtc->features);
|
||||||
set_bit(RTC_FEATURE_ALARM_WAKEUP_ONLY, rtc->features);
|
if (efi_rt_services_supported(EFI_RT_SUPPORTED_WAKEUP_SERVICES))
|
||||||
|
set_bit(RTC_FEATURE_ALARM_WAKEUP_ONLY, rtc->features);
|
||||||
|
else
|
||||||
|
clear_bit(RTC_FEATURE_ALARM, rtc->features);
|
||||||
|
|
||||||
device_init_wakeup(&dev->dev, true);
|
device_init_wakeup(&dev->dev, true);
|
||||||
|
|
||||||
|
@ -240,8 +240,8 @@ static int sp_rtc_probe(struct platform_device *plat_dev)
|
|||||||
if (IS_ERR(sp_rtc->reg_base))
|
if (IS_ERR(sp_rtc->reg_base))
|
||||||
return dev_err_probe(&plat_dev->dev, PTR_ERR(sp_rtc->reg_base),
|
return dev_err_probe(&plat_dev->dev, PTR_ERR(sp_rtc->reg_base),
|
||||||
"%s devm_ioremap_resource fail\n", RTC_REG_NAME);
|
"%s devm_ioremap_resource fail\n", RTC_REG_NAME);
|
||||||
dev_dbg(&plat_dev->dev, "res = 0x%x, reg_base = 0x%lx\n",
|
dev_dbg(&plat_dev->dev, "res = %pR, reg_base = %p\n",
|
||||||
sp_rtc->res->start, (unsigned long)sp_rtc->reg_base);
|
sp_rtc->res, sp_rtc->reg_base);
|
||||||
|
|
||||||
sp_rtc->irq = platform_get_irq(plat_dev, 0);
|
sp_rtc->irq = platform_get_irq(plat_dev, 0);
|
||||||
if (sp_rtc->irq < 0)
|
if (sp_rtc->irq < 0)
|
||||||
|
@ -668,7 +668,8 @@ extern struct efi {
|
|||||||
|
|
||||||
#define EFI_RT_SUPPORTED_ALL 0x3fff
|
#define EFI_RT_SUPPORTED_ALL 0x3fff
|
||||||
|
|
||||||
#define EFI_RT_SUPPORTED_TIME_SERVICES 0x000f
|
#define EFI_RT_SUPPORTED_TIME_SERVICES 0x0003
|
||||||
|
#define EFI_RT_SUPPORTED_WAKEUP_SERVICES 0x000c
|
||||||
#define EFI_RT_SUPPORTED_VARIABLE_SERVICES 0x0070
|
#define EFI_RT_SUPPORTED_VARIABLE_SERVICES 0x0070
|
||||||
|
|
||||||
extern struct mm_struct efi_mm;
|
extern struct mm_struct efi_mm;
|
||||||
|
Reference in New Issue
Block a user