diff options
| -rw-r--r-- | Documentation/devicetree/bindings/sound/tegra-audio-trimslice.txt | 14 | ||||
| -rw-r--r-- | sound/soc/tegra/trimslice.c | 34 |
2 files changed, 48 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/sound/tegra-audio-trimslice.txt b/Documentation/devicetree/bindings/sound/tegra-audio-trimslice.txt new file mode 100644 index 000000000000..04b14cfb1f16 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/tegra-audio-trimslice.txt | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | NVIDIA Tegra audio complex for TrimSlice | ||
| 2 | |||
| 3 | Required properties: | ||
| 4 | - compatible : "nvidia,tegra-audio-trimslice" | ||
| 5 | - nvidia,i2s-controller : The phandle of the Tegra I2S1 controller | ||
| 6 | - nvidia,audio-codec : The phandle of the WM8903 audio codec | ||
| 7 | |||
| 8 | Example: | ||
| 9 | |||
| 10 | sound { | ||
| 11 | compatible = "nvidia,tegra-audio-trimslice"; | ||
| 12 | nvidia,i2s-controller = <&tegra_i2s1>; | ||
| 13 | nvidia,audio-codec = <&codec>; | ||
| 14 | }; | ||
diff --git a/sound/soc/tegra/trimslice.c b/sound/soc/tegra/trimslice.c index 0fd115e69a8a..4a8d5b672c9f 100644 --- a/sound/soc/tegra/trimslice.c +++ b/sound/soc/tegra/trimslice.c | |||
| @@ -27,6 +27,7 @@ | |||
| 27 | #include <asm/mach-types.h> | 27 | #include <asm/mach-types.h> |
| 28 | 28 | ||
| 29 | #include <linux/module.h> | 29 | #include <linux/module.h> |
| 30 | #include <linux/of.h> | ||
| 30 | #include <linux/platform_device.h> | 31 | #include <linux/platform_device.h> |
| 31 | #include <linux/slab.h> | 32 | #include <linux/slab.h> |
| 32 | 33 | ||
| @@ -149,6 +150,32 @@ static __devinit int tegra_snd_trimslice_probe(struct platform_device *pdev) | |||
| 149 | goto err; | 150 | goto err; |
| 150 | } | 151 | } |
| 151 | 152 | ||
| 153 | if (pdev->dev.of_node) { | ||
| 154 | trimslice_tlv320aic23_dai.codec_name = NULL; | ||
| 155 | trimslice_tlv320aic23_dai.codec_of_node = of_parse_phandle( | ||
| 156 | pdev->dev.of_node, "nvidia,audio-codec", 0); | ||
| 157 | if (!trimslice_tlv320aic23_dai.codec_of_node) { | ||
| 158 | dev_err(&pdev->dev, | ||
| 159 | "Property 'nvidia,audio-codec' missing or invalid\n"); | ||
| 160 | ret = -EINVAL; | ||
| 161 | goto err; | ||
| 162 | } | ||
| 163 | |||
| 164 | trimslice_tlv320aic23_dai.cpu_dai_name = NULL; | ||
| 165 | trimslice_tlv320aic23_dai.cpu_dai_of_node = of_parse_phandle( | ||
| 166 | pdev->dev.of_node, "nvidia,i2s-controller", 0); | ||
| 167 | if (!trimslice_tlv320aic23_dai.cpu_dai_of_node) { | ||
| 168 | dev_err(&pdev->dev, | ||
| 169 | "Property 'nvidia,i2s-controller' missing or invalid\n"); | ||
| 170 | ret = -EINVAL; | ||
| 171 | goto err; | ||
| 172 | } | ||
| 173 | |||
| 174 | trimslice_tlv320aic23_dai.platform_name = NULL; | ||
| 175 | trimslice_tlv320aic23_dai.platform_of_node = | ||
| 176 | trimslice_tlv320aic23_dai.cpu_dai_of_node; | ||
| 177 | } | ||
| 178 | |||
| 152 | ret = tegra_asoc_utils_init(&trimslice->util_data, &pdev->dev); | 179 | ret = tegra_asoc_utils_init(&trimslice->util_data, &pdev->dev); |
| 153 | if (ret) | 180 | if (ret) |
| 154 | goto err; | 181 | goto err; |
| @@ -184,10 +211,17 @@ static int __devexit tegra_snd_trimslice_remove(struct platform_device *pdev) | |||
| 184 | return 0; | 211 | return 0; |
| 185 | } | 212 | } |
| 186 | 213 | ||
| 214 | static const struct of_device_id trimslice_of_match[] __devinitconst = { | ||
| 215 | { .compatible = "nvidia,tegra-audio-trimslice", }, | ||
| 216 | {}, | ||
| 217 | }; | ||
| 218 | MODULE_DEVICE_TABLE(of, trimslice_of_match); | ||
| 219 | |||
| 187 | static struct platform_driver tegra_snd_trimslice_driver = { | 220 | static struct platform_driver tegra_snd_trimslice_driver = { |
| 188 | .driver = { | 221 | .driver = { |
| 189 | .name = DRV_NAME, | 222 | .name = DRV_NAME, |
| 190 | .owner = THIS_MODULE, | 223 | .owner = THIS_MODULE, |
| 224 | .of_match_table = trimslice_of_match, | ||
| 191 | }, | 225 | }, |
| 192 | .probe = tegra_snd_trimslice_probe, | 226 | .probe = tegra_snd_trimslice_probe, |
| 193 | .remove = __devexit_p(tegra_snd_trimslice_remove), | 227 | .remove = __devexit_p(tegra_snd_trimslice_remove), |
