summaryrefslogtreecommitdiffstats
path: root/sound/soc/fsl
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2019-06-06 00:15:25 -0400
committerMark Brown <broonie@kernel.org>2019-06-06 16:42:35 -0400
commit6aa7b4091d0bd3866d42e368ef32674aa1c155cc (patch)
tree9d584b3e978ac3d2696950bf89df01ba82d1683c /sound/soc/fsl
parent893f195104142c0f83e60a91ccada2653bccee2a (diff)
ASoC: fsl: mpc8610_hpcd/p1022_ds/p1022_rdk: use modern dai_link style
ASoC is now supporting modern style dai_link (= snd_soc_dai_link_component) for CPU/Codec/Platform. This patch switches to use it. mpc8610_hpcd/p1022_ds/p1022_rdk are sharing fsl_asoc_get_dma_channel() which setups platform. We need to update these by 1 patch. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/fsl')
-rw-r--r--sound/soc/fsl/fsl_utils.c2
-rw-r--r--sound/soc/fsl/mpc8610_hpcd.c33
-rw-r--r--sound/soc/fsl/p1022_ds.c36
-rw-r--r--sound/soc/fsl/p1022_rdk.c35
4 files changed, 88 insertions, 18 deletions
diff --git a/sound/soc/fsl/fsl_utils.c b/sound/soc/fsl/fsl_utils.c
index 040d06b89f00..9bab202569af 100644
--- a/sound/soc/fsl/fsl_utils.c
+++ b/sound/soc/fsl/fsl_utils.c
@@ -57,7 +57,7 @@ int fsl_asoc_get_dma_channel(struct device_node *ssi_np,
57 of_node_put(dma_channel_np); 57 of_node_put(dma_channel_np);
58 return ret; 58 return ret;
59 } 59 }
60 snprintf((char *)dai->platform_name, DAI_NAME_SIZE, "%llx.%pOFn", 60 snprintf((char *)dai->platforms->name, DAI_NAME_SIZE, "%llx.%pOFn",
61 (unsigned long long) res.start, dma_channel_np); 61 (unsigned long long) res.start, dma_channel_np);
62 62
63 iprop = of_get_property(dma_channel_np, "cell-index", NULL); 63 iprop = of_get_property(dma_channel_np, "cell-index", NULL);
diff --git a/sound/soc/fsl/mpc8610_hpcd.c b/sound/soc/fsl/mpc8610_hpcd.c
index f6261a3eeb0f..23617eb09ba1 100644
--- a/sound/soc/fsl/mpc8610_hpcd.c
+++ b/sound/soc/fsl/mpc8610_hpcd.c
@@ -189,6 +189,7 @@ static int mpc8610_hpcd_probe(struct platform_device *pdev)
189 struct device_node *np = ssi_pdev->dev.of_node; 189 struct device_node *np = ssi_pdev->dev.of_node;
190 struct device_node *codec_np = NULL; 190 struct device_node *codec_np = NULL;
191 struct mpc8610_hpcd_data *machine_data; 191 struct mpc8610_hpcd_data *machine_data;
192 struct snd_soc_dai_link_component *comp;
192 int ret = -ENODEV; 193 int ret = -ENODEV;
193 const char *sprop; 194 const char *sprop;
194 const u32 *iprop; 195 const u32 *iprop;
@@ -206,14 +207,36 @@ static int mpc8610_hpcd_probe(struct platform_device *pdev)
206 goto error_alloc; 207 goto error_alloc;
207 } 208 }
208 209
209 machine_data->dai[0].cpu_dai_name = dev_name(&ssi_pdev->dev); 210 comp = devm_kzalloc(&pdev->dev, 6 * sizeof(*comp), GFP_KERNEL);
211 if (!comp) {
212 ret = -ENOMEM;
213 goto error_alloc;
214 }
215
216 machine_data->dai[0].cpus = &comp[0];
217 machine_data->dai[0].codecs = &comp[1];
218 machine_data->dai[0].platforms = &comp[2];
219
220 machine_data->dai[0].num_cpus = 1;
221 machine_data->dai[0].num_codecs = 1;
222 machine_data->dai[0].num_platforms = 1;
223
224 machine_data->dai[1].cpus = &comp[3];
225 machine_data->dai[1].codecs = &comp[4];
226 machine_data->dai[1].platforms = &comp[5];
227
228 machine_data->dai[1].num_cpus = 1;
229 machine_data->dai[1].num_codecs = 1;
230 machine_data->dai[1].num_platforms = 1;
231
232 machine_data->dai[0].cpus->dai_name = dev_name(&ssi_pdev->dev);
210 machine_data->dai[0].ops = &mpc8610_hpcd_ops; 233 machine_data->dai[0].ops = &mpc8610_hpcd_ops;
211 234
212 /* ASoC core can match codec with device node */ 235 /* ASoC core can match codec with device node */
213 machine_data->dai[0].codec_of_node = codec_np; 236 machine_data->dai[0].codecs->of_node = codec_np;
214 237
215 /* The DAI name from the codec (snd_soc_dai_driver.name) */ 238 /* The DAI name from the codec (snd_soc_dai_driver.name) */
216 machine_data->dai[0].codec_dai_name = "cs4270-hifi"; 239 machine_data->dai[0].codecs->dai_name = "cs4270-hifi";
217 240
218 /* We register two DAIs per SSI, one for playback and the other for 241 /* We register two DAIs per SSI, one for playback and the other for
219 * capture. Currently, we only support codecs that have one DAI for 242 * capture. Currently, we only support codecs that have one DAI for
@@ -306,7 +329,7 @@ static int mpc8610_hpcd_probe(struct platform_device *pdev)
306 } 329 }
307 330
308 /* Find the playback DMA channel to use. */ 331 /* Find the playback DMA channel to use. */
309 machine_data->dai[0].platform_name = machine_data->platform_name[0]; 332 machine_data->dai[0].platforms->name = machine_data->platform_name[0];
310 ret = fsl_asoc_get_dma_channel(np, "fsl,playback-dma", 333 ret = fsl_asoc_get_dma_channel(np, "fsl,playback-dma",
311 &machine_data->dai[0], 334 &machine_data->dai[0],
312 &machine_data->dma_channel_id[0], 335 &machine_data->dma_channel_id[0],
@@ -317,7 +340,7 @@ static int mpc8610_hpcd_probe(struct platform_device *pdev)
317 } 340 }
318 341
319 /* Find the capture DMA channel to use. */ 342 /* Find the capture DMA channel to use. */
320 machine_data->dai[1].platform_name = machine_data->platform_name[1]; 343 machine_data->dai[1].platforms->name = machine_data->platform_name[1];
321 ret = fsl_asoc_get_dma_channel(np, "fsl,capture-dma", 344 ret = fsl_asoc_get_dma_channel(np, "fsl,capture-dma",
322 &machine_data->dai[1], 345 &machine_data->dai[1],
323 &machine_data->dma_channel_id[1], 346 &machine_data->dma_channel_id[1],
diff --git a/sound/soc/fsl/p1022_ds.c b/sound/soc/fsl/p1022_ds.c
index 80384f70878d..6114b01b90f7 100644
--- a/sound/soc/fsl/p1022_ds.c
+++ b/sound/soc/fsl/p1022_ds.c
@@ -199,6 +199,7 @@ static int p1022_ds_probe(struct platform_device *pdev)
199 struct device_node *np = ssi_pdev->dev.of_node; 199 struct device_node *np = ssi_pdev->dev.of_node;
200 struct device_node *codec_np = NULL; 200 struct device_node *codec_np = NULL;
201 struct machine_data *mdata; 201 struct machine_data *mdata;
202 struct snd_soc_dai_link_component *comp;
202 int ret = -ENODEV; 203 int ret = -ENODEV;
203 const char *sprop; 204 const char *sprop;
204 const u32 *iprop; 205 const u32 *iprop;
@@ -216,11 +217,34 @@ static int p1022_ds_probe(struct platform_device *pdev)
216 goto error_put; 217 goto error_put;
217 } 218 }
218 219
219 mdata->dai[0].cpu_dai_name = dev_name(&ssi_pdev->dev); 220 comp = devm_kzalloc(&pdev->dev, 6 * sizeof(*comp), GFP_KERNEL);
221 if (!comp) {
222 ret = -ENOMEM;
223 goto error_put;
224 }
225
226 mdata->dai[0].cpus = &comp[0];
227 mdata->dai[0].codecs = &comp[1];
228 mdata->dai[0].platforms = &comp[2];
229
230 mdata->dai[0].num_cpus = 1;
231 mdata->dai[0].num_codecs = 1;
232 mdata->dai[0].num_platforms = 1;
233
234 mdata->dai[1].cpus = &comp[3];
235 mdata->dai[1].codecs = &comp[4];
236 mdata->dai[1].platforms = &comp[5];
237
238 mdata->dai[1].num_cpus = 1;
239 mdata->dai[1].num_codecs = 1;
240 mdata->dai[1].num_platforms = 1;
241
242
243 mdata->dai[0].cpus->dai_name = dev_name(&ssi_pdev->dev);
220 mdata->dai[0].ops = &p1022_ds_ops; 244 mdata->dai[0].ops = &p1022_ds_ops;
221 245
222 /* ASoC core can match codec with device node */ 246 /* ASoC core can match codec with device node */
223 mdata->dai[0].codec_of_node = codec_np; 247 mdata->dai[0].codecs->of_node = codec_np;
224 248
225 /* We register two DAIs per SSI, one for playback and the other for 249 /* We register two DAIs per SSI, one for playback and the other for
226 * capture. We support codecs that have separate DAIs for both playback 250 * capture. We support codecs that have separate DAIs for both playback
@@ -229,8 +253,8 @@ static int p1022_ds_probe(struct platform_device *pdev)
229 memcpy(&mdata->dai[1], &mdata->dai[0], sizeof(struct snd_soc_dai_link)); 253 memcpy(&mdata->dai[1], &mdata->dai[0], sizeof(struct snd_soc_dai_link));
230 254
231 /* The DAI names from the codec (snd_soc_dai_driver.name) */ 255 /* The DAI names from the codec (snd_soc_dai_driver.name) */
232 mdata->dai[0].codec_dai_name = "wm8776-hifi-playback"; 256 mdata->dai[0].codecs->dai_name = "wm8776-hifi-playback";
233 mdata->dai[1].codec_dai_name = "wm8776-hifi-capture"; 257 mdata->dai[1].codecs->dai_name = "wm8776-hifi-capture";
234 258
235 /* Get the device ID */ 259 /* Get the device ID */
236 iprop = of_get_property(np, "cell-index", NULL); 260 iprop = of_get_property(np, "cell-index", NULL);
@@ -316,7 +340,7 @@ static int p1022_ds_probe(struct platform_device *pdev)
316 } 340 }
317 341
318 /* Find the playback DMA channel to use. */ 342 /* Find the playback DMA channel to use. */
319 mdata->dai[0].platform_name = mdata->platform_name[0]; 343 mdata->dai[0].platforms->name = mdata->platform_name[0];
320 ret = fsl_asoc_get_dma_channel(np, "fsl,playback-dma", &mdata->dai[0], 344 ret = fsl_asoc_get_dma_channel(np, "fsl,playback-dma", &mdata->dai[0],
321 &mdata->dma_channel_id[0], 345 &mdata->dma_channel_id[0],
322 &mdata->dma_id[0]); 346 &mdata->dma_id[0]);
@@ -326,7 +350,7 @@ static int p1022_ds_probe(struct platform_device *pdev)
326 } 350 }
327 351
328 /* Find the capture DMA channel to use. */ 352 /* Find the capture DMA channel to use. */
329 mdata->dai[1].platform_name = mdata->platform_name[1]; 353 mdata->dai[1].platforms->name = mdata->platform_name[1];
330 ret = fsl_asoc_get_dma_channel(np, "fsl,capture-dma", &mdata->dai[1], 354 ret = fsl_asoc_get_dma_channel(np, "fsl,capture-dma", &mdata->dai[1],
331 &mdata->dma_channel_id[1], 355 &mdata->dma_channel_id[1],
332 &mdata->dma_id[1]); 356 &mdata->dma_id[1]);
diff --git a/sound/soc/fsl/p1022_rdk.c b/sound/soc/fsl/p1022_rdk.c
index 1c32c2d8c6b0..72687235c0ae 100644
--- a/sound/soc/fsl/p1022_rdk.c
+++ b/sound/soc/fsl/p1022_rdk.c
@@ -203,6 +203,7 @@ static int p1022_rdk_probe(struct platform_device *pdev)
203 struct device_node *np = ssi_pdev->dev.of_node; 203 struct device_node *np = ssi_pdev->dev.of_node;
204 struct device_node *codec_np = NULL; 204 struct device_node *codec_np = NULL;
205 struct machine_data *mdata; 205 struct machine_data *mdata;
206 struct snd_soc_dai_link_component *comp;
206 const u32 *iprop; 207 const u32 *iprop;
207 int ret; 208 int ret;
208 209
@@ -219,11 +220,33 @@ static int p1022_rdk_probe(struct platform_device *pdev)
219 goto error_put; 220 goto error_put;
220 } 221 }
221 222
222 mdata->dai[0].cpu_dai_name = dev_name(&ssi_pdev->dev); 223 comp = devm_kzalloc(&pdev->dev, 6 * sizeof(*comp), GFP_KERNEL);
224 if (!comp) {
225 ret = -ENOMEM;
226 goto error_put;
227 }
228
229 mdata->dai[0].cpus = &comp[0];
230 mdata->dai[0].codecs = &comp[1];
231 mdata->dai[0].platforms = &comp[2];
232
233 mdata->dai[0].num_cpus = 1;
234 mdata->dai[0].num_codecs = 1;
235 mdata->dai[0].num_platforms = 1;
236
237 mdata->dai[1].cpus = &comp[3];
238 mdata->dai[1].codecs = &comp[4];
239 mdata->dai[1].platforms = &comp[5];
240
241 mdata->dai[1].num_cpus = 1;
242 mdata->dai[1].num_codecs = 1;
243 mdata->dai[1].num_platforms = 1;
244
245 mdata->dai[0].cpus->dai_name = dev_name(&ssi_pdev->dev);
223 mdata->dai[0].ops = &p1022_rdk_ops; 246 mdata->dai[0].ops = &p1022_rdk_ops;
224 247
225 /* ASoC core can match codec with device node */ 248 /* ASoC core can match codec with device node */
226 mdata->dai[0].codec_of_node = codec_np; 249 mdata->dai[0].codecs->of_node = codec_np;
227 250
228 /* 251 /*
229 * We register two DAIs per SSI, one for playback and the other for 252 * We register two DAIs per SSI, one for playback and the other for
@@ -233,8 +256,8 @@ static int p1022_rdk_probe(struct platform_device *pdev)
233 memcpy(&mdata->dai[1], &mdata->dai[0], sizeof(struct snd_soc_dai_link)); 256 memcpy(&mdata->dai[1], &mdata->dai[0], sizeof(struct snd_soc_dai_link));
234 257
235 /* The DAI names from the codec (snd_soc_dai_driver.name) */ 258 /* The DAI names from the codec (snd_soc_dai_driver.name) */
236 mdata->dai[0].codec_dai_name = "wm8960-hifi"; 259 mdata->dai[0].codecs->dai_name = "wm8960-hifi";
237 mdata->dai[1].codec_dai_name = mdata->dai[0].codec_dai_name; 260 mdata->dai[1].codecs->dai_name = mdata->dai[0].codecs->dai_name;
238 261
239 /* 262 /*
240 * Configure the SSI for I2S slave mode. Older device trees have 263 * Configure the SSI for I2S slave mode. Older device trees have
@@ -266,7 +289,7 @@ static int p1022_rdk_probe(struct platform_device *pdev)
266 } 289 }
267 290
268 /* Find the playback DMA channel to use. */ 291 /* Find the playback DMA channel to use. */
269 mdata->dai[0].platform_name = mdata->platform_name[0]; 292 mdata->dai[0].platforms->name = mdata->platform_name[0];
270 ret = fsl_asoc_get_dma_channel(np, "fsl,playback-dma", &mdata->dai[0], 293 ret = fsl_asoc_get_dma_channel(np, "fsl,playback-dma", &mdata->dai[0],
271 &mdata->dma_channel_id[0], 294 &mdata->dma_channel_id[0],
272 &mdata->dma_id[0]); 295 &mdata->dma_id[0]);
@@ -277,7 +300,7 @@ static int p1022_rdk_probe(struct platform_device *pdev)
277 } 300 }
278 301
279 /* Find the capture DMA channel to use. */ 302 /* Find the capture DMA channel to use. */
280 mdata->dai[1].platform_name = mdata->platform_name[1]; 303 mdata->dai[1].platforms->name = mdata->platform_name[1];
281 ret = fsl_asoc_get_dma_channel(np, "fsl,capture-dma", &mdata->dai[1], 304 ret = fsl_asoc_get_dma_channel(np, "fsl,capture-dma", &mdata->dai[1],
282 &mdata->dma_channel_id[1], 305 &mdata->dma_channel_id[1],
283 &mdata->dma_id[1]); 306 &mdata->dma_id[1]);