* [PATCH 2/4] extcon: max77693: Remove left-over code fter switching to regmap irq chip
2014-10-10 8:23 [PATCH 1/4] mfd: max77693: Remove unused define Krzysztof Kozlowski
@ 2014-10-10 8:23 ` Krzysztof Kozlowski
2014-10-10 8:23 ` [PATCH 3/4] extcon: max77693: Request only specific interrupts Krzysztof Kozlowski
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2014-10-10 8:23 UTC (permalink / raw)
To: MyungJoo Ham, Chanwoo Choi, Samuel Ortiz, Lee Jones, linux-kernel
Cc: Kyungmin Park, Marek Szyprowski, Bartlomiej Zolnierkiewicz,
Krzysztof Kozlowski
Before switching to regmap irq chip the extcon driver parsed some
initialization data (from platform data or defaults hard coded in the
driver) and adjusted interrupt masks to the init data (code was located
in max77693-irq.c).
However commit 342d669c1ee4 ("mfd: max77693: Handle IRQs using regmap")
removed the max77693-irq.c and replaced whole interrupt handling with
regmap irq chip. Thus the part responsible for using adjusted interrupt
masks disappeared.
Remove left-over code as this is now useless and it is doing nothing.
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
---
drivers/extcon/extcon-max77693.c | 21 +--------------------
include/linux/mfd/max77693-private.h | 3 ---
2 files changed, 1 insertion(+), 23 deletions(-)
diff --git a/drivers/extcon/extcon-max77693.c b/drivers/extcon/extcon-max77693.c
index d3adacf3187f..d4b2dfab1888 100644
--- a/drivers/extcon/extcon-max77693.c
+++ b/drivers/extcon/extcon-max77693.c
@@ -1217,28 +1217,9 @@ static int max77693_muic_probe(struct platform_device *pdev)
}
for (i = 0; i < num_init_data; i++) {
- enum max77693_irq_source irq_src
- = MAX77693_IRQ_GROUP_NR;
-
regmap_write(info->max77693->regmap_muic,
init_data[i].addr,
init_data[i].data);
-
- switch (init_data[i].addr) {
- case MAX77693_MUIC_REG_INTMASK1:
- irq_src = MUIC_INT1;
- break;
- case MAX77693_MUIC_REG_INTMASK2:
- irq_src = MUIC_INT2;
- break;
- case MAX77693_MUIC_REG_INTMASK3:
- irq_src = MUIC_INT3;
- break;
- }
-
- if (irq_src < MAX77693_IRQ_GROUP_NR)
- info->max77693->irq_masks_cur[irq_src]
- = init_data[i].data;
}
if (pdata && pdata->muic_data) {
@@ -1275,7 +1256,7 @@ static int max77693_muic_probe(struct platform_device *pdev)
}
/* Set initial path for UART */
- max77693_muic_set_path(info, info->path_uart, true);
+ max77693_muic_set_path(info, info->path_uart, true);
/* Check revision number of MUIC device*/
ret = regmap_read(info->max77693->regmap_muic,
diff --git a/include/linux/mfd/max77693-private.h b/include/linux/mfd/max77693-private.h
index 3c51c4d01306..8006c5a1339d 100644
--- a/include/linux/mfd/max77693-private.h
+++ b/include/linux/mfd/max77693-private.h
@@ -545,9 +545,6 @@ struct max77693_dev {
int irq;
int irq_gpio;
- struct mutex irqlock;
- int irq_masks_cur[MAX77693_IRQ_GROUP_NR];
- int irq_masks_cache[MAX77693_IRQ_GROUP_NR];
};
enum max77693_types {
--
1.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 3/4] extcon: max77693: Request only specific interrupts
2014-10-10 8:23 [PATCH 1/4] mfd: max77693: Remove unused define Krzysztof Kozlowski
2014-10-10 8:23 ` [PATCH 2/4] extcon: max77693: Remove left-over code fter switching to regmap irq chip Krzysztof Kozlowski
@ 2014-10-10 8:23 ` Krzysztof Kozlowski
2014-10-10 8:23 ` [PATCH 4/4] extcon: max77693: Fix extcon UART on Trats2 board Krzysztof Kozlowski
2014-10-10 9:00 ` [PATCH 1/4] mfd: max77693: Remove unused define Lee Jones
3 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2014-10-10 8:23 UTC (permalink / raw)
To: MyungJoo Ham, Chanwoo Choi, Samuel Ortiz, Lee Jones, linux-kernel
Cc: Kyungmin Park, Marek Szyprowski, Bartlomiej Zolnierkiewicz,
Krzysztof Kozlowski
The driver was requesting all MUIC interrupts but then was masking most
of them manually at end of probe (with default_init_data). Since
default_init_data cannot be passed through DTS (no bindings for driver),
this was a conflicting behavior. First get everything, then mask what we
don't want.
This could change after adding DTS bindings for requesting specific
MUIC interrupts. Until then driver should request only these MUIC
interrupts which he is really interested in.
The commit does not introduce any functional change when the driver is
used with DTS (no platform data). However this changes the behavior with
platform data supplied. In such case the driver will request only 3
interrupts (ADC, ADC1K, ChgTyp). Platform data could still unmask other
interrupts but they won't be handled by the driver.
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
---
drivers/extcon/extcon-max77693.c | 26 --------------------------
1 file changed, 26 deletions(-)
diff --git a/drivers/extcon/extcon-max77693.c b/drivers/extcon/extcon-max77693.c
index d4b2dfab1888..68d6c7cccc4f 100644
--- a/drivers/extcon/extcon-max77693.c
+++ b/drivers/extcon/extcon-max77693.c
@@ -44,19 +44,6 @@ static struct max77693_reg_data default_init_data[] = {
.addr = MAX77693_MUIC_REG_STATUS2,
.data = STATUS2_CHGDETRUN_MASK,
}, {
- /* INTMASK1 - Unmask [3]ADC1KM,[0]ADCM */
- .addr = MAX77693_MUIC_REG_INTMASK1,
- .data = INTMASK1_ADC1K_MASK
- | INTMASK1_ADC_MASK,
- }, {
- /* INTMASK2 - Unmask [0]ChgTypM */
- .addr = MAX77693_MUIC_REG_INTMASK2,
- .data = INTMASK2_CHGTYP_MASK,
- }, {
- /* INTMASK3 - Mask all of interrupts */
- .addr = MAX77693_MUIC_REG_INTMASK3,
- .data = 0x0,
- }, {
/* CDETCTRL2 */
.addr = MAX77693_MUIC_REG_CDETCTRL2,
.data = CDETCTRL2_VIDRMEN_MASK
@@ -135,21 +122,8 @@ struct max77693_muic_irq {
static struct max77693_muic_irq muic_irqs[] = {
{ MAX77693_MUIC_IRQ_INT1_ADC, "muic-ADC" },
- { MAX77693_MUIC_IRQ_INT1_ADC_LOW, "muic-ADCLOW" },
- { MAX77693_MUIC_IRQ_INT1_ADC_ERR, "muic-ADCError" },
{ MAX77693_MUIC_IRQ_INT1_ADC1K, "muic-ADC1K" },
{ MAX77693_MUIC_IRQ_INT2_CHGTYP, "muic-CHGTYP" },
- { MAX77693_MUIC_IRQ_INT2_CHGDETREUN, "muic-CHGDETREUN" },
- { MAX77693_MUIC_IRQ_INT2_DCDTMR, "muic-DCDTMR" },
- { MAX77693_MUIC_IRQ_INT2_DXOVP, "muic-DXOVP" },
- { MAX77693_MUIC_IRQ_INT2_VBVOLT, "muic-VBVOLT" },
- { MAX77693_MUIC_IRQ_INT2_VIDRM, "muic-VIDRM" },
- { MAX77693_MUIC_IRQ_INT3_EOC, "muic-EOC" },
- { MAX77693_MUIC_IRQ_INT3_CGMBC, "muic-CGMBC" },
- { MAX77693_MUIC_IRQ_INT3_OVP, "muic-OVP" },
- { MAX77693_MUIC_IRQ_INT3_MBCCHG_ERR, "muic-MBCCHG_ERR" },
- { MAX77693_MUIC_IRQ_INT3_CHG_ENABLED, "muic-CHG_ENABLED" },
- { MAX77693_MUIC_IRQ_INT3_BAT_DET, "muic-BAT_DET" },
};
/* Define supported accessory type */
--
1.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 4/4] extcon: max77693: Fix extcon UART on Trats2 board
2014-10-10 8:23 [PATCH 1/4] mfd: max77693: Remove unused define Krzysztof Kozlowski
2014-10-10 8:23 ` [PATCH 2/4] extcon: max77693: Remove left-over code fter switching to regmap irq chip Krzysztof Kozlowski
2014-10-10 8:23 ` [PATCH 3/4] extcon: max77693: Request only specific interrupts Krzysztof Kozlowski
@ 2014-10-10 8:23 ` Krzysztof Kozlowski
2014-10-10 9:00 ` [PATCH 1/4] mfd: max77693: Remove unused define Lee Jones
3 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2014-10-10 8:23 UTC (permalink / raw)
To: MyungJoo Ham, Chanwoo Choi, Samuel Ortiz, Lee Jones, linux-kernel
Cc: Kyungmin Park, Marek Szyprowski, Bartlomiej Zolnierkiewicz,
Krzysztof Kozlowski
When JIG was set to "boot on" mode, the UART connection did not work
because it was assigned to Dock-Car cable (path: audio), not JIG-UART-ON
cable.
This was introduced in 39bf369e4ed3 ("extcon: max77693: Add support dock
device and buttons") while adding dock features.
Assign the JIG-UART-ON back to UART path.
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
---
drivers/extcon/extcon-max77693.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/extcon/extcon-max77693.c b/drivers/extcon/extcon-max77693.c
index 68d6c7cccc4f..943e8966bd05 100644
--- a/drivers/extcon/extcon-max77693.c
+++ b/drivers/extcon/extcon-max77693.c
@@ -206,7 +206,7 @@ static const char *max77693_extcon_cable[] = {
[EXTCON_CABLE_JIG_USB_ON] = "JIG-USB-ON",
[EXTCON_CABLE_JIG_USB_OFF] = "JIG-USB-OFF",
[EXTCON_CABLE_JIG_UART_OFF] = "JIG-UART-OFF",
- [EXTCON_CABLE_JIG_UART_ON] = "Dock-Car",
+ [EXTCON_CABLE_JIG_UART_ON] = "JIG-UART-ON",
[EXTCON_CABLE_DOCK_SMART] = "Dock-Smart",
[EXTCON_CABLE_DOCK_DESK] = "Dock-Desk",
[EXTCON_CABLE_DOCK_AUDIO] = "Dock-Audio",
@@ -506,9 +506,6 @@ static int max77693_muic_dock_handler(struct max77693_muic_info *info,
extcon_set_cable_state(info->edev, "Dock-Smart", attached);
extcon_set_cable_state(info->edev, "MHL", attached);
goto out;
- case MAX77693_MUIC_ADC_FACTORY_MODE_UART_ON: /* Dock-Car */
- strcpy(dock_name, "Dock-Car");
- break;
case MAX77693_MUIC_ADC_AUDIO_MODE_REMOTE: /* Dock-Desk */
strcpy(dock_name, "Dock-Desk");
break;
@@ -643,6 +640,11 @@ static int max77693_muic_jig_handler(struct max77693_muic_info *info,
strcpy(cable_name, "JIG-UART-OFF");
path = CONTROL1_SW_UART;
break;
+ case MAX77693_MUIC_ADC_FACTORY_MODE_UART_ON: /* ADC_JIG_UART_ON */
+ /* PATH:AP_UART */
+ strcpy(cable_name, "JIG-UART-ON");
+ path = CONTROL1_SW_UART;
+ break;
default:
dev_err(info->dev, "failed to detect %s jig cable\n",
attached ? "attached" : "detached");
@@ -682,13 +684,13 @@ static int max77693_muic_adc_handler(struct max77693_muic_info *info)
case MAX77693_MUIC_ADC_FACTORY_MODE_USB_OFF:
case MAX77693_MUIC_ADC_FACTORY_MODE_USB_ON:
case MAX77693_MUIC_ADC_FACTORY_MODE_UART_OFF:
+ case MAX77693_MUIC_ADC_FACTORY_MODE_UART_ON:
/* JIG */
ret = max77693_muic_jig_handler(info, cable_type, attached);
if (ret < 0)
return ret;
break;
case MAX77693_MUIC_ADC_RESERVED_ACC_3: /* Dock-Smart */
- case MAX77693_MUIC_ADC_FACTORY_MODE_UART_ON: /* Dock-Car */
case MAX77693_MUIC_ADC_AUDIO_MODE_REMOTE: /* Dock-Desk */
case MAX77693_MUIC_ADC_AV_CABLE_NOLOAD: /* Dock-Audio */
/*
--
1.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH 1/4] mfd: max77693: Remove unused define
2014-10-10 8:23 [PATCH 1/4] mfd: max77693: Remove unused define Krzysztof Kozlowski
` (2 preceding siblings ...)
2014-10-10 8:23 ` [PATCH 4/4] extcon: max77693: Fix extcon UART on Trats2 board Krzysztof Kozlowski
@ 2014-10-10 9:00 ` Lee Jones
3 siblings, 0 replies; 5+ messages in thread
From: Lee Jones @ 2014-10-10 9:00 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: MyungJoo Ham, Chanwoo Choi, Samuel Ortiz, linux-kernel,
Kyungmin Park, Marek Szyprowski, Bartlomiej Zolnierkiewicz
On Fri, 10 Oct 2014, Krzysztof Kozlowski wrote:
> Remove old MAX77693_NUM_IRQ_MUIC_REGS define. Not used anywhere.
>
> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> ---
> include/linux/mfd/max77693-private.h | 1 -
> 1 file changed, 1 deletion(-)
Applied for v3.19.
> diff --git a/include/linux/mfd/max77693-private.h b/include/linux/mfd/max77693-private.h
> index 4f1a80b66ecf..3c51c4d01306 100644
> --- a/include/linux/mfd/max77693-private.h
> +++ b/include/linux/mfd/max77693-private.h
> @@ -26,7 +26,6 @@
>
> #include <linux/i2c.h>
>
> -#define MAX77693_NUM_IRQ_MUIC_REGS 3
> #define MAX77693_REG_INVALID (0xff)
>
> /* Slave addr = 0xCC: PMIC, Charger, Flash LED */
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 5+ messages in thread