Commit 1427e660 authored by Peter Ujfalusi's avatar Peter Ujfalusi Committed by Mark Brown

ASoC: davinci-mcasp: Remove redundant num-serializer DT parameter

The serial-dir array gives this information so there is no need to have the
num-serializer property in DT description.
Just ignore the property in the driver the DTS files can be updated
separately without regression.
Update the documentation at the same time for davinci-mcasp
Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: default avatarJyri Sarha <jsarha@ti.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 62561b39
...@@ -49,7 +49,6 @@ mcasp0: mcasp0@1d00000 { ...@@ -49,7 +49,6 @@ mcasp0: mcasp0@1d00000 {
interrupts-names = "tx", "rx"; interrupts-names = "tx", "rx";
op-mode = <0>; /* MCASP_IIS_MODE */ op-mode = <0>; /* MCASP_IIS_MODE */
tdm-slots = <2>; tdm-slots = <2>;
num-serializer = <16>;
serial-dir = < serial-dir = <
0 0 0 0 /* 0: INACTIVE, 1: TX, 2: RX */ 0 0 0 0 /* 0: INACTIVE, 1: TX, 2: RX */
0 0 0 0 0 0 0 0
......
...@@ -1050,7 +1050,6 @@ static struct snd_platform_data *davinci_mcasp_set_pdata_from_of( ...@@ -1050,7 +1050,6 @@ static struct snd_platform_data *davinci_mcasp_set_pdata_from_of(
struct of_phandle_args dma_spec; struct of_phandle_args dma_spec;
const u32 *of_serial_dir32; const u32 *of_serial_dir32;
u8 *of_serial_dir;
u32 val; u32 val;
int i, ret = 0; int i, ret = 0;
...@@ -1081,32 +1080,21 @@ static struct snd_platform_data *davinci_mcasp_set_pdata_from_of( ...@@ -1081,32 +1080,21 @@ static struct snd_platform_data *davinci_mcasp_set_pdata_from_of(
pdata->tdm_slots = val; pdata->tdm_slots = val;
} }
ret = of_property_read_u32(np, "num-serializer", &val);
if (ret >= 0)
pdata->num_serializer = val;
of_serial_dir32 = of_get_property(np, "serial-dir", &val); of_serial_dir32 = of_get_property(np, "serial-dir", &val);
val /= sizeof(u32); val /= sizeof(u32);
if (val != pdata->num_serializer) {
dev_err(&pdev->dev,
"num-serializer(%d) != serial-dir size(%d)\n",
pdata->num_serializer, val);
ret = -EINVAL;
goto nodata;
}
if (of_serial_dir32) { if (of_serial_dir32) {
of_serial_dir = devm_kzalloc(&pdev->dev, u8 *of_serial_dir = devm_kzalloc(&pdev->dev,
(sizeof(*of_serial_dir) * val), (sizeof(*of_serial_dir) * val),
GFP_KERNEL); GFP_KERNEL);
if (!of_serial_dir) { if (!of_serial_dir) {
ret = -ENOMEM; ret = -ENOMEM;
goto nodata; goto nodata;
} }
for (i = 0; i < pdata->num_serializer; i++) for (i = 0; i < val; i++)
of_serial_dir[i] = be32_to_cpup(&of_serial_dir32[i]); of_serial_dir[i] = be32_to_cpup(&of_serial_dir32[i]);
pdata->num_serializer = val;
pdata->serial_dir = of_serial_dir; pdata->serial_dir = of_serial_dir;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment