Commit 44760cf3 authored by John Crispin's avatar John Crispin Committed by Lee Jones

mfd: mt6397: Add MT6323 support to MT6397 driver

Signed-off-by: default avatarJohn Crispin <blogic@openwrt.org>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent 1d2c25ed
......@@ -19,11 +19,14 @@
#include <linux/regmap.h>
#include <linux/mfd/core.h>
#include <linux/mfd/mt6397/core.h>
#include <linux/mfd/mt6323/core.h>
#include <linux/mfd/mt6397/registers.h>
#include <linux/mfd/mt6323/registers.h>
#define MT6397_RTC_BASE 0xe000
#define MT6397_RTC_SIZE 0x3e
#define MT6323_CID_CODE 0x23
#define MT6391_CID_CODE 0x91
#define MT6397_CID_CODE 0x97
......@@ -40,6 +43,13 @@ static const struct resource mt6397_rtc_resources[] = {
},
};
static const struct mfd_cell mt6323_devs[] = {
{
.name = "mt6323-regulator",
.of_compatible = "mediatek,mt6323-regulator"
},
};
static const struct mfd_cell mt6397_devs[] = {
{
.name = "mt6397-rtc",
......@@ -261,6 +271,15 @@ static int mt6397_probe(struct platform_device *pdev)
}
switch (id & 0xff) {
case MT6323_CID_CODE:
pmic->int_con[0] = MT6323_INT_CON0;
pmic->int_con[1] = MT6323_INT_CON1;
pmic->int_status[0] = MT6323_INT_STATUS0;
pmic->int_status[1] = MT6323_INT_STATUS1;
ret = mfd_add_devices(&pdev->dev, -1, mt6323_devs,
ARRAY_SIZE(mt6323_devs), NULL, 0, NULL);
break;
case MT6397_CID_CODE:
case MT6391_CID_CODE:
pmic->int_con[0] = MT6397_INT_CON0;
......@@ -302,6 +321,7 @@ static int mt6397_remove(struct platform_device *pdev)
static const struct of_device_id mt6397_of_match[] = {
{ .compatible = "mediatek,mt6397" },
{ .compatible = "mediatek,mt6323" },
{ }
};
MODULE_DEVICE_TABLE(of, mt6397_of_match);
......
/*
* Copyright (c) 2016 Chen Zhong <chen.zhong@mediatek.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#ifndef __MFD_MT6323_CORE_H__
#define __MFD_MT6323_CORE_H__
enum MT6323_IRQ_STATUS_numbers {
MT6323_IRQ_STATUS_SPKL_AB = 0,
MT6323_IRQ_STATUS_SPKL,
MT6323_IRQ_STATUS_BAT_L,
MT6323_IRQ_STATUS_BAT_H,
MT6323_IRQ_STATUS_WATCHDOG,
MT6323_IRQ_STATUS_PWRKEY,
MT6323_IRQ_STATUS_THR_L,
MT6323_IRQ_STATUS_THR_H,
MT6323_IRQ_STATUS_VBATON_UNDET,
MT6323_IRQ_STATUS_BVALID_DET,
MT6323_IRQ_STATUS_CHRDET,
MT6323_IRQ_STATUS_OV,
MT6323_IRQ_STATUS_LDO = 16,
MT6323_IRQ_STATUS_FCHRKEY,
MT6323_IRQ_STATUS_ACCDET,
MT6323_IRQ_STATUS_AUDIO,
MT6323_IRQ_STATUS_RTC,
MT6323_IRQ_STATUS_VPROC,
MT6323_IRQ_STATUS_VSYS,
MT6323_IRQ_STATUS_VPA,
MT6323_IRQ_STATUS_NR,
};
#endif /* __MFD_MT6323_CORE_H__ */
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment