mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2024-12-29 09:13:38 +00:00
mfd: rtc: bd7xxxx Drop IC name from IRQ
A few ROHM PMICs have an RTC block which can be controlled by the rtc-bd70528 driver. The RTC driver needs the alarm interrupt information from the parent MFD driver. The MFD driver provides the interrupt information as a set of named interrupts, where the name is of form: <PMIC model>-rtc-alm-<x>, where x is an alarm block number. >From the RTC driver point of view it is irrelevant what the PMIC name is. It is sufficient to know this is alarm interrupt for a block X. The PMIC model information is carried to RTC via the platform device ID. Hence, having the PMIC model in the interrupt name is only making things more complex because the RTC driver needs to request differently named interrupts on different PMICs, making code unnecessary complicated. Simplify this slightly by always using the RTC driver name 'bd70528' as the prefix for alarm interrupts, no matter what the exact PMIC model is, and always request the alarm interrupts of same name no matter what the PMIC model is. Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com> Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/ZvVNCfk10ih0YFLW@fedora Signed-off-by: Lee Jones <lee@kernel.org>
This commit is contained in:
parent
6e31bb8d3a
commit
9b15062cc0
@ -32,15 +32,15 @@ static struct gpio_keys_platform_data bd71828_powerkey_data = {
|
||||
};
|
||||
|
||||
static const struct resource bd71815_rtc_irqs[] = {
|
||||
DEFINE_RES_IRQ_NAMED(BD71815_INT_RTC0, "bd71815-rtc-alm-0"),
|
||||
DEFINE_RES_IRQ_NAMED(BD71815_INT_RTC1, "bd71815-rtc-alm-1"),
|
||||
DEFINE_RES_IRQ_NAMED(BD71815_INT_RTC2, "bd71815-rtc-alm-2"),
|
||||
DEFINE_RES_IRQ_NAMED(BD71815_INT_RTC0, "bd70528-rtc-alm-0"),
|
||||
DEFINE_RES_IRQ_NAMED(BD71815_INT_RTC1, "bd70528-rtc-alm-1"),
|
||||
DEFINE_RES_IRQ_NAMED(BD71815_INT_RTC2, "bd70528-rtc-alm-2"),
|
||||
};
|
||||
|
||||
static const struct resource bd71828_rtc_irqs[] = {
|
||||
DEFINE_RES_IRQ_NAMED(BD71828_INT_RTC0, "bd71828-rtc-alm-0"),
|
||||
DEFINE_RES_IRQ_NAMED(BD71828_INT_RTC1, "bd71828-rtc-alm-1"),
|
||||
DEFINE_RES_IRQ_NAMED(BD71828_INT_RTC2, "bd71828-rtc-alm-2"),
|
||||
DEFINE_RES_IRQ_NAMED(BD71828_INT_RTC0, "bd70528-rtc-alm-0"),
|
||||
DEFINE_RES_IRQ_NAMED(BD71828_INT_RTC1, "bd70528-rtc-alm-1"),
|
||||
DEFINE_RES_IRQ_NAMED(BD71828_INT_RTC2, "bd70528-rtc-alm-2"),
|
||||
};
|
||||
|
||||
static struct resource bd71815_power_irqs[] = {
|
||||
|
@ -236,7 +236,6 @@ static int bd70528_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct bd70528_rtc *bd_rtc;
|
||||
const struct rtc_class_ops *rtc_ops;
|
||||
const char *irq_name;
|
||||
int ret;
|
||||
struct rtc_device *rtc;
|
||||
int irq;
|
||||
@ -259,7 +258,6 @@ static int bd70528_probe(struct platform_device *pdev)
|
||||
|
||||
switch (chip) {
|
||||
case ROHM_CHIP_TYPE_BD71815:
|
||||
irq_name = "bd71815-rtc-alm-0";
|
||||
bd_rtc->reg_time_start = BD71815_REG_RTC_START;
|
||||
|
||||
/*
|
||||
@ -276,7 +274,6 @@ static int bd70528_probe(struct platform_device *pdev)
|
||||
hour_reg = BD71815_REG_HOUR;
|
||||
break;
|
||||
case ROHM_CHIP_TYPE_BD71828:
|
||||
irq_name = "bd71828-rtc-alm-0";
|
||||
bd_rtc->reg_time_start = BD71828_REG_RTC_START;
|
||||
bd_rtc->bd718xx_alm_block_start = BD71828_REG_RTC_ALM_START;
|
||||
hour_reg = BD71828_REG_RTC_HOUR;
|
||||
@ -286,7 +283,7 @@ static int bd70528_probe(struct platform_device *pdev)
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
irq = platform_get_irq_byname(pdev, irq_name);
|
||||
irq = platform_get_irq_byname(pdev, "bd70528-rtc-alm-0");
|
||||
|
||||
if (irq < 0)
|
||||
return irq;
|
||||
|
Loading…
Reference in New Issue
Block a user