21
21
22
22
#include "raven/acp3x.h"
23
23
#include "../codecs/rt5682.h"
24
+ #include "../codecs/rt1015.h"
24
25
25
26
#define PCO_PLAT_CLK 48000000
26
27
#define RT5682_PLL_FREQ (48000 * 512)
@@ -247,7 +248,18 @@ SND_SOC_DAILINK_DEF(cros_ec,
247
248
SND_SOC_DAILINK_DEF (platform ,
248
249
DAILINK_COMP_ARRAY (COMP_PLATFORM ("acp3x_rv_i2s_dma.0" )));
249
250
250
- static struct snd_soc_dai_link acp3x_dai_5682_98357 [] = {
251
+ static struct snd_soc_codec_conf rt1015_conf [] = {
252
+ {
253
+ .dlc = COMP_CODEC_CONF ("i2c-10EC1015:00" ),
254
+ .name_prefix = "Left" ,
255
+ },
256
+ {
257
+ .dlc = COMP_CODEC_CONF ("i2c-10EC1015:01" ),
258
+ .name_prefix = "Right" ,
259
+ },
260
+ };
261
+
262
+ static struct snd_soc_dai_link acp3x_dai [] = {
251
263
{
252
264
.name = "acp3x-5682-play" ,
253
265
.stream_name = "Playback" ,
@@ -317,8 +329,8 @@ static const struct snd_kcontrol_new acp3x_5682_mc_controls[] = {
317
329
static struct snd_soc_card acp3x_5682 = {
318
330
.name = "acp3xalc5682m98357" ,
319
331
.owner = THIS_MODULE ,
320
- .dai_link = acp3x_dai_5682_98357 ,
321
- .num_links = ARRAY_SIZE (acp3x_dai_5682_98357 ),
332
+ .dai_link = acp3x_dai ,
333
+ .num_links = ARRAY_SIZE (acp3x_dai ),
322
334
.dapm_widgets = acp3x_5682_widgets ,
323
335
.num_dapm_widgets = ARRAY_SIZE (acp3x_5682_widgets ),
324
336
.dapm_routes = acp3x_5682_audio_route ,
@@ -327,6 +339,47 @@ static struct snd_soc_card acp3x_5682 = {
327
339
.num_controls = ARRAY_SIZE (acp3x_5682_mc_controls ),
328
340
};
329
341
342
+ static const struct snd_soc_dapm_widget acp3x_1015_widgets [] = {
343
+ SND_SOC_DAPM_HP ("Headphone Jack" , NULL ),
344
+ SND_SOC_DAPM_MIC ("Headset Mic" , NULL ),
345
+ SND_SOC_DAPM_MUX ("Dmic Mux" , SND_SOC_NOPM , 0 , 0 ,
346
+ & acp3x_dmic_mux_control ),
347
+ SND_SOC_DAPM_SPK ("Left Spk" , NULL ),
348
+ SND_SOC_DAPM_SPK ("Right Spk" , NULL ),
349
+ };
350
+
351
+ static const struct snd_soc_dapm_route acp3x_1015_route [] = {
352
+ {"Headphone Jack" , NULL , "HPOL" },
353
+ {"Headphone Jack" , NULL , "HPOR" },
354
+ {"IN1P" , NULL , "Headset Mic" },
355
+ {"Dmic Mux" , "Front Mic" , "DMIC" },
356
+ {"Dmic Mux" , "Rear Mic" , "DMIC" },
357
+ {"Left Spk" , NULL , "Left SPO" },
358
+ {"Right Spk" , NULL , "Right SPO" },
359
+ };
360
+
361
+ static const struct snd_kcontrol_new acp3x_mc_1015_controls [] = {
362
+ SOC_DAPM_PIN_SWITCH ("Headphone Jack" ),
363
+ SOC_DAPM_PIN_SWITCH ("Headset Mic" ),
364
+ SOC_DAPM_PIN_SWITCH ("Left Spk" ),
365
+ SOC_DAPM_PIN_SWITCH ("Right Spk" ),
366
+ };
367
+
368
+ static struct snd_soc_card acp3x_1015 = {
369
+ .name = "acp3xalc56821015" ,
370
+ .owner = THIS_MODULE ,
371
+ .dai_link = acp3x_dai ,
372
+ .num_links = ARRAY_SIZE (acp3x_dai ),
373
+ .dapm_widgets = acp3x_1015_widgets ,
374
+ .num_dapm_widgets = ARRAY_SIZE (acp3x_1015_widgets ),
375
+ .dapm_routes = acp3x_1015_route ,
376
+ .num_dapm_routes = ARRAY_SIZE (acp3x_1015_route ),
377
+ .codec_conf = rt1015_conf ,
378
+ .num_configs = ARRAY_SIZE (rt1015_conf ),
379
+ .controls = acp3x_mc_1015_controls ,
380
+ .num_controls = ARRAY_SIZE (acp3x_mc_1015_controls ),
381
+ };
382
+
330
383
void * soc_is_rltk_max (struct device * dev )
331
384
{
332
385
const struct acpi_device_id * match ;
@@ -375,6 +428,7 @@ static int acp3x_probe(struct platform_device *pdev)
375
428
376
429
static const struct acpi_device_id acp3x_audio_acpi_match [] = {
377
430
{ "AMDI5682" , (unsigned long )& acp3x_5682 },
431
+ { "AMDI1015" , (unsigned long )& acp3x_1015 },
378
432
{},
379
433
};
380
434
MODULE_DEVICE_TABLE (acpi , acp3x_audio_acpi_match );
@@ -391,5 +445,6 @@ static struct platform_driver acp3x_audio = {
391
445
module_platform_driver (acp3x_audio );
392
446
393
447
MODULE_AUTHOR (
"[email protected] " );
394
- MODULE_DESCRIPTION ("ALC5682 & MAX98357 audio support" );
448
+ MODULE_AUTHOR (
"[email protected] " );
449
+ MODULE_DESCRIPTION ("ALC5682 ALC1015 & MAX98357 audio support" );
395
450
MODULE_LICENSE ("GPL v2" );
0 commit comments