* [PATCH 0/6] Arizona Extcon Update Device Bindings
@ 2015-09-16 9:56 Charles Keepax
2015-09-16 9:56 ` [PATCH 2/6] extcon: arizona: Add device binding for the general purpose switch Charles Keepax
` (4 more replies)
0 siblings, 5 replies; 14+ messages in thread
From: Charles Keepax @ 2015-09-16 9:56 UTC (permalink / raw)
To: cw00.choi, lee.jones
Cc: robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak,
myungjoo.ham, sameo, devicetree, linux-kernel
Hi,
This patch chain adds device bindings for the jack and
microphone detection system specific settings.
Some of the bindings in this chain depend on features that
are being added in the following chain of patches:
https://lkml.org/lkml/2015/9/16/244
Thanks,
Charles
Charles Keepax (6):
extcon: arizona: Add device binding to enable ADC mode micdet
extcon: arizona: Add device binding for the general purpose switch
extcon: arizona: Add device binding for jack detect polarity
inversion
extcon: arizona: Add device binding for second jack detect pin on
GPIO5
mfd: arizona: Update DT binding documentation for mic detection
mfd: arizona: Update DT binding documentation for jack detection
Documentation/devicetree/bindings/mfd/arizona.txt | 27 +++++++++++++++++++++
drivers/extcon/extcon-arizona.c | 13 ++++++++++
include/dt-bindings/mfd/arizona.h | 5 ++++
3 files changed, 45 insertions(+), 0 deletions(-)
--
1.7.2.5
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 1/6] extcon: arizona: Add device binding to enable ADC mode micdet
[not found] ` <1442397404-7579-1-git-send-email-ckeepax-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
@ 2015-09-16 9:56 ` Charles Keepax
2015-09-25 0:54 ` Chanwoo Choi
2015-09-16 9:56 ` [PATCH 6/6] mfd: arizona: Update DT binding documentation for jack detection Charles Keepax
1 sibling, 1 reply; 14+ messages in thread
From: Charles Keepax @ 2015-09-16 9:56 UTC (permalink / raw)
To: cw00.choi-Sze3O3UU22JBDgjK7y7TUQ,
lee.jones-QSEj5FYQhm4dnm+yROfE0A
Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
galak-sgV2jX0FEOL9JmXXK+q4OQ, myungjoo.ham-Sze3O3UU22JBDgjK7y7TUQ,
sameo-VuQAYsv1563Yd54FQh9/CA, devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
Add a simple boolean binding to turn on and off the use of ADC
microphone detection mode to determine 3/4 pole jack.
Signed-off-by: Charles Keepax <ckeepax-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
---
drivers/extcon/extcon-arizona.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c
index 4479781..869a920 100644
--- a/drivers/extcon/extcon-arizona.c
+++ b/drivers/extcon/extcon-arizona.c
@@ -1227,6 +1227,9 @@ static int arizona_extcon_device_get_pdata(struct arizona *arizona)
pdata->micd_force_micbias = device_property_read_bool(arizona->dev,
"wlf,micd-force-micbias");
+ pdata->micd_software_compare = device_property_read_bool(arizona->dev,
+ "wlf,micd-software-compare");
+
return 0;
}
--
1.7.2.5
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 2/6] extcon: arizona: Add device binding for the general purpose switch
2015-09-16 9:56 [PATCH 0/6] Arizona Extcon Update Device Bindings Charles Keepax
@ 2015-09-16 9:56 ` Charles Keepax
2015-09-25 0:54 ` Chanwoo Choi
2015-09-16 9:56 ` [PATCH 3/6] extcon: arizona: Add device binding for jack detect polarity inversion Charles Keepax
` (3 subsequent siblings)
4 siblings, 1 reply; 14+ messages in thread
From: Charles Keepax @ 2015-09-16 9:56 UTC (permalink / raw)
To: cw00.choi, lee.jones
Cc: robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak,
myungjoo.ham, sameo, devicetree, linux-kernel
The switch is generally used in conjunction with the MICDET clamp to
suppress pops and clicks associated with jack insertion. This patch adds
a binding that allows the user to select the mode of operation for this
switch.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
---
drivers/extcon/extcon-arizona.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c
index 869a920..5b4bc2f 100644
--- a/drivers/extcon/extcon-arizona.c
+++ b/drivers/extcon/extcon-arizona.c
@@ -1230,6 +1230,8 @@ static int arizona_extcon_device_get_pdata(struct arizona *arizona)
pdata->micd_software_compare = device_property_read_bool(arizona->dev,
"wlf,micd-software-compare");
+ device_property_read_u32(arizona->dev, "wlf,gpsw", &pdata->gpsw);
+
return 0;
}
--
1.7.2.5
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 3/6] extcon: arizona: Add device binding for jack detect polarity inversion
2015-09-16 9:56 [PATCH 0/6] Arizona Extcon Update Device Bindings Charles Keepax
2015-09-16 9:56 ` [PATCH 2/6] extcon: arizona: Add device binding for the general purpose switch Charles Keepax
@ 2015-09-16 9:56 ` Charles Keepax
2015-09-16 9:56 ` [PATCH 4/6] extcon: arizona: Add device binding for second jack detect pin on GPIO5 Charles Keepax
` (2 subsequent siblings)
4 siblings, 0 replies; 14+ messages in thread
From: Charles Keepax @ 2015-09-16 9:56 UTC (permalink / raw)
To: cw00.choi, lee.jones
Cc: robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak,
myungjoo.ham, sameo, devicetree, linux-kernel
By default the driver expects the jackdet pin to be pulled low when a
jack is inserted. This patch adds a device binding that allows the user
to specify that the jackdet pin will be pulled high when a jack is
inserted.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
---
drivers/extcon/extcon-arizona.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c
index 5b4bc2f..dc1910d 100644
--- a/drivers/extcon/extcon-arizona.c
+++ b/drivers/extcon/extcon-arizona.c
@@ -1230,6 +1230,9 @@ static int arizona_extcon_device_get_pdata(struct arizona *arizona)
pdata->micd_software_compare = device_property_read_bool(arizona->dev,
"wlf,micd-software-compare");
+ pdata->jd_invert = device_property_read_bool(arizona->dev,
+ "wlf,jd-invert");
+
device_property_read_u32(arizona->dev, "wlf,gpsw", &pdata->gpsw);
return 0;
--
1.7.2.5
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 4/6] extcon: arizona: Add device binding for second jack detect pin on GPIO5
2015-09-16 9:56 [PATCH 0/6] Arizona Extcon Update Device Bindings Charles Keepax
2015-09-16 9:56 ` [PATCH 2/6] extcon: arizona: Add device binding for the general purpose switch Charles Keepax
2015-09-16 9:56 ` [PATCH 3/6] extcon: arizona: Add device binding for jack detect polarity inversion Charles Keepax
@ 2015-09-16 9:56 ` Charles Keepax
[not found] ` <1442397404-7579-5-git-send-email-ckeepax-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2015-09-16 9:56 ` [PATCH 5/6] mfd: arizona: Update DT binding documentation for mic detection Charles Keepax
[not found] ` <1442397404-7579-1-git-send-email-ckeepax-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
4 siblings, 1 reply; 14+ messages in thread
From: Charles Keepax @ 2015-09-16 9:56 UTC (permalink / raw)
To: cw00.choi, lee.jones
Cc: robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak,
myungjoo.ham, sameo, devicetree, linux-kernel
Some Arizona devices have the option to use the GPIO5 pin as a second
jack detection pin. This patch adds device bindings to specify to the
driver that it should use this pin. Note that the second jack detection
pin is hard wired in the chip so can only be enabled through the
binding, rather than a pin being specified.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
---
drivers/extcon/extcon-arizona.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c
index dc1910d..992f80e 100644
--- a/drivers/extcon/extcon-arizona.c
+++ b/drivers/extcon/extcon-arizona.c
@@ -1235,6 +1235,11 @@ static int arizona_extcon_device_get_pdata(struct arizona *arizona)
device_property_read_u32(arizona->dev, "wlf,gpsw", &pdata->gpsw);
+ pdata->jd_gpio5 = device_property_read_bool(arizona->dev,
+ "wlf,use-jd-gpio");
+ pdata->jd_gpio5_nopull = device_property_read_bool(arizona->dev,
+ "wlf,use-jd-gpio-nopull");
+
return 0;
}
--
1.7.2.5
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 5/6] mfd: arizona: Update DT binding documentation for mic detection
2015-09-16 9:56 [PATCH 0/6] Arizona Extcon Update Device Bindings Charles Keepax
` (2 preceding siblings ...)
2015-09-16 9:56 ` [PATCH 4/6] extcon: arizona: Add device binding for second jack detect pin on GPIO5 Charles Keepax
@ 2015-09-16 9:56 ` Charles Keepax
2015-09-20 4:16 ` Lee Jones
[not found] ` <1442397404-7579-1-git-send-email-ckeepax-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
4 siblings, 1 reply; 14+ messages in thread
From: Charles Keepax @ 2015-09-16 9:56 UTC (permalink / raw)
To: cw00.choi, lee.jones
Cc: robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak,
myungjoo.ham, sameo, devicetree, linux-kernel
Add additional bindings to allow configuration of the system specific
microphone detection settings.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
---
Documentation/devicetree/bindings/mfd/arizona.txt | 21 +++++++++++++++++++++
include/dt-bindings/mfd/arizona.h | 5 +++++
2 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/Documentation/devicetree/bindings/mfd/arizona.txt b/Documentation/devicetree/bindings/mfd/arizona.txt
index a8fee60..b98a11b 100644
--- a/Documentation/devicetree/bindings/mfd/arizona.txt
+++ b/Documentation/devicetree/bindings/mfd/arizona.txt
@@ -73,6 +73,27 @@ Optional properties:
If this node is not mentioned or if the value is unknown, then
headphone detection mode is set to HPDETL.
+ - wlf,micd-software-compare : Use a software comparison to determine mic
+ presence
+ - wlf,micd-detect-debounce : Additional software microphone detection
+ debounce specified in milliseconds.
+ - wlf,micd-pol-gpio : GPIO specifier for the GPIO controlling the headset
+ polarity if one exists.
+ - wlf,micd-bias-start-time : Time allowed for MICBIAS to startup prior to
+ performing microphone detection, specified as per the ARIZONA_MICD_TIME_XXX
+ defines.
+ - wlf,micd-rate : Delay between successive microphone detection measurements,
+ specified as per the ARIZONA_MICD_TIME_XXX defines.
+ - wlf,micd-dbtime : Microphone detection hardware debounces specified as the
+ number of measurements to take, valid values being 2 and 4.
+ - wlf,micd-timeout : Timeout for microphone detection, specified in
+ milliseconds.
+ - wlf,micd-force-micbias : Force MICBIAS continuously on during microphone
+ detection.
+
+ - wlf,gpsw : Settings for the general purpose switch, set as one of the
+ ARIZONA_GPSW_XXX defines.
+
- DCVDD-supply, MICVDD-supply : Power supplies, only need to be specified if
they are being externally supplied. As covered in
Documentation/devicetree/bindings/regulator/regulator.txt
diff --git a/include/dt-bindings/mfd/arizona.h b/include/dt-bindings/mfd/arizona.h
index c40f665..dedf46f 100644
--- a/include/dt-bindings/mfd/arizona.h
+++ b/include/dt-bindings/mfd/arizona.h
@@ -110,4 +110,9 @@
#define ARIZONA_ACCDET_MODE_HPM 4
#define ARIZONA_ACCDET_MODE_ADC 7
+#define ARIZONA_GPSW_OPEN 0
+#define ARIZONA_GPSW_CLOSED 1
+#define ARIZONA_GPSW_CLAMP_ENABLED 2
+#define ARIZONA_GPSW_CLAMP_DISABLED 3
+
#endif
--
1.7.2.5
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 6/6] mfd: arizona: Update DT binding documentation for jack detection
[not found] ` <1442397404-7579-1-git-send-email-ckeepax-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2015-09-16 9:56 ` [PATCH 1/6] extcon: arizona: Add device binding to enable ADC mode micdet Charles Keepax
@ 2015-09-16 9:56 ` Charles Keepax
2015-09-20 4:17 ` Lee Jones
1 sibling, 1 reply; 14+ messages in thread
From: Charles Keepax @ 2015-09-16 9:56 UTC (permalink / raw)
To: cw00.choi-Sze3O3UU22JBDgjK7y7TUQ,
lee.jones-QSEj5FYQhm4dnm+yROfE0A
Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
galak-sgV2jX0FEOL9JmXXK+q4OQ, myungjoo.ham-Sze3O3UU22JBDgjK7y7TUQ,
sameo-VuQAYsv1563Yd54FQh9/CA, devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
Add additional bindings for both inverting the polarity of the jack
detection pins and allowing the use of a second jack detection pin. Note
that the second jack detection pin is hard wired in the chip so can only
be enabled through the binding, rather than a pin being specified.
Signed-off-by: Charles Keepax <ckeepax-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
Reviewed-by: Chanwoo Choi <cw00.choi-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
---
Documentation/devicetree/bindings/mfd/arizona.txt | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/Documentation/devicetree/bindings/mfd/arizona.txt b/Documentation/devicetree/bindings/mfd/arizona.txt
index b98a11b..cb3a652 100644
--- a/Documentation/devicetree/bindings/mfd/arizona.txt
+++ b/Documentation/devicetree/bindings/mfd/arizona.txt
@@ -73,6 +73,12 @@ Optional properties:
If this node is not mentioned or if the value is unknown, then
headphone detection mode is set to HPDETL.
+ - wlf,use-jd-gpio : Use GPIO input along with JD1 for dual pin jack
+ detection.
+ - wlf,use-jd-gpio-nopull : Internal pull on GPIO is disabled when used for
+ jack detection.
+ - wlf,jd-invert : Invert the polarity of the jack detection switch
+
- wlf,micd-software-compare : Use a software comparison to determine mic
presence
- wlf,micd-detect-debounce : Additional software microphone detection
--
1.7.2.5
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH 5/6] mfd: arizona: Update DT binding documentation for mic detection
2015-09-16 9:56 ` [PATCH 5/6] mfd: arizona: Update DT binding documentation for mic detection Charles Keepax
@ 2015-09-20 4:16 ` Lee Jones
0 siblings, 0 replies; 14+ messages in thread
From: Lee Jones @ 2015-09-20 4:16 UTC (permalink / raw)
To: Charles Keepax
Cc: cw00.choi, robh+dt, pawel.moll, mark.rutland, ijc+devicetree,
galak, myungjoo.ham, sameo, devicetree, linux-kernel
On Wed, 16 Sep 2015, Charles Keepax wrote:
> Add additional bindings to allow configuration of the system specific
> microphone detection settings.
>
> Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
> ---
> Documentation/devicetree/bindings/mfd/arizona.txt | 21 +++++++++++++++++++++
> include/dt-bindings/mfd/arizona.h | 5 +++++
> 2 files changed, 26 insertions(+), 0 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/mfd/arizona.txt b/Documentation/devicetree/bindings/mfd/arizona.txt
> index a8fee60..b98a11b 100644
> --- a/Documentation/devicetree/bindings/mfd/arizona.txt
> +++ b/Documentation/devicetree/bindings/mfd/arizona.txt
> @@ -73,6 +73,27 @@ Optional properties:
> If this node is not mentioned or if the value is unknown, then
> headphone detection mode is set to HPDETL.
>
> + - wlf,micd-software-compare : Use a software comparison to determine mic
> + presence
> + - wlf,micd-detect-debounce : Additional software microphone detection
> + debounce specified in milliseconds.
> + - wlf,micd-pol-gpio : GPIO specifier for the GPIO controlling the headset
> + polarity if one exists.
> + - wlf,micd-bias-start-time : Time allowed for MICBIAS to startup prior to
> + performing microphone detection, specified as per the ARIZONA_MICD_TIME_XXX
> + defines.
> + - wlf,micd-rate : Delay between successive microphone detection measurements,
> + specified as per the ARIZONA_MICD_TIME_XXX defines.
> + - wlf,micd-dbtime : Microphone detection hardware debounces specified as the
> + number of measurements to take, valid values being 2 and 4.
> + - wlf,micd-timeout : Timeout for microphone detection, specified in
> + milliseconds.
> + - wlf,micd-force-micbias : Force MICBIAS continuously on during microphone
> + detection.
> +
> + - wlf,gpsw : Settings for the general purpose switch, set as one of the
> + ARIZONA_GPSW_XXX defines.
I either need an Ack from the DT folks, or at least someone who knows
about this stuff. Mark perhaps.
> - DCVDD-supply, MICVDD-supply : Power supplies, only need to be specified if
> they are being externally supplied. As covered in
> Documentation/devicetree/bindings/regulator/regulator.txt
> diff --git a/include/dt-bindings/mfd/arizona.h b/include/dt-bindings/mfd/arizona.h
> index c40f665..dedf46f 100644
> --- a/include/dt-bindings/mfd/arizona.h
> +++ b/include/dt-bindings/mfd/arizona.h
> @@ -110,4 +110,9 @@
> #define ARIZONA_ACCDET_MODE_HPM 4
> #define ARIZONA_ACCDET_MODE_ADC 7
>
> +#define ARIZONA_GPSW_OPEN 0
> +#define ARIZONA_GPSW_CLOSED 1
> +#define ARIZONA_GPSW_CLAMP_ENABLED 2
> +#define ARIZONA_GPSW_CLAMP_DISABLED 3
> +
> #endif
--
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] 14+ messages in thread
* Re: [PATCH 6/6] mfd: arizona: Update DT binding documentation for jack detection
2015-09-16 9:56 ` [PATCH 6/6] mfd: arizona: Update DT binding documentation for jack detection Charles Keepax
@ 2015-09-20 4:17 ` Lee Jones
0 siblings, 0 replies; 14+ messages in thread
From: Lee Jones @ 2015-09-20 4:17 UTC (permalink / raw)
To: Charles Keepax
Cc: cw00.choi, robh+dt, pawel.moll, mark.rutland, ijc+devicetree,
galak, myungjoo.ham, sameo, devicetree, linux-kernel
On Wed, 16 Sep 2015, Charles Keepax wrote:
> Add additional bindings for both inverting the polarity of the jack
> detection pins and allowing the use of a second jack detection pin. Note
> that the second jack detection pin is hard wired in the chip so can only
> be enabled through the binding, rather than a pin being specified.
>
> Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
> Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
> ---
> Documentation/devicetree/bindings/mfd/arizona.txt | 6 ++++++
> 1 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/mfd/arizona.txt b/Documentation/devicetree/bindings/mfd/arizona.txt
> index b98a11b..cb3a652 100644
> --- a/Documentation/devicetree/bindings/mfd/arizona.txt
> +++ b/Documentation/devicetree/bindings/mfd/arizona.txt
> @@ -73,6 +73,12 @@ Optional properties:
> If this node is not mentioned or if the value is unknown, then
> headphone detection mode is set to HPDETL.
>
> + - wlf,use-jd-gpio : Use GPIO input along with JD1 for dual pin jack
> + detection.
> + - wlf,use-jd-gpio-nopull : Internal pull on GPIO is disabled when used for
> + jack detection.
> + - wlf,jd-invert : Invert the polarity of the jack detection switch
As before, I need an Ack from one of the DT guys, or perhaps Linus W.
> - wlf,micd-software-compare : Use a software comparison to determine mic
> presence
> - wlf,micd-detect-debounce : Additional software microphone detection
--
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] 14+ messages in thread
* Re: [PATCH 4/6] extcon: arizona: Add device binding for second jack detect pin on GPIO5
[not found] ` <1442397404-7579-5-git-send-email-ckeepax-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
@ 2015-09-25 0:54 ` Chanwoo Choi
[not found] ` <56049B42.7030509-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
0 siblings, 1 reply; 14+ messages in thread
From: Chanwoo Choi @ 2015-09-25 0:54 UTC (permalink / raw)
To: Charles Keepax, lee.jones-QSEj5FYQhm4dnm+yROfE0A
Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
galak-sgV2jX0FEOL9JmXXK+q4OQ, myungjoo.ham-Sze3O3UU22JBDgjK7y7TUQ,
sameo-VuQAYsv1563Yd54FQh9/CA, devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
Hi Charles,
I have one comment.
I think current extcon-arizona.c has the many platform data
so, extcon-arizona.c use the too much if statement to support each feature
for different wolfsonmicro codec. I think it cause the complicated code.
For example,
You may use 'struct of_device_id' as following. You used already this method
on drivers/mfd/arizona-core.c. If you separate the function of each wmXXXX arizona,
it makes improved readability for extcon-arizona.c and some user will use extcon-arizora
more easily.
struct arizona_extcon_data {
void (*init)(...);
void (*irq_handler)(...);
...
};
struct arizona_extcon_data wm8994_data {
.init = wm8994_extcon_init,
.irq_handler = wm8994_extcon_irq_handler;
...
};
static const struct of_device_id arizona_extcon_dt_match[] = {
{
.compatible = "wm8994-arizona-extcon",
.data = (void *)wm8994_data;
}, {
.compatible = "wmXXXX-arizona-extcon",
.data = (void *)wmXXXX_data;
},
};
I expect that you will revise the arizona-extcon.c driver on next time.
Thanks,
Chanwoo Choi
On 2015년 09월 16일 18:56, Charles Keepax wrote:
> Some Arizona devices have the option to use the GPIO5 pin as a second
> jack detection pin. This patch adds device bindings to specify to the
> driver that it should use this pin. Note that the second jack detection
> pin is hard wired in the chip so can only be enabled through the
> binding, rather than a pin being specified.
>
> Signed-off-by: Charles Keepax <ckeepax-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
> Acked-by: Chanwoo Choi <cw00.choi-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
> ---
> drivers/extcon/extcon-arizona.c | 5 +++++
> 1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c
> index dc1910d..992f80e 100644
> --- a/drivers/extcon/extcon-arizona.c
> +++ b/drivers/extcon/extcon-arizona.c
> @@ -1235,6 +1235,11 @@ static int arizona_extcon_device_get_pdata(struct arizona *arizona)
>
> device_property_read_u32(arizona->dev, "wlf,gpsw", &pdata->gpsw);
>
> + pdata->jd_gpio5 = device_property_read_bool(arizona->dev,
> + "wlf,use-jd-gpio");
> + pdata->jd_gpio5_nopull = device_property_read_bool(arizona->dev,
> + "wlf,use-jd-gpio-nopull");
> +
> return 0;
> }
>
>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 2/6] extcon: arizona: Add device binding for the general purpose switch
2015-09-16 9:56 ` [PATCH 2/6] extcon: arizona: Add device binding for the general purpose switch Charles Keepax
@ 2015-09-25 0:54 ` Chanwoo Choi
0 siblings, 0 replies; 14+ messages in thread
From: Chanwoo Choi @ 2015-09-25 0:54 UTC (permalink / raw)
To: Charles Keepax, lee.jones
Cc: robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak,
myungjoo.ham, sameo, devicetree, linux-kernel
Hi Charles,
On 2015년 09월 16일 18:56, Charles Keepax wrote:
> The switch is generally used in conjunction with the MICDET clamp to
> suppress pops and clicks associated with jack insertion. This patch adds
> a binding that allows the user to select the mode of operation for this
> switch.
>
> Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
> ---
> drivers/extcon/extcon-arizona.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c
> index 869a920..5b4bc2f 100644
> --- a/drivers/extcon/extcon-arizona.c
> +++ b/drivers/extcon/extcon-arizona.c
> @@ -1230,6 +1230,8 @@ static int arizona_extcon_device_get_pdata(struct arizona *arizona)
> pdata->micd_software_compare = device_property_read_bool(arizona->dev,
> "wlf,micd-software-compare");
>
> + device_property_read_u32(arizona->dev, "wlf,gpsw", &pdata->gpsw);
> +
> return 0;
> }
>
>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Thanks,
Chanwoo Choi
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/6] extcon: arizona: Add device binding to enable ADC mode micdet
2015-09-16 9:56 ` [PATCH 1/6] extcon: arizona: Add device binding to enable ADC mode micdet Charles Keepax
@ 2015-09-25 0:54 ` Chanwoo Choi
0 siblings, 0 replies; 14+ messages in thread
From: Chanwoo Choi @ 2015-09-25 0:54 UTC (permalink / raw)
To: Charles Keepax, lee.jones
Cc: robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak,
myungjoo.ham, sameo, devicetree, linux-kernel
Hi Charles,
On 2015년 09월 16일 18:56, Charles Keepax wrote:
> Add a simple boolean binding to turn on and off the use of ADC
> microphone detection mode to determine 3/4 pole jack.
>
> Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
> ---
> drivers/extcon/extcon-arizona.c | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c
> index 4479781..869a920 100644
> --- a/drivers/extcon/extcon-arizona.c
> +++ b/drivers/extcon/extcon-arizona.c
> @@ -1227,6 +1227,9 @@ static int arizona_extcon_device_get_pdata(struct arizona *arizona)
> pdata->micd_force_micbias = device_property_read_bool(arizona->dev,
> "wlf,micd-force-micbias");
>
> + pdata->micd_software_compare = device_property_read_bool(arizona->dev,
> + "wlf,micd-software-compare");
> +
> return 0;
> }
>
>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Thanks,
Chanwoo Choi
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 4/6] extcon: arizona: Add device binding for second jack detect pin on GPIO5
[not found] ` <56049B42.7030509-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
@ 2015-09-25 9:10 ` Charles Keepax
2015-09-27 4:50 ` Chanwoo Choi
0 siblings, 1 reply; 14+ messages in thread
From: Charles Keepax @ 2015-09-25 9:10 UTC (permalink / raw)
To: Chanwoo Choi
Cc: lee.jones-QSEj5FYQhm4dnm+yROfE0A, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
pawel.moll-5wv7dgnIgG8, mark.rutland-5wv7dgnIgG8,
ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
galak-sgV2jX0FEOL9JmXXK+q4OQ, myungjoo.ham-Sze3O3UU22JBDgjK7y7TUQ,
sameo-VuQAYsv1563Yd54FQh9/CA, devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
On Fri, Sep 25, 2015 at 09:54:26AM +0900, Chanwoo Choi wrote:
> Hi Charles,
>
> I have one comment.
> I think current extcon-arizona.c has the many platform data
> so, extcon-arizona.c use the too much if statement to support each feature
> for different wolfsonmicro codec. I think it cause the complicated code.
>
> For example,
> You may use 'struct of_device_id' as following. You used already this method
> on drivers/mfd/arizona-core.c. If you separate the function of each wmXXXX arizona,
> it makes improved readability for extcon-arizona.c and some user will use extcon-arizora
> more easily.
>
> struct arizona_extcon_data {
> void (*init)(...);
> void (*irq_handler)(...);
> ...
> };
>
> struct arizona_extcon_data wm8994_data {
> .init = wm8994_extcon_init,
> .irq_handler = wm8994_extcon_irq_handler;
> ...
> };
>
> static const struct of_device_id arizona_extcon_dt_match[] = {
> {
> .compatible = "wm8994-arizona-extcon",
> .data = (void *)wm8994_data;
> }, {
> .compatible = "wmXXXX-arizona-extcon",
> .data = (void *)wmXXXX_data;
> },
> };
>
> I expect that you will revise the arizona-extcon.c driver on next time.
I will have an investigation to see what ideas I can come up with
here and send through some patches.
But I am slightly worried you think the gains will be better than
they actually will be. Most of the platform data is just that
platform data, and needs to be configured based on the system not
based on the CODEC.
Thanks,
Charles
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 4/6] extcon: arizona: Add device binding for second jack detect pin on GPIO5
2015-09-25 9:10 ` Charles Keepax
@ 2015-09-27 4:50 ` Chanwoo Choi
0 siblings, 0 replies; 14+ messages in thread
From: Chanwoo Choi @ 2015-09-27 4:50 UTC (permalink / raw)
To: Charles Keepax
Cc: Lee Jones, Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell,
Kumar Gala, myungjoo.ham@samsung.com, Samuel Ortiz, devicetree,
linux-kernel
On Fri, Sep 25, 2015 at 6:10 PM, Charles Keepax
<ckeepax@opensource.wolfsonmicro.com> wrote:
> On Fri, Sep 25, 2015 at 09:54:26AM +0900, Chanwoo Choi wrote:
>> Hi Charles,
>>
>> I have one comment.
>> I think current extcon-arizona.c has the many platform data
>> so, extcon-arizona.c use the too much if statement to support each feature
>> for different wolfsonmicro codec. I think it cause the complicated code.
>>
>> For example,
>> You may use 'struct of_device_id' as following. You used already this method
>> on drivers/mfd/arizona-core.c. If you separate the function of each wmXXXX arizona,
>> it makes improved readability for extcon-arizona.c and some user will use extcon-arizora
>> more easily.
>>
>> struct arizona_extcon_data {
>> void (*init)(...);
>> void (*irq_handler)(...);
>> ...
>> };
>>
>> struct arizona_extcon_data wm8994_data {
>> .init = wm8994_extcon_init,
>> .irq_handler = wm8994_extcon_irq_handler;
>> ...
>> };
>>
>> static const struct of_device_id arizona_extcon_dt_match[] = {
>> {
>> .compatible = "wm8994-arizona-extcon",
>> .data = (void *)wm8994_data;
>> }, {
>> .compatible = "wmXXXX-arizona-extcon",
>> .data = (void *)wmXXXX_data;
>> },
>> };
>>
>> I expect that you will revise the arizona-extcon.c driver on next time.
>
> I will have an investigation to see what ideas I can come up with
> here and send through some patches.
>
> But I am slightly worried you think the gains will be better than
> they actually will be. Most of the platform data is just that
> platform data, and needs to be configured based on the system not
> based on the CODEC.
I agree. As you mentioned, platform data will be configured based on the system.
But, I mean that there are many platform datas for extcon-arizona in
"struct arizona_pdata" (in include/linux/mfd/arizona/pdata.h).
There are four sound code using the extcon-arizona driver as
following: I check the following list
in drivers/mfd/arizona-core.c.
- wm5102
- wm5110
- wm8997
- wm8998
If upper four sound codec include the same headset detection IP
(extcon-arizona.c)
without any difference about detection IP in sound codec, you don't
need to revise
the extcon-arizona.c driver.
But, If some field of "struct arizona_pdata" (in
include/linux/mfd/arizona/pdata.h)
are used for only specific sound codec (wmXXX series), I think we need
to revise it.
I'm positive about your patches of extcon-arizona. Just I think that
you can make it
more easier and improved readability.
Thanks,
Chanwoo Choi
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2015-09-27 4:50 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-16 9:56 [PATCH 0/6] Arizona Extcon Update Device Bindings Charles Keepax
2015-09-16 9:56 ` [PATCH 2/6] extcon: arizona: Add device binding for the general purpose switch Charles Keepax
2015-09-25 0:54 ` Chanwoo Choi
2015-09-16 9:56 ` [PATCH 3/6] extcon: arizona: Add device binding for jack detect polarity inversion Charles Keepax
2015-09-16 9:56 ` [PATCH 4/6] extcon: arizona: Add device binding for second jack detect pin on GPIO5 Charles Keepax
[not found] ` <1442397404-7579-5-git-send-email-ckeepax-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2015-09-25 0:54 ` Chanwoo Choi
[not found] ` <56049B42.7030509-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2015-09-25 9:10 ` Charles Keepax
2015-09-27 4:50 ` Chanwoo Choi
2015-09-16 9:56 ` [PATCH 5/6] mfd: arizona: Update DT binding documentation for mic detection Charles Keepax
2015-09-20 4:16 ` Lee Jones
[not found] ` <1442397404-7579-1-git-send-email-ckeepax-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2015-09-16 9:56 ` [PATCH 1/6] extcon: arizona: Add device binding to enable ADC mode micdet Charles Keepax
2015-09-25 0:54 ` Chanwoo Choi
2015-09-16 9:56 ` [PATCH 6/6] mfd: arizona: Update DT binding documentation for jack detection Charles Keepax
2015-09-20 4:17 ` Lee Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).