| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * snappercl15.c -- SoC audio for Bluewater Systems Snapper CL15 module |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2008 Bluewater Systems Ltd |
|---|
| 5 | 6 | * Author: Ryan Mallon |
|---|
| 6 | | - * |
|---|
| 7 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 8 | | - * under the terms of the GNU General Public License as published by the |
|---|
| 9 | | - * Free Software Foundation; either version 2 of the License, or (at your |
|---|
| 10 | | - * option) any later version. |
|---|
| 11 | | - * |
|---|
| 12 | 7 | */ |
|---|
| 13 | 8 | |
|---|
| 14 | 9 | #include <linux/platform_device.h> |
|---|
| 15 | 10 | #include <linux/module.h> |
|---|
| 11 | +#include <linux/soc/cirrus/ep93xx.h> |
|---|
| 16 | 12 | #include <sound/core.h> |
|---|
| 17 | 13 | #include <sound/pcm.h> |
|---|
| 18 | 14 | #include <sound/soc.h> |
|---|
| 19 | 15 | |
|---|
| 20 | 16 | #include <asm/mach-types.h> |
|---|
| 21 | | -#include <mach/hardware.h> |
|---|
| 22 | 17 | |
|---|
| 23 | 18 | #include "../codecs/tlv320aic23.h" |
|---|
| 24 | 19 | |
|---|
| .. | .. |
|---|
| 27 | 22 | static int snappercl15_hw_params(struct snd_pcm_substream *substream, |
|---|
| 28 | 23 | struct snd_pcm_hw_params *params) |
|---|
| 29 | 24 | { |
|---|
| 30 | | - struct snd_soc_pcm_runtime *rtd = substream->private_data; |
|---|
| 31 | | - struct snd_soc_dai *codec_dai = rtd->codec_dai; |
|---|
| 32 | | - struct snd_soc_dai *cpu_dai = rtd->cpu_dai; |
|---|
| 25 | + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); |
|---|
| 26 | + struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); |
|---|
| 27 | + struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); |
|---|
| 33 | 28 | int err; |
|---|
| 34 | 29 | |
|---|
| 35 | 30 | err = snd_soc_dai_set_sysclk(codec_dai, 0, CODEC_CLOCK, |
|---|
| .. | .. |
|---|
| 65 | 60 | {"MICIN", NULL, "Mic Jack"}, |
|---|
| 66 | 61 | }; |
|---|
| 67 | 62 | |
|---|
| 63 | +SND_SOC_DAILINK_DEFS(aic23, |
|---|
| 64 | + DAILINK_COMP_ARRAY(COMP_CPU("ep93xx-i2s")), |
|---|
| 65 | + DAILINK_COMP_ARRAY(COMP_CODEC("tlv320aic23-codec.0-001a", |
|---|
| 66 | + "tlv320aic23-hifi")), |
|---|
| 67 | + DAILINK_COMP_ARRAY(COMP_PLATFORM("ep93xx-i2s"))); |
|---|
| 68 | + |
|---|
| 68 | 69 | static struct snd_soc_dai_link snappercl15_dai = { |
|---|
| 69 | 70 | .name = "tlv320aic23", |
|---|
| 70 | 71 | .stream_name = "AIC23", |
|---|
| 71 | | - .cpu_dai_name = "ep93xx-i2s", |
|---|
| 72 | | - .codec_dai_name = "tlv320aic23-hifi", |
|---|
| 73 | | - .codec_name = "tlv320aic23-codec.0-001a", |
|---|
| 74 | | - .platform_name = "ep93xx-i2s", |
|---|
| 75 | 72 | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | |
|---|
| 76 | 73 | SND_SOC_DAIFMT_CBS_CFS, |
|---|
| 77 | 74 | .ops = &snappercl15_ops, |
|---|
| 75 | + SND_SOC_DAILINK_REG(aic23), |
|---|
| 78 | 76 | }; |
|---|
| 79 | 77 | |
|---|
| 80 | 78 | static struct snd_soc_card snd_soc_snappercl15 = { |
|---|