Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mfd: arizona: Add device tree binding to specify mono outputs

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 <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

Charles Keepax and committed by
Lee Jones
f199d393 8726cacc

+11 -1
+10
drivers/mfd/arizona-core.c
··· 861 861 count++; 862 862 } 863 863 864 + count = 0; 865 + of_property_for_each_u32(arizona->dev->of_node, "wlf,out-mono", prop, 866 + cur, val) { 867 + if (count == ARRAY_SIZE(pdata->out_mono)) 868 + break; 869 + 870 + pdata->out_mono[count] = !!val; 871 + count++; 872 + } 873 + 864 874 return 0; 865 875 } 866 876
+1 -1
include/linux/mfd/arizona/pdata.h
··· 171 171 int inmode[ARIZONA_MAX_INPUT]; 172 172 173 173 /** Mode for outputs */ 174 - bool out_mono[ARIZONA_MAX_OUTPUT]; 174 + int out_mono[ARIZONA_MAX_OUTPUT]; 175 175 176 176 /** PDM speaker mute setting */ 177 177 unsigned int spk_mute[ARIZONA_MAX_PDM_SPK];