diff options
author | Hsin-Hsiung Wang <hsin-hsiung.wang@mediatek.com> | 2021-05-26 14:52:04 +0800 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2021-06-01 16:44:23 +0100 |
commit | e545b8f380a96174df40db4203d09156e096ee89 (patch) | |
tree | 441aec15092e7f471ae4b97ee1a26bc3dd0e7fc1 /drivers/mfd/mt6358-irq.c | |
parent | 8771456635d595707307210d5aa9f8ce41598f94 (diff) | |
download | lwn-e545b8f380a96174df40db4203d09156e096ee89.tar.gz lwn-e545b8f380a96174df40db4203d09156e096ee89.zip |
mfd: Add support for the MediaTek MT6359 PMIC
This adds support for the MediaTek MT6359 PMIC. This is a
multifunction device with the following sub modules:
- Codec
- Interrupt
- Regulator
- RTC
It is interfaced to the host controller using SPI interface
by a proprietary hardware called PMIC wrapper or pwrap.
MT6359 MFD is a child device of the pwrap.
Signed-off-by: Hsin-Hsiung Wang <hsin-hsiung.wang@mediatek.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd/mt6358-irq.c')
-rw-r--r-- | drivers/mfd/mt6358-irq.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/mfd/mt6358-irq.c b/drivers/mfd/mt6358-irq.c index 4b094e5e51cc..83f3ffbdbb4c 100644 --- a/drivers/mfd/mt6358-irq.c +++ b/drivers/mfd/mt6358-irq.c @@ -5,6 +5,8 @@ #include <linux/interrupt.h> #include <linux/mfd/mt6358/core.h> #include <linux/mfd/mt6358/registers.h> +#include <linux/mfd/mt6359/core.h> +#include <linux/mfd/mt6359/registers.h> #include <linux/mfd/mt6397/core.h> #include <linux/module.h> #include <linux/of.h> @@ -26,6 +28,17 @@ static const struct irq_top_t mt6358_ints[] = { MT6358_TOP_GEN(MISC), }; +static const struct irq_top_t mt6359_ints[] = { + MT6359_TOP_GEN(BUCK), + MT6359_TOP_GEN(LDO), + MT6359_TOP_GEN(PSC), + MT6359_TOP_GEN(SCK), + MT6359_TOP_GEN(BM), + MT6359_TOP_GEN(HK), + MT6359_TOP_GEN(AUD), + MT6359_TOP_GEN(MISC), +}; + static struct pmic_irq_data mt6358_irqd = { .num_top = ARRAY_SIZE(mt6358_ints), .num_pmic_irqs = MT6358_IRQ_NR, @@ -33,6 +46,13 @@ static struct pmic_irq_data mt6358_irqd = { .pmic_ints = mt6358_ints, }; +static struct pmic_irq_data mt6359_irqd = { + .num_top = ARRAY_SIZE(mt6359_ints), + .num_pmic_irqs = MT6359_IRQ_NR, + .top_int_status_reg = MT6359_TOP_INT_STATUS0, + .pmic_ints = mt6359_ints, +}; + static void pmic_irq_enable(struct irq_data *data) { unsigned int hwirq = irqd_to_hwirq(data); @@ -195,6 +215,10 @@ int mt6358_irq_init(struct mt6397_chip *chip) chip->irq_data = &mt6358_irqd; break; + case MT6359_CHIP_ID: + chip->irq_data = &mt6359_irqd; + break; + default: dev_err(chip->dev, "unsupported chip: 0x%x\n", chip->chip_id); return -ENODEV; |