mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-24 04:34:08 +08:00
mfd: mt6358-irq: Add MT6357 PMIC support
Add MT6357 PMIC IRQ support. Signed-off-by: Fabien Parent <fparent@baylibre.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20220531124959.202787-6-fparent@baylibre.com
This commit is contained in:
parent
de58cee8c6
commit
738654be3c
@ -3,6 +3,8 @@
|
|||||||
// Copyright (c) 2020 MediaTek Inc.
|
// Copyright (c) 2020 MediaTek Inc.
|
||||||
|
|
||||||
#include <linux/interrupt.h>
|
#include <linux/interrupt.h>
|
||||||
|
#include <linux/mfd/mt6357/core.h>
|
||||||
|
#include <linux/mfd/mt6357/registers.h>
|
||||||
#include <linux/mfd/mt6358/core.h>
|
#include <linux/mfd/mt6358/core.h>
|
||||||
#include <linux/mfd/mt6358/registers.h>
|
#include <linux/mfd/mt6358/registers.h>
|
||||||
#include <linux/mfd/mt6359/core.h>
|
#include <linux/mfd/mt6359/core.h>
|
||||||
@ -17,6 +19,17 @@
|
|||||||
|
|
||||||
#define MTK_PMIC_REG_WIDTH 16
|
#define MTK_PMIC_REG_WIDTH 16
|
||||||
|
|
||||||
|
static const struct irq_top_t mt6357_ints[] = {
|
||||||
|
MT6357_TOP_GEN(BUCK),
|
||||||
|
MT6357_TOP_GEN(LDO),
|
||||||
|
MT6357_TOP_GEN(PSC),
|
||||||
|
MT6357_TOP_GEN(SCK),
|
||||||
|
MT6357_TOP_GEN(BM),
|
||||||
|
MT6357_TOP_GEN(HK),
|
||||||
|
MT6357_TOP_GEN(AUD),
|
||||||
|
MT6357_TOP_GEN(MISC),
|
||||||
|
};
|
||||||
|
|
||||||
static const struct irq_top_t mt6358_ints[] = {
|
static const struct irq_top_t mt6358_ints[] = {
|
||||||
MT6358_TOP_GEN(BUCK),
|
MT6358_TOP_GEN(BUCK),
|
||||||
MT6358_TOP_GEN(LDO),
|
MT6358_TOP_GEN(LDO),
|
||||||
@ -39,6 +52,13 @@ static const struct irq_top_t mt6359_ints[] = {
|
|||||||
MT6359_TOP_GEN(MISC),
|
MT6359_TOP_GEN(MISC),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static struct pmic_irq_data mt6357_irqd = {
|
||||||
|
.num_top = ARRAY_SIZE(mt6357_ints),
|
||||||
|
.num_pmic_irqs = MT6357_IRQ_NR,
|
||||||
|
.top_int_status_reg = MT6357_TOP_INT_STATUS0,
|
||||||
|
.pmic_ints = mt6357_ints,
|
||||||
|
};
|
||||||
|
|
||||||
static struct pmic_irq_data mt6358_irqd = {
|
static struct pmic_irq_data mt6358_irqd = {
|
||||||
.num_top = ARRAY_SIZE(mt6358_ints),
|
.num_top = ARRAY_SIZE(mt6358_ints),
|
||||||
.num_pmic_irqs = MT6358_IRQ_NR,
|
.num_pmic_irqs = MT6358_IRQ_NR,
|
||||||
@ -211,6 +231,10 @@ int mt6358_irq_init(struct mt6397_chip *chip)
|
|||||||
struct pmic_irq_data *irqd;
|
struct pmic_irq_data *irqd;
|
||||||
|
|
||||||
switch (chip->chip_id) {
|
switch (chip->chip_id) {
|
||||||
|
case MT6357_CHIP_ID:
|
||||||
|
chip->irq_data = &mt6357_irqd;
|
||||||
|
break;
|
||||||
|
|
||||||
case MT6358_CHIP_ID:
|
case MT6358_CHIP_ID:
|
||||||
case MT6366_CHIP_ID:
|
case MT6366_CHIP_ID:
|
||||||
chip->irq_data = &mt6358_irqd;
|
chip->irq_data = &mt6358_irqd;
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
enum chip_id {
|
enum chip_id {
|
||||||
MT6323_CHIP_ID = 0x23,
|
MT6323_CHIP_ID = 0x23,
|
||||||
|
MT6357_CHIP_ID = 0x57,
|
||||||
MT6358_CHIP_ID = 0x58,
|
MT6358_CHIP_ID = 0x58,
|
||||||
MT6359_CHIP_ID = 0x59,
|
MT6359_CHIP_ID = 0x59,
|
||||||
MT6366_CHIP_ID = 0x66,
|
MT6366_CHIP_ID = 0x66,
|
||||||
|
Loading…
Reference in New Issue
Block a user