diff options
author | Bin Gao <bin.gao@linux.intel.com> | 2016-07-20 20:33:56 -0400 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2016-10-04 10:48:02 -0400 |
commit | 9c6235c8633210cc2da0882e2e9d6ff90aa37503 (patch) | |
tree | 91431924b0aadc4c9fcef8314bc6f79d35470671 /drivers/mfd | |
parent | 77fc5ff64f1834976abbf499b2adc95a4589ea86 (diff) |
mfd: intel_soc_pmic_bxtwc: Add bxt_wcove_usbc device
The Intel Whiskey Cove PMIC includes several function units, e.g.
ADC, thermal, USB Type-C, GPIO, etc. The corresponding device has
to be created in the mfd driver(intel_soc_pmic_bxtwc.c). This change
adds the USB Type-c device.
Signed-off-by: Bin Gao <bin.gao@intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/intel_soc_pmic_bxtwc.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c index b9428767e615..43e54b7e908f 100644 --- a/drivers/mfd/intel_soc_pmic_bxtwc.c +++ b/drivers/mfd/intel_soc_pmic_bxtwc.c | |||
@@ -47,6 +47,8 @@ | |||
47 | #define BXTWC_MIRQLVL1 0x4E0E | 47 | #define BXTWC_MIRQLVL1 0x4E0E |
48 | #define BXTWC_MPWRTNIRQ 0x4E0F | 48 | #define BXTWC_MPWRTNIRQ 0x4E0F |
49 | 49 | ||
50 | #define BXTWC_MIRQLVL1_MCHGR BIT(5) | ||
51 | |||
50 | #define BXTWC_MTHRM0IRQ 0x4E12 | 52 | #define BXTWC_MTHRM0IRQ 0x4E12 |
51 | #define BXTWC_MTHRM1IRQ 0x4E13 | 53 | #define BXTWC_MTHRM1IRQ 0x4E13 |
52 | #define BXTWC_MTHRM2IRQ 0x4E14 | 54 | #define BXTWC_MTHRM2IRQ 0x4E14 |
@@ -109,7 +111,7 @@ static const struct regmap_irq bxtwc_regmap_irqs_level2[] = { | |||
109 | REGMAP_IRQ_REG(BXTWC_THRM2_IRQ, 2, 0xff), | 111 | REGMAP_IRQ_REG(BXTWC_THRM2_IRQ, 2, 0xff), |
110 | REGMAP_IRQ_REG(BXTWC_BCU_IRQ, 3, 0x1f), | 112 | REGMAP_IRQ_REG(BXTWC_BCU_IRQ, 3, 0x1f), |
111 | REGMAP_IRQ_REG(BXTWC_ADC_IRQ, 4, 0xff), | 113 | REGMAP_IRQ_REG(BXTWC_ADC_IRQ, 4, 0xff), |
112 | REGMAP_IRQ_REG(BXTWC_CHGR0_IRQ, 5, 0x1f), | 114 | REGMAP_IRQ_REG(BXTWC_CHGR0_IRQ, 5, 0x3f), |
113 | REGMAP_IRQ_REG(BXTWC_CHGR1_IRQ, 6, 0x1f), | 115 | REGMAP_IRQ_REG(BXTWC_CHGR1_IRQ, 6, 0x1f), |
114 | REGMAP_IRQ_REG(BXTWC_GPIO0_IRQ, 7, 0xff), | 116 | REGMAP_IRQ_REG(BXTWC_GPIO0_IRQ, 7, 0xff), |
115 | REGMAP_IRQ_REG(BXTWC_GPIO1_IRQ, 8, 0x3f), | 117 | REGMAP_IRQ_REG(BXTWC_GPIO1_IRQ, 8, 0x3f), |
@@ -143,6 +145,10 @@ static struct resource adc_resources[] = { | |||
143 | DEFINE_RES_IRQ_NAMED(BXTWC_ADC_IRQ, "ADC"), | 145 | DEFINE_RES_IRQ_NAMED(BXTWC_ADC_IRQ, "ADC"), |
144 | }; | 146 | }; |
145 | 147 | ||
148 | static struct resource usbc_resources[] = { | ||
149 | DEFINE_RES_IRQ_NAMED(BXTWC_CHGR0_IRQ, "USBC"), | ||
150 | }; | ||
151 | |||
146 | static struct resource charger_resources[] = { | 152 | static struct resource charger_resources[] = { |
147 | DEFINE_RES_IRQ_NAMED(BXTWC_CHGR0_IRQ, "CHARGER"), | 153 | DEFINE_RES_IRQ_NAMED(BXTWC_CHGR0_IRQ, "CHARGER"), |
148 | DEFINE_RES_IRQ_NAMED(BXTWC_CHGR1_IRQ, "CHARGER1"), | 154 | DEFINE_RES_IRQ_NAMED(BXTWC_CHGR1_IRQ, "CHARGER1"), |
@@ -170,6 +176,11 @@ static struct mfd_cell bxt_wc_dev[] = { | |||
170 | .resources = thermal_resources, | 176 | .resources = thermal_resources, |
171 | }, | 177 | }, |
172 | { | 178 | { |
179 | .name = "bxt_wcove_usbc", | ||
180 | .num_resources = ARRAY_SIZE(usbc_resources), | ||
181 | .resources = usbc_resources, | ||
182 | }, | ||
183 | { | ||
173 | .name = "bxt_wcove_ext_charger", | 184 | .name = "bxt_wcove_ext_charger", |
174 | .num_resources = ARRAY_SIZE(charger_resources), | 185 | .num_resources = ARRAY_SIZE(charger_resources), |
175 | .resources = charger_resources, | 186 | .resources = charger_resources, |
@@ -403,6 +414,16 @@ static int bxtwc_probe(struct platform_device *pdev) | |||
403 | goto err_sysfs; | 414 | goto err_sysfs; |
404 | } | 415 | } |
405 | 416 | ||
417 | /* | ||
418 | * There is known hw bug. Upon reset BIT 5 of register | ||
419 | * BXTWC_CHGR_LVL1_IRQ is 0 which is the expected value. However, | ||
420 | * later it's set to 1(masked) automatically by hardware. So we | ||
421 | * have the software workaround here to unmaksed it in order to let | ||
422 | * charger interrutp work. | ||
423 | */ | ||
424 | regmap_update_bits(pmic->regmap, BXTWC_MIRQLVL1, | ||
425 | BXTWC_MIRQLVL1_MCHGR, 0); | ||
426 | |||
406 | return 0; | 427 | return 0; |
407 | 428 | ||
408 | err_sysfs: | 429 | err_sysfs: |