| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * spitz.c -- SoC audio for Sharp SL-Cxx00 models Spitz, Borzoi and Akita |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 6 | 7 | * |
|---|
| 7 | 8 | * Authors: Liam Girdwood <lrg@slimlogic.co.uk> |
|---|
| 8 | 9 | * Richard Purdie <richard@openedhand.com> |
|---|
| 9 | | - * |
|---|
| 10 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 11 | | - * under the terms of the GNU General Public License as published by the |
|---|
| 12 | | - * Free Software Foundation; either version 2 of the License, or (at your |
|---|
| 13 | | - * option) any later version. |
|---|
| 14 | | - * |
|---|
| 15 | 10 | */ |
|---|
| 16 | 11 | |
|---|
| 17 | 12 | #include <linux/module.h> |
|---|
| .. | .. |
|---|
| 110 | 105 | |
|---|
| 111 | 106 | static int spitz_startup(struct snd_pcm_substream *substream) |
|---|
| 112 | 107 | { |
|---|
| 113 | | - struct snd_soc_pcm_runtime *rtd = substream->private_data; |
|---|
| 108 | + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); |
|---|
| 114 | 109 | |
|---|
| 115 | 110 | /* check the jack status at stream startup */ |
|---|
| 116 | 111 | spitz_ext_control(&rtd->card->dapm); |
|---|
| .. | .. |
|---|
| 121 | 116 | static int spitz_hw_params(struct snd_pcm_substream *substream, |
|---|
| 122 | 117 | struct snd_pcm_hw_params *params) |
|---|
| 123 | 118 | { |
|---|
| 124 | | - struct snd_soc_pcm_runtime *rtd = substream->private_data; |
|---|
| 125 | | - struct snd_soc_dai *codec_dai = rtd->codec_dai; |
|---|
| 126 | | - struct snd_soc_dai *cpu_dai = rtd->cpu_dai; |
|---|
| 119 | + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); |
|---|
| 120 | + struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); |
|---|
| 121 | + struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); |
|---|
| 127 | 122 | unsigned int clk = 0; |
|---|
| 128 | 123 | int ret = 0; |
|---|
| 129 | 124 | |
|---|
| .. | .. |
|---|
| 257 | 252 | }; |
|---|
| 258 | 253 | |
|---|
| 259 | 254 | /* spitz digital audio interface glue - connects codec <--> CPU */ |
|---|
| 255 | +SND_SOC_DAILINK_DEFS(wm8750, |
|---|
| 256 | + DAILINK_COMP_ARRAY(COMP_CPU("pxa2xx-i2s")), |
|---|
| 257 | + DAILINK_COMP_ARRAY(COMP_CODEC("wm8750.0-001b", "wm8750-hifi")), |
|---|
| 258 | + DAILINK_COMP_ARRAY(COMP_PLATFORM("pxa-pcm-audio"))); |
|---|
| 259 | + |
|---|
| 260 | 260 | static struct snd_soc_dai_link spitz_dai = { |
|---|
| 261 | 261 | .name = "wm8750", |
|---|
| 262 | 262 | .stream_name = "WM8750", |
|---|
| 263 | | - .cpu_dai_name = "pxa2xx-i2s", |
|---|
| 264 | | - .codec_dai_name = "wm8750-hifi", |
|---|
| 265 | | - .platform_name = "pxa-pcm-audio", |
|---|
| 266 | | - .codec_name = "wm8750.0-001b", |
|---|
| 267 | 263 | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | |
|---|
| 268 | 264 | SND_SOC_DAIFMT_CBS_CFS, |
|---|
| 269 | 265 | .ops = &spitz_ops, |
|---|
| 266 | + SND_SOC_DAILINK_REG(wm8750), |
|---|
| 270 | 267 | }; |
|---|
| 271 | 268 | |
|---|
| 272 | 269 | /* spitz audio machine driver */ |
|---|