diff options
author | Gene Chen <gene_chen@richtek.com> | 2021-05-18 01:33:13 +0800 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2021-06-02 10:50:02 +0100 |
commit | b042c085de7aa89eedfe8df8388b19a0e6679a39 (patch) | |
tree | 3e1bcfe4eb21f9600f1e0328d7cecd36651d60f7 /drivers/mfd | |
parent | e84702940613accd46e4cee46c287badd59b7628 (diff) | |
download | linux-b042c085de7aa89eedfe8df8388b19a0e6679a39.tar.gz linux-b042c085de7aa89eedfe8df8388b19a0e6679a39.tar.bz2 linux-b042c085de7aa89eedfe8df8388b19a0e6679a39.zip |
mfd: mt6360: Merge header file into driver and remove unuse register define
Merge header file into driver and remove unuse register define
Signed-off-by: Gene Chen <gene_chen@richtek.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/mt6360-core.c | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/drivers/mfd/mt6360-core.c b/drivers/mfd/mt6360-core.c index cdd99770f94a..a4c705c8dd68 100644 --- a/drivers/mfd/mt6360-core.c +++ b/drivers/mfd/mt6360-core.c @@ -15,7 +15,53 @@ #include <linux/regmap.h> #include <linux/slab.h> -#include <linux/mfd/mt6360.h> +enum { + MT6360_SLAVE_TCPC = 0, + MT6360_SLAVE_PMIC, + MT6360_SLAVE_LDO, + MT6360_SLAVE_PMU, + MT6360_SLAVE_MAX, +}; + +struct mt6360_ddata { + struct i2c_client *i2c[MT6360_SLAVE_MAX]; + struct device *dev; + struct regmap *regmap; + struct regmap_irq_chip_data *irq_data; + unsigned int chip_rev; + u8 crc8_tbl[CRC8_TABLE_SIZE]; +}; + +#define MT6360_TCPC_SLAVEID 0x4E +#define MT6360_PMIC_SLAVEID 0x1A +#define MT6360_LDO_SLAVEID 0x64 +#define MT6360_PMU_SLAVEID 0x34 + +#define MT6360_REG_TCPCSTART 0x00 +#define MT6360_REG_TCPCEND 0xFF +#define MT6360_REG_PMICSTART 0x100 +#define MT6360_REG_PMICEND 0x13B +#define MT6360_REG_LDOSTART 0x200 +#define MT6360_REG_LDOEND 0x21C +#define MT6360_REG_PMUSTART 0x300 +#define MT6360_PMU_DEV_INFO 0x300 +#define MT6360_PMU_CHG_IRQ1 0x3D0 +#define MT6360_PMU_CHG_MASK1 0x3F0 +#define MT6360_REG_PMUEND 0x3FF + +#define MT6360_PMU_IRQ_REGNUM 16 + +#define CHIP_VEN_MASK 0xF0 +#define CHIP_VEN_MT6360 0x50 +#define CHIP_REV_MASK 0x0F + +#define MT6360_ADDRESS_MASK 0x3F +#define MT6360_DATA_SIZE_1_BYTE 0x00 +#define MT6360_DATA_SIZE_2_BYTES 0x40 +#define MT6360_DATA_SIZE_3_BYTES 0x80 +#define MT6360_DATA_SIZE_4_BYTES 0xC0 + +#define MT6360_CRC8_POLYNOMIAL 0x7 /* reg 0 -> 0 ~ 7 */ #define MT6360_CHG_TREG_EVT 4 |