Thomas Gleixner | 97fb5e8 | 2019-05-29 07:17:58 -0700 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0-only |
Srinivas Kandagatla | bdb052e | 2015-06-10 13:15:54 +0100 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (c) 2015 The Linux Foundation. All rights reserved. |
Srinivas Kandagatla | bdb052e | 2015-06-10 13:15:54 +0100 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #include <linux/device.h> |
| 7 | #include <linux/module.h> |
| 8 | #include <linux/kernel.h> |
| 9 | #include <linux/io.h> |
| 10 | #include <linux/of.h> |
| 11 | #include <linux/clk.h> |
| 12 | #include <linux/platform_device.h> |
| 13 | #include <sound/pcm.h> |
| 14 | #include <sound/pcm_params.h> |
Srinivas Kandagatla | b47b91c | 2017-08-17 10:02:11 +0200 | [diff] [blame] | 15 | #include <sound/jack.h> |
Srinivas Kandagatla | bdb052e | 2015-06-10 13:15:54 +0100 | [diff] [blame] | 16 | #include <sound/soc.h> |
Srinivas Kandagatla | b47b91c | 2017-08-17 10:02:11 +0200 | [diff] [blame] | 17 | #include <uapi/linux/input-event-codes.h> |
Srinivas Kandagatla | bdb052e | 2015-06-10 13:15:54 +0100 | [diff] [blame] | 18 | #include <dt-bindings/sound/apq8016-lpass.h> |
Stephan Gerhold | 118205d2 | 2020-07-23 20:39:03 +0200 | [diff] [blame] | 19 | #include "common.h" |
Stephan Gerhold | a78a42f | 2021-12-02 15:55:05 +0100 | [diff] [blame] | 20 | #include "qdsp6/q6afe.h" |
| 21 | |
| 22 | #define MI2S_COUNT (MI2S_QUATERNARY + 1) |
Srinivas Kandagatla | bdb052e | 2015-06-10 13:15:54 +0100 | [diff] [blame] | 23 | |
| 24 | struct apq8016_sbc_data { |
Stephan Gerhold | 118205d2 | 2020-07-23 20:39:03 +0200 | [diff] [blame] | 25 | struct snd_soc_card card; |
Srinivas Kandagatla | bdb052e | 2015-06-10 13:15:54 +0100 | [diff] [blame] | 26 | void __iomem *mic_iomux; |
| 27 | void __iomem *spkr_iomux; |
Srinivas Kandagatla | b47b91c | 2017-08-17 10:02:11 +0200 | [diff] [blame] | 28 | struct snd_soc_jack jack; |
| 29 | bool jack_setup; |
Stephan Gerhold | a78a42f | 2021-12-02 15:55:05 +0100 | [diff] [blame] | 30 | int mi2s_clk_count[MI2S_COUNT]; |
Srinivas Kandagatla | bdb052e | 2015-06-10 13:15:54 +0100 | [diff] [blame] | 31 | }; |
| 32 | |
Srinivas Kandagatla | bbedefb | 2016-02-11 12:18:45 +0000 | [diff] [blame] | 33 | #define MIC_CTRL_TER_WS_SLAVE_SEL BIT(21) |
Srinivas Kandagatla | bdb052e | 2015-06-10 13:15:54 +0100 | [diff] [blame] | 34 | #define MIC_CTRL_QUA_WS_SLAVE_SEL_10 BIT(17) |
| 35 | #define MIC_CTRL_TLMM_SCLK_EN BIT(1) |
| 36 | #define SPKR_CTL_PRI_WS_SLAVE_SEL_11 (BIT(17) | BIT(16)) |
Vincent Knecht | 1e2c784 | 2021-08-06 13:41:16 +0200 | [diff] [blame] | 37 | #define SPKR_CTL_TLMM_MCLK_EN BIT(1) |
| 38 | #define SPKR_CTL_TLMM_SCLK_EN BIT(2) |
| 39 | #define SPKR_CTL_TLMM_DATA1_EN BIT(3) |
| 40 | #define SPKR_CTL_TLMM_WS_OUT_SEL_MASK GENMASK(7, 6) |
| 41 | #define SPKR_CTL_TLMM_WS_OUT_SEL_SEC BIT(6) |
| 42 | #define SPKR_CTL_TLMM_WS_EN_SEL_MASK GENMASK(19, 18) |
| 43 | #define SPKR_CTL_TLMM_WS_EN_SEL_SEC BIT(18) |
Srinivas Kandagatla | 334822a | 2017-08-02 15:17:47 +0200 | [diff] [blame] | 44 | #define DEFAULT_MCLK_RATE 9600000 |
Stephan Gerhold | a78a42f | 2021-12-02 15:55:05 +0100 | [diff] [blame] | 45 | #define MI2S_BCLK_RATE 1536000 |
Srinivas Kandagatla | bdb052e | 2015-06-10 13:15:54 +0100 | [diff] [blame] | 46 | |
Stephan Gerhold | a78a42f | 2021-12-02 15:55:05 +0100 | [diff] [blame] | 47 | static int apq8016_dai_init(struct snd_soc_pcm_runtime *rtd, int mi2s) |
Srinivas Kandagatla | bdb052e | 2015-06-10 13:15:54 +0100 | [diff] [blame] | 48 | { |
Kuninori Morimoto | cf4dae0 | 2020-02-19 15:56:09 +0900 | [diff] [blame] | 49 | struct snd_soc_dai *codec_dai; |
Kuninori Morimoto | 96e1b9e | 2017-12-05 04:24:13 +0000 | [diff] [blame] | 50 | struct snd_soc_component *component; |
Srinivas Kandagatla | bdb052e | 2015-06-10 13:15:54 +0100 | [diff] [blame] | 51 | struct snd_soc_card *card = rtd->card; |
| 52 | struct apq8016_sbc_data *pdata = snd_soc_card_get_drvdata(card); |
Srinivas Kandagatla | 334822a | 2017-08-02 15:17:47 +0200 | [diff] [blame] | 53 | int i, rval; |
Vincent Knecht | 1e2c784 | 2021-08-06 13:41:16 +0200 | [diff] [blame] | 54 | u32 value; |
Srinivas Kandagatla | bdb052e | 2015-06-10 13:15:54 +0100 | [diff] [blame] | 55 | |
Stephan Gerhold | a78a42f | 2021-12-02 15:55:05 +0100 | [diff] [blame] | 56 | switch (mi2s) { |
Srinivas Kandagatla | bdb052e | 2015-06-10 13:15:54 +0100 | [diff] [blame] | 57 | case MI2S_PRIMARY: |
| 58 | writel(readl(pdata->spkr_iomux) | SPKR_CTL_PRI_WS_SLAVE_SEL_11, |
| 59 | pdata->spkr_iomux); |
| 60 | break; |
| 61 | |
| 62 | case MI2S_QUATERNARY: |
| 63 | /* Configure the Quat MI2S to TLMM */ |
| 64 | writel(readl(pdata->mic_iomux) | MIC_CTRL_QUA_WS_SLAVE_SEL_10 | |
| 65 | MIC_CTRL_TLMM_SCLK_EN, |
| 66 | pdata->mic_iomux); |
| 67 | break; |
Vincent Knecht | 1e2c784 | 2021-08-06 13:41:16 +0200 | [diff] [blame] | 68 | case MI2S_SECONDARY: |
| 69 | /* Clear TLMM_WS_OUT_SEL and TLMM_WS_EN_SEL fields */ |
| 70 | value = readl(pdata->spkr_iomux) & |
| 71 | ~(SPKR_CTL_TLMM_WS_OUT_SEL_MASK | SPKR_CTL_TLMM_WS_EN_SEL_MASK); |
| 72 | /* Configure the Sec MI2S to TLMM */ |
| 73 | writel(value | SPKR_CTL_TLMM_MCLK_EN | SPKR_CTL_TLMM_SCLK_EN | |
| 74 | SPKR_CTL_TLMM_DATA1_EN | SPKR_CTL_TLMM_WS_OUT_SEL_SEC | |
| 75 | SPKR_CTL_TLMM_WS_EN_SEL_SEC, pdata->spkr_iomux); |
| 76 | break; |
Srinivas Kandagatla | bbedefb | 2016-02-11 12:18:45 +0000 | [diff] [blame] | 77 | case MI2S_TERTIARY: |
| 78 | writel(readl(pdata->mic_iomux) | MIC_CTRL_TER_WS_SLAVE_SEL | |
| 79 | MIC_CTRL_TLMM_SCLK_EN, |
| 80 | pdata->mic_iomux); |
| 81 | |
| 82 | break; |
Srinivas Kandagatla | bdb052e | 2015-06-10 13:15:54 +0100 | [diff] [blame] | 83 | |
| 84 | default: |
| 85 | dev_err(card->dev, "unsupported cpu dai configuration\n"); |
Srinivas Kandagatla | 334822a | 2017-08-02 15:17:47 +0200 | [diff] [blame] | 86 | return -EINVAL; |
Srinivas Kandagatla | bdb052e | 2015-06-10 13:15:54 +0100 | [diff] [blame] | 87 | |
| 88 | } |
| 89 | |
Srinivas Kandagatla | b47b91c | 2017-08-17 10:02:11 +0200 | [diff] [blame] | 90 | if (!pdata->jack_setup) { |
| 91 | struct snd_jack *jack; |
| 92 | |
| 93 | rval = snd_soc_card_jack_new(card, "Headset Jack", |
| 94 | SND_JACK_HEADSET | |
| 95 | SND_JACK_HEADPHONE | |
| 96 | SND_JACK_BTN_0 | SND_JACK_BTN_1 | |
| 97 | SND_JACK_BTN_2 | SND_JACK_BTN_3 | |
| 98 | SND_JACK_BTN_4, |
| 99 | &pdata->jack, NULL, 0); |
| 100 | |
| 101 | if (rval < 0) { |
| 102 | dev_err(card->dev, "Unable to add Headphone Jack\n"); |
| 103 | return rval; |
| 104 | } |
| 105 | |
| 106 | jack = pdata->jack.jack; |
| 107 | |
Benson Leung | 5f6d1df | 2017-11-22 12:56:43 -0800 | [diff] [blame] | 108 | snd_jack_set_key(jack, SND_JACK_BTN_0, KEY_PLAYPAUSE); |
Srinivas Kandagatla | b47b91c | 2017-08-17 10:02:11 +0200 | [diff] [blame] | 109 | snd_jack_set_key(jack, SND_JACK_BTN_1, KEY_VOICECOMMAND); |
| 110 | snd_jack_set_key(jack, SND_JACK_BTN_2, KEY_VOLUMEUP); |
| 111 | snd_jack_set_key(jack, SND_JACK_BTN_3, KEY_VOLUMEDOWN); |
| 112 | pdata->jack_setup = true; |
| 113 | } |
| 114 | |
Kuninori Morimoto | c998ee3 | 2020-03-09 13:07:57 +0900 | [diff] [blame] | 115 | for_each_rtd_codec_dais(rtd, i, codec_dai) { |
Srinivas Kandagatla | 334822a | 2017-08-02 15:17:47 +0200 | [diff] [blame] | 116 | |
Kuninori Morimoto | cf4dae0 | 2020-02-19 15:56:09 +0900 | [diff] [blame] | 117 | component = codec_dai->component; |
Srinivas Kandagatla | 334822a | 2017-08-02 15:17:47 +0200 | [diff] [blame] | 118 | /* Set default mclk for internal codec */ |
Kuninori Morimoto | 96e1b9e | 2017-12-05 04:24:13 +0000 | [diff] [blame] | 119 | rval = snd_soc_component_set_sysclk(component, 0, 0, DEFAULT_MCLK_RATE, |
Srinivas Kandagatla | 334822a | 2017-08-02 15:17:47 +0200 | [diff] [blame] | 120 | SND_SOC_CLOCK_IN); |
| 121 | if (rval != 0 && rval != -ENOTSUPP) { |
| 122 | dev_warn(card->dev, "Failed to set mclk: %d\n", rval); |
| 123 | return rval; |
| 124 | } |
Kuninori Morimoto | 96e1b9e | 2017-12-05 04:24:13 +0000 | [diff] [blame] | 125 | rval = snd_soc_component_set_jack(component, &pdata->jack, NULL); |
Srinivas Kandagatla | b47b91c | 2017-08-17 10:02:11 +0200 | [diff] [blame] | 126 | if (rval != 0 && rval != -ENOTSUPP) { |
| 127 | dev_warn(card->dev, "Failed to set jack: %d\n", rval); |
| 128 | return rval; |
| 129 | } |
Srinivas Kandagatla | 334822a | 2017-08-02 15:17:47 +0200 | [diff] [blame] | 130 | } |
| 131 | |
| 132 | return 0; |
Srinivas Kandagatla | bdb052e | 2015-06-10 13:15:54 +0100 | [diff] [blame] | 133 | } |
| 134 | |
Stephan Gerhold | a78a42f | 2021-12-02 15:55:05 +0100 | [diff] [blame] | 135 | static int apq8016_sbc_dai_init(struct snd_soc_pcm_runtime *rtd) |
| 136 | { |
| 137 | struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); |
| 138 | |
| 139 | return apq8016_dai_init(rtd, cpu_dai->id); |
| 140 | } |
| 141 | |
Stephan Gerhold | 118205d2 | 2020-07-23 20:39:03 +0200 | [diff] [blame] | 142 | static void apq8016_sbc_add_ops(struct snd_soc_card *card) |
Srinivas Kandagatla | bdb052e | 2015-06-10 13:15:54 +0100 | [diff] [blame] | 143 | { |
Srinivas Kandagatla | bdb052e | 2015-06-10 13:15:54 +0100 | [diff] [blame] | 144 | struct snd_soc_dai_link *link; |
Stephan Gerhold | 118205d2 | 2020-07-23 20:39:03 +0200 | [diff] [blame] | 145 | int i; |
Srinivas Kandagatla | bdb052e | 2015-06-10 13:15:54 +0100 | [diff] [blame] | 146 | |
Stephan Gerhold | 118205d2 | 2020-07-23 20:39:03 +0200 | [diff] [blame] | 147 | for_each_card_prelinks(card, i, link) |
Srinivas Kandagatla | bdb052e | 2015-06-10 13:15:54 +0100 | [diff] [blame] | 148 | link->init = apq8016_sbc_dai_init; |
Srinivas Kandagatla | bdb052e | 2015-06-10 13:15:54 +0100 | [diff] [blame] | 149 | } |
| 150 | |
Stephan Gerhold | a78a42f | 2021-12-02 15:55:05 +0100 | [diff] [blame] | 151 | static int qdsp6_dai_get_lpass_id(struct snd_soc_dai *cpu_dai) |
| 152 | { |
| 153 | switch (cpu_dai->id) { |
| 154 | case PRIMARY_MI2S_RX: |
| 155 | case PRIMARY_MI2S_TX: |
| 156 | return MI2S_PRIMARY; |
| 157 | case SECONDARY_MI2S_RX: |
| 158 | case SECONDARY_MI2S_TX: |
| 159 | return MI2S_SECONDARY; |
| 160 | case TERTIARY_MI2S_RX: |
| 161 | case TERTIARY_MI2S_TX: |
| 162 | return MI2S_TERTIARY; |
| 163 | case QUATERNARY_MI2S_RX: |
| 164 | case QUATERNARY_MI2S_TX: |
| 165 | return MI2S_QUATERNARY; |
| 166 | default: |
| 167 | return -EINVAL; |
| 168 | } |
| 169 | } |
| 170 | |
| 171 | static int msm8916_qdsp6_dai_init(struct snd_soc_pcm_runtime *rtd) |
| 172 | { |
| 173 | struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); |
| 174 | |
| 175 | snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_CBS_CFS); |
| 176 | return apq8016_dai_init(rtd, qdsp6_dai_get_lpass_id(cpu_dai)); |
| 177 | } |
| 178 | |
| 179 | static int msm8916_qdsp6_startup(struct snd_pcm_substream *substream) |
| 180 | { |
| 181 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
| 182 | struct snd_soc_card *card = rtd->card; |
| 183 | struct apq8016_sbc_data *data = snd_soc_card_get_drvdata(card); |
| 184 | struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); |
| 185 | int mi2s, ret; |
| 186 | |
| 187 | mi2s = qdsp6_dai_get_lpass_id(cpu_dai); |
| 188 | if (mi2s < 0) |
| 189 | return mi2s; |
| 190 | |
| 191 | if (++data->mi2s_clk_count[mi2s] > 1) |
| 192 | return 0; |
| 193 | |
| 194 | ret = snd_soc_dai_set_sysclk(cpu_dai, LPAIF_BIT_CLK, MI2S_BCLK_RATE, 0); |
| 195 | if (ret) |
| 196 | dev_err(card->dev, "Failed to enable LPAIF bit clk: %d\n", ret); |
| 197 | return ret; |
| 198 | } |
| 199 | |
| 200 | static void msm8916_qdsp6_shutdown(struct snd_pcm_substream *substream) |
| 201 | { |
| 202 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
| 203 | struct snd_soc_card *card = rtd->card; |
| 204 | struct apq8016_sbc_data *data = snd_soc_card_get_drvdata(card); |
| 205 | struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); |
| 206 | int mi2s, ret; |
| 207 | |
| 208 | mi2s = qdsp6_dai_get_lpass_id(cpu_dai); |
| 209 | if (mi2s < 0) |
| 210 | return; |
| 211 | |
| 212 | if (--data->mi2s_clk_count[mi2s] > 0) |
| 213 | return; |
| 214 | |
| 215 | ret = snd_soc_dai_set_sysclk(cpu_dai, LPAIF_BIT_CLK, 0, 0); |
| 216 | if (ret) |
| 217 | dev_err(card->dev, "Failed to disable LPAIF bit clk: %d\n", ret); |
| 218 | } |
| 219 | |
| 220 | static const struct snd_soc_ops msm8916_qdsp6_be_ops = { |
| 221 | .startup = msm8916_qdsp6_startup, |
| 222 | .shutdown = msm8916_qdsp6_shutdown, |
| 223 | }; |
| 224 | |
| 225 | static int msm8916_qdsp6_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, |
| 226 | struct snd_pcm_hw_params *params) |
| 227 | { |
| 228 | struct snd_interval *rate = hw_param_interval(params, |
| 229 | SNDRV_PCM_HW_PARAM_RATE); |
| 230 | struct snd_interval *channels = hw_param_interval(params, |
| 231 | SNDRV_PCM_HW_PARAM_CHANNELS); |
| 232 | struct snd_mask *fmt = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT); |
| 233 | |
| 234 | rate->min = rate->max = 48000; |
| 235 | channels->min = channels->max = 2; |
| 236 | snd_mask_set_format(fmt, SNDRV_PCM_FORMAT_S16_LE); |
| 237 | |
| 238 | return 0; |
| 239 | } |
| 240 | |
| 241 | static void msm8916_qdsp6_add_ops(struct snd_soc_card *card) |
| 242 | { |
| 243 | struct snd_soc_dai_link *link; |
| 244 | int i; |
| 245 | |
| 246 | /* Make it obvious to userspace that QDSP6 is used */ |
| 247 | card->components = "qdsp6"; |
| 248 | |
| 249 | for_each_card_prelinks(card, i, link) { |
| 250 | if (link->no_pcm) { |
| 251 | link->init = msm8916_qdsp6_dai_init; |
| 252 | link->ops = &msm8916_qdsp6_be_ops; |
| 253 | link->be_hw_params_fixup = msm8916_qdsp6_be_hw_params_fixup; |
| 254 | } |
| 255 | } |
| 256 | } |
| 257 | |
Srinivas Kandagatla | 1190300 | 2016-09-06 10:57:42 +0100 | [diff] [blame] | 258 | static const struct snd_soc_dapm_widget apq8016_sbc_dapm_widgets[] = { |
| 259 | |
| 260 | SND_SOC_DAPM_MIC("Handset Mic", NULL), |
| 261 | SND_SOC_DAPM_MIC("Headset Mic", NULL), |
| 262 | SND_SOC_DAPM_MIC("Secondary Mic", NULL), |
| 263 | SND_SOC_DAPM_MIC("Digital Mic1", NULL), |
| 264 | SND_SOC_DAPM_MIC("Digital Mic2", NULL), |
| 265 | }; |
| 266 | |
Srinivas Kandagatla | bdb052e | 2015-06-10 13:15:54 +0100 | [diff] [blame] | 267 | static int apq8016_sbc_platform_probe(struct platform_device *pdev) |
| 268 | { |
Stephan Gerhold | a78a42f | 2021-12-02 15:55:05 +0100 | [diff] [blame] | 269 | void (*add_ops)(struct snd_soc_card *card); |
Srinivas Kandagatla | bdb052e | 2015-06-10 13:15:54 +0100 | [diff] [blame] | 270 | struct device *dev = &pdev->dev; |
| 271 | struct snd_soc_card *card; |
| 272 | struct apq8016_sbc_data *data; |
Stephan Gerhold | 118205d2 | 2020-07-23 20:39:03 +0200 | [diff] [blame] | 273 | int ret; |
Srinivas Kandagatla | bdb052e | 2015-06-10 13:15:54 +0100 | [diff] [blame] | 274 | |
Stephan Gerhold | a78a42f | 2021-12-02 15:55:05 +0100 | [diff] [blame] | 275 | add_ops = device_get_match_data(&pdev->dev); |
| 276 | if (!add_ops) |
| 277 | return -EINVAL; |
| 278 | |
Stephan Gerhold | 118205d2 | 2020-07-23 20:39:03 +0200 | [diff] [blame] | 279 | data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL); |
| 280 | if (!data) |
Srinivas Kandagatla | bdb052e | 2015-06-10 13:15:54 +0100 | [diff] [blame] | 281 | return -ENOMEM; |
| 282 | |
Stephan Gerhold | 118205d2 | 2020-07-23 20:39:03 +0200 | [diff] [blame] | 283 | card = &data->card; |
Srinivas Kandagatla | bdb052e | 2015-06-10 13:15:54 +0100 | [diff] [blame] | 284 | card->dev = dev; |
Stephan Gerhold | 3c27ea2 | 2020-08-20 17:45:11 +0200 | [diff] [blame] | 285 | card->owner = THIS_MODULE; |
Srinivas Kandagatla | 1190300 | 2016-09-06 10:57:42 +0100 | [diff] [blame] | 286 | card->dapm_widgets = apq8016_sbc_dapm_widgets; |
| 287 | card->num_dapm_widgets = ARRAY_SIZE(apq8016_sbc_dapm_widgets); |
Stephan Gerhold | 118205d2 | 2020-07-23 20:39:03 +0200 | [diff] [blame] | 288 | |
| 289 | ret = qcom_snd_parse_of(card); |
| 290 | if (ret) |
| 291 | return ret; |
Srinivas Kandagatla | bdb052e | 2015-06-10 13:15:54 +0100 | [diff] [blame] | 292 | |
Yang Yingliang | e6bb518 | 2021-06-15 22:07:10 +0800 | [diff] [blame] | 293 | data->mic_iomux = devm_platform_ioremap_resource_byname(pdev, "mic-iomux"); |
Srinivas Kandagatla | bdb052e | 2015-06-10 13:15:54 +0100 | [diff] [blame] | 294 | if (IS_ERR(data->mic_iomux)) |
| 295 | return PTR_ERR(data->mic_iomux); |
| 296 | |
Yang Yingliang | e6bb518 | 2021-06-15 22:07:10 +0800 | [diff] [blame] | 297 | data->spkr_iomux = devm_platform_ioremap_resource_byname(pdev, "spkr-iomux"); |
Srinivas Kandagatla | bdb052e | 2015-06-10 13:15:54 +0100 | [diff] [blame] | 298 | if (IS_ERR(data->spkr_iomux)) |
| 299 | return PTR_ERR(data->spkr_iomux); |
| 300 | |
Srinivas Kandagatla | bdb052e | 2015-06-10 13:15:54 +0100 | [diff] [blame] | 301 | snd_soc_card_set_drvdata(card, data); |
| 302 | |
Stephan Gerhold | a78a42f | 2021-12-02 15:55:05 +0100 | [diff] [blame] | 303 | add_ops(card); |
Srinivas Kandagatla | bdb052e | 2015-06-10 13:15:54 +0100 | [diff] [blame] | 304 | return devm_snd_soc_register_card(&pdev->dev, card); |
| 305 | } |
| 306 | |
Krzysztof Kozlowski | 377c7b7 | 2020-11-25 17:44:22 +0100 | [diff] [blame] | 307 | static const struct of_device_id apq8016_sbc_device_id[] __maybe_unused = { |
Stephan Gerhold | a78a42f | 2021-12-02 15:55:05 +0100 | [diff] [blame] | 308 | { .compatible = "qcom,apq8016-sbc-sndcard", .data = apq8016_sbc_add_ops }, |
| 309 | { .compatible = "qcom,msm8916-qdsp6-sndcard", .data = msm8916_qdsp6_add_ops }, |
Srinivas Kandagatla | bdb052e | 2015-06-10 13:15:54 +0100 | [diff] [blame] | 310 | {}, |
| 311 | }; |
| 312 | MODULE_DEVICE_TABLE(of, apq8016_sbc_device_id); |
| 313 | |
| 314 | static struct platform_driver apq8016_sbc_platform_driver = { |
| 315 | .driver = { |
| 316 | .name = "qcom-apq8016-sbc", |
| 317 | .of_match_table = of_match_ptr(apq8016_sbc_device_id), |
| 318 | }, |
| 319 | .probe = apq8016_sbc_platform_probe, |
| 320 | }; |
| 321 | module_platform_driver(apq8016_sbc_platform_driver); |
| 322 | |
| 323 | MODULE_AUTHOR("Srinivas Kandagatla <srinivas.kandagatla@linaro.org"); |
| 324 | MODULE_DESCRIPTION("APQ8016 ASoC Machine Driver"); |
| 325 | MODULE_LICENSE("GPL v2"); |