Add device tree bindings to support specifying outputs from the chip as
mono outputs. Whilst we are doing it change the out_mono pdata from a
bool to an int, because Sparse gets upset about using ARRAY_SIZE on
bools.
Signed-off-by: Charles Keepax <[email protected]>
---
drivers/mfd/arizona-core.c | 10 ++++++++++
include/linux/mfd/arizona/pdata.h | 2 +-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c
index b9489a0..4bb4866 100644
--- a/drivers/mfd/arizona-core.c
+++ b/drivers/mfd/arizona-core.c
@@ -861,6 +861,16 @@ static int arizona_of_get_core_pdata(struct arizona *arizona)
count++;
}
+ count = 0;
+ of_property_for_each_u32(arizona->dev->of_node, "wlf,out-mono", prop,
+ cur, val) {
+ if (count == ARRAY_SIZE(pdata->out_mono))
+ break;
+
+ pdata->out_mono[count] = !!val;
+ count++;
+ }
+
return 0;
}
diff --git a/include/linux/mfd/arizona/pdata.h b/include/linux/mfd/arizona/pdata.h
index 57b45ca..64faeef 100644
--- a/include/linux/mfd/arizona/pdata.h
+++ b/include/linux/mfd/arizona/pdata.h
@@ -171,7 +171,7 @@ struct arizona_pdata {
int inmode[ARIZONA_MAX_INPUT];
/** Mode for outputs */
- bool out_mono[ARIZONA_MAX_OUTPUT];
+ int out_mono[ARIZONA_MAX_OUTPUT];
/** PDM speaker mute setting */
unsigned int spk_mute[ARIZONA_MAX_PDM_SPK];
--
2.1.4
Update the device tree binding documentation to include the wlf,out-mono
property that is used to specify whether each output is a mono or stereo
output.
Signed-off-by: Charles Keepax <[email protected]>
---
Documentation/devicetree/bindings/mfd/arizona.txt | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/Documentation/devicetree/bindings/mfd/arizona.txt b/Documentation/devicetree/bindings/mfd/arizona.txt
index 2b6ccdb..489dd07 100644
--- a/Documentation/devicetree/bindings/mfd/arizona.txt
+++ b/Documentation/devicetree/bindings/mfd/arizona.txt
@@ -65,6 +65,10 @@ Optional properties:
that have not been specified are set to 0 by default. Entries are:
<IN1, IN2, IN3, IN4> (wm5102, wm5110, wm8280, wm8997)
<IN1A, IN2A, IN1B, IN2B> (wm8998, wm1814)
+ - wlf,out-mono : A boolean indicating whether each output is mono or stereo.
+ A non-zero value indicates a mono output. If present, the number of values
+ should be less than or equal to the number of outputs, if less values are
+ supplied the additional outputs will be treated as stereo.
- wlf,dmic-ref : DMIC reference voltage source for each input, can be
selected from either MICVDD or one of the MICBIAS's, defines
--
2.1.4
On Fri, Dec 11, 2015 at 10:28:23AM +0000, Charles Keepax wrote:
> Update the device tree binding documentation to include the wlf,out-mono
> property that is used to specify whether each output is a mono or stereo
> output.
You just added this binding and updating it already? While we may like
kernel changes incremental, we don't like bindings evolving any more
than necessary.
> Signed-off-by: Charles Keepax <[email protected]>
> ---
> Documentation/devicetree/bindings/mfd/arizona.txt | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/mfd/arizona.txt b/Documentation/devicetree/bindings/mfd/arizona.txt
> index 2b6ccdb..489dd07 100644
> --- a/Documentation/devicetree/bindings/mfd/arizona.txt
> +++ b/Documentation/devicetree/bindings/mfd/arizona.txt
> @@ -65,6 +65,10 @@ Optional properties:
> that have not been specified are set to 0 by default. Entries are:
> <IN1, IN2, IN3, IN4> (wm5102, wm5110, wm8280, wm8997)
> <IN1A, IN2A, IN1B, IN2B> (wm8998, wm1814)
> + - wlf,out-mono : A boolean indicating whether each output is mono or stereo.
> + A non-zero value indicates a mono output. If present, the number of values
> + should be less than or equal to the number of outputs, if less values are
> + supplied the additional outputs will be treated as stereo.
How do you know which outputs are which with a variable number?
Rob
On Fri, Dec 11, 2015 at 11:33:53AM -0600, Rob Herring wrote:
> On Fri, Dec 11, 2015 at 10:28:23AM +0000, Charles Keepax wrote:
> > Update the device tree binding documentation to include the wlf,out-mono
> > property that is used to specify whether each output is a mono or stereo
> > output.
>
> You just added this binding and updating it already? While we may like
> kernel changes incremental, we don't like bindings evolving any more
> than necessary.
The binding has been around for ages I have been working through
updating it to actually include more of the functionality of the
driver. The last set of changes where some initial work on the
jack detection, this is a fairly self contained update that
doesn't really relate to the jack detection.
Its a fairly complex part so there is going to be quite a lot to
the binding. I have basically been upstreaming them as much as
possible in groups of similar functionality, as I have time to
work on them. I could try save the changes up out of tree and
collect together into much larger chains, if you felt strongly
about it? But I am not really clear that helps much. As I have to
hang on to much more out of tree code, people using the part have
to wait longer to have access to useful bindings in mainline and
it makes the CC lists much longer so everyone needs to look at
more email than they need to.
>
> > Signed-off-by: Charles Keepax <[email protected]>
> > ---
> > Documentation/devicetree/bindings/mfd/arizona.txt | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/mfd/arizona.txt b/Documentation/devicetree/bindings/mfd/arizona.txt
> > index 2b6ccdb..489dd07 100644
> > --- a/Documentation/devicetree/bindings/mfd/arizona.txt
> > +++ b/Documentation/devicetree/bindings/mfd/arizona.txt
> > @@ -65,6 +65,10 @@ Optional properties:
> > that have not been specified are set to 0 by default. Entries are:
> > <IN1, IN2, IN3, IN4> (wm5102, wm5110, wm8280, wm8997)
> > <IN1A, IN2A, IN1B, IN2B> (wm8998, wm1814)
> > + - wlf,out-mono : A boolean indicating whether each output is mono or stereo.
> > + A non-zero value indicates a mono output. If present, the number of values
> > + should be less than or equal to the number of outputs, if less values are
> > + supplied the additional outputs will be treated as stereo.
>
> How do you know which outputs are which with a variable number?
Position in the array (ie. first entry is the first output, and
so on). I will respin to update the comment to make this more
clear.
Thanks,
Charles