Loading...
1// SPDX-License-Identifier: GPL-2.0-only
2// Copyright(c) 2021 Intel Corporation.
3
4/*
5 * Intel SOF Machine Driver with Cirrus Logic CS42L42 Codec
6 * and speaker codec MAX98357A
7 */
8#include <linux/i2c.h>
9#include <linux/input.h>
10#include <linux/module.h>
11#include <linux/platform_device.h>
12#include <linux/regulator/consumer.h>
13#include <linux/dmi.h>
14#include <sound/core.h>
15#include <sound/jack.h>
16#include <sound/pcm.h>
17#include <sound/pcm_params.h>
18#include <sound/soc.h>
19#include <sound/sof.h>
20#include <sound/soc-acpi.h>
21#include <dt-bindings/sound/cs42l42.h>
22#include "../common/soc-intel-quirks.h"
23#include "sof_board_helpers.h"
24#include "sof_maxim_common.h"
25
26static struct snd_soc_jack_pin jack_pins[] = {
27 {
28 .pin = "Headphone Jack",
29 .mask = SND_JACK_HEADPHONE,
30 },
31 {
32 .pin = "Headset Mic",
33 .mask = SND_JACK_MICROPHONE,
34 },
35};
36
37/* Default: SSP2 */
38static unsigned long sof_cs42l42_quirk = SOF_SSP_PORT_CODEC(2);
39
40static int sof_cs42l42_init(struct snd_soc_pcm_runtime *rtd)
41{
42 struct sof_card_private *ctx = snd_soc_card_get_drvdata(rtd->card);
43 struct snd_soc_component *component = snd_soc_rtd_to_codec(rtd, 0)->component;
44 struct snd_soc_jack *jack = &ctx->headset_jack;
45 int ret;
46
47 /*
48 * Headset buttons map to the google Reference headset.
49 * These can be configured by userspace.
50 */
51 ret = snd_soc_card_jack_new_pins(rtd->card, "Headset Jack",
52 SND_JACK_HEADSET | SND_JACK_BTN_0 |
53 SND_JACK_BTN_1 | SND_JACK_BTN_2 |
54 SND_JACK_BTN_3,
55 jack,
56 jack_pins,
57 ARRAY_SIZE(jack_pins));
58 if (ret) {
59 dev_err(rtd->dev, "Headset Jack creation failed: %d\n", ret);
60 return ret;
61 }
62
63 snd_jack_set_key(jack->jack, SND_JACK_BTN_0, KEY_PLAYPAUSE);
64 snd_jack_set_key(jack->jack, SND_JACK_BTN_1, KEY_VOLUMEUP);
65 snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEDOWN);
66 snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOICECOMMAND);
67
68 ret = snd_soc_component_set_jack(component, jack, NULL);
69 if (ret) {
70 dev_err(rtd->dev, "Headset Jack call-back failed: %d\n", ret);
71 return ret;
72 }
73
74 return ret;
75};
76
77static void sof_cs42l42_exit(struct snd_soc_pcm_runtime *rtd)
78{
79 struct snd_soc_component *component = snd_soc_rtd_to_codec(rtd, 0)->component;
80
81 snd_soc_component_set_jack(component, NULL, NULL);
82}
83
84static int sof_cs42l42_hw_params(struct snd_pcm_substream *substream,
85 struct snd_pcm_hw_params *params)
86{
87 struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
88 struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
89 int clk_freq, ret;
90
91 clk_freq = sof_dai_get_bclk(rtd); /* BCLK freq */
92
93 if (clk_freq <= 0) {
94 dev_err(rtd->dev, "get bclk freq failed: %d\n", clk_freq);
95 return -EINVAL;
96 }
97
98 /* Configure sysclk for codec */
99 ret = snd_soc_dai_set_sysclk(codec_dai, 0,
100 clk_freq, SND_SOC_CLOCK_IN);
101 if (ret < 0)
102 dev_err(rtd->dev, "snd_soc_dai_set_sysclk err = %d\n", ret);
103
104 return ret;
105}
106
107static const struct snd_soc_ops sof_cs42l42_ops = {
108 .hw_params = sof_cs42l42_hw_params,
109};
110
111static int sof_card_late_probe(struct snd_soc_card *card)
112{
113 return sof_intel_board_card_late_probe(card);
114}
115
116static const struct snd_kcontrol_new sof_controls[] = {
117 SOC_DAPM_PIN_SWITCH("Headphone Jack"),
118 SOC_DAPM_PIN_SWITCH("Headset Mic"),
119};
120
121static const struct snd_soc_dapm_widget sof_widgets[] = {
122 SND_SOC_DAPM_HP("Headphone Jack", NULL),
123 SND_SOC_DAPM_MIC("Headset Mic", NULL),
124};
125
126static const struct snd_soc_dapm_route sof_map[] = {
127 /* HP jack connectors - unknown if we have jack detection */
128 {"Headphone Jack", NULL, "HP"},
129
130 /* other jacks */
131 {"HS", NULL, "Headset Mic"},
132};
133
134/* sof audio machine driver for cs42l42 codec */
135static struct snd_soc_card sof_audio_card_cs42l42 = {
136 .name = "cs42l42", /* the sof- prefix is added by the core */
137 .owner = THIS_MODULE,
138 .controls = sof_controls,
139 .num_controls = ARRAY_SIZE(sof_controls),
140 .dapm_widgets = sof_widgets,
141 .num_dapm_widgets = ARRAY_SIZE(sof_widgets),
142 .dapm_routes = sof_map,
143 .num_dapm_routes = ARRAY_SIZE(sof_map),
144 .fully_routed = true,
145 .late_probe = sof_card_late_probe,
146};
147
148static struct snd_soc_dai_link_component cs42l42_component[] = {
149 {
150 .name = "i2c-10134242:00",
151 .dai_name = "cs42l42",
152 }
153};
154
155static int
156sof_card_dai_links_create(struct device *dev, struct snd_soc_card *card,
157 struct sof_card_private *ctx)
158{
159 int ret;
160
161 ret = sof_intel_board_set_dai_link(dev, card, ctx);
162 if (ret)
163 return ret;
164
165 if (!ctx->codec_link) {
166 dev_err(dev, "codec link not available");
167 return -EINVAL;
168 }
169
170 /* codec-specific fields for headphone codec */
171 ctx->codec_link->codecs = cs42l42_component;
172 ctx->codec_link->num_codecs = ARRAY_SIZE(cs42l42_component);
173 ctx->codec_link->init = sof_cs42l42_init;
174 ctx->codec_link->exit = sof_cs42l42_exit;
175 ctx->codec_link->ops = &sof_cs42l42_ops;
176
177 if (ctx->amp_type == CODEC_NONE)
178 return 0;
179
180 if (!ctx->amp_link) {
181 dev_err(dev, "amp link not available");
182 return -EINVAL;
183 }
184
185 /* codec-specific fields for speaker amplifier */
186 switch (ctx->amp_type) {
187 case CODEC_MAX98357A:
188 max_98357a_dai_link(ctx->amp_link);
189 break;
190 case CODEC_MAX98360A:
191 max_98360a_dai_link(ctx->amp_link);
192 break;
193 default:
194 dev_err(dev, "invalid amp type %d\n", ctx->amp_type);
195 return -EINVAL;
196 }
197
198 return 0;
199}
200
201#define GLK_LINK_ORDER SOF_LINK_ORDER(SOF_LINK_AMP, \
202 SOF_LINK_CODEC, \
203 SOF_LINK_DMIC01, \
204 SOF_LINK_IDISP_HDMI, \
205 SOF_LINK_NONE, \
206 SOF_LINK_NONE, \
207 SOF_LINK_NONE)
208
209static int sof_audio_probe(struct platform_device *pdev)
210{
211 struct snd_soc_acpi_mach *mach = pdev->dev.platform_data;
212 struct sof_card_private *ctx;
213 int ret;
214
215 if (pdev->id_entry && pdev->id_entry->driver_data)
216 sof_cs42l42_quirk = (unsigned long)pdev->id_entry->driver_data;
217
218 dev_dbg(&pdev->dev, "sof_cs42l42_quirk = %lx\n", sof_cs42l42_quirk);
219
220 /* initialize ctx with board quirk */
221 ctx = sof_intel_board_get_ctx(&pdev->dev, sof_cs42l42_quirk);
222 if (!ctx)
223 return -ENOMEM;
224
225 if (soc_intel_is_glk()) {
226 ctx->dmic_be_num = 1;
227
228 /* overwrite the DAI link order for GLK boards */
229 ctx->link_order_overwrite = GLK_LINK_ORDER;
230 }
231
232 if (mach->mach_params.codec_mask & IDISP_CODEC_MASK)
233 ctx->hdmi.idisp_codec = true;
234
235 /* update dai_link */
236 ret = sof_card_dai_links_create(&pdev->dev, &sof_audio_card_cs42l42, ctx);
237 if (ret)
238 return ret;
239
240 sof_audio_card_cs42l42.dev = &pdev->dev;
241
242 /* set platform name for each dailink */
243 ret = snd_soc_fixup_dai_links_platform_name(&sof_audio_card_cs42l42,
244 mach->mach_params.platform);
245 if (ret)
246 return ret;
247
248 snd_soc_card_set_drvdata(&sof_audio_card_cs42l42, ctx);
249
250 return devm_snd_soc_register_card(&pdev->dev,
251 &sof_audio_card_cs42l42);
252}
253
254static const struct platform_device_id board_ids[] = {
255 {
256 .name = "glk_cs4242_mx98357a",
257 .driver_data = (kernel_ulong_t)(SOF_SSP_PORT_CODEC(2) |
258 SOF_SSP_PORT_AMP(1)),
259 },
260 {
261 .name = "jsl_cs4242_mx98360a",
262 .driver_data = (kernel_ulong_t)(SOF_SSP_PORT_CODEC(0) |
263 SOF_SSP_PORT_AMP(1)),
264 },
265 {
266 .name = "adl_cs42l42_def",
267 .driver_data = (kernel_ulong_t)(SOF_SSP_PORT_CODEC(0) |
268 SOF_SSP_PORT_AMP(1) |
269 SOF_NUM_IDISP_HDMI(4) |
270 SOF_BT_OFFLOAD_PRESENT |
271 SOF_SSP_PORT_BT_OFFLOAD(2)),
272 },
273 {
274 .name = "rpl_cs42l42_def",
275 .driver_data = (kernel_ulong_t)(SOF_SSP_PORT_CODEC(0) |
276 SOF_SSP_PORT_AMP(1) |
277 SOF_NUM_IDISP_HDMI(4) |
278 SOF_BT_OFFLOAD_PRESENT |
279 SOF_SSP_PORT_BT_OFFLOAD(2)),
280 },
281 {
282 .name = "mtl_cs42l42_def",
283 .driver_data = (kernel_ulong_t)(SOF_SSP_PORT_CODEC(2) |
284 SOF_SSP_PORT_AMP(0) |
285 SOF_BT_OFFLOAD_PRESENT |
286 SOF_SSP_PORT_BT_OFFLOAD(1)),
287 },
288 { }
289};
290MODULE_DEVICE_TABLE(platform, board_ids);
291
292static struct platform_driver sof_audio = {
293 .probe = sof_audio_probe,
294 .driver = {
295 .name = "sof_cs42l42",
296 .pm = &snd_soc_pm_ops,
297 },
298 .id_table = board_ids,
299};
300module_platform_driver(sof_audio)
301
302/* Module information */
303MODULE_DESCRIPTION("SOF Audio Machine driver for CS42L42");
304MODULE_AUTHOR("Brent Lu <brent.lu@intel.com>");
305MODULE_LICENSE("GPL");
306MODULE_IMPORT_NS("SND_SOC_INTEL_SOF_BOARD_HELPERS");
307MODULE_IMPORT_NS("SND_SOC_INTEL_SOF_MAXIM_COMMON");
1// SPDX-License-Identifier: GPL-2.0-only
2// Copyright(c) 2021 Intel Corporation.
3
4/*
5 * Intel SOF Machine Driver with Cirrus Logic CS42L42 Codec
6 * and speaker codec MAX98357A
7 */
8#include <linux/i2c.h>
9#include <linux/input.h>
10#include <linux/module.h>
11#include <linux/platform_device.h>
12#include <linux/regulator/consumer.h>
13#include <linux/dmi.h>
14#include <sound/core.h>
15#include <sound/jack.h>
16#include <sound/pcm.h>
17#include <sound/pcm_params.h>
18#include <sound/soc.h>
19#include <sound/sof.h>
20#include <sound/soc-acpi.h>
21#include <dt-bindings/sound/cs42l42.h>
22#include "../common/soc-intel-quirks.h"
23#include "sof_board_helpers.h"
24#include "sof_maxim_common.h"
25#include "sof_ssp_common.h"
26
27#define SOF_CS42L42_SSP_CODEC(quirk) ((quirk) & GENMASK(2, 0))
28#define SOF_CS42L42_SSP_CODEC_MASK (GENMASK(2, 0))
29#define SOF_CS42L42_SSP_AMP_SHIFT 4
30#define SOF_CS42L42_SSP_AMP_MASK (GENMASK(6, 4))
31#define SOF_CS42L42_SSP_AMP(quirk) \
32 (((quirk) << SOF_CS42L42_SSP_AMP_SHIFT) & SOF_CS42L42_SSP_AMP_MASK)
33#define SOF_CS42L42_NUM_HDMIDEV_SHIFT 7
34#define SOF_CS42L42_NUM_HDMIDEV_MASK (GENMASK(9, 7))
35#define SOF_CS42L42_NUM_HDMIDEV(quirk) \
36 (((quirk) << SOF_CS42L42_NUM_HDMIDEV_SHIFT) & SOF_CS42L42_NUM_HDMIDEV_MASK)
37#define SOF_BT_OFFLOAD_PRESENT BIT(25)
38#define SOF_CS42L42_SSP_BT_SHIFT 26
39#define SOF_CS42L42_SSP_BT_MASK (GENMASK(28, 26))
40#define SOF_CS42L42_SSP_BT(quirk) \
41 (((quirk) << SOF_CS42L42_SSP_BT_SHIFT) & SOF_CS42L42_SSP_BT_MASK)
42
43static struct snd_soc_jack_pin jack_pins[] = {
44 {
45 .pin = "Headphone Jack",
46 .mask = SND_JACK_HEADPHONE,
47 },
48 {
49 .pin = "Headset Mic",
50 .mask = SND_JACK_MICROPHONE,
51 },
52};
53
54/* Default: SSP2 */
55static unsigned long sof_cs42l42_quirk = SOF_CS42L42_SSP_CODEC(2);
56
57static int sof_cs42l42_init(struct snd_soc_pcm_runtime *rtd)
58{
59 struct sof_card_private *ctx = snd_soc_card_get_drvdata(rtd->card);
60 struct snd_soc_component *component = snd_soc_rtd_to_codec(rtd, 0)->component;
61 struct snd_soc_jack *jack = &ctx->headset_jack;
62 int ret;
63
64 /*
65 * Headset buttons map to the google Reference headset.
66 * These can be configured by userspace.
67 */
68 ret = snd_soc_card_jack_new_pins(rtd->card, "Headset Jack",
69 SND_JACK_HEADSET | SND_JACK_BTN_0 |
70 SND_JACK_BTN_1 | SND_JACK_BTN_2 |
71 SND_JACK_BTN_3,
72 jack,
73 jack_pins,
74 ARRAY_SIZE(jack_pins));
75 if (ret) {
76 dev_err(rtd->dev, "Headset Jack creation failed: %d\n", ret);
77 return ret;
78 }
79
80 snd_jack_set_key(jack->jack, SND_JACK_BTN_0, KEY_PLAYPAUSE);
81 snd_jack_set_key(jack->jack, SND_JACK_BTN_1, KEY_VOLUMEUP);
82 snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEDOWN);
83 snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOICECOMMAND);
84
85 ret = snd_soc_component_set_jack(component, jack, NULL);
86 if (ret) {
87 dev_err(rtd->dev, "Headset Jack call-back failed: %d\n", ret);
88 return ret;
89 }
90
91 return ret;
92};
93
94static void sof_cs42l42_exit(struct snd_soc_pcm_runtime *rtd)
95{
96 struct snd_soc_component *component = snd_soc_rtd_to_codec(rtd, 0)->component;
97
98 snd_soc_component_set_jack(component, NULL, NULL);
99}
100
101static int sof_cs42l42_hw_params(struct snd_pcm_substream *substream,
102 struct snd_pcm_hw_params *params)
103{
104 struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
105 struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
106 int clk_freq, ret;
107
108 clk_freq = sof_dai_get_bclk(rtd); /* BCLK freq */
109
110 if (clk_freq <= 0) {
111 dev_err(rtd->dev, "get bclk freq failed: %d\n", clk_freq);
112 return -EINVAL;
113 }
114
115 /* Configure sysclk for codec */
116 ret = snd_soc_dai_set_sysclk(codec_dai, 0,
117 clk_freq, SND_SOC_CLOCK_IN);
118 if (ret < 0)
119 dev_err(rtd->dev, "snd_soc_dai_set_sysclk err = %d\n", ret);
120
121 return ret;
122}
123
124static const struct snd_soc_ops sof_cs42l42_ops = {
125 .hw_params = sof_cs42l42_hw_params,
126};
127
128static int sof_card_late_probe(struct snd_soc_card *card)
129{
130 return sof_intel_board_card_late_probe(card);
131}
132
133static const struct snd_kcontrol_new sof_controls[] = {
134 SOC_DAPM_PIN_SWITCH("Headphone Jack"),
135 SOC_DAPM_PIN_SWITCH("Headset Mic"),
136};
137
138static const struct snd_soc_dapm_widget sof_widgets[] = {
139 SND_SOC_DAPM_HP("Headphone Jack", NULL),
140 SND_SOC_DAPM_MIC("Headset Mic", NULL),
141};
142
143static const struct snd_soc_dapm_route sof_map[] = {
144 /* HP jack connectors - unknown if we have jack detection */
145 {"Headphone Jack", NULL, "HP"},
146
147 /* other jacks */
148 {"HS", NULL, "Headset Mic"},
149};
150
151/* sof audio machine driver for cs42l42 codec */
152static struct snd_soc_card sof_audio_card_cs42l42 = {
153 .name = "cs42l42", /* the sof- prefix is added by the core */
154 .owner = THIS_MODULE,
155 .controls = sof_controls,
156 .num_controls = ARRAY_SIZE(sof_controls),
157 .dapm_widgets = sof_widgets,
158 .num_dapm_widgets = ARRAY_SIZE(sof_widgets),
159 .dapm_routes = sof_map,
160 .num_dapm_routes = ARRAY_SIZE(sof_map),
161 .fully_routed = true,
162 .late_probe = sof_card_late_probe,
163};
164
165static struct snd_soc_dai_link_component cs42l42_component[] = {
166 {
167 .name = "i2c-10134242:00",
168 .dai_name = "cs42l42",
169 }
170};
171
172static int
173sof_card_dai_links_create(struct device *dev, struct snd_soc_card *card,
174 struct sof_card_private *ctx)
175{
176 int ret;
177
178 ret = sof_intel_board_set_dai_link(dev, card, ctx);
179 if (ret)
180 return ret;
181
182 if (!ctx->codec_link) {
183 dev_err(dev, "codec link not available");
184 return -EINVAL;
185 }
186
187 /* codec-specific fields for headphone codec */
188 ctx->codec_link->codecs = cs42l42_component;
189 ctx->codec_link->num_codecs = ARRAY_SIZE(cs42l42_component);
190 ctx->codec_link->init = sof_cs42l42_init;
191 ctx->codec_link->exit = sof_cs42l42_exit;
192 ctx->codec_link->ops = &sof_cs42l42_ops;
193
194 if (ctx->amp_type == CODEC_NONE)
195 return 0;
196
197 if (!ctx->amp_link) {
198 dev_err(dev, "amp link not available");
199 return -EINVAL;
200 }
201
202 /* codec-specific fields for speaker amplifier */
203 switch (ctx->amp_type) {
204 case CODEC_MAX98357A:
205 max_98357a_dai_link(ctx->amp_link);
206 break;
207 case CODEC_MAX98360A:
208 max_98360a_dai_link(ctx->amp_link);
209 break;
210 default:
211 dev_err(dev, "invalid amp type %d\n", ctx->amp_type);
212 return -EINVAL;
213 }
214
215 return 0;
216}
217
218#define GLK_LINK_ORDER SOF_LINK_ORDER(SOF_LINK_AMP, \
219 SOF_LINK_CODEC, \
220 SOF_LINK_DMIC01, \
221 SOF_LINK_IDISP_HDMI, \
222 SOF_LINK_NONE, \
223 SOF_LINK_NONE, \
224 SOF_LINK_NONE)
225
226static int sof_audio_probe(struct platform_device *pdev)
227{
228 struct snd_soc_acpi_mach *mach = pdev->dev.platform_data;
229 struct sof_card_private *ctx;
230 int ret;
231
232 ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
233 if (!ctx)
234 return -ENOMEM;
235
236 if (pdev->id_entry && pdev->id_entry->driver_data)
237 sof_cs42l42_quirk = (unsigned long)pdev->id_entry->driver_data;
238
239 ctx->codec_type = sof_ssp_detect_codec_type(&pdev->dev);
240 ctx->amp_type = sof_ssp_detect_amp_type(&pdev->dev);
241
242 if (soc_intel_is_glk()) {
243 ctx->dmic_be_num = 1;
244 ctx->hdmi_num = 3;
245
246 /* overwrite the DAI link order for GLK boards */
247 ctx->link_order_overwrite = GLK_LINK_ORDER;
248 } else {
249 ctx->dmic_be_num = 2;
250 ctx->hdmi_num = (sof_cs42l42_quirk & SOF_CS42L42_NUM_HDMIDEV_MASK) >>
251 SOF_CS42L42_NUM_HDMIDEV_SHIFT;
252 /* default number of HDMI DAI's */
253 if (!ctx->hdmi_num)
254 ctx->hdmi_num = 3;
255 }
256
257 if (mach->mach_params.codec_mask & IDISP_CODEC_MASK)
258 ctx->hdmi.idisp_codec = true;
259
260 dev_dbg(&pdev->dev, "sof_cs42l42_quirk = %lx\n", sof_cs42l42_quirk);
261
262 /* port number of peripherals attached to ssp interface */
263 ctx->ssp_bt = (sof_cs42l42_quirk & SOF_CS42L42_SSP_BT_MASK) >>
264 SOF_CS42L42_SSP_BT_SHIFT;
265
266 ctx->ssp_amp = (sof_cs42l42_quirk & SOF_CS42L42_SSP_AMP_MASK) >>
267 SOF_CS42L42_SSP_AMP_SHIFT;
268
269 ctx->ssp_codec = sof_cs42l42_quirk & SOF_CS42L42_SSP_CODEC_MASK;
270
271 if (sof_cs42l42_quirk & SOF_BT_OFFLOAD_PRESENT)
272 ctx->bt_offload_present = true;
273
274 /* update dai_link */
275 ret = sof_card_dai_links_create(&pdev->dev, &sof_audio_card_cs42l42, ctx);
276 if (ret)
277 return ret;
278
279 sof_audio_card_cs42l42.dev = &pdev->dev;
280
281 /* set platform name for each dailink */
282 ret = snd_soc_fixup_dai_links_platform_name(&sof_audio_card_cs42l42,
283 mach->mach_params.platform);
284 if (ret)
285 return ret;
286
287 snd_soc_card_set_drvdata(&sof_audio_card_cs42l42, ctx);
288
289 return devm_snd_soc_register_card(&pdev->dev,
290 &sof_audio_card_cs42l42);
291}
292
293static const struct platform_device_id board_ids[] = {
294 {
295 .name = "glk_cs4242_mx98357a",
296 .driver_data = (kernel_ulong_t)(SOF_CS42L42_SSP_CODEC(2) |
297 SOF_CS42L42_SSP_AMP(1)),
298 },
299 {
300 .name = "jsl_cs4242_mx98360a",
301 .driver_data = (kernel_ulong_t)(SOF_CS42L42_SSP_CODEC(0) |
302 SOF_CS42L42_SSP_AMP(1)),
303 },
304 {
305 .name = "adl_mx98360a_cs4242",
306 .driver_data = (kernel_ulong_t)(SOF_CS42L42_SSP_CODEC(0) |
307 SOF_CS42L42_SSP_AMP(1) |
308 SOF_CS42L42_NUM_HDMIDEV(4) |
309 SOF_BT_OFFLOAD_PRESENT |
310 SOF_CS42L42_SSP_BT(2)),
311 },
312 { }
313};
314MODULE_DEVICE_TABLE(platform, board_ids);
315
316static struct platform_driver sof_audio = {
317 .probe = sof_audio_probe,
318 .driver = {
319 .name = "sof_cs42l42",
320 .pm = &snd_soc_pm_ops,
321 },
322 .id_table = board_ids,
323};
324module_platform_driver(sof_audio)
325
326/* Module information */
327MODULE_DESCRIPTION("SOF Audio Machine driver for CS42L42");
328MODULE_AUTHOR("Brent Lu <brent.lu@intel.com>");
329MODULE_LICENSE("GPL");
330MODULE_IMPORT_NS(SND_SOC_INTEL_SOF_BOARD_HELPERS);
331MODULE_IMPORT_NS(SND_SOC_INTEL_SOF_MAXIM_COMMON);
332MODULE_IMPORT_NS(SND_SOC_INTEL_SOF_SSP_COMMON);