refresh/rename patches
[openwrt/openwrt.git] / target / linux / omap / patches-3.12 / 415-ASoC-davinci-mcasp-Remove-redundant-num-serializer-D.patch
1 From fdb8d3521ecae71865df66a84a1cbe13f7daa6f5 Mon Sep 17 00:00:00 2001
2 From: Peter Ujfalusi <peter.ujfalusi@ti.com>
3 Date: Mon, 23 Sep 2013 11:25:02 +0300
4 Subject: [PATCH 226/752] ASoC: davinci: mcasp: Remove redundant
5 num-serializer DT parameter
6
7 The serial-dir array gives this information so there is no need to have the
8 num-serializer property in DT description.
9 Just ignore the property in the driver the DTS files can be updated
10 separately without regression.
11 Update the documentation at the same time for davinci-mcasp
12
13 Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
14 ---
15 .../bindings/sound/davinci-mcasp-audio.txt | 8 +++----
16 sound/soc/davinci/davinci-mcasp.c | 22 +++++---------------
17 2 files changed, 8 insertions(+), 22 deletions(-)
18
19 --- a/Documentation/devicetree/bindings/sound/davinci-mcasp-audio.txt
20 +++ b/Documentation/devicetree/bindings/sound/davinci-mcasp-audio.txt
21 @@ -13,10 +13,9 @@ Required properties:
22 good to keep "mpu" first in the list.
23 - op-mode : I2S/DIT ops mode.
24 - tdm-slots : Slots for TDM operation.
25 -- num-serializer : Serializers used by McASP.
26 -- serial-dir : A list of serializer pin mode. The list number should be equal
27 - to "num-serializer" parameter. Each entry is a number indication
28 - serializer pin direction. (0 - INACTIVE, 1 - TX, 2 - RX)
29 +- serial-dir : A list of serializer configuration. Each entry is a number
30 + indication serializer pin direction.
31 + (0 - INACTIVE, 1 - TX, 2 - RX)
32 - dmas: two element list of DMA controller phandles and DMA request line
33 ordered pairs.
34 - dma-names: identifier string for each DMA request line in the dmas property.
35 @@ -45,7 +44,6 @@ mcasp0: mcasp0@1d00000 {
36 interrupts-names = "tx", "rx";
37 op-mode = <0>; /* MCASP_IIS_MODE */
38 tdm-slots = <2>;
39 - num-serializer = <16>;
40 serial-dir = <
41 0 0 0 0 /* 0: INACTIVE, 1: TX, 2: RX */
42 0 0 0 0
43 --- a/sound/soc/davinci/davinci-mcasp.c
44 +++ b/sound/soc/davinci/davinci-mcasp.c
45 @@ -1050,7 +1050,6 @@ static struct snd_platform_data *davinci
46 struct of_phandle_args dma_spec;
47
48 const u32 *of_serial_dir32;
49 - u8 *of_serial_dir;
50 u32 val;
51 int i, ret = 0;
52
53 @@ -1081,32 +1080,21 @@ static struct snd_platform_data *davinci
54 pdata->tdm_slots = val;
55 }
56
57 - ret = of_property_read_u32(np, "num-serializer", &val);
58 - if (ret >= 0)
59 - pdata->num_serializer = val;
60 -
61 of_serial_dir32 = of_get_property(np, "serial-dir", &val);
62 val /= sizeof(u32);
63 - if (val != pdata->num_serializer) {
64 - dev_err(&pdev->dev,
65 - "num-serializer(%d) != serial-dir size(%d)\n",
66 - pdata->num_serializer, val);
67 - ret = -EINVAL;
68 - goto nodata;
69 - }
70 -
71 if (of_serial_dir32) {
72 - of_serial_dir = devm_kzalloc(&pdev->dev,
73 - (sizeof(*of_serial_dir) * val),
74 - GFP_KERNEL);
75 + u8 *of_serial_dir = devm_kzalloc(&pdev->dev,
76 + (sizeof(*of_serial_dir) * val),
77 + GFP_KERNEL);
78 if (!of_serial_dir) {
79 ret = -ENOMEM;
80 goto nodata;
81 }
82
83 - for (i = 0; i < pdata->num_serializer; i++)
84 + for (i = 0; i < val; i++)
85 of_serial_dir[i] = be32_to_cpup(&of_serial_dir32[i]);
86
87 + pdata->num_serializer = val;
88 pdata->serial_dir = of_serial_dir;
89 }
90