fix gpio interrupt-cells property on AM335x
[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 diff --git a/Documentation/devicetree/bindings/sound/davinci-mcasp-audio.txt b/Documentation/devicetree/bindings/sound/davinci-mcasp-audio.txt
20 index 2fd0bf2..be6cf94 100644
21 --- a/Documentation/devicetree/bindings/sound/davinci-mcasp-audio.txt
22 +++ b/Documentation/devicetree/bindings/sound/davinci-mcasp-audio.txt
23 @@ -13,10 +13,9 @@ Required properties:
24 good to keep "mpu" first in the list.
25 - op-mode : I2S/DIT ops mode.
26 - tdm-slots : Slots for TDM operation.
27 -- num-serializer : Serializers used by McASP.
28 -- serial-dir : A list of serializer pin mode. The list number should be equal
29 - to "num-serializer" parameter. Each entry is a number indication
30 - serializer pin direction. (0 - INACTIVE, 1 - TX, 2 - RX)
31 +- serial-dir : A list of serializer configuration. Each entry is a number
32 + indication serializer pin direction.
33 + (0 - INACTIVE, 1 - TX, 2 - RX)
34 - dmas: two element list of DMA controller phandles and DMA request line
35 ordered pairs.
36 - dma-names: identifier string for each DMA request line in the dmas property.
37 @@ -45,7 +44,6 @@ mcasp0: mcasp0@1d00000 {
38 interrupts-names = "tx", "rx";
39 op-mode = <0>; /* MCASP_IIS_MODE */
40 tdm-slots = <2>;
41 - num-serializer = <16>;
42 serial-dir = <
43 0 0 0 0 /* 0: INACTIVE, 1: TX, 2: RX */
44 0 0 0 0
45 diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c
46 index acbf5f8..69e662e 100644
47 --- a/sound/soc/davinci/davinci-mcasp.c
48 +++ b/sound/soc/davinci/davinci-mcasp.c
49 @@ -1050,7 +1050,6 @@ static struct snd_platform_data *davinci_mcasp_set_pdata_from_of(
50 struct of_phandle_args dma_spec;
51
52 const u32 *of_serial_dir32;
53 - u8 *of_serial_dir;
54 u32 val;
55 int i, ret = 0;
56
57 @@ -1081,32 +1080,21 @@ static struct snd_platform_data *davinci_mcasp_set_pdata_from_of(
58 pdata->tdm_slots = val;
59 }
60
61 - ret = of_property_read_u32(np, "num-serializer", &val);
62 - if (ret >= 0)
63 - pdata->num_serializer = val;
64 -
65 of_serial_dir32 = of_get_property(np, "serial-dir", &val);
66 val /= sizeof(u32);
67 - if (val != pdata->num_serializer) {
68 - dev_err(&pdev->dev,
69 - "num-serializer(%d) != serial-dir size(%d)\n",
70 - pdata->num_serializer, val);
71 - ret = -EINVAL;
72 - goto nodata;
73 - }
74 -
75 if (of_serial_dir32) {
76 - of_serial_dir = devm_kzalloc(&pdev->dev,
77 - (sizeof(*of_serial_dir) * val),
78 - GFP_KERNEL);
79 + u8 *of_serial_dir = devm_kzalloc(&pdev->dev,
80 + (sizeof(*of_serial_dir) * val),
81 + GFP_KERNEL);
82 if (!of_serial_dir) {
83 ret = -ENOMEM;
84 goto nodata;
85 }
86
87 - for (i = 0; i < pdata->num_serializer; i++)
88 + for (i = 0; i < val; i++)
89 of_serial_dir[i] = be32_to_cpup(&of_serial_dir32[i]);
90
91 + pdata->num_serializer = val;
92 pdata->serial_dir = of_serial_dir;
93 }
94
95 --
96 1.7.10.4
97