| .. | .. |
|---|
| 1 | | -/* |
|---|
| 2 | | - * smdk_spdif.c -- S/PDIF audio for SMDK |
|---|
| 3 | | - * |
|---|
| 4 | | - * Copyright 2010 Samsung Electronics Co. Ltd. |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is free software; you can redistribute it and/or |
|---|
| 7 | | - * modify it under the terms of the GNU General Public License as |
|---|
| 8 | | - * published by the Free Software Foundation; either version 2 of the |
|---|
| 9 | | - * License, or (at your option) any later version. |
|---|
| 10 | | - * |
|---|
| 11 | | - */ |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0+ |
|---|
| 2 | +// |
|---|
| 3 | +// smdk_spdif.c - S/PDIF audio for SMDK |
|---|
| 4 | +// |
|---|
| 5 | +// Copyright (C) 2010 Samsung Electronics Co., Ltd. |
|---|
| 12 | 6 | |
|---|
| 13 | 7 | #include <linux/clk.h> |
|---|
| 14 | 8 | #include <linux/module.h> |
|---|
| .. | .. |
|---|
| 106 | 100 | static int smdk_hw_params(struct snd_pcm_substream *substream, |
|---|
| 107 | 101 | struct snd_pcm_hw_params *params) |
|---|
| 108 | 102 | { |
|---|
| 109 | | - struct snd_soc_pcm_runtime *rtd = substream->private_data; |
|---|
| 110 | | - struct snd_soc_dai *cpu_dai = rtd->cpu_dai; |
|---|
| 103 | + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); |
|---|
| 104 | + struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); |
|---|
| 111 | 105 | unsigned long pll_out, rclk_rate; |
|---|
| 112 | 106 | int ret, ratio; |
|---|
| 113 | 107 | |
|---|
| .. | .. |
|---|
| 148 | 142 | .hw_params = smdk_hw_params, |
|---|
| 149 | 143 | }; |
|---|
| 150 | 144 | |
|---|
| 145 | +SND_SOC_DAILINK_DEFS(spdif, |
|---|
| 146 | + DAILINK_COMP_ARRAY(COMP_CPU("samsung-spdif")), |
|---|
| 147 | + DAILINK_COMP_ARRAY(COMP_CODEC("spdif-dit", "dit-hifi")), |
|---|
| 148 | + DAILINK_COMP_ARRAY(COMP_PLATFORM("samsung-spdif"))); |
|---|
| 149 | + |
|---|
| 151 | 150 | static struct snd_soc_dai_link smdk_dai = { |
|---|
| 152 | 151 | .name = "S/PDIF", |
|---|
| 153 | 152 | .stream_name = "S/PDIF PCM Playback", |
|---|
| 154 | | - .platform_name = "samsung-spdif", |
|---|
| 155 | | - .cpu_dai_name = "samsung-spdif", |
|---|
| 156 | | - .codec_dai_name = "dit-hifi", |
|---|
| 157 | | - .codec_name = "spdif-dit", |
|---|
| 158 | 153 | .ops = &smdk_spdif_ops, |
|---|
| 154 | + SND_SOC_DAILINK_REG(spdif), |
|---|
| 159 | 155 | }; |
|---|
| 160 | 156 | |
|---|
| 161 | 157 | static struct snd_soc_card smdk = { |
|---|