| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * SoC audio for HP iPAQ hx4700 |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (c) 2009 Philipp Zabel |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 7 | | - * under the terms of the GNU General Public License as published by the |
|---|
| 8 | | - * Free Software Foundation; either version 2 of the License, or (at your |
|---|
| 9 | | - * option) any later version. |
|---|
| 10 | | - * |
|---|
| 11 | 6 | */ |
|---|
| 12 | 7 | |
|---|
| 13 | 8 | #include <linux/module.h> |
|---|
| .. | .. |
|---|
| 58 | 53 | static int hx4700_hw_params(struct snd_pcm_substream *substream, |
|---|
| 59 | 54 | struct snd_pcm_hw_params *params) |
|---|
| 60 | 55 | { |
|---|
| 61 | | - struct snd_soc_pcm_runtime *rtd = substream->private_data; |
|---|
| 62 | | - struct snd_soc_dai *codec_dai = rtd->codec_dai; |
|---|
| 63 | | - struct snd_soc_dai *cpu_dai = rtd->cpu_dai; |
|---|
| 56 | + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); |
|---|
| 57 | + struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); |
|---|
| 58 | + struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); |
|---|
| 64 | 59 | int ret = 0; |
|---|
| 65 | 60 | |
|---|
| 66 | 61 | /* set the I2S system clock as output */ |
|---|
| .. | .. |
|---|
| 139 | 134 | } |
|---|
| 140 | 135 | |
|---|
| 141 | 136 | /* hx4700 digital audio interface glue - connects codec <--> CPU */ |
|---|
| 137 | +SND_SOC_DAILINK_DEFS(ak4641, |
|---|
| 138 | + DAILINK_COMP_ARRAY(COMP_CPU("pxa2xx-i2s")), |
|---|
| 139 | + DAILINK_COMP_ARRAY(COMP_CODEC("ak4641.0-0012", "ak4641-hifi")), |
|---|
| 140 | + DAILINK_COMP_ARRAY(COMP_PLATFORM("pxa-pcm-audio"))); |
|---|
| 141 | + |
|---|
| 142 | 142 | static struct snd_soc_dai_link hx4700_dai = { |
|---|
| 143 | 143 | .name = "ak4641", |
|---|
| 144 | 144 | .stream_name = "AK4641", |
|---|
| 145 | | - .cpu_dai_name = "pxa2xx-i2s", |
|---|
| 146 | | - .codec_dai_name = "ak4641-hifi", |
|---|
| 147 | | - .platform_name = "pxa-pcm-audio", |
|---|
| 148 | | - .codec_name = "ak4641.0-0012", |
|---|
| 149 | 145 | .init = hx4700_ak4641_init, |
|---|
| 150 | 146 | .dai_fmt = SND_SOC_DAIFMT_MSB | SND_SOC_DAIFMT_NB_NF | |
|---|
| 151 | 147 | SND_SOC_DAIFMT_CBS_CFS, |
|---|
| 152 | 148 | .ops = &hx4700_ops, |
|---|
| 149 | + SND_SOC_DAILINK_REG(ak4641), |
|---|
| 153 | 150 | }; |
|---|
| 154 | 151 | |
|---|
| 155 | 152 | /* hx4700 audio machine driver */ |
|---|