1 // SPDX-License-Identifier: GPL-2.0
2 // tscs454.c -- TSCS454 ALSA SoC Audio driver
3 // Copyright 2018 Tempo Semiconductor, Inc.
4 // Author: Steven Eckhoff <steven.eckhoff.opensource@gmail.com>
6 #include <linux/kernel.h>
8 #include <linux/device.h>
9 #include <linux/regmap.h>
10 #include <linux/i2c.h>
11 #include <linux/err.h>
12 #include <linux/string.h>
13 #include <linux/module.h>
14 #include <linux/delay.h>
15 #include <linux/mutex.h>
17 #include <sound/tlv.h>
18 #include <sound/pcm_params.h>
19 #include <sound/pcm.h>
20 #include <sound/soc.h>
21 #include <sound/soc-dapm.h>
25 static const unsigned int PLL_44_1K_RATE
= (44100 * 256);
28 #define BIQUAD_COEFF_COUNT 5
29 #define BIQUAD_SIZE (COEFF_SIZE * BIQUAD_COEFF_COUNT)
31 #define COEFF_RAM_MAX_ADDR 0xcd
32 #define COEFF_RAM_COEFF_COUNT (COEFF_RAM_MAX_ADDR + 1)
33 #define COEFF_RAM_SIZE (COEFF_SIZE * COEFF_RAM_COEFF_COUNT)
48 static inline void pll_init(struct pll
*pll
, int id
)
51 mutex_init(&pll
->lock
);
54 struct internal_rate
{
64 static inline void aif_init(struct aif
*aif
, unsigned int id
)
70 u8 cache
[COEFF_RAM_SIZE
];
75 static inline void init_coeff_ram_cache(u8
*cache
)
77 static const u8 norm_addrs
[] = { 0x00, 0x05, 0x0a, 0x0f, 0x14, 0x19,
78 0x1f, 0x20, 0x25, 0x2a, 0x2f, 0x34, 0x39, 0x3f, 0x40, 0x45,
79 0x4a, 0x4f, 0x54, 0x59, 0x5f, 0x60, 0x65, 0x6a, 0x6f, 0x74,
80 0x79, 0x7f, 0x80, 0x85, 0x8c, 0x91, 0x96, 0x97, 0x9c, 0xa3,
81 0xa8, 0xad, 0xaf, 0xb0, 0xb5, 0xba, 0xbf, 0xc4, 0xc9};
84 for (i
= 0; i
< ARRAY_SIZE(norm_addrs
); i
++)
85 cache
[((norm_addrs
[i
] + 1) * COEFF_SIZE
) - 1] = 0x40;
88 static inline void coeff_ram_init(struct coeff_ram
*ram
)
90 init_coeff_ram_cache(ram
->cache
);
91 mutex_init(&ram
->lock
);
98 static inline void set_aif_status_active(struct aifs_status
*status
,
99 int aif_id
, bool playback
)
101 u8 mask
= 0x01 << (aif_id
* 2 + !playback
);
103 status
->streams
|= mask
;
106 static inline void set_aif_status_inactive(struct aifs_status
*status
,
107 int aif_id
, bool playback
)
109 u8 mask
= ~(0x01 << (aif_id
* 2 + !playback
));
111 status
->streams
&= mask
;
114 static bool aifs_active(struct aifs_status
*status
)
116 return status
->streams
;
119 static bool aif_active(struct aifs_status
*status
, int aif_id
)
121 return (0x03 << aif_id
* 2) & status
->streams
;
125 struct regmap
*regmap
;
126 struct aif aifs
[TSCS454_DAI_COUNT
];
128 struct aifs_status aifs_status
;
129 struct mutex aifs_status_lock
;
133 struct internal_rate internal_rate
;
135 struct coeff_ram dac_ram
;
136 struct coeff_ram spk_ram
;
137 struct coeff_ram sub_ram
;
141 unsigned int bclk_freq
;
144 struct coeff_ram_ctl
{
146 struct soc_bytes_ext bytes_ext
;
149 static const struct reg_sequence tscs454_patch
[] = {
150 /* Assign ASRC out of the box so DAI 1 just works */
151 { R_AUDIOMUX1
, FV_ASRCIMUX_I2S1
| FV_I2S2MUX_I2S2
},
152 { R_AUDIOMUX2
, FV_ASRCOMUX_I2S1
| FV_DACMUX_I2S1
| FV_I2S3MUX_I2S3
},
153 { R_AUDIOMUX3
, FV_CLSSDMUX_I2S1
| FV_SUBMUX_I2S1_LR
},
154 { R_TDMCTL0
, FV_TDMMD_256
},
155 { VIRT_ADDR(0x0A, 0x13), 1 << 3 },
158 static bool tscs454_volatile(struct device
*dev
, unsigned int reg
)
183 static bool tscs454_writable(struct device
*dev
, unsigned int reg
)
203 static bool tscs454_readable(struct device
*dev
, unsigned int reg
)
223 static bool tscs454_precious(struct device
*dev
, unsigned int reg
)
252 static const struct regmap_range_cfg tscs454_regmap_range_cfg
= {
254 .range_min
= VIRT_BASE
,
255 .range_max
= VIRT_ADDR(0xFE, 0x02),
256 .selector_reg
= R_PAGESEL
,
257 .selector_mask
= 0xff,
263 static struct regmap_config
const tscs454_regmap_cfg
= {
266 .writeable_reg
= tscs454_writable
,
267 .readable_reg
= tscs454_readable
,
268 .volatile_reg
= tscs454_volatile
,
269 .precious_reg
= tscs454_precious
,
270 .ranges
= &tscs454_regmap_range_cfg
,
272 .max_register
= VIRT_ADDR(0xFE, 0x02),
273 .cache_type
= REGCACHE_RBTREE
,
276 static inline int tscs454_data_init(struct tscs454
*tscs454
,
277 struct i2c_client
*i2c
)
282 tscs454
->regmap
= devm_regmap_init_i2c(i2c
, &tscs454_regmap_cfg
);
283 if (IS_ERR(tscs454
->regmap
)) {
284 ret
= PTR_ERR(tscs454
->regmap
);
288 for (i
= 0; i
< TSCS454_DAI_COUNT
; i
++)
289 aif_init(&tscs454
->aifs
[i
], i
);
291 mutex_init(&tscs454
->aifs_status_lock
);
292 pll_init(&tscs454
->pll1
, 1);
293 pll_init(&tscs454
->pll2
, 2);
295 coeff_ram_init(&tscs454
->dac_ram
);
296 coeff_ram_init(&tscs454
->spk_ram
);
297 coeff_ram_init(&tscs454
->sub_ram
);
307 static int coeff_ram_get(struct snd_kcontrol
*kcontrol
,
308 struct snd_ctl_elem_value
*ucontrol
)
310 struct snd_soc_component
*component
=
311 snd_soc_kcontrol_component(kcontrol
);
312 struct tscs454
*tscs454
= snd_soc_component_get_drvdata(component
);
313 struct coeff_ram_ctl
*ctl
=
314 (struct coeff_ram_ctl
*)kcontrol
->private_value
;
315 struct soc_bytes_ext
*params
= &ctl
->bytes_ext
;
317 struct mutex
*coeff_ram_lock
;
319 if (strstr(kcontrol
->id
.name
, "DAC")) {
320 coeff_ram
= tscs454
->dac_ram
.cache
;
321 coeff_ram_lock
= &tscs454
->dac_ram
.lock
;
322 } else if (strstr(kcontrol
->id
.name
, "Speaker")) {
323 coeff_ram
= tscs454
->spk_ram
.cache
;
324 coeff_ram_lock
= &tscs454
->spk_ram
.lock
;
325 } else if (strstr(kcontrol
->id
.name
, "Sub")) {
326 coeff_ram
= tscs454
->sub_ram
.cache
;
327 coeff_ram_lock
= &tscs454
->sub_ram
.lock
;
332 mutex_lock(coeff_ram_lock
);
334 memcpy(ucontrol
->value
.bytes
.data
,
335 &coeff_ram
[ctl
->addr
* COEFF_SIZE
], params
->max
);
337 mutex_unlock(coeff_ram_lock
);
342 #define DACCRSTAT_MAX_TRYS 10
343 static int write_coeff_ram(struct snd_soc_component
*component
, u8
*coeff_ram
,
344 unsigned int r_stat
, unsigned int r_addr
, unsigned int r_wr
,
345 unsigned int coeff_addr
, unsigned int coeff_cnt
)
347 struct tscs454
*tscs454
= snd_soc_component_get_drvdata(component
);
353 for (cnt
= 0; cnt
< coeff_cnt
; cnt
++, coeff_addr
++) {
355 for (trys
= 0; trys
< DACCRSTAT_MAX_TRYS
; trys
++) {
356 ret
= snd_soc_component_read(component
, r_stat
, &val
);
358 dev_err(component
->dev
,
359 "Failed to read stat (%d)\n", ret
);
366 if (trys
== DACCRSTAT_MAX_TRYS
) {
368 dev_err(component
->dev
,
369 "Coefficient write error (%d)\n", ret
);
373 ret
= regmap_write(tscs454
->regmap
, r_addr
, coeff_addr
);
375 dev_err(component
->dev
,
376 "Failed to write dac ram address (%d)\n", ret
);
380 ret
= regmap_bulk_write(tscs454
->regmap
, r_wr
,
381 &coeff_ram
[coeff_addr
* COEFF_SIZE
],
384 dev_err(component
->dev
,
385 "Failed to write dac ram (%d)\n", ret
);
393 static int coeff_ram_put(struct snd_kcontrol
*kcontrol
,
394 struct snd_ctl_elem_value
*ucontrol
)
396 struct snd_soc_component
*component
=
397 snd_soc_kcontrol_component(kcontrol
);
398 struct tscs454
*tscs454
= snd_soc_component_get_drvdata(component
);
399 struct coeff_ram_ctl
*ctl
=
400 (struct coeff_ram_ctl
*)kcontrol
->private_value
;
401 struct soc_bytes_ext
*params
= &ctl
->bytes_ext
;
402 unsigned int coeff_cnt
= params
->max
/ COEFF_SIZE
;
404 struct mutex
*coeff_ram_lock
;
405 bool *coeff_ram_synced
;
412 if (strstr(kcontrol
->id
.name
, "DAC")) {
413 coeff_ram
= tscs454
->dac_ram
.cache
;
414 coeff_ram_lock
= &tscs454
->dac_ram
.lock
;
415 coeff_ram_synced
= &tscs454
->dac_ram
.synced
;
419 } else if (strstr(kcontrol
->id
.name
, "Speaker")) {
420 coeff_ram
= tscs454
->spk_ram
.cache
;
421 coeff_ram_lock
= &tscs454
->spk_ram
.lock
;
422 coeff_ram_synced
= &tscs454
->spk_ram
.synced
;
426 } else if (strstr(kcontrol
->id
.name
, "Sub")) {
427 coeff_ram
= tscs454
->sub_ram
.cache
;
428 coeff_ram_lock
= &tscs454
->sub_ram
.lock
;
429 coeff_ram_synced
= &tscs454
->sub_ram
.synced
;
437 mutex_lock(coeff_ram_lock
);
439 *coeff_ram_synced
= false;
441 memcpy(&coeff_ram
[ctl
->addr
* COEFF_SIZE
],
442 ucontrol
->value
.bytes
.data
, params
->max
);
444 mutex_lock(&tscs454
->pll1
.lock
);
445 mutex_lock(&tscs454
->pll2
.lock
);
447 ret
= snd_soc_component_read(component
, R_PLLSTAT
, &val
);
449 dev_err(component
->dev
, "Failed to read PLL status (%d)\n",
453 if (val
) { /* PLLs locked */
454 ret
= write_coeff_ram(component
, coeff_ram
,
455 r_stat
, r_addr
, r_wr
,
456 ctl
->addr
, coeff_cnt
);
458 dev_err(component
->dev
,
459 "Failed to flush coeff ram cache (%d)\n", ret
);
462 *coeff_ram_synced
= true;
467 mutex_unlock(&tscs454
->pll2
.lock
);
468 mutex_unlock(&tscs454
->pll1
.lock
);
469 mutex_unlock(coeff_ram_lock
);
474 static inline int coeff_ram_sync(struct snd_soc_component
*component
,
475 struct tscs454
*tscs454
)
479 mutex_lock(&tscs454
->dac_ram
.lock
);
480 if (!tscs454
->dac_ram
.synced
) {
481 ret
= write_coeff_ram(component
, tscs454
->dac_ram
.cache
,
482 R_DACCRS
, R_DACCRADD
, R_DACCRWDL
,
483 0x00, COEFF_RAM_COEFF_COUNT
);
485 mutex_unlock(&tscs454
->dac_ram
.lock
);
489 mutex_unlock(&tscs454
->dac_ram
.lock
);
491 mutex_lock(&tscs454
->spk_ram
.lock
);
492 if (!tscs454
->spk_ram
.synced
) {
493 ret
= write_coeff_ram(component
, tscs454
->spk_ram
.cache
,
494 R_SPKCRS
, R_SPKCRADD
, R_SPKCRWDL
,
495 0x00, COEFF_RAM_COEFF_COUNT
);
497 mutex_unlock(&tscs454
->spk_ram
.lock
);
501 mutex_unlock(&tscs454
->spk_ram
.lock
);
503 mutex_lock(&tscs454
->sub_ram
.lock
);
504 if (!tscs454
->sub_ram
.synced
) {
505 ret
= write_coeff_ram(component
, tscs454
->sub_ram
.cache
,
506 R_SUBCRS
, R_SUBCRADD
, R_SUBCRWDL
,
507 0x00, COEFF_RAM_COEFF_COUNT
);
509 mutex_unlock(&tscs454
->sub_ram
.lock
);
513 mutex_unlock(&tscs454
->sub_ram
.lock
);
518 #define PLL_REG_SETTINGS_COUNT 11
521 struct reg_setting settings
[PLL_REG_SETTINGS_COUNT
];
524 #define PLL_CTL(f, t, c1, r1, o1, f1l, f1h, c2, r2, o2, f2l, f2h) \
531 {R_PLL1FDIVL, f1l}, \
532 {R_PLL1FDIVH, f1h}, \
536 {R_PLL2FDIVL, f2l}, \
537 {R_PLL2FDIVH, f2h}, \
542 static const struct pll_ctl pll_ctls
[] = {
543 PLL_CTL(1411200, 0x05,
544 0xB9, 0x07, 0x02, 0xC3, 0x04,
545 0x5A, 0x02, 0x03, 0xE0, 0x01),
546 PLL_CTL(1536000, 0x05,
547 0x5A, 0x02, 0x03, 0xE0, 0x01,
548 0x5A, 0x02, 0x03, 0xB9, 0x01),
549 PLL_CTL(2822400, 0x0A,
550 0x63, 0x07, 0x04, 0xC3, 0x04,
551 0x62, 0x07, 0x03, 0x48, 0x03),
552 PLL_CTL(3072000, 0x0B,
553 0x62, 0x07, 0x03, 0x48, 0x03,
554 0x5A, 0x04, 0x03, 0xB9, 0x01),
555 PLL_CTL(5644800, 0x15,
556 0x63, 0x0E, 0x04, 0xC3, 0x04,
557 0x5A, 0x08, 0x03, 0xE0, 0x01),
558 PLL_CTL(6144000, 0x17,
559 0x5A, 0x08, 0x03, 0xE0, 0x01,
560 0x5A, 0x08, 0x03, 0xB9, 0x01),
561 PLL_CTL(12000000, 0x2E,
562 0x5B, 0x19, 0x03, 0x00, 0x03,
563 0x6A, 0x19, 0x05, 0x98, 0x04),
564 PLL_CTL(19200000, 0x4A,
565 0x53, 0x14, 0x03, 0x80, 0x01,
566 0x5A, 0x19, 0x03, 0xB9, 0x01),
567 PLL_CTL(22000000, 0x55,
568 0x6A, 0x37, 0x05, 0x00, 0x06,
569 0x62, 0x26, 0x03, 0x49, 0x02),
570 PLL_CTL(22579200, 0x57,
571 0x62, 0x31, 0x03, 0x20, 0x03,
572 0x53, 0x1D, 0x03, 0xB3, 0x01),
573 PLL_CTL(24000000, 0x5D,
574 0x53, 0x19, 0x03, 0x80, 0x01,
575 0x5B, 0x19, 0x05, 0x4C, 0x02),
576 PLL_CTL(24576000, 0x5F,
577 0x53, 0x1D, 0x03, 0xB3, 0x01,
578 0x62, 0x40, 0x03, 0x72, 0x03),
579 PLL_CTL(27000000, 0x68,
580 0x62, 0x4B, 0x03, 0x00, 0x04,
581 0x6A, 0x7D, 0x03, 0x20, 0x06),
582 PLL_CTL(36000000, 0x8C,
583 0x5B, 0x4B, 0x03, 0x00, 0x03,
584 0x6A, 0x7D, 0x03, 0x98, 0x04),
585 PLL_CTL(11289600, 0x2B,
586 0x6A, 0x31, 0x03, 0x40, 0x06,
587 0x5A, 0x12, 0x03, 0x1C, 0x02),
588 PLL_CTL(26000000, 0x65,
589 0x63, 0x41, 0x05, 0x00, 0x06,
590 0x5A, 0x26, 0x03, 0xEF, 0x01),
591 PLL_CTL(12288000, 0x2F,
592 0x5A, 0x12, 0x03, 0x1C, 0x02,
593 0x62, 0x20, 0x03, 0x72, 0x03),
594 PLL_CTL(40000000, 0x9B,
595 0xA2, 0x7D, 0x03, 0x80, 0x04,
596 0x63, 0x7D, 0x05, 0xE4, 0x06),
597 PLL_CTL(512000, 0x01,
598 0x62, 0x01, 0x03, 0xD0, 0x02,
599 0x5B, 0x01, 0x04, 0x72, 0x03),
600 PLL_CTL(705600, 0x02,
601 0x62, 0x02, 0x03, 0x15, 0x04,
602 0x62, 0x01, 0x04, 0x80, 0x02),
603 PLL_CTL(1024000, 0x03,
604 0x62, 0x02, 0x03, 0xD0, 0x02,
605 0x5B, 0x02, 0x04, 0x72, 0x03),
606 PLL_CTL(2048000, 0x07,
607 0x62, 0x04, 0x03, 0xD0, 0x02,
608 0x5B, 0x04, 0x04, 0x72, 0x03),
609 PLL_CTL(2400000, 0x08,
610 0x62, 0x05, 0x03, 0x00, 0x03,
611 0x63, 0x05, 0x05, 0x98, 0x04),
614 static inline const struct pll_ctl
*get_pll_ctl(unsigned long freq_in
)
617 struct pll_ctl
const *pll_ctl
= NULL
;
619 for (i
= 0; i
< ARRAY_SIZE(pll_ctls
); ++i
)
620 if (pll_ctls
[i
].freq_in
== freq_in
) {
621 pll_ctl
= &pll_ctls
[i
];
635 static int set_sysclk(struct snd_soc_component
*component
)
637 struct tscs454
*tscs454
= snd_soc_component_get_drvdata(component
);
638 struct pll_ctl
const *pll_ctl
;
643 if (tscs454
->sysclk_src_id
< PLL_INPUT_BCLK
)
644 freq
= clk_get_rate(tscs454
->sysclk
);
646 freq
= tscs454
->bclk_freq
;
647 pll_ctl
= get_pll_ctl(freq
);
650 dev_err(component
->dev
,
651 "Invalid PLL input %lu (%d)\n", freq
, ret
);
655 for (i
= 0; i
< PLL_REG_SETTINGS_COUNT
; ++i
) {
656 ret
= snd_soc_component_write(component
,
657 pll_ctl
->settings
[i
].addr
,
658 pll_ctl
->settings
[i
].val
);
660 dev_err(component
->dev
,
661 "Failed to set pll setting (%d)\n",
670 static inline void reserve_pll(struct pll
*pll
)
672 mutex_lock(&pll
->lock
);
674 mutex_unlock(&pll
->lock
);
677 static inline void free_pll(struct pll
*pll
)
679 mutex_lock(&pll
->lock
);
681 mutex_unlock(&pll
->lock
);
684 static int pll_connected(struct snd_soc_dapm_widget
*source
,
685 struct snd_soc_dapm_widget
*sink
)
687 struct snd_soc_component
*component
=
688 snd_soc_dapm_to_component(source
->dapm
);
689 struct tscs454
*tscs454
= snd_soc_component_get_drvdata(component
);
692 if (strstr(source
->name
, "PLL 1")) {
693 mutex_lock(&tscs454
->pll1
.lock
);
694 users
= tscs454
->pll1
.users
;
695 mutex_unlock(&tscs454
->pll1
.lock
);
696 dev_dbg(component
->dev
, "%s(): PLL 1 users = %d\n", __func__
,
699 mutex_lock(&tscs454
->pll2
.lock
);
700 users
= tscs454
->pll2
.users
;
701 mutex_unlock(&tscs454
->pll2
.lock
);
702 dev_dbg(component
->dev
, "%s(): PLL 2 users = %d\n", __func__
,
710 * PLL must be enabled after power up and must be disabled before power down
711 * for proper clock switching.
713 static int pll_power_event(struct snd_soc_dapm_widget
*w
,
714 struct snd_kcontrol
*kcontrol
, int event
)
716 struct snd_soc_component
*component
=
717 snd_soc_dapm_to_component(w
->dapm
);
718 struct tscs454
*tscs454
= snd_soc_component_get_drvdata(component
);
725 if (strstr(w
->name
, "PLL 1"))
730 msk
= pll1
? FM_PLLCTL_PLL1CLKEN
: FM_PLLCTL_PLL2CLKEN
;
732 if (event
== SND_SOC_DAPM_POST_PMU
)
738 val
= pll1
? FV_PLL1CLKEN_ENABLE
: FV_PLL2CLKEN_ENABLE
;
740 val
= pll1
? FV_PLL1CLKEN_DISABLE
: FV_PLL2CLKEN_DISABLE
;
742 ret
= snd_soc_component_update_bits(component
, R_PLLCTL
, msk
, val
);
744 dev_err(component
->dev
, "Failed to %s PLL %d (%d)\n",
745 enable
? "enable" : "disable",
752 msleep(20); // Wait for lock
753 ret
= coeff_ram_sync(component
, tscs454
);
755 dev_err(component
->dev
,
756 "Failed to sync coeff ram (%d)\n", ret
);
764 static inline int aif_set_master(struct snd_soc_component
*component
,
765 unsigned int aif_id
, bool master
)
773 case TSCS454_DAI1_ID
:
776 case TSCS454_DAI2_ID
:
779 case TSCS454_DAI3_ID
:
784 dev_err(component
->dev
, "Unknown DAI %d (%d)\n", aif_id
, ret
);
787 mask
= FM_I2SPCTL_PORTMS
;
788 val
= master
? FV_PORTMS_MASTER
: FV_PORTMS_SLAVE
;
790 ret
= snd_soc_component_update_bits(component
, reg
, mask
, val
);
792 dev_err(component
->dev
, "Failed to set DAI %d to %s (%d)\n",
793 aif_id
, master
? "master" : "slave", ret
);
801 int aif_prepare(struct snd_soc_component
*component
, struct aif
*aif
)
805 ret
= aif_set_master(component
, aif
->id
, aif
->master
);
812 static inline int aif_free(struct snd_soc_component
*component
,
813 struct aif
*aif
, bool playback
)
815 struct tscs454
*tscs454
= snd_soc_component_get_drvdata(component
);
817 mutex_lock(&tscs454
->aifs_status_lock
);
819 dev_dbg(component
->dev
, "%s(): aif %d\n", __func__
, aif
->id
);
821 set_aif_status_inactive(&tscs454
->aifs_status
, aif
->id
, playback
);
823 dev_dbg(component
->dev
, "Set aif %d inactive. Streams status is 0x%x\n",
824 aif
->id
, tscs454
->aifs_status
.streams
);
826 if (!aif_active(&tscs454
->aifs_status
, aif
->id
)) {
827 /* Do config in slave mode */
828 aif_set_master(component
, aif
->id
, false);
829 dev_dbg(component
->dev
, "Freeing pll %d from aif %d\n",
830 aif
->pll
->id
, aif
->id
);
834 if (!aifs_active(&tscs454
->aifs_status
)) {
835 dev_dbg(component
->dev
, "Freeing pll %d from ir\n",
836 tscs454
->internal_rate
.pll
->id
);
837 free_pll(tscs454
->internal_rate
.pll
);
840 mutex_unlock(&tscs454
->aifs_status_lock
);
845 /* R_PLLCTL PG 0 ADDR 0x15 */
846 static char const * const bclk_sel_txt
[] = {
847 "BCLK 1", "BCLK 2", "BCLK 3"};
849 static struct soc_enum
const bclk_sel_enum
=
850 SOC_ENUM_SINGLE(R_PLLCTL
, FB_PLLCTL_BCLKSEL
,
851 ARRAY_SIZE(bclk_sel_txt
), bclk_sel_txt
);
853 /* R_ISRC PG 0 ADDR 0x16 */
854 static char const * const isrc_br_txt
[] = {
857 static struct soc_enum
const isrc_br_enum
=
858 SOC_ENUM_SINGLE(R_ISRC
, FB_ISRC_IBR
,
859 ARRAY_SIZE(isrc_br_txt
), isrc_br_txt
);
861 static char const * const isrc_bm_txt
[] = {
862 "0.25x", "0.5x", "1.0x", "2.0x"};
864 static struct soc_enum
const isrc_bm_enum
=
865 SOC_ENUM_SINGLE(R_ISRC
, FB_ISRC_IBM
,
866 ARRAY_SIZE(isrc_bm_txt
), isrc_bm_txt
);
868 /* R_SCLKCTL PG 0 ADDR 0x18 */
869 static char const * const modular_rate_txt
[] = {
870 "Reserved", "Half", "Full", "Auto",};
872 static struct soc_enum
const adc_modular_rate_enum
=
873 SOC_ENUM_SINGLE(R_SCLKCTL
, FB_SCLKCTL_ASDM
,
874 ARRAY_SIZE(modular_rate_txt
), modular_rate_txt
);
876 static struct soc_enum
const dac_modular_rate_enum
=
877 SOC_ENUM_SINGLE(R_SCLKCTL
, FB_SCLKCTL_DSDM
,
878 ARRAY_SIZE(modular_rate_txt
), modular_rate_txt
);
880 /* R_I2SIDCTL PG 0 ADDR 0x38 */
881 static char const * const data_ctrl_txt
[] = {
882 "L/R", "L/L", "R/R", "R/L"};
884 static struct soc_enum
const data_in_ctrl_enums
[] = {
885 SOC_ENUM_SINGLE(R_I2SIDCTL
, FB_I2SIDCTL_I2SI1DCTL
,
886 ARRAY_SIZE(data_ctrl_txt
), data_ctrl_txt
),
887 SOC_ENUM_SINGLE(R_I2SIDCTL
, FB_I2SIDCTL_I2SI2DCTL
,
888 ARRAY_SIZE(data_ctrl_txt
), data_ctrl_txt
),
889 SOC_ENUM_SINGLE(R_I2SIDCTL
, FB_I2SIDCTL_I2SI3DCTL
,
890 ARRAY_SIZE(data_ctrl_txt
), data_ctrl_txt
),
893 /* R_I2SODCTL PG 0 ADDR 0x39 */
894 static struct soc_enum
const data_out_ctrl_enums
[] = {
895 SOC_ENUM_SINGLE(R_I2SODCTL
, FB_I2SODCTL_I2SO1DCTL
,
896 ARRAY_SIZE(data_ctrl_txt
), data_ctrl_txt
),
897 SOC_ENUM_SINGLE(R_I2SODCTL
, FB_I2SODCTL_I2SO2DCTL
,
898 ARRAY_SIZE(data_ctrl_txt
), data_ctrl_txt
),
899 SOC_ENUM_SINGLE(R_I2SODCTL
, FB_I2SODCTL_I2SO3DCTL
,
900 ARRAY_SIZE(data_ctrl_txt
), data_ctrl_txt
),
903 /* R_AUDIOMUX1 PG 0 ADDR 0x3A */
904 static char const * const asrc_mux_txt
[] = {
905 "None", "DAI 1", "DAI 2", "DAI 3"};
907 static struct soc_enum
const asrc_in_mux_enum
=
908 SOC_ENUM_SINGLE(R_AUDIOMUX1
, FB_AUDIOMUX1_ASRCIMUX
,
909 ARRAY_SIZE(asrc_mux_txt
), asrc_mux_txt
);
911 static char const * const dai_mux_txt
[] = {
912 "CH 0_1", "CH 2_3", "CH 4_5", "ADC/DMic 1",
913 "DMic 2", "ClassD", "DAC", "Sub"};
915 static struct soc_enum
const dai2_mux_enum
=
916 SOC_ENUM_SINGLE(R_AUDIOMUX1
, FB_AUDIOMUX1_I2S2MUX
,
917 ARRAY_SIZE(dai_mux_txt
), dai_mux_txt
);
919 static struct snd_kcontrol_new
const dai2_mux_dapm_enum
=
920 SOC_DAPM_ENUM("DAI 2 Mux", dai2_mux_enum
);
922 static struct soc_enum
const dai1_mux_enum
=
923 SOC_ENUM_SINGLE(R_AUDIOMUX1
, FB_AUDIOMUX1_I2S1MUX
,
924 ARRAY_SIZE(dai_mux_txt
), dai_mux_txt
);
926 static struct snd_kcontrol_new
const dai1_mux_dapm_enum
=
927 SOC_DAPM_ENUM("DAI 1 Mux", dai1_mux_enum
);
929 /* R_AUDIOMUX2 PG 0 ADDR 0x3B */
930 static struct soc_enum
const asrc_out_mux_enum
=
931 SOC_ENUM_SINGLE(R_AUDIOMUX2
, FB_AUDIOMUX2_ASRCOMUX
,
932 ARRAY_SIZE(asrc_mux_txt
), asrc_mux_txt
);
934 static struct soc_enum
const dac_mux_enum
=
935 SOC_ENUM_SINGLE(R_AUDIOMUX2
, FB_AUDIOMUX2_DACMUX
,
936 ARRAY_SIZE(dai_mux_txt
), dai_mux_txt
);
938 static struct snd_kcontrol_new
const dac_mux_dapm_enum
=
939 SOC_DAPM_ENUM("DAC Mux", dac_mux_enum
);
941 static struct soc_enum
const dai3_mux_enum
=
942 SOC_ENUM_SINGLE(R_AUDIOMUX2
, FB_AUDIOMUX2_I2S3MUX
,
943 ARRAY_SIZE(dai_mux_txt
), dai_mux_txt
);
945 static struct snd_kcontrol_new
const dai3_mux_dapm_enum
=
946 SOC_DAPM_ENUM("DAI 3 Mux", dai3_mux_enum
);
948 /* R_AUDIOMUX3 PG 0 ADDR 0x3C */
949 static char const * const sub_mux_txt
[] = {
950 "CH 0", "CH 1", "CH 0 + 1",
951 "CH 2", "CH 3", "CH 2 + 3",
952 "CH 4", "CH 5", "CH 4 + 5",
953 "ADC/DMic 1 Left", "ADC/DMic 1 Right",
954 "ADC/DMic 1 Left Plus Right",
955 "DMic 2 Left", "DMic 2 Right", "DMic 2 Left Plus Right",
956 "ClassD Left", "ClassD Right", "ClassD Left Plus Right"};
958 static struct soc_enum
const sub_mux_enum
=
959 SOC_ENUM_SINGLE(R_AUDIOMUX3
, FB_AUDIOMUX3_SUBMUX
,
960 ARRAY_SIZE(sub_mux_txt
), sub_mux_txt
);
962 static struct snd_kcontrol_new
const sub_mux_dapm_enum
=
963 SOC_DAPM_ENUM("Sub Mux", sub_mux_enum
);
965 static struct soc_enum
const classd_mux_enum
=
966 SOC_ENUM_SINGLE(R_AUDIOMUX3
, FB_AUDIOMUX3_CLSSDMUX
,
967 ARRAY_SIZE(dai_mux_txt
), dai_mux_txt
);
969 static struct snd_kcontrol_new
const classd_mux_dapm_enum
=
970 SOC_DAPM_ENUM("ClassD Mux", classd_mux_enum
);
972 /* R_HSDCTL1 PG 1 ADDR 0x01 */
973 static char const * const jack_type_txt
[] = {
974 "3 Terminal", "4 Terminal"};
976 static struct soc_enum
const hp_jack_type_enum
=
977 SOC_ENUM_SINGLE(R_HSDCTL1
, FB_HSDCTL1_HPJKTYPE
,
978 ARRAY_SIZE(jack_type_txt
), jack_type_txt
);
980 static char const * const hs_det_pol_txt
[] = {
981 "Rising", "Falling"};
983 static struct soc_enum
const hs_det_pol_enum
=
984 SOC_ENUM_SINGLE(R_HSDCTL1
, FB_HSDCTL1_HSDETPOL
,
985 ARRAY_SIZE(hs_det_pol_txt
), hs_det_pol_txt
);
987 /* R_HSDCTL1 PG 1 ADDR 0x02 */
988 static char const * const hs_mic_bias_force_txt
[] = {
989 "Off", "Ring", "Sleeve"};
991 static struct soc_enum
const hs_mic_bias_force_enum
=
992 SOC_ENUM_SINGLE(R_HSDCTL2
, FB_HSDCTL2_FMICBIAS1
,
993 ARRAY_SIZE(hs_mic_bias_force_txt
),
994 hs_mic_bias_force_txt
);
996 static char const * const plug_type_txt
[] = {
997 "OMTP", "CTIA", "Reserved", "Headphone"};
999 static struct soc_enum
const plug_type_force_enum
=
1000 SOC_ENUM_SINGLE(R_HSDCTL2
, FB_HSDCTL2_FPLUGTYPE
,
1001 ARRAY_SIZE(plug_type_txt
), plug_type_txt
);
1004 /* R_CH0AIC PG 1 ADDR 0x06 */
1005 static char const * const in_bst_mux_txt
[] = {
1006 "Input 1", "Input 2", "Input 3", "D2S"};
1008 static struct soc_enum
const in_bst_mux_ch0_enum
=
1009 SOC_ENUM_SINGLE(R_CH0AIC
, FB_CH0AIC_INSELL
,
1010 ARRAY_SIZE(in_bst_mux_txt
),
1012 static struct snd_kcontrol_new
const in_bst_mux_ch0_dapm_enum
=
1013 SOC_DAPM_ENUM("Input Boost Channel 0 Enum",
1014 in_bst_mux_ch0_enum
);
1016 static DECLARE_TLV_DB_SCALE(in_bst_vol_tlv_arr
, 0, 1000, 0);
1018 static char const * const adc_mux_txt
[] = {
1019 "Input 1 Boost Bypass", "Input 2 Boost Bypass",
1020 "Input 3 Boost Bypass", "Input Boost"};
1022 static struct soc_enum
const adc_mux_ch0_enum
=
1023 SOC_ENUM_SINGLE(R_CH0AIC
, FB_CH0AIC_LADCIN
,
1024 ARRAY_SIZE(adc_mux_txt
), adc_mux_txt
);
1025 static struct snd_kcontrol_new
const adc_mux_ch0_dapm_enum
=
1026 SOC_DAPM_ENUM("ADC Channel 0 Enum", adc_mux_ch0_enum
);
1028 static char const * const in_proc_mux_txt
[] = {
1031 static struct soc_enum
const in_proc_ch0_enum
=
1032 SOC_ENUM_SINGLE(R_CH0AIC
, FB_CH0AIC_IPCH0S
,
1033 ARRAY_SIZE(in_proc_mux_txt
), in_proc_mux_txt
);
1034 static struct snd_kcontrol_new
const in_proc_mux_ch0_dapm_enum
=
1035 SOC_DAPM_ENUM("Input Processor Channel 0 Enum",
1038 /* R_CH1AIC PG 1 ADDR 0x07 */
1039 static struct soc_enum
const in_bst_mux_ch1_enum
=
1040 SOC_ENUM_SINGLE(R_CH1AIC
, FB_CH1AIC_INSELR
,
1041 ARRAY_SIZE(in_bst_mux_txt
),
1043 static struct snd_kcontrol_new
const in_bst_mux_ch1_dapm_enum
=
1044 SOC_DAPM_ENUM("Input Boost Channel 1 Enum",
1045 in_bst_mux_ch1_enum
);
1047 static struct soc_enum
const adc_mux_ch1_enum
=
1048 SOC_ENUM_SINGLE(R_CH1AIC
, FB_CH1AIC_RADCIN
,
1049 ARRAY_SIZE(adc_mux_txt
), adc_mux_txt
);
1050 static struct snd_kcontrol_new
const adc_mux_ch1_dapm_enum
=
1051 SOC_DAPM_ENUM("ADC Channel 1 Enum", adc_mux_ch1_enum
);
1053 static struct soc_enum
const in_proc_ch1_enum
=
1054 SOC_ENUM_SINGLE(R_CH1AIC
, FB_CH1AIC_IPCH1S
,
1055 ARRAY_SIZE(in_proc_mux_txt
), in_proc_mux_txt
);
1056 static struct snd_kcontrol_new
const in_proc_mux_ch1_dapm_enum
=
1057 SOC_DAPM_ENUM("Input Processor Channel 1 Enum",
1060 /* R_ICTL0 PG 1 ADDR 0x0A */
1061 static char const * const pol_txt
[] = {
1062 "Normal", "Invert"};
1064 static struct soc_enum
const in_pol_ch1_enum
=
1065 SOC_ENUM_SINGLE(R_ICTL0
, FB_ICTL0_IN0POL
,
1066 ARRAY_SIZE(pol_txt
), pol_txt
);
1068 static struct soc_enum
const in_pol_ch0_enum
=
1069 SOC_ENUM_SINGLE(R_ICTL0
, FB_ICTL0_IN1POL
,
1070 ARRAY_SIZE(pol_txt
), pol_txt
);
1072 static char const * const in_proc_ch_sel_txt
[] = {
1073 "Normal", "Mono Mix to Channel 0",
1074 "Mono Mix to Channel 1", "Add"};
1076 static struct soc_enum
const in_proc_ch01_sel_enum
=
1077 SOC_ENUM_SINGLE(R_ICTL0
, FB_ICTL0_INPCH10SEL
,
1078 ARRAY_SIZE(in_proc_ch_sel_txt
),
1079 in_proc_ch_sel_txt
);
1081 /* R_ICTL1 PG 1 ADDR 0x0B */
1082 static struct soc_enum
const in_pol_ch3_enum
=
1083 SOC_ENUM_SINGLE(R_ICTL1
, FB_ICTL1_IN2POL
,
1084 ARRAY_SIZE(pol_txt
), pol_txt
);
1086 static struct soc_enum
const in_pol_ch2_enum
=
1087 SOC_ENUM_SINGLE(R_ICTL1
, FB_ICTL1_IN3POL
,
1088 ARRAY_SIZE(pol_txt
), pol_txt
);
1090 static struct soc_enum
const in_proc_ch23_sel_enum
=
1091 SOC_ENUM_SINGLE(R_ICTL1
, FB_ICTL1_INPCH32SEL
,
1092 ARRAY_SIZE(in_proc_ch_sel_txt
),
1093 in_proc_ch_sel_txt
);
1095 /* R_MICBIAS PG 1 ADDR 0x0C */
1096 static char const * const mic_bias_txt
[] = {
1097 "2.5V", "2.1V", "1.8V", "Vdd"};
1099 static struct soc_enum
const mic_bias_2_enum
=
1100 SOC_ENUM_SINGLE(R_MICBIAS
, FB_MICBIAS_MICBOV2
,
1101 ARRAY_SIZE(mic_bias_txt
), mic_bias_txt
);
1103 static struct soc_enum
const mic_bias_1_enum
=
1104 SOC_ENUM_SINGLE(R_MICBIAS
, FB_MICBIAS_MICBOV1
,
1105 ARRAY_SIZE(mic_bias_txt
), mic_bias_txt
);
1107 /* R_PGACTL0 PG 1 ADDR 0x0D */
1108 /* R_PGACTL1 PG 1 ADDR 0x0E */
1109 /* R_PGACTL2 PG 1 ADDR 0x0F */
1110 /* R_PGACTL3 PG 1 ADDR 0x10 */
1111 static DECLARE_TLV_DB_SCALE(in_pga_vol_tlv_arr
, -1725, 75, 0);
1113 /* R_ICH0VOL PG1 ADDR 0x12 */
1114 /* R_ICH1VOL PG1 ADDR 0x13 */
1115 /* R_ICH2VOL PG1 ADDR 0x14 */
1116 /* R_ICH3VOL PG1 ADDR 0x15 */
1117 static DECLARE_TLV_DB_MINMAX(in_vol_tlv_arr
, -7125, 2400);
1119 /* R_ASRCILVOL PG1 ADDR 0x16 */
1120 /* R_ASRCIRVOL PG1 ADDR 0x17 */
1121 /* R_ASRCOLVOL PG1 ADDR 0x18 */
1122 /* R_ASRCORVOL PG1 ADDR 0x19 */
1123 static DECLARE_TLV_DB_MINMAX(asrc_vol_tlv_arr
, -9562, 600);
1125 /* R_ALCCTL0 PG1 ADDR 0x1D */
1126 static char const * const alc_mode_txt
[] = {
1129 static struct soc_enum
const alc_mode_enum
=
1130 SOC_ENUM_SINGLE(R_ALCCTL0
, FB_ALCCTL0_ALCMODE
,
1131 ARRAY_SIZE(alc_mode_txt
), alc_mode_txt
);
1133 static char const * const alc_ref_text
[] = {
1134 "Channel 0", "Channel 1", "Channel 2", "Channel 3", "Peak"};
1136 static struct soc_enum
const alc_ref_enum
=
1137 SOC_ENUM_SINGLE(R_ALCCTL0
, FB_ALCCTL0_ALCREF
,
1138 ARRAY_SIZE(alc_ref_text
), alc_ref_text
);
1140 /* R_ALCCTL1 PG 1 ADDR 0x1E */
1141 static DECLARE_TLV_DB_SCALE(alc_max_gain_tlv_arr
, -1200, 600, 0);
1142 static DECLARE_TLV_DB_SCALE(alc_target_tlv_arr
, -2850, 150, 0);
1144 /* R_ALCCTL2 PG 1 ADDR 0x1F */
1145 static DECLARE_TLV_DB_SCALE(alc_min_gain_tlv_arr
, -1725, 600, 0);
1147 /* R_NGATE PG 1 ADDR 0x21 */
1148 static DECLARE_TLV_DB_SCALE(ngth_tlv_arr
, -7650, 150, 0);
1150 static char const * const ngate_type_txt
[] = {
1151 "PGA Constant", "ADC Mute"};
1153 static struct soc_enum
const ngate_type_enum
=
1154 SOC_ENUM_SINGLE(R_NGATE
, FB_NGATE_NGG
,
1155 ARRAY_SIZE(ngate_type_txt
), ngate_type_txt
);
1157 /* R_DMICCTL PG 1 ADDR 0x22 */
1158 static char const * const dmic_mono_sel_txt
[] = {
1161 static struct soc_enum
const dmic_mono_sel_enum
=
1162 SOC_ENUM_SINGLE(R_DMICCTL
, FB_DMICCTL_DMONO
,
1163 ARRAY_SIZE(dmic_mono_sel_txt
), dmic_mono_sel_txt
);
1165 /* R_DACCTL PG 2 ADDR 0x01 */
1166 static struct soc_enum
const dac_pol_r_enum
=
1167 SOC_ENUM_SINGLE(R_DACCTL
, FB_DACCTL_DACPOLR
,
1168 ARRAY_SIZE(pol_txt
), pol_txt
);
1170 static struct soc_enum
const dac_pol_l_enum
=
1171 SOC_ENUM_SINGLE(R_DACCTL
, FB_DACCTL_DACPOLL
,
1172 ARRAY_SIZE(pol_txt
), pol_txt
);
1174 static char const * const dac_dith_txt
[] = {
1175 "Half", "Full", "Disabled", "Static"};
1177 static struct soc_enum
const dac_dith_enum
=
1178 SOC_ENUM_SINGLE(R_DACCTL
, FB_DACCTL_DACDITH
,
1179 ARRAY_SIZE(dac_dith_txt
), dac_dith_txt
);
1181 /* R_SPKCTL PG 2 ADDR 0x02 */
1182 static struct soc_enum
const spk_pol_r_enum
=
1183 SOC_ENUM_SINGLE(R_SPKCTL
, FB_SPKCTL_SPKPOLR
,
1184 ARRAY_SIZE(pol_txt
), pol_txt
);
1186 static struct soc_enum
const spk_pol_l_enum
=
1187 SOC_ENUM_SINGLE(R_SPKCTL
, FB_SPKCTL_SPKPOLL
,
1188 ARRAY_SIZE(pol_txt
), pol_txt
);
1190 /* R_SUBCTL PG 2 ADDR 0x03 */
1191 static struct soc_enum
const sub_pol_enum
=
1192 SOC_ENUM_SINGLE(R_SUBCTL
, FB_SUBCTL_SUBPOL
,
1193 ARRAY_SIZE(pol_txt
), pol_txt
);
1195 /* R_MVOLL PG 2 ADDR 0x08 */
1196 /* R_MVOLR PG 2 ADDR 0x09 */
1197 static DECLARE_TLV_DB_MINMAX(mvol_tlv_arr
, -9562, 0);
1199 /* R_HPVOLL PG 2 ADDR 0x0A */
1200 /* R_HPVOLR PG 2 ADDR 0x0B */
1201 static DECLARE_TLV_DB_SCALE(hp_vol_tlv_arr
, -8850, 75, 0);
1203 /* R_SPKVOLL PG 2 ADDR 0x0C */
1204 /* R_SPKVOLR PG 2 ADDR 0x0D */
1205 static DECLARE_TLV_DB_SCALE(spk_vol_tlv_arr
, -7725, 75, 0);
1207 /* R_SPKEQFILT PG 3 ADDR 0x01 */
1208 static char const * const eq_txt
[] = {
1210 "Pre Scale + EQ Band 0",
1211 "Pre Scale + EQ Band 0 - 1",
1212 "Pre Scale + EQ Band 0 - 2",
1213 "Pre Scale + EQ Band 0 - 3",
1214 "Pre Scale + EQ Band 0 - 4",
1215 "Pre Scale + EQ Band 0 - 5",
1218 static struct soc_enum
const spk_eq_enums
[] = {
1219 SOC_ENUM_SINGLE(R_SPKEQFILT
, FB_SPKEQFILT_EQ2BE
,
1220 ARRAY_SIZE(eq_txt
), eq_txt
),
1221 SOC_ENUM_SINGLE(R_SPKEQFILT
, FB_SPKEQFILT_EQ1BE
,
1222 ARRAY_SIZE(eq_txt
), eq_txt
),
1225 /* R_SPKMBCCTL PG 3 ADDR 0x0B */
1226 static char const * const lvl_mode_txt
[] = {
1229 static struct soc_enum
const spk_mbc3_lvl_det_mode_enum
=
1230 SOC_ENUM_SINGLE(R_SPKMBCCTL
, FB_SPKMBCCTL_LVLMODE3
,
1231 ARRAY_SIZE(lvl_mode_txt
), lvl_mode_txt
);
1233 static char const * const win_sel_txt
[] = {
1236 static struct soc_enum
const spk_mbc3_win_sel_enum
=
1237 SOC_ENUM_SINGLE(R_SPKMBCCTL
, FB_SPKMBCCTL_WINSEL3
,
1238 ARRAY_SIZE(win_sel_txt
), win_sel_txt
);
1240 static struct soc_enum
const spk_mbc2_lvl_det_mode_enum
=
1241 SOC_ENUM_SINGLE(R_SPKMBCCTL
, FB_SPKMBCCTL_LVLMODE2
,
1242 ARRAY_SIZE(lvl_mode_txt
), lvl_mode_txt
);
1244 static struct soc_enum
const spk_mbc2_win_sel_enum
=
1245 SOC_ENUM_SINGLE(R_SPKMBCCTL
, FB_SPKMBCCTL_WINSEL2
,
1246 ARRAY_SIZE(win_sel_txt
), win_sel_txt
);
1248 static struct soc_enum
const spk_mbc1_lvl_det_mode_enum
=
1249 SOC_ENUM_SINGLE(R_SPKMBCCTL
, FB_SPKMBCCTL_LVLMODE1
,
1250 ARRAY_SIZE(lvl_mode_txt
), lvl_mode_txt
);
1252 static struct soc_enum
const spk_mbc1_win_sel_enum
=
1253 SOC_ENUM_SINGLE(R_SPKMBCCTL
, FB_SPKMBCCTL_WINSEL1
,
1254 ARRAY_SIZE(win_sel_txt
), win_sel_txt
);
1256 /* R_SPKMBCMUG1 PG 3 ADDR 0x0C */
1257 static struct soc_enum
const spk_mbc1_phase_pol_enum
=
1258 SOC_ENUM_SINGLE(R_SPKMBCMUG1
, FB_SPKMBCMUG_PHASE
,
1259 ARRAY_SIZE(pol_txt
), pol_txt
);
1261 static DECLARE_TLV_DB_MINMAX(mbc_mug_tlv_arr
, -4650, 0);
1263 /* R_SPKMBCTHR1 PG 3 ADDR 0x0D */
1264 static DECLARE_TLV_DB_MINMAX(thr_tlv_arr
, -9562, 0);
1266 /* R_SPKMBCRAT1 PG 3 ADDR 0x0E */
1267 static char const * const comp_rat_txt
[] = {
1268 "Reserved", "1.5:1", "2:1", "3:1", "4:1", "5:1", "6:1",
1269 "7:1", "8:1", "9:1", "10:1", "11:1", "12:1", "13:1", "14:1",
1270 "15:1", "16:1", "17:1", "18:1", "19:1", "20:1"};
1272 static struct soc_enum
const spk_mbc1_comp_rat_enum
=
1273 SOC_ENUM_SINGLE(R_SPKMBCRAT1
, FB_SPKMBCRAT_RATIO
,
1274 ARRAY_SIZE(comp_rat_txt
), comp_rat_txt
);
1276 /* R_SPKMBCMUG2 PG 3 ADDR 0x13 */
1277 static struct soc_enum
const spk_mbc2_phase_pol_enum
=
1278 SOC_ENUM_SINGLE(R_SPKMBCMUG2
, FB_SPKMBCMUG_PHASE
,
1279 ARRAY_SIZE(pol_txt
), pol_txt
);
1281 /* R_SPKMBCRAT2 PG 3 ADDR 0x15 */
1282 static struct soc_enum
const spk_mbc2_comp_rat_enum
=
1283 SOC_ENUM_SINGLE(R_SPKMBCRAT2
, FB_SPKMBCRAT_RATIO
,
1284 ARRAY_SIZE(comp_rat_txt
), comp_rat_txt
);
1286 /* R_SPKMBCMUG3 PG 3 ADDR 0x1A */
1287 static struct soc_enum
const spk_mbc3_phase_pol_enum
=
1288 SOC_ENUM_SINGLE(R_SPKMBCMUG3
, FB_SPKMBCMUG_PHASE
,
1289 ARRAY_SIZE(pol_txt
), pol_txt
);
1291 /* R_SPKMBCRAT3 PG 3 ADDR 0x1C */
1292 static struct soc_enum
const spk_mbc3_comp_rat_enum
=
1293 SOC_ENUM_SINGLE(R_SPKMBCRAT3
, FB_SPKMBCRAT_RATIO
,
1294 ARRAY_SIZE(comp_rat_txt
), comp_rat_txt
);
1296 /* R_SPKCLECTL PG 3 ADDR 0x21 */
1297 static struct soc_enum
const spk_cle_lvl_mode_enum
=
1298 SOC_ENUM_SINGLE(R_SPKCLECTL
, FB_SPKCLECTL_LVLMODE
,
1299 ARRAY_SIZE(lvl_mode_txt
), lvl_mode_txt
);
1301 static struct soc_enum
const spk_cle_win_sel_enum
=
1302 SOC_ENUM_SINGLE(R_SPKCLECTL
, FB_SPKCLECTL_WINSEL
,
1303 ARRAY_SIZE(win_sel_txt
), win_sel_txt
);
1305 /* R_SPKCLEMUG PG 3 ADDR 0x22 */
1306 static DECLARE_TLV_DB_MINMAX(cle_mug_tlv_arr
, 0, 4650);
1308 /* R_SPKCOMPRAT PG 3 ADDR 0x24 */
1309 static struct soc_enum
const spk_comp_rat_enum
=
1310 SOC_ENUM_SINGLE(R_SPKCOMPRAT
, FB_SPKCOMPRAT_RATIO
,
1311 ARRAY_SIZE(comp_rat_txt
), comp_rat_txt
);
1313 /* R_SPKEXPTHR PG 3 ADDR 0x2F */
1314 static char const * const exp_rat_txt
[] = {
1315 "Reserved", "Reserved", "1:2", "1:3",
1316 "1:4", "1:5", "1:6", "1:7"};
1318 static struct soc_enum
const spk_exp_rat_enum
=
1319 SOC_ENUM_SINGLE(R_SPKEXPRAT
, FB_SPKEXPRAT_RATIO
,
1320 ARRAY_SIZE(exp_rat_txt
), exp_rat_txt
);
1322 /* R_DACEQFILT PG 4 ADDR 0x01 */
1323 static struct soc_enum
const dac_eq_enums
[] = {
1324 SOC_ENUM_SINGLE(R_DACEQFILT
, FB_DACEQFILT_EQ2BE
,
1325 ARRAY_SIZE(eq_txt
), eq_txt
),
1326 SOC_ENUM_SINGLE(R_DACEQFILT
, FB_DACEQFILT_EQ1BE
,
1327 ARRAY_SIZE(eq_txt
), eq_txt
),
1330 /* R_DACMBCCTL PG 4 ADDR 0x0B */
1331 static struct soc_enum
const dac_mbc3_lvl_det_mode_enum
=
1332 SOC_ENUM_SINGLE(R_DACMBCCTL
, FB_DACMBCCTL_LVLMODE3
,
1333 ARRAY_SIZE(lvl_mode_txt
), lvl_mode_txt
);
1335 static struct soc_enum
const dac_mbc3_win_sel_enum
=
1336 SOC_ENUM_SINGLE(R_DACMBCCTL
, FB_DACMBCCTL_WINSEL3
,
1337 ARRAY_SIZE(win_sel_txt
), win_sel_txt
);
1339 static struct soc_enum
const dac_mbc2_lvl_det_mode_enum
=
1340 SOC_ENUM_SINGLE(R_DACMBCCTL
, FB_DACMBCCTL_LVLMODE2
,
1341 ARRAY_SIZE(lvl_mode_txt
), lvl_mode_txt
);
1343 static struct soc_enum
const dac_mbc2_win_sel_enum
=
1344 SOC_ENUM_SINGLE(R_DACMBCCTL
, FB_DACMBCCTL_WINSEL2
,
1345 ARRAY_SIZE(win_sel_txt
), win_sel_txt
);
1347 static struct soc_enum
const dac_mbc1_lvl_det_mode_enum
=
1348 SOC_ENUM_SINGLE(R_DACMBCCTL
, FB_DACMBCCTL_LVLMODE1
,
1349 ARRAY_SIZE(lvl_mode_txt
), lvl_mode_txt
);
1351 static struct soc_enum
const dac_mbc1_win_sel_enum
=
1352 SOC_ENUM_SINGLE(R_DACMBCCTL
, FB_DACMBCCTL_WINSEL1
,
1353 ARRAY_SIZE(win_sel_txt
), win_sel_txt
);
1355 /* R_DACMBCMUG1 PG 4 ADDR 0x0C */
1356 static struct soc_enum
const dac_mbc1_phase_pol_enum
=
1357 SOC_ENUM_SINGLE(R_DACMBCMUG1
, FB_DACMBCMUG_PHASE
,
1358 ARRAY_SIZE(pol_txt
), pol_txt
);
1360 /* R_DACMBCRAT1 PG 4 ADDR 0x0E */
1361 static struct soc_enum
const dac_mbc1_comp_rat_enum
=
1362 SOC_ENUM_SINGLE(R_DACMBCRAT1
, FB_DACMBCRAT_RATIO
,
1363 ARRAY_SIZE(comp_rat_txt
), comp_rat_txt
);
1365 /* R_DACMBCMUG2 PG 4 ADDR 0x13 */
1366 static struct soc_enum
const dac_mbc2_phase_pol_enum
=
1367 SOC_ENUM_SINGLE(R_DACMBCMUG2
, FB_DACMBCMUG_PHASE
,
1368 ARRAY_SIZE(pol_txt
), pol_txt
);
1370 /* R_DACMBCRAT2 PG 4 ADDR 0x15 */
1371 static struct soc_enum
const dac_mbc2_comp_rat_enum
=
1372 SOC_ENUM_SINGLE(R_DACMBCRAT2
, FB_DACMBCRAT_RATIO
,
1373 ARRAY_SIZE(comp_rat_txt
), comp_rat_txt
);
1375 /* R_DACMBCMUG3 PG 4 ADDR 0x1A */
1376 static struct soc_enum
const dac_mbc3_phase_pol_enum
=
1377 SOC_ENUM_SINGLE(R_DACMBCMUG3
, FB_DACMBCMUG_PHASE
,
1378 ARRAY_SIZE(pol_txt
), pol_txt
);
1380 /* R_DACMBCRAT3 PG 4 ADDR 0x1C */
1381 static struct soc_enum
const dac_mbc3_comp_rat_enum
=
1382 SOC_ENUM_SINGLE(R_DACMBCRAT3
, FB_DACMBCRAT_RATIO
,
1383 ARRAY_SIZE(comp_rat_txt
), comp_rat_txt
);
1385 /* R_DACCLECTL PG 4 ADDR 0x21 */
1386 static struct soc_enum
const dac_cle_lvl_mode_enum
=
1387 SOC_ENUM_SINGLE(R_DACCLECTL
, FB_DACCLECTL_LVLMODE
,
1388 ARRAY_SIZE(lvl_mode_txt
), lvl_mode_txt
);
1390 static struct soc_enum
const dac_cle_win_sel_enum
=
1391 SOC_ENUM_SINGLE(R_DACCLECTL
, FB_DACCLECTL_WINSEL
,
1392 ARRAY_SIZE(win_sel_txt
), win_sel_txt
);
1394 /* R_DACCOMPRAT PG 4 ADDR 0x24 */
1395 static struct soc_enum
const dac_comp_rat_enum
=
1396 SOC_ENUM_SINGLE(R_DACCOMPRAT
, FB_DACCOMPRAT_RATIO
,
1397 ARRAY_SIZE(comp_rat_txt
), comp_rat_txt
);
1399 /* R_DACEXPRAT PG 4 ADDR 0x30 */
1400 static struct soc_enum
const dac_exp_rat_enum
=
1401 SOC_ENUM_SINGLE(R_DACEXPRAT
, FB_DACEXPRAT_RATIO
,
1402 ARRAY_SIZE(exp_rat_txt
), exp_rat_txt
);
1404 /* R_SUBEQFILT PG 5 ADDR 0x01 */
1405 static struct soc_enum
const sub_eq_enums
[] = {
1406 SOC_ENUM_SINGLE(R_SUBEQFILT
, FB_SUBEQFILT_EQ2BE
,
1407 ARRAY_SIZE(eq_txt
), eq_txt
),
1408 SOC_ENUM_SINGLE(R_SUBEQFILT
, FB_SUBEQFILT_EQ1BE
,
1409 ARRAY_SIZE(eq_txt
), eq_txt
),
1412 /* R_SUBMBCCTL PG 5 ADDR 0x0B */
1413 static struct soc_enum
const sub_mbc3_lvl_det_mode_enum
=
1414 SOC_ENUM_SINGLE(R_SUBMBCCTL
, FB_SUBMBCCTL_LVLMODE3
,
1415 ARRAY_SIZE(lvl_mode_txt
), lvl_mode_txt
);
1417 static struct soc_enum
const sub_mbc3_win_sel_enum
=
1418 SOC_ENUM_SINGLE(R_SUBMBCCTL
, FB_SUBMBCCTL_WINSEL3
,
1419 ARRAY_SIZE(win_sel_txt
), win_sel_txt
);
1421 static struct soc_enum
const sub_mbc2_lvl_det_mode_enum
=
1422 SOC_ENUM_SINGLE(R_SUBMBCCTL
, FB_SUBMBCCTL_LVLMODE2
,
1423 ARRAY_SIZE(lvl_mode_txt
), lvl_mode_txt
);
1425 static struct soc_enum
const sub_mbc2_win_sel_enum
=
1426 SOC_ENUM_SINGLE(R_SUBMBCCTL
, FB_SUBMBCCTL_WINSEL2
,
1427 ARRAY_SIZE(win_sel_txt
), win_sel_txt
);
1429 static struct soc_enum
const sub_mbc1_lvl_det_mode_enum
=
1430 SOC_ENUM_SINGLE(R_SUBMBCCTL
, FB_SUBMBCCTL_LVLMODE1
,
1431 ARRAY_SIZE(lvl_mode_txt
), lvl_mode_txt
);
1433 static struct soc_enum
const sub_mbc1_win_sel_enum
=
1434 SOC_ENUM_SINGLE(R_SUBMBCCTL
, FB_SUBMBCCTL_WINSEL1
,
1435 ARRAY_SIZE(win_sel_txt
), win_sel_txt
);
1437 /* R_SUBMBCMUG1 PG 5 ADDR 0x0C */
1438 static struct soc_enum
const sub_mbc1_phase_pol_enum
=
1439 SOC_ENUM_SINGLE(R_SUBMBCMUG1
, FB_SUBMBCMUG_PHASE
,
1440 ARRAY_SIZE(pol_txt
), pol_txt
);
1442 /* R_SUBMBCRAT1 PG 5 ADDR 0x0E */
1443 static struct soc_enum
const sub_mbc1_comp_rat_enum
=
1444 SOC_ENUM_SINGLE(R_SUBMBCRAT1
, FB_SUBMBCRAT_RATIO
,
1445 ARRAY_SIZE(comp_rat_txt
), comp_rat_txt
);
1447 /* R_SUBMBCMUG2 PG 5 ADDR 0x13 */
1448 static struct soc_enum
const sub_mbc2_phase_pol_enum
=
1449 SOC_ENUM_SINGLE(R_SUBMBCMUG2
, FB_SUBMBCMUG_PHASE
,
1450 ARRAY_SIZE(pol_txt
), pol_txt
);
1452 /* R_SUBMBCRAT2 PG 5 ADDR 0x15 */
1453 static struct soc_enum
const sub_mbc2_comp_rat_enum
=
1454 SOC_ENUM_SINGLE(R_SUBMBCRAT2
, FB_SUBMBCRAT_RATIO
,
1455 ARRAY_SIZE(comp_rat_txt
), comp_rat_txt
);
1457 /* R_SUBMBCMUG3 PG 5 ADDR 0x1A */
1458 static struct soc_enum
const sub_mbc3_phase_pol_enum
=
1459 SOC_ENUM_SINGLE(R_SUBMBCMUG3
, FB_SUBMBCMUG_PHASE
,
1460 ARRAY_SIZE(pol_txt
), pol_txt
);
1462 /* R_SUBMBCRAT3 PG 5 ADDR 0x1C */
1463 static struct soc_enum
const sub_mbc3_comp_rat_enum
=
1464 SOC_ENUM_SINGLE(R_SUBMBCRAT3
, FB_SUBMBCRAT_RATIO
,
1465 ARRAY_SIZE(comp_rat_txt
), comp_rat_txt
);
1467 /* R_SUBCLECTL PG 5 ADDR 0x21 */
1468 static struct soc_enum
const sub_cle_lvl_mode_enum
=
1469 SOC_ENUM_SINGLE(R_SUBCLECTL
, FB_SUBCLECTL_LVLMODE
,
1470 ARRAY_SIZE(lvl_mode_txt
), lvl_mode_txt
);
1471 static struct soc_enum
const sub_cle_win_sel_enum
=
1472 SOC_ENUM_SINGLE(R_SUBCLECTL
, FB_SUBCLECTL_WINSEL
,
1473 ARRAY_SIZE(win_sel_txt
), win_sel_txt
);
1475 /* R_SUBCOMPRAT PG 5 ADDR 0x24 */
1476 static struct soc_enum
const sub_comp_rat_enum
=
1477 SOC_ENUM_SINGLE(R_SUBCOMPRAT
, FB_SUBCOMPRAT_RATIO
,
1478 ARRAY_SIZE(comp_rat_txt
), comp_rat_txt
);
1480 /* R_SUBEXPRAT PG 5 ADDR 0x30 */
1481 static struct soc_enum
const sub_exp_rat_enum
=
1482 SOC_ENUM_SINGLE(R_SUBEXPRAT
, FB_SUBEXPRAT_RATIO
,
1483 ARRAY_SIZE(exp_rat_txt
), exp_rat_txt
);
1485 static int bytes_info_ext(struct snd_kcontrol
*kcontrol
,
1486 struct snd_ctl_elem_info
*ucontrol
)
1488 struct coeff_ram_ctl
*ctl
=
1489 (struct coeff_ram_ctl
*)kcontrol
->private_value
;
1490 struct soc_bytes_ext
*params
= &ctl
->bytes_ext
;
1492 ucontrol
->type
= SNDRV_CTL_ELEM_TYPE_BYTES
;
1493 ucontrol
->count
= params
->max
;
1498 /* CH 0_1 Input Mux */
1499 static char const * const ch_0_1_mux_txt
[] = {"DAI 1", "TDM 0_1"};
1501 static struct soc_enum
const ch_0_1_mux_enum
=
1502 SOC_ENUM_SINGLE(SND_SOC_NOPM
, 0,
1503 ARRAY_SIZE(ch_0_1_mux_txt
), ch_0_1_mux_txt
);
1505 static struct snd_kcontrol_new
const ch_0_1_mux_dapm_enum
=
1506 SOC_DAPM_ENUM("CH 0_1 Input Mux", ch_0_1_mux_enum
);
1508 /* CH 2_3 Input Mux */
1509 static char const * const ch_2_3_mux_txt
[] = {"DAI 2", "TDM 2_3"};
1511 static struct soc_enum
const ch_2_3_mux_enum
=
1512 SOC_ENUM_SINGLE(SND_SOC_NOPM
, 0,
1513 ARRAY_SIZE(ch_2_3_mux_txt
), ch_2_3_mux_txt
);
1515 static struct snd_kcontrol_new
const ch_2_3_mux_dapm_enum
=
1516 SOC_DAPM_ENUM("CH 2_3 Input Mux", ch_2_3_mux_enum
);
1518 /* CH 4_5 Input Mux */
1519 static char const * const ch_4_5_mux_txt
[] = {"DAI 3", "TDM 4_5"};
1521 static struct soc_enum
const ch_4_5_mux_enum
=
1522 SOC_ENUM_SINGLE(SND_SOC_NOPM
, 0,
1523 ARRAY_SIZE(ch_4_5_mux_txt
), ch_4_5_mux_txt
);
1525 static struct snd_kcontrol_new
const ch_4_5_mux_dapm_enum
=
1526 SOC_DAPM_ENUM("CH 4_5 Input Mux", ch_4_5_mux_enum
);
1528 #define COEFF_RAM_CTL(xname, xcount, xaddr) \
1529 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
1530 .info = bytes_info_ext, \
1531 .get = coeff_ram_get, .put = coeff_ram_put, \
1532 .private_value = (unsigned long)&(struct coeff_ram_ctl) { \
1534 .bytes_ext = {.max = xcount, }, \
1538 static struct snd_kcontrol_new
const tscs454_snd_controls
[] = {
1539 /* R_PLLCTL PG 0 ADDR 0x15 */
1540 SOC_ENUM("PLL BCLK Input", bclk_sel_enum
),
1541 /* R_ISRC PG 0 ADDR 0x16 */
1542 SOC_ENUM("Internal Rate", isrc_br_enum
),
1543 SOC_ENUM("Internal Rate Multiple", isrc_bm_enum
),
1544 /* R_SCLKCTL PG 0 ADDR 0x18 */
1545 SOC_ENUM("ADC Modular Rate", adc_modular_rate_enum
),
1546 SOC_ENUM("DAC Modular Rate", dac_modular_rate_enum
),
1547 /* R_ASRC PG 0 ADDR 0x28 */
1548 SOC_SINGLE("ASRC Out High Bandwidth Switch",
1549 R_ASRC
, FB_ASRC_ASRCOBW
, 1, 0),
1550 SOC_SINGLE("ASRC In High Bandwidth Switch",
1551 R_ASRC
, FB_ASRC_ASRCIBW
, 1, 0),
1552 /* R_I2SIDCTL PG 0 ADDR 0x38 */
1553 SOC_ENUM("I2S 1 Data In Control", data_in_ctrl_enums
[0]),
1554 SOC_ENUM("I2S 2 Data In Control", data_in_ctrl_enums
[1]),
1555 SOC_ENUM("I2S 3 Data In Control", data_in_ctrl_enums
[2]),
1556 /* R_I2SODCTL PG 0 ADDR 0x39 */
1557 SOC_ENUM("I2S 1 Data Out Control", data_out_ctrl_enums
[0]),
1558 SOC_ENUM("I2S 2 Data Out Control", data_out_ctrl_enums
[1]),
1559 SOC_ENUM("I2S 3 Data Out Control", data_out_ctrl_enums
[2]),
1560 /* R_AUDIOMUX1 PG 0 ADDR 0x3A */
1561 SOC_ENUM("ASRC In", asrc_in_mux_enum
),
1562 /* R_AUDIOMUX2 PG 0 ADDR 0x3B */
1563 SOC_ENUM("ASRC Out", asrc_out_mux_enum
),
1564 /* R_HSDCTL1 PG 1 ADDR 0x01 */
1565 SOC_ENUM("Headphone Jack Type", hp_jack_type_enum
),
1566 SOC_ENUM("Headset Detection Polarity", hs_det_pol_enum
),
1567 SOC_SINGLE("Headphone Detection Switch",
1568 R_HSDCTL1
, FB_HSDCTL1_HPID_EN
, 1, 0),
1569 SOC_SINGLE("Headset OMTP/CTIA Switch",
1570 R_HSDCTL1
, FB_HSDCTL1_GBLHS_EN
, 1, 0),
1571 /* R_HSDCTL1 PG 1 ADDR 0x02 */
1572 SOC_ENUM("Headset Mic Bias Force", hs_mic_bias_force_enum
),
1573 SOC_SINGLE("Manual Mic Bias Switch",
1574 R_HSDCTL2
, FB_HSDCTL2_MB1MODE
, 1, 0),
1575 SOC_SINGLE("Ring/Sleeve Auto Switch",
1576 R_HSDCTL2
, FB_HSDCTL2_SWMODE
, 1, 0),
1577 SOC_ENUM("Manual Mode Plug Type", plug_type_force_enum
),
1578 /* R_CH0AIC PG 1 ADDR 0x06 */
1579 SOC_SINGLE_TLV("Input Boost Channel 0 Volume", R_CH0AIC
,
1580 FB_CHAIC_MICBST
, 0x3, 0, in_bst_vol_tlv_arr
),
1581 /* R_CH1AIC PG 1 ADDR 0x07 */
1582 SOC_SINGLE_TLV("Input Boost Channel 1 Volume", R_CH1AIC
,
1583 FB_CHAIC_MICBST
, 0x3, 0, in_bst_vol_tlv_arr
),
1584 /* R_CH2AIC PG 1 ADDR 0x08 */
1585 SOC_SINGLE_TLV("Input Boost Channel 2 Volume", R_CH2AIC
,
1586 FB_CHAIC_MICBST
, 0x3, 0, in_bst_vol_tlv_arr
),
1587 /* R_CH3AIC PG 1 ADDR 0x09 */
1588 SOC_SINGLE_TLV("Input Boost Channel 3 Volume", R_CH3AIC
,
1589 FB_CHAIC_MICBST
, 0x3, 0, in_bst_vol_tlv_arr
),
1590 /* R_ICTL0 PG 1 ADDR 0x0A */
1591 SOC_ENUM("Input Channel 1 Polarity", in_pol_ch1_enum
),
1592 SOC_ENUM("Input Channel 0 Polarity", in_pol_ch0_enum
),
1593 SOC_ENUM("Input Processor Channel 0/1 Operation",
1594 in_proc_ch01_sel_enum
),
1595 SOC_SINGLE("Input Channel 1 Mute Switch",
1596 R_ICTL0
, FB_ICTL0_IN1MUTE
, 1, 0),
1597 SOC_SINGLE("Input Channel 0 Mute Switch",
1598 R_ICTL0
, FB_ICTL0_IN0MUTE
, 1, 0),
1599 SOC_SINGLE("Input Channel 1 HPF Disable Switch",
1600 R_ICTL0
, FB_ICTL0_IN1HP
, 1, 0),
1601 SOC_SINGLE("Input Channel 0 HPF Disable Switch",
1602 R_ICTL0
, FB_ICTL0_IN0HP
, 1, 0),
1603 /* R_ICTL1 PG 1 ADDR 0x0B */
1604 SOC_ENUM("Input Channel 3 Polarity", in_pol_ch3_enum
),
1605 SOC_ENUM("Input Channel 2 Polarity", in_pol_ch2_enum
),
1606 SOC_ENUM("Input Processor Channel 2/3 Operation",
1607 in_proc_ch23_sel_enum
),
1608 SOC_SINGLE("Input Channel 3 Mute Switch",
1609 R_ICTL1
, FB_ICTL1_IN3MUTE
, 1, 0),
1610 SOC_SINGLE("Input Channel 2 Mute Switch",
1611 R_ICTL1
, FB_ICTL1_IN2MUTE
, 1, 0),
1612 SOC_SINGLE("Input Channel 3 HPF Disable Switch",
1613 R_ICTL1
, FB_ICTL1_IN3HP
, 1, 0),
1614 SOC_SINGLE("Input Channel 2 HPF Disable Switch",
1615 R_ICTL1
, FB_ICTL1_IN2HP
, 1, 0),
1616 /* R_MICBIAS PG 1 ADDR 0x0C */
1617 SOC_ENUM("Mic Bias 2 Voltage", mic_bias_2_enum
),
1618 SOC_ENUM("Mic Bias 1 Voltage", mic_bias_1_enum
),
1619 /* R_PGACTL0 PG 1 ADDR 0x0D */
1620 SOC_SINGLE("Input Channel 0 PGA Mute Switch",
1621 R_PGACTL0
, FB_PGACTL_PGAMUTE
, 1, 0),
1622 SOC_SINGLE_TLV("Input Channel 0 PGA Volume", R_PGACTL0
,
1624 FM_PGACTL_PGAVOL
, 0, in_pga_vol_tlv_arr
),
1625 /* R_PGACTL1 PG 1 ADDR 0x0E */
1626 SOC_SINGLE("Input Channel 1 PGA Mute Switch",
1627 R_PGACTL1
, FB_PGACTL_PGAMUTE
, 1, 0),
1628 SOC_SINGLE_TLV("Input Channel 1 PGA Volume", R_PGACTL1
,
1630 FM_PGACTL_PGAVOL
, 0, in_pga_vol_tlv_arr
),
1631 /* R_PGACTL2 PG 1 ADDR 0x0F */
1632 SOC_SINGLE("Input Channel 2 PGA Mute Switch",
1633 R_PGACTL2
, FB_PGACTL_PGAMUTE
, 1, 0),
1634 SOC_SINGLE_TLV("Input Channel 2 PGA Volume", R_PGACTL2
,
1636 FM_PGACTL_PGAVOL
, 0, in_pga_vol_tlv_arr
),
1637 /* R_PGACTL3 PG 1 ADDR 0x10 */
1638 SOC_SINGLE("Input Channel 3 PGA Mute Switch",
1639 R_PGACTL3
, FB_PGACTL_PGAMUTE
, 1, 0),
1640 SOC_SINGLE_TLV("Input Channel 3 PGA Volume", R_PGACTL3
,
1642 FM_PGACTL_PGAVOL
, 0, in_pga_vol_tlv_arr
),
1643 /* R_ICH0VOL PG 1 ADDR 0x12 */
1644 SOC_SINGLE_TLV("Input Channel 0 Volume", R_ICH0VOL
,
1645 FB_ICHVOL_ICHVOL
, FM_ICHVOL_ICHVOL
, 0, in_vol_tlv_arr
),
1646 /* R_ICH1VOL PG 1 ADDR 0x13 */
1647 SOC_SINGLE_TLV("Input Channel 1 Volume", R_ICH1VOL
,
1648 FB_ICHVOL_ICHVOL
, FM_ICHVOL_ICHVOL
, 0, in_vol_tlv_arr
),
1649 /* R_ICH2VOL PG 1 ADDR 0x14 */
1650 SOC_SINGLE_TLV("Input Channel 2 Volume", R_ICH2VOL
,
1651 FB_ICHVOL_ICHVOL
, FM_ICHVOL_ICHVOL
, 0, in_vol_tlv_arr
),
1652 /* R_ICH3VOL PG 1 ADDR 0x15 */
1653 SOC_SINGLE_TLV("Input Channel 3 Volume", R_ICH3VOL
,
1654 FB_ICHVOL_ICHVOL
, FM_ICHVOL_ICHVOL
, 0, in_vol_tlv_arr
),
1655 /* R_ASRCILVOL PG 1 ADDR 0x16 */
1656 SOC_SINGLE_TLV("ASRC Input Left Volume", R_ASRCILVOL
,
1657 FB_ASRCILVOL_ASRCILVOL
, FM_ASRCILVOL_ASRCILVOL
,
1658 0, asrc_vol_tlv_arr
),
1659 /* R_ASRCIRVOL PG 1 ADDR 0x17 */
1660 SOC_SINGLE_TLV("ASRC Input Right Volume", R_ASRCIRVOL
,
1661 FB_ASRCIRVOL_ASRCIRVOL
, FM_ASRCIRVOL_ASRCIRVOL
,
1662 0, asrc_vol_tlv_arr
),
1663 /* R_ASRCOLVOL PG 1 ADDR 0x18 */
1664 SOC_SINGLE_TLV("ASRC Output Left Volume", R_ASRCOLVOL
,
1665 FB_ASRCOLVOL_ASRCOLVOL
, FM_ASRCOLVOL_ASRCOLVOL
,
1666 0, asrc_vol_tlv_arr
),
1667 /* R_ASRCORVOL PG 1 ADDR 0x19 */
1668 SOC_SINGLE_TLV("ASRC Output Right Volume", R_ASRCORVOL
,
1669 FB_ASRCORVOL_ASRCOLVOL
, FM_ASRCORVOL_ASRCOLVOL
,
1670 0, asrc_vol_tlv_arr
),
1671 /* R_IVOLCTLU PG 1 ADDR 0x1C */
1672 /* R_ALCCTL0 PG 1 ADDR 0x1D */
1673 SOC_ENUM("ALC Mode", alc_mode_enum
),
1674 SOC_ENUM("ALC Reference", alc_ref_enum
),
1675 SOC_SINGLE("Input Channel 3 ALC Switch",
1676 R_ALCCTL0
, FB_ALCCTL0_ALCEN3
, 1, 0),
1677 SOC_SINGLE("Input Channel 2 ALC Switch",
1678 R_ALCCTL0
, FB_ALCCTL0_ALCEN2
, 1, 0),
1679 SOC_SINGLE("Input Channel 1 ALC Switch",
1680 R_ALCCTL0
, FB_ALCCTL0_ALCEN1
, 1, 0),
1681 SOC_SINGLE("Input Channel 0 ALC Switch",
1682 R_ALCCTL0
, FB_ALCCTL0_ALCEN0
, 1, 0),
1683 /* R_ALCCTL1 PG 1 ADDR 0x1E */
1684 SOC_SINGLE_TLV("ALC Max Gain Volume", R_ALCCTL1
,
1685 FB_ALCCTL1_MAXGAIN
, FM_ALCCTL1_MAXGAIN
,
1686 0, alc_max_gain_tlv_arr
),
1687 SOC_SINGLE_TLV("ALC Target Volume", R_ALCCTL1
,
1688 FB_ALCCTL1_ALCL
, FM_ALCCTL1_ALCL
,
1689 0, alc_target_tlv_arr
),
1690 /* R_ALCCTL2 PG 1 ADDR 0x1F */
1691 SOC_SINGLE("ALC Zero Cross Switch",
1692 R_ALCCTL2
, FB_ALCCTL2_ALCZC
, 1, 0),
1693 SOC_SINGLE_TLV("ALC Min Gain Volume", R_ALCCTL2
,
1694 FB_ALCCTL2_MINGAIN
, FM_ALCCTL2_MINGAIN
,
1695 0, alc_min_gain_tlv_arr
),
1696 SOC_SINGLE_RANGE("ALC Hold", R_ALCCTL2
,
1697 FB_ALCCTL2_HLD
, 0, FM_ALCCTL2_HLD
, 0),
1698 /* R_ALCCTL3 PG 1 ADDR 0x20 */
1699 SOC_SINGLE_RANGE("ALC Decay", R_ALCCTL3
,
1700 FB_ALCCTL3_DCY
, 0, FM_ALCCTL3_DCY
, 0),
1701 SOC_SINGLE_RANGE("ALC Attack", R_ALCCTL3
,
1702 FB_ALCCTL3_ATK
, 0, FM_ALCCTL3_ATK
, 0),
1703 /* R_NGATE PG 1 ADDR 0x21 */
1704 SOC_SINGLE_TLV("Noise Gate Threshold Volume", R_NGATE
,
1705 FB_NGATE_NGTH
, FM_NGATE_NGTH
, 0, ngth_tlv_arr
),
1706 SOC_ENUM("Noise Gate Type", ngate_type_enum
),
1707 SOC_SINGLE("Noise Gate Switch", R_NGATE
, FB_NGATE_NGAT
, 1, 0),
1708 /* R_DMICCTL PG 1 ADDR 0x22 */
1709 SOC_SINGLE("Digital Mic 2 Switch", R_DMICCTL
, FB_DMICCTL_DMIC2EN
, 1, 0),
1710 SOC_SINGLE("Digital Mic 1 Switch", R_DMICCTL
, FB_DMICCTL_DMIC1EN
, 1, 0),
1711 SOC_ENUM("Digital Mic Mono Select", dmic_mono_sel_enum
),
1712 /* R_DACCTL PG 2 ADDR 0x01 */
1713 SOC_ENUM("DAC Polarity Left", dac_pol_r_enum
),
1714 SOC_ENUM("DAC Polarity Right", dac_pol_l_enum
),
1715 SOC_ENUM("DAC Dither", dac_dith_enum
),
1716 SOC_SINGLE("DAC Mute Switch", R_DACCTL
, FB_DACCTL_DACMUTE
, 1, 0),
1717 SOC_SINGLE("DAC De-Emphasis Switch", R_DACCTL
, FB_DACCTL_DACDEM
, 1, 0),
1718 /* R_SPKCTL PG 2 ADDR 0x02 */
1719 SOC_ENUM("Speaker Polarity Right", spk_pol_r_enum
),
1720 SOC_ENUM("Speaker Polarity Left", spk_pol_l_enum
),
1721 SOC_SINGLE("Speaker Mute Switch", R_SPKCTL
, FB_SPKCTL_SPKMUTE
, 1, 0),
1722 SOC_SINGLE("Speaker De-Emphasis Switch",
1723 R_SPKCTL
, FB_SPKCTL_SPKDEM
, 1, 0),
1724 /* R_SUBCTL PG 2 ADDR 0x03 */
1725 SOC_ENUM("Sub Polarity", sub_pol_enum
),
1726 SOC_SINGLE("SUB Mute Switch", R_SUBCTL
, FB_SUBCTL_SUBMUTE
, 1, 0),
1727 SOC_SINGLE("Sub De-Emphasis Switch", R_SUBCTL
, FB_SUBCTL_SUBDEM
, 1, 0),
1728 /* R_DCCTL PG 2 ADDR 0x04 */
1729 SOC_SINGLE("Sub DC Removal Switch", R_DCCTL
, FB_DCCTL_SUBDCBYP
, 1, 1),
1730 SOC_SINGLE("DAC DC Removal Switch", R_DCCTL
, FB_DCCTL_DACDCBYP
, 1, 1),
1731 SOC_SINGLE("Speaker DC Removal Switch",
1732 R_DCCTL
, FB_DCCTL_SPKDCBYP
, 1, 1),
1733 SOC_SINGLE("DC Removal Coefficient Switch", R_DCCTL
, FB_DCCTL_DCCOEFSEL
,
1734 FM_DCCTL_DCCOEFSEL
, 0),
1735 /* R_OVOLCTLU PG 2 ADDR 0x06 */
1736 SOC_SINGLE("Output Fade Switch", R_OVOLCTLU
, FB_OVOLCTLU_OFADE
, 1, 0),
1737 /* R_MVOLL PG 2 ADDR 0x08 */
1738 /* R_MVOLR PG 2 ADDR 0x09 */
1739 SOC_DOUBLE_R_TLV("Master Volume", R_MVOLL
, R_MVOLR
,
1740 FB_MVOLL_MVOL_L
, FM_MVOLL_MVOL_L
, 0, mvol_tlv_arr
),
1741 /* R_HPVOLL PG 2 ADDR 0x0A */
1742 /* R_HPVOLR PG 2 ADDR 0x0B */
1743 SOC_DOUBLE_R_TLV("Headphone Volume", R_HPVOLL
, R_HPVOLR
,
1744 FB_HPVOLL_HPVOL_L
, FM_HPVOLL_HPVOL_L
, 0,
1746 /* R_SPKVOLL PG 2 ADDR 0x0C */
1747 /* R_SPKVOLR PG 2 ADDR 0x0D */
1748 SOC_DOUBLE_R_TLV("Speaker Volume", R_SPKVOLL
, R_SPKVOLR
,
1749 FB_SPKVOLL_SPKVOL_L
, FM_SPKVOLL_SPKVOL_L
, 0,
1751 /* R_SUBVOL PG 2 ADDR 0x10 */
1752 SOC_SINGLE_TLV("Sub Volume", R_SUBVOL
,
1753 FB_SUBVOL_SUBVOL
, FM_SUBVOL_SUBVOL
, 0, spk_vol_tlv_arr
),
1754 /* R_SPKEQFILT PG 3 ADDR 0x01 */
1755 SOC_SINGLE("Speaker EQ 2 Switch",
1756 R_SPKEQFILT
, FB_SPKEQFILT_EQ2EN
, 1, 0),
1757 SOC_ENUM("Speaker EQ 2 Band", spk_eq_enums
[0]),
1758 SOC_SINGLE("Speaker EQ 1 Switch",
1759 R_SPKEQFILT
, FB_SPKEQFILT_EQ1EN
, 1, 0),
1760 SOC_ENUM("Speaker EQ 1 Band", spk_eq_enums
[1]),
1761 /* R_SPKMBCEN PG 3 ADDR 0x0A */
1762 SOC_SINGLE("Speaker MBC 3 Switch",
1763 R_SPKMBCEN
, FB_SPKMBCEN_MBCEN3
, 1, 0),
1764 SOC_SINGLE("Speaker MBC 2 Switch",
1765 R_SPKMBCEN
, FB_SPKMBCEN_MBCEN2
, 1, 0),
1766 SOC_SINGLE("Speaker MBC 1 Switch",
1767 R_SPKMBCEN
, FB_SPKMBCEN_MBCEN1
, 1, 0),
1768 /* R_SPKMBCCTL PG 3 ADDR 0x0B */
1769 SOC_ENUM("Speaker MBC 3 Mode", spk_mbc3_lvl_det_mode_enum
),
1770 SOC_ENUM("Speaker MBC 3 Window", spk_mbc3_win_sel_enum
),
1771 SOC_ENUM("Speaker MBC 2 Mode", spk_mbc2_lvl_det_mode_enum
),
1772 SOC_ENUM("Speaker MBC 2 Window", spk_mbc2_win_sel_enum
),
1773 SOC_ENUM("Speaker MBC 1 Mode", spk_mbc1_lvl_det_mode_enum
),
1774 SOC_ENUM("Speaker MBC 1 Window", spk_mbc1_win_sel_enum
),
1775 /* R_SPKMBCMUG1 PG 3 ADDR 0x0C */
1776 SOC_ENUM("Speaker MBC 1 Phase Polarity", spk_mbc1_phase_pol_enum
),
1777 SOC_SINGLE_TLV("Speaker MBC1 Make-Up Gain Volume", R_SPKMBCMUG1
,
1778 FB_SPKMBCMUG_MUGAIN
, FM_SPKMBCMUG_MUGAIN
,
1779 0, mbc_mug_tlv_arr
),
1780 /* R_SPKMBCTHR1 PG 3 ADDR 0x0D */
1781 SOC_SINGLE_TLV("Speaker MBC 1 Compressor Threshold Volume",
1782 R_SPKMBCTHR1
, FB_SPKMBCTHR_THRESH
, FM_SPKMBCTHR_THRESH
,
1784 /* R_SPKMBCRAT1 PG 3 ADDR 0x0E */
1785 SOC_ENUM("Speaker MBC 1 Compressor Ratio", spk_mbc1_comp_rat_enum
),
1786 /* R_SPKMBCATK1L PG 3 ADDR 0x0F */
1787 /* R_SPKMBCATK1H PG 3 ADDR 0x10 */
1788 SND_SOC_BYTES("Speaker MBC 1 Attack", R_SPKMBCATK1L
, 2),
1789 /* R_SPKMBCREL1L PG 3 ADDR 0x11 */
1790 /* R_SPKMBCREL1H PG 3 ADDR 0x12 */
1791 SND_SOC_BYTES("Speaker MBC 1 Release", R_SPKMBCREL1L
, 2),
1792 /* R_SPKMBCMUG2 PG 3 ADDR 0x13 */
1793 SOC_ENUM("Speaker MBC 2 Phase Polarity", spk_mbc2_phase_pol_enum
),
1794 SOC_SINGLE_TLV("Speaker MBC2 Make-Up Gain Volume", R_SPKMBCMUG2
,
1795 FB_SPKMBCMUG_MUGAIN
, FM_SPKMBCMUG_MUGAIN
,
1796 0, mbc_mug_tlv_arr
),
1797 /* R_SPKMBCTHR2 PG 3 ADDR 0x14 */
1798 SOC_SINGLE_TLV("Speaker MBC 2 Compressor Threshold Volume",
1799 R_SPKMBCTHR2
, FB_SPKMBCTHR_THRESH
, FM_SPKMBCTHR_THRESH
,
1801 /* R_SPKMBCRAT2 PG 3 ADDR 0x15 */
1802 SOC_ENUM("Speaker MBC 2 Compressor Ratio", spk_mbc2_comp_rat_enum
),
1803 /* R_SPKMBCATK2L PG 3 ADDR 0x16 */
1804 /* R_SPKMBCATK2H PG 3 ADDR 0x17 */
1805 SND_SOC_BYTES("Speaker MBC 2 Attack", R_SPKMBCATK2L
, 2),
1806 /* R_SPKMBCREL2L PG 3 ADDR 0x18 */
1807 /* R_SPKMBCREL2H PG 3 ADDR 0x19 */
1808 SND_SOC_BYTES("Speaker MBC 2 Release", R_SPKMBCREL2L
, 2),
1809 /* R_SPKMBCMUG3 PG 3 ADDR 0x1A */
1810 SOC_ENUM("Speaker MBC 3 Phase Polarity", spk_mbc3_phase_pol_enum
),
1811 SOC_SINGLE_TLV("Speaker MBC 3 Make-Up Gain Volume", R_SPKMBCMUG3
,
1812 FB_SPKMBCMUG_MUGAIN
, FM_SPKMBCMUG_MUGAIN
,
1813 0, mbc_mug_tlv_arr
),
1814 /* R_SPKMBCTHR3 PG 3 ADDR 0x1B */
1815 SOC_SINGLE_TLV("Speaker MBC 3 Threshold Volume", R_SPKMBCTHR3
,
1816 FB_SPKMBCTHR_THRESH
, FM_SPKMBCTHR_THRESH
,
1818 /* R_SPKMBCRAT3 PG 3 ADDR 0x1C */
1819 SOC_ENUM("Speaker MBC 3 Compressor Ratio", spk_mbc3_comp_rat_enum
),
1820 /* R_SPKMBCATK3L PG 3 ADDR 0x1D */
1821 /* R_SPKMBCATK3H PG 3 ADDR 0x1E */
1822 SND_SOC_BYTES("Speaker MBC 3 Attack", R_SPKMBCATK3L
, 3),
1823 /* R_SPKMBCREL3L PG 3 ADDR 0x1F */
1824 /* R_SPKMBCREL3H PG 3 ADDR 0x20 */
1825 SND_SOC_BYTES("Speaker MBC 3 Release", R_SPKMBCREL3L
, 3),
1826 /* R_SPKCLECTL PG 3 ADDR 0x21 */
1827 SOC_ENUM("Speaker CLE Level Mode", spk_cle_lvl_mode_enum
),
1828 SOC_ENUM("Speaker CLE Window", spk_cle_win_sel_enum
),
1829 SOC_SINGLE("Speaker CLE Expander Switch",
1830 R_SPKCLECTL
, FB_SPKCLECTL_EXPEN
, 1, 0),
1831 SOC_SINGLE("Speaker CLE Limiter Switch",
1832 R_SPKCLECTL
, FB_SPKCLECTL_LIMEN
, 1, 0),
1833 SOC_SINGLE("Speaker CLE Compressor Switch",
1834 R_SPKCLECTL
, FB_SPKCLECTL_COMPEN
, 1, 0),
1835 /* R_SPKCLEMUG PG 3 ADDR 0x22 */
1836 SOC_SINGLE_TLV("Speaker CLE Make-Up Gain Volume", R_SPKCLEMUG
,
1837 FB_SPKCLEMUG_MUGAIN
, FM_SPKCLEMUG_MUGAIN
,
1838 0, cle_mug_tlv_arr
),
1839 /* R_SPKCOMPTHR PG 3 ADDR 0x23 */
1840 SOC_SINGLE_TLV("Speaker Compressor Threshold Volume", R_SPKCOMPTHR
,
1841 FB_SPKCOMPTHR_THRESH
, FM_SPKCOMPTHR_THRESH
,
1843 /* R_SPKCOMPRAT PG 3 ADDR 0x24 */
1844 SOC_ENUM("Speaker Compressor Ratio", spk_comp_rat_enum
),
1845 /* R_SPKCOMPATKL PG 3 ADDR 0x25 */
1846 /* R_SPKCOMPATKH PG 3 ADDR 0x26 */
1847 SND_SOC_BYTES("Speaker Compressor Attack", R_SPKCOMPATKL
, 2),
1848 /* R_SPKCOMPRELL PG 3 ADDR 0x27 */
1849 /* R_SPKCOMPRELH PG 3 ADDR 0x28 */
1850 SND_SOC_BYTES("Speaker Compressor Release", R_SPKCOMPRELL
, 2),
1851 /* R_SPKLIMTHR PG 3 ADDR 0x29 */
1852 SOC_SINGLE_TLV("Speaker Limiter Threshold Volume", R_SPKLIMTHR
,
1853 FB_SPKLIMTHR_THRESH
, FM_SPKLIMTHR_THRESH
,
1855 /* R_SPKLIMTGT PG 3 ADDR 0x2A */
1856 SOC_SINGLE_TLV("Speaker Limiter Target Volume", R_SPKLIMTGT
,
1857 FB_SPKLIMTGT_TARGET
, FM_SPKLIMTGT_TARGET
,
1859 /* R_SPKLIMATKL PG 3 ADDR 0x2B */
1860 /* R_SPKLIMATKH PG 3 ADDR 0x2C */
1861 SND_SOC_BYTES("Speaker Limiter Attack", R_SPKLIMATKL
, 2),
1862 /* R_SPKLIMRELL PG 3 ADDR 0x2D */
1863 /* R_SPKLIMRELR PG 3 ADDR 0x2E */
1864 SND_SOC_BYTES("Speaker Limiter Release", R_SPKLIMRELL
, 2),
1865 /* R_SPKEXPTHR PG 3 ADDR 0x2F */
1866 SOC_SINGLE_TLV("Speaker Expander Threshold Volume", R_SPKEXPTHR
,
1867 FB_SPKEXPTHR_THRESH
, FM_SPKEXPTHR_THRESH
,
1869 /* R_SPKEXPRAT PG 3 ADDR 0x30 */
1870 SOC_ENUM("Speaker Expander Ratio", spk_exp_rat_enum
),
1871 /* R_SPKEXPATKL PG 3 ADDR 0x31 */
1872 /* R_SPKEXPATKR PG 3 ADDR 0x32 */
1873 SND_SOC_BYTES("Speaker Expander Attack", R_SPKEXPATKL
, 2),
1874 /* R_SPKEXPRELL PG 3 ADDR 0x33 */
1875 /* R_SPKEXPRELR PG 3 ADDR 0x34 */
1876 SND_SOC_BYTES("Speaker Expander Release", R_SPKEXPRELL
, 2),
1877 /* R_SPKFXCTL PG 3 ADDR 0x35 */
1878 SOC_SINGLE("Speaker 3D Switch", R_SPKFXCTL
, FB_SPKFXCTL_3DEN
, 1, 0),
1879 SOC_SINGLE("Speaker Treble Enhancement Switch",
1880 R_SPKFXCTL
, FB_SPKFXCTL_TEEN
, 1, 0),
1881 SOC_SINGLE("Speaker Treble NLF Switch",
1882 R_SPKFXCTL
, FB_SPKFXCTL_TNLFBYP
, 1, 1),
1883 SOC_SINGLE("Speaker Bass Enhancement Switch",
1884 R_SPKFXCTL
, FB_SPKFXCTL_BEEN
, 1, 0),
1885 SOC_SINGLE("Speaker Bass NLF Switch",
1886 R_SPKFXCTL
, FB_SPKFXCTL_BNLFBYP
, 1, 1),
1887 /* R_DACEQFILT PG 4 ADDR 0x01 */
1888 SOC_SINGLE("DAC EQ 2 Switch",
1889 R_DACEQFILT
, FB_DACEQFILT_EQ2EN
, 1, 0),
1890 SOC_ENUM("DAC EQ 2 Band", dac_eq_enums
[0]),
1891 SOC_SINGLE("DAC EQ 1 Switch", R_DACEQFILT
, FB_DACEQFILT_EQ1EN
, 1, 0),
1892 SOC_ENUM("DAC EQ 1 Band", dac_eq_enums
[1]),
1893 /* R_DACMBCEN PG 4 ADDR 0x0A */
1894 SOC_SINGLE("DAC MBC 3 Switch", R_DACMBCEN
, FB_DACMBCEN_MBCEN3
, 1, 0),
1895 SOC_SINGLE("DAC MBC 2 Switch", R_DACMBCEN
, FB_DACMBCEN_MBCEN2
, 1, 0),
1896 SOC_SINGLE("DAC MBC 1 Switch", R_DACMBCEN
, FB_DACMBCEN_MBCEN1
, 1, 0),
1897 /* R_DACMBCCTL PG 4 ADDR 0x0B */
1898 SOC_ENUM("DAC MBC 3 Mode", dac_mbc3_lvl_det_mode_enum
),
1899 SOC_ENUM("DAC MBC 3 Window", dac_mbc3_win_sel_enum
),
1900 SOC_ENUM("DAC MBC 2 Mode", dac_mbc2_lvl_det_mode_enum
),
1901 SOC_ENUM("DAC MBC 2 Window", dac_mbc2_win_sel_enum
),
1902 SOC_ENUM("DAC MBC 1 Mode", dac_mbc1_lvl_det_mode_enum
),
1903 SOC_ENUM("DAC MBC 1 Window", dac_mbc1_win_sel_enum
),
1904 /* R_DACMBCMUG1 PG 4 ADDR 0x0C */
1905 SOC_ENUM("DAC MBC 1 Phase Polarity", dac_mbc1_phase_pol_enum
),
1906 SOC_SINGLE_TLV("DAC MBC 1 Make-Up Gain Volume", R_DACMBCMUG1
,
1907 FB_DACMBCMUG_MUGAIN
, FM_DACMBCMUG_MUGAIN
,
1908 0, mbc_mug_tlv_arr
),
1909 /* R_DACMBCTHR1 PG 4 ADDR 0x0D */
1910 SOC_SINGLE_TLV("DAC MBC 1 Compressor Threshold Volume", R_DACMBCTHR1
,
1911 FB_DACMBCTHR_THRESH
, FM_DACMBCTHR_THRESH
,
1913 /* R_DACMBCRAT1 PG 4 ADDR 0x0E */
1914 SOC_ENUM("DAC MBC 1 Compressor Ratio", dac_mbc1_comp_rat_enum
),
1915 /* R_DACMBCATK1L PG 4 ADDR 0x0F */
1916 /* R_DACMBCATK1H PG 4 ADDR 0x10 */
1917 SND_SOC_BYTES("DAC MBC 1 Attack", R_DACMBCATK1L
, 2),
1918 /* R_DACMBCREL1L PG 4 ADDR 0x11 */
1919 /* R_DACMBCREL1H PG 4 ADDR 0x12 */
1920 SND_SOC_BYTES("DAC MBC 1 Release", R_DACMBCREL1L
, 2),
1921 /* R_DACMBCMUG2 PG 4 ADDR 0x13 */
1922 SOC_ENUM("DAC MBC 2 Phase Polarity", dac_mbc2_phase_pol_enum
),
1923 SOC_SINGLE_TLV("DAC MBC 2 Make-Up Gain Volume", R_DACMBCMUG2
,
1924 FB_DACMBCMUG_MUGAIN
, FM_DACMBCMUG_MUGAIN
,
1925 0, mbc_mug_tlv_arr
),
1926 /* R_DACMBCTHR2 PG 4 ADDR 0x14 */
1927 SOC_SINGLE_TLV("DAC MBC 2 Compressor Threshold Volume", R_DACMBCTHR2
,
1928 FB_DACMBCTHR_THRESH
, FM_DACMBCTHR_THRESH
,
1930 /* R_DACMBCRAT2 PG 4 ADDR 0x15 */
1931 SOC_ENUM("DAC MBC 2 Compressor Ratio", dac_mbc2_comp_rat_enum
),
1932 /* R_DACMBCATK2L PG 4 ADDR 0x16 */
1933 /* R_DACMBCATK2H PG 4 ADDR 0x17 */
1934 SND_SOC_BYTES("DAC MBC 2 Attack", R_DACMBCATK2L
, 2),
1935 /* R_DACMBCREL2L PG 4 ADDR 0x18 */
1936 /* R_DACMBCREL2H PG 4 ADDR 0x19 */
1937 SND_SOC_BYTES("DAC MBC 2 Release", R_DACMBCREL2L
, 2),
1938 /* R_DACMBCMUG3 PG 4 ADDR 0x1A */
1939 SOC_ENUM("DAC MBC 3 Phase Polarity", dac_mbc3_phase_pol_enum
),
1940 SOC_SINGLE_TLV("DAC MBC 3 Make-Up Gain Volume", R_DACMBCMUG3
,
1941 FB_DACMBCMUG_MUGAIN
, FM_DACMBCMUG_MUGAIN
,
1942 0, mbc_mug_tlv_arr
),
1943 /* R_DACMBCTHR3 PG 4 ADDR 0x1B */
1944 SOC_SINGLE_TLV("DAC MBC 3 Threshold Volume", R_DACMBCTHR3
,
1945 FB_DACMBCTHR_THRESH
, FM_DACMBCTHR_THRESH
,
1947 /* R_DACMBCRAT3 PG 4 ADDR 0x1C */
1948 SOC_ENUM("DAC MBC 3 Compressor Ratio", dac_mbc3_comp_rat_enum
),
1949 /* R_DACMBCATK3L PG 4 ADDR 0x1D */
1950 /* R_DACMBCATK3H PG 4 ADDR 0x1E */
1951 SND_SOC_BYTES("DAC MBC 3 Attack", R_DACMBCATK3L
, 3),
1952 /* R_DACMBCREL3L PG 4 ADDR 0x1F */
1953 /* R_DACMBCREL3H PG 4 ADDR 0x20 */
1954 SND_SOC_BYTES("DAC MBC 3 Release", R_DACMBCREL3L
, 3),
1955 /* R_DACCLECTL PG 4 ADDR 0x21 */
1956 SOC_ENUM("DAC CLE Level Mode", dac_cle_lvl_mode_enum
),
1957 SOC_ENUM("DAC CLE Window", dac_cle_win_sel_enum
),
1958 SOC_SINGLE("DAC CLE Expander Switch",
1959 R_DACCLECTL
, FB_DACCLECTL_EXPEN
, 1, 0),
1960 SOC_SINGLE("DAC CLE Limiter Switch",
1961 R_DACCLECTL
, FB_DACCLECTL_LIMEN
, 1, 0),
1962 SOC_SINGLE("DAC CLE Compressor Switch",
1963 R_DACCLECTL
, FB_DACCLECTL_COMPEN
, 1, 0),
1964 /* R_DACCLEMUG PG 4 ADDR 0x22 */
1965 SOC_SINGLE_TLV("DAC CLE Make-Up Gain Volume", R_DACCLEMUG
,
1966 FB_DACCLEMUG_MUGAIN
, FM_DACCLEMUG_MUGAIN
,
1967 0, cle_mug_tlv_arr
),
1968 /* R_DACCOMPTHR PG 4 ADDR 0x23 */
1969 SOC_SINGLE_TLV("DAC Compressor Threshold Volume", R_DACCOMPTHR
,
1970 FB_DACCOMPTHR_THRESH
, FM_DACCOMPTHR_THRESH
,
1972 /* R_DACCOMPRAT PG 4 ADDR 0x24 */
1973 SOC_ENUM("DAC Compressor Ratio", dac_comp_rat_enum
),
1974 /* R_DACCOMPATKL PG 4 ADDR 0x25 */
1975 /* R_DACCOMPATKH PG 4 ADDR 0x26 */
1976 SND_SOC_BYTES("DAC Compressor Attack", R_DACCOMPATKL
, 2),
1977 /* R_DACCOMPRELL PG 4 ADDR 0x27 */
1978 /* R_DACCOMPRELH PG 4 ADDR 0x28 */
1979 SND_SOC_BYTES("DAC Compressor Release", R_DACCOMPRELL
, 2),
1980 /* R_DACLIMTHR PG 4 ADDR 0x29 */
1981 SOC_SINGLE_TLV("DAC Limiter Threshold Volume", R_DACLIMTHR
,
1982 FB_DACLIMTHR_THRESH
, FM_DACLIMTHR_THRESH
,
1984 /* R_DACLIMTGT PG 4 ADDR 0x2A */
1985 SOC_SINGLE_TLV("DAC Limiter Target Volume", R_DACLIMTGT
,
1986 FB_DACLIMTGT_TARGET
, FM_DACLIMTGT_TARGET
,
1988 /* R_DACLIMATKL PG 4 ADDR 0x2B */
1989 /* R_DACLIMATKH PG 4 ADDR 0x2C */
1990 SND_SOC_BYTES("DAC Limiter Attack", R_DACLIMATKL
, 2),
1991 /* R_DACLIMRELL PG 4 ADDR 0x2D */
1992 /* R_DACLIMRELR PG 4 ADDR 0x2E */
1993 SND_SOC_BYTES("DAC Limiter Release", R_DACLIMRELL
, 2),
1994 /* R_DACEXPTHR PG 4 ADDR 0x2F */
1995 SOC_SINGLE_TLV("DAC Expander Threshold Volume", R_DACEXPTHR
,
1996 FB_DACEXPTHR_THRESH
, FM_DACEXPTHR_THRESH
,
1998 /* R_DACEXPRAT PG 4 ADDR 0x30 */
1999 SOC_ENUM("DAC Expander Ratio", dac_exp_rat_enum
),
2000 /* R_DACEXPATKL PG 4 ADDR 0x31 */
2001 /* R_DACEXPATKR PG 4 ADDR 0x32 */
2002 SND_SOC_BYTES("DAC Expander Attack", R_DACEXPATKL
, 2),
2003 /* R_DACEXPRELL PG 4 ADDR 0x33 */
2004 /* R_DACEXPRELR PG 4 ADDR 0x34 */
2005 SND_SOC_BYTES("DAC Expander Release", R_DACEXPRELL
, 2),
2006 /* R_DACFXCTL PG 4 ADDR 0x35 */
2007 SOC_SINGLE("DAC 3D Switch", R_DACFXCTL
, FB_DACFXCTL_3DEN
, 1, 0),
2008 SOC_SINGLE("DAC Treble Enhancement Switch",
2009 R_DACFXCTL
, FB_DACFXCTL_TEEN
, 1, 0),
2010 SOC_SINGLE("DAC Treble NLF Switch",
2011 R_DACFXCTL
, FB_DACFXCTL_TNLFBYP
, 1, 1),
2012 SOC_SINGLE("DAC Bass Enhancement Switch",
2013 R_DACFXCTL
, FB_DACFXCTL_BEEN
, 1, 0),
2014 SOC_SINGLE("DAC Bass NLF Switch",
2015 R_DACFXCTL
, FB_DACFXCTL_BNLFBYP
, 1, 1),
2016 /* R_SUBEQFILT PG 5 ADDR 0x01 */
2017 SOC_SINGLE("Sub EQ 2 Switch",
2018 R_SUBEQFILT
, FB_SUBEQFILT_EQ2EN
, 1, 0),
2019 SOC_ENUM("Sub EQ 2 Band", sub_eq_enums
[0]),
2020 SOC_SINGLE("Sub EQ 1 Switch", R_SUBEQFILT
, FB_SUBEQFILT_EQ1EN
, 1, 0),
2021 SOC_ENUM("Sub EQ 1 Band", sub_eq_enums
[1]),
2022 /* R_SUBMBCEN PG 5 ADDR 0x0A */
2023 SOC_SINGLE("Sub MBC 3 Switch", R_SUBMBCEN
, FB_SUBMBCEN_MBCEN3
, 1, 0),
2024 SOC_SINGLE("Sub MBC 2 Switch", R_SUBMBCEN
, FB_SUBMBCEN_MBCEN2
, 1, 0),
2025 SOC_SINGLE("Sub MBC 1 Switch", R_SUBMBCEN
, FB_SUBMBCEN_MBCEN1
, 1, 0),
2026 /* R_SUBMBCCTL PG 5 ADDR 0x0B */
2027 SOC_ENUM("Sub MBC 3 Mode", sub_mbc3_lvl_det_mode_enum
),
2028 SOC_ENUM("Sub MBC 3 Window", sub_mbc3_win_sel_enum
),
2029 SOC_ENUM("Sub MBC 2 Mode", sub_mbc2_lvl_det_mode_enum
),
2030 SOC_ENUM("Sub MBC 2 Window", sub_mbc2_win_sel_enum
),
2031 SOC_ENUM("Sub MBC 1 Mode", sub_mbc1_lvl_det_mode_enum
),
2032 SOC_ENUM("Sub MBC 1 Window", sub_mbc1_win_sel_enum
),
2033 /* R_SUBMBCMUG1 PG 5 ADDR 0x0C */
2034 SOC_ENUM("Sub MBC 1 Phase Polarity", sub_mbc1_phase_pol_enum
),
2035 SOC_SINGLE_TLV("Sub MBC 1 Make-Up Gain Volume", R_SUBMBCMUG1
,
2036 FB_SUBMBCMUG_MUGAIN
, FM_SUBMBCMUG_MUGAIN
,
2037 0, mbc_mug_tlv_arr
),
2038 /* R_SUBMBCTHR1 PG 5 ADDR 0x0D */
2039 SOC_SINGLE_TLV("Sub MBC 1 Compressor Threshold Volume", R_SUBMBCTHR1
,
2040 FB_SUBMBCTHR_THRESH
, FM_SUBMBCTHR_THRESH
,
2042 /* R_SUBMBCRAT1 PG 5 ADDR 0x0E */
2043 SOC_ENUM("Sub MBC 1 Compressor Ratio", sub_mbc1_comp_rat_enum
),
2044 /* R_SUBMBCATK1L PG 5 ADDR 0x0F */
2045 /* R_SUBMBCATK1H PG 5 ADDR 0x10 */
2046 SND_SOC_BYTES("Sub MBC 1 Attack", R_SUBMBCATK1L
, 2),
2047 /* R_SUBMBCREL1L PG 5 ADDR 0x11 */
2048 /* R_SUBMBCREL1H PG 5 ADDR 0x12 */
2049 SND_SOC_BYTES("Sub MBC 1 Release", R_SUBMBCREL1L
, 2),
2050 /* R_SUBMBCMUG2 PG 5 ADDR 0x13 */
2051 SOC_ENUM("Sub MBC 2 Phase Polarity", sub_mbc2_phase_pol_enum
),
2052 SOC_SINGLE_TLV("Sub MBC 2 Make-Up Gain Volume", R_SUBMBCMUG2
,
2053 FB_SUBMBCMUG_MUGAIN
, FM_SUBMBCMUG_MUGAIN
,
2054 0, mbc_mug_tlv_arr
),
2055 /* R_SUBMBCTHR2 PG 5 ADDR 0x14 */
2056 SOC_SINGLE_TLV("Sub MBC 2 Compressor Threshold Volume", R_SUBMBCTHR2
,
2057 FB_SUBMBCTHR_THRESH
, FM_SUBMBCTHR_THRESH
,
2059 /* R_SUBMBCRAT2 PG 5 ADDR 0x15 */
2060 SOC_ENUM("Sub MBC 2 Compressor Ratio", sub_mbc2_comp_rat_enum
),
2061 /* R_SUBMBCATK2L PG 5 ADDR 0x16 */
2062 /* R_SUBMBCATK2H PG 5 ADDR 0x17 */
2063 SND_SOC_BYTES("Sub MBC 2 Attack", R_SUBMBCATK2L
, 2),
2064 /* R_SUBMBCREL2L PG 5 ADDR 0x18 */
2065 /* R_SUBMBCREL2H PG 5 ADDR 0x19 */
2066 SND_SOC_BYTES("Sub MBC 2 Release", R_SUBMBCREL2L
, 2),
2067 /* R_SUBMBCMUG3 PG 5 ADDR 0x1A */
2068 SOC_ENUM("Sub MBC 3 Phase Polarity", sub_mbc3_phase_pol_enum
),
2069 SOC_SINGLE_TLV("Sub MBC 3 Make-Up Gain Volume", R_SUBMBCMUG3
,
2070 FB_SUBMBCMUG_MUGAIN
, FM_SUBMBCMUG_MUGAIN
,
2071 0, mbc_mug_tlv_arr
),
2072 /* R_SUBMBCTHR3 PG 5 ADDR 0x1B */
2073 SOC_SINGLE_TLV("Sub MBC 3 Threshold Volume", R_SUBMBCTHR3
,
2074 FB_SUBMBCTHR_THRESH
, FM_SUBMBCTHR_THRESH
,
2076 /* R_SUBMBCRAT3 PG 5 ADDR 0x1C */
2077 SOC_ENUM("Sub MBC 3 Compressor Ratio", sub_mbc3_comp_rat_enum
),
2078 /* R_SUBMBCATK3L PG 5 ADDR 0x1D */
2079 /* R_SUBMBCATK3H PG 5 ADDR 0x1E */
2080 SND_SOC_BYTES("Sub MBC 3 Attack", R_SUBMBCATK3L
, 3),
2081 /* R_SUBMBCREL3L PG 5 ADDR 0x1F */
2082 /* R_SUBMBCREL3H PG 5 ADDR 0x20 */
2083 SND_SOC_BYTES("Sub MBC 3 Release", R_SUBMBCREL3L
, 3),
2084 /* R_SUBCLECTL PG 5 ADDR 0x21 */
2085 SOC_ENUM("Sub CLE Level Mode", sub_cle_lvl_mode_enum
),
2086 SOC_ENUM("Sub CLE Window", sub_cle_win_sel_enum
),
2087 SOC_SINGLE("Sub CLE Expander Switch",
2088 R_SUBCLECTL
, FB_SUBCLECTL_EXPEN
, 1, 0),
2089 SOC_SINGLE("Sub CLE Limiter Switch",
2090 R_SUBCLECTL
, FB_SUBCLECTL_LIMEN
, 1, 0),
2091 SOC_SINGLE("Sub CLE Compressor Switch",
2092 R_SUBCLECTL
, FB_SUBCLECTL_COMPEN
, 1, 0),
2093 /* R_SUBCLEMUG PG 5 ADDR 0x22 */
2094 SOC_SINGLE_TLV("Sub CLE Make-Up Gain Volume", R_SUBCLEMUG
,
2095 FB_SUBCLEMUG_MUGAIN
, FM_SUBCLEMUG_MUGAIN
,
2096 0, cle_mug_tlv_arr
),
2097 /* R_SUBCOMPTHR PG 5 ADDR 0x23 */
2098 SOC_SINGLE_TLV("Sub Compressor Threshold Volume", R_SUBCOMPTHR
,
2099 FB_SUBCOMPTHR_THRESH
, FM_SUBCOMPTHR_THRESH
,
2101 /* R_SUBCOMPRAT PG 5 ADDR 0x24 */
2102 SOC_ENUM("Sub Compressor Ratio", sub_comp_rat_enum
),
2103 /* R_SUBCOMPATKL PG 5 ADDR 0x25 */
2104 /* R_SUBCOMPATKH PG 5 ADDR 0x26 */
2105 SND_SOC_BYTES("Sub Compressor Attack", R_SUBCOMPATKL
, 2),
2106 /* R_SUBCOMPRELL PG 5 ADDR 0x27 */
2107 /* R_SUBCOMPRELH PG 5 ADDR 0x28 */
2108 SND_SOC_BYTES("Sub Compressor Release", R_SUBCOMPRELL
, 2),
2109 /* R_SUBLIMTHR PG 5 ADDR 0x29 */
2110 SOC_SINGLE_TLV("Sub Limiter Threshold Volume", R_SUBLIMTHR
,
2111 FB_SUBLIMTHR_THRESH
, FM_SUBLIMTHR_THRESH
,
2113 /* R_SUBLIMTGT PG 5 ADDR 0x2A */
2114 SOC_SINGLE_TLV("Sub Limiter Target Volume", R_SUBLIMTGT
,
2115 FB_SUBLIMTGT_TARGET
, FM_SUBLIMTGT_TARGET
,
2117 /* R_SUBLIMATKL PG 5 ADDR 0x2B */
2118 /* R_SUBLIMATKH PG 5 ADDR 0x2C */
2119 SND_SOC_BYTES("Sub Limiter Attack", R_SUBLIMATKL
, 2),
2120 /* R_SUBLIMRELL PG 5 ADDR 0x2D */
2121 /* R_SUBLIMRELR PG 5 ADDR 0x2E */
2122 SND_SOC_BYTES("Sub Limiter Release", R_SUBLIMRELL
, 2),
2123 /* R_SUBEXPTHR PG 5 ADDR 0x2F */
2124 SOC_SINGLE_TLV("Sub Expander Threshold Volume", R_SUBEXPTHR
,
2125 FB_SUBEXPTHR_THRESH
, FM_SUBEXPTHR_THRESH
,
2127 /* R_SUBEXPRAT PG 5 ADDR 0x30 */
2128 SOC_ENUM("Sub Expander Ratio", sub_exp_rat_enum
),
2129 /* R_SUBEXPATKL PG 5 ADDR 0x31 */
2130 /* R_SUBEXPATKR PG 5 ADDR 0x32 */
2131 SND_SOC_BYTES("Sub Expander Attack", R_SUBEXPATKL
, 2),
2132 /* R_SUBEXPRELL PG 5 ADDR 0x33 */
2133 /* R_SUBEXPRELR PG 5 ADDR 0x34 */
2134 SND_SOC_BYTES("Sub Expander Release", R_SUBEXPRELL
, 2),
2135 /* R_SUBFXCTL PG 5 ADDR 0x35 */
2136 SOC_SINGLE("Sub Treble Enhancement Switch",
2137 R_SUBFXCTL
, FB_SUBFXCTL_TEEN
, 1, 0),
2138 SOC_SINGLE("Sub Treble NLF Switch",
2139 R_SUBFXCTL
, FB_SUBFXCTL_TNLFBYP
, 1, 1),
2140 SOC_SINGLE("Sub Bass Enhancement Switch",
2141 R_SUBFXCTL
, FB_SUBFXCTL_BEEN
, 1, 0),
2142 SOC_SINGLE("Sub Bass NLF Switch",
2143 R_SUBFXCTL
, FB_SUBFXCTL_BNLFBYP
, 1, 1),
2144 COEFF_RAM_CTL("DAC Cascade 1 Left BiQuad 1", BIQUAD_SIZE
, 0x00),
2145 COEFF_RAM_CTL("DAC Cascade 1 Left BiQuad 2", BIQUAD_SIZE
, 0x05),
2146 COEFF_RAM_CTL("DAC Cascade 1 Left BiQuad 3", BIQUAD_SIZE
, 0x0a),
2147 COEFF_RAM_CTL("DAC Cascade 1 Left BiQuad 4", BIQUAD_SIZE
, 0x0f),
2148 COEFF_RAM_CTL("DAC Cascade 1 Left BiQuad 5", BIQUAD_SIZE
, 0x14),
2149 COEFF_RAM_CTL("DAC Cascade 1 Left BiQuad 6", BIQUAD_SIZE
, 0x19),
2151 COEFF_RAM_CTL("DAC Cascade 1 Right BiQuad 1", BIQUAD_SIZE
, 0x20),
2152 COEFF_RAM_CTL("DAC Cascade 1 Right BiQuad 2", BIQUAD_SIZE
, 0x25),
2153 COEFF_RAM_CTL("DAC Cascade 1 Right BiQuad 3", BIQUAD_SIZE
, 0x2a),
2154 COEFF_RAM_CTL("DAC Cascade 1 Right BiQuad 4", BIQUAD_SIZE
, 0x2f),
2155 COEFF_RAM_CTL("DAC Cascade 1 Right BiQuad 5", BIQUAD_SIZE
, 0x34),
2156 COEFF_RAM_CTL("DAC Cascade 1 Right BiQuad 6", BIQUAD_SIZE
, 0x39),
2158 COEFF_RAM_CTL("DAC Cascade 1 Left Prescale", COEFF_SIZE
, 0x1f),
2159 COEFF_RAM_CTL("DAC Cascade 1 Right Prescale", COEFF_SIZE
, 0x3f),
2161 COEFF_RAM_CTL("DAC Cascade 2 Left BiQuad 1", BIQUAD_SIZE
, 0x40),
2162 COEFF_RAM_CTL("DAC Cascade 2 Left BiQuad 2", BIQUAD_SIZE
, 0x45),
2163 COEFF_RAM_CTL("DAC Cascade 2 Left BiQuad 3", BIQUAD_SIZE
, 0x4a),
2164 COEFF_RAM_CTL("DAC Cascade 2 Left BiQuad 4", BIQUAD_SIZE
, 0x4f),
2165 COEFF_RAM_CTL("DAC Cascade 2 Left BiQuad 5", BIQUAD_SIZE
, 0x54),
2166 COEFF_RAM_CTL("DAC Cascade 2 Left BiQuad 6", BIQUAD_SIZE
, 0x59),
2168 COEFF_RAM_CTL("DAC Cascade 2 Right BiQuad 1", BIQUAD_SIZE
, 0x60),
2169 COEFF_RAM_CTL("DAC Cascade 2 Right BiQuad 2", BIQUAD_SIZE
, 0x65),
2170 COEFF_RAM_CTL("DAC Cascade 2 Right BiQuad 3", BIQUAD_SIZE
, 0x6a),
2171 COEFF_RAM_CTL("DAC Cascade 2 Right BiQuad 4", BIQUAD_SIZE
, 0x6f),
2172 COEFF_RAM_CTL("DAC Cascade 2 Right BiQuad 5", BIQUAD_SIZE
, 0x74),
2173 COEFF_RAM_CTL("DAC Cascade 2 Right BiQuad 6", BIQUAD_SIZE
, 0x79),
2175 COEFF_RAM_CTL("DAC Cascade 2 Left Prescale", COEFF_SIZE
, 0x5f),
2176 COEFF_RAM_CTL("DAC Cascade 2 Right Prescale", COEFF_SIZE
, 0x7f),
2178 COEFF_RAM_CTL("DAC Bass Extraction BiQuad 1", BIQUAD_SIZE
, 0x80),
2179 COEFF_RAM_CTL("DAC Bass Extraction BiQuad 2", BIQUAD_SIZE
, 0x85),
2181 COEFF_RAM_CTL("DAC Bass Non Linear Function 1", COEFF_SIZE
, 0x8a),
2182 COEFF_RAM_CTL("DAC Bass Non Linear Function 2", COEFF_SIZE
, 0x8b),
2184 COEFF_RAM_CTL("DAC Bass Limiter BiQuad", BIQUAD_SIZE
, 0x8c),
2186 COEFF_RAM_CTL("DAC Bass Cut Off BiQuad", BIQUAD_SIZE
, 0x91),
2188 COEFF_RAM_CTL("DAC Bass Mix", COEFF_SIZE
, 0x96),
2190 COEFF_RAM_CTL("DAC Treb Extraction BiQuad 1", BIQUAD_SIZE
, 0x97),
2191 COEFF_RAM_CTL("DAC Treb Extraction BiQuad 2", BIQUAD_SIZE
, 0x9c),
2193 COEFF_RAM_CTL("DAC Treb Non Linear Function 1", COEFF_SIZE
, 0xa1),
2194 COEFF_RAM_CTL("DAC Treb Non Linear Function 2", COEFF_SIZE
, 0xa2),
2196 COEFF_RAM_CTL("DAC Treb Limiter BiQuad", BIQUAD_SIZE
, 0xa3),
2198 COEFF_RAM_CTL("DAC Treb Cut Off BiQuad", BIQUAD_SIZE
, 0xa8),
2200 COEFF_RAM_CTL("DAC Treb Mix", COEFF_SIZE
, 0xad),
2202 COEFF_RAM_CTL("DAC 3D", COEFF_SIZE
, 0xae),
2204 COEFF_RAM_CTL("DAC 3D Mix", COEFF_SIZE
, 0xaf),
2206 COEFF_RAM_CTL("DAC MBC 1 BiQuad 1", BIQUAD_SIZE
, 0xb0),
2207 COEFF_RAM_CTL("DAC MBC 1 BiQuad 2", BIQUAD_SIZE
, 0xb5),
2209 COEFF_RAM_CTL("DAC MBC 2 BiQuad 1", BIQUAD_SIZE
, 0xba),
2210 COEFF_RAM_CTL("DAC MBC 2 BiQuad 2", BIQUAD_SIZE
, 0xbf),
2212 COEFF_RAM_CTL("DAC MBC 3 BiQuad 1", BIQUAD_SIZE
, 0xc4),
2213 COEFF_RAM_CTL("DAC MBC 3 BiQuad 2", BIQUAD_SIZE
, 0xc9),
2215 COEFF_RAM_CTL("Speaker Cascade 1 Left BiQuad 1", BIQUAD_SIZE
, 0x00),
2216 COEFF_RAM_CTL("Speaker Cascade 1 Left BiQuad 2", BIQUAD_SIZE
, 0x05),
2217 COEFF_RAM_CTL("Speaker Cascade 1 Left BiQuad 3", BIQUAD_SIZE
, 0x0a),
2218 COEFF_RAM_CTL("Speaker Cascade 1 Left BiQuad 4", BIQUAD_SIZE
, 0x0f),
2219 COEFF_RAM_CTL("Speaker Cascade 1 Left BiQuad 5", BIQUAD_SIZE
, 0x14),
2220 COEFF_RAM_CTL("Speaker Cascade 1 Left BiQuad 6", BIQUAD_SIZE
, 0x19),
2222 COEFF_RAM_CTL("Speaker Cascade 1 Right BiQuad 1", BIQUAD_SIZE
, 0x20),
2223 COEFF_RAM_CTL("Speaker Cascade 1 Right BiQuad 2", BIQUAD_SIZE
, 0x25),
2224 COEFF_RAM_CTL("Speaker Cascade 1 Right BiQuad 3", BIQUAD_SIZE
, 0x2a),
2225 COEFF_RAM_CTL("Speaker Cascade 1 Right BiQuad 4", BIQUAD_SIZE
, 0x2f),
2226 COEFF_RAM_CTL("Speaker Cascade 1 Right BiQuad 5", BIQUAD_SIZE
, 0x34),
2227 COEFF_RAM_CTL("Speaker Cascade 1 Right BiQuad 6", BIQUAD_SIZE
, 0x39),
2229 COEFF_RAM_CTL("Speaker Cascade 1 Left Prescale", COEFF_SIZE
, 0x1f),
2230 COEFF_RAM_CTL("Speaker Cascade 1 Right Prescale", COEFF_SIZE
, 0x3f),
2232 COEFF_RAM_CTL("Speaker Cascade 2 Left BiQuad 1", BIQUAD_SIZE
, 0x40),
2233 COEFF_RAM_CTL("Speaker Cascade 2 Left BiQuad 2", BIQUAD_SIZE
, 0x45),
2234 COEFF_RAM_CTL("Speaker Cascade 2 Left BiQuad 3", BIQUAD_SIZE
, 0x4a),
2235 COEFF_RAM_CTL("Speaker Cascade 2 Left BiQuad 4", BIQUAD_SIZE
, 0x4f),
2236 COEFF_RAM_CTL("Speaker Cascade 2 Left BiQuad 5", BIQUAD_SIZE
, 0x54),
2237 COEFF_RAM_CTL("Speaker Cascade 2 Left BiQuad 6", BIQUAD_SIZE
, 0x59),
2239 COEFF_RAM_CTL("Speaker Cascade 2 Right BiQuad 1", BIQUAD_SIZE
, 0x60),
2240 COEFF_RAM_CTL("Speaker Cascade 2 Right BiQuad 2", BIQUAD_SIZE
, 0x65),
2241 COEFF_RAM_CTL("Speaker Cascade 2 Right BiQuad 3", BIQUAD_SIZE
, 0x6a),
2242 COEFF_RAM_CTL("Speaker Cascade 2 Right BiQuad 4", BIQUAD_SIZE
, 0x6f),
2243 COEFF_RAM_CTL("Speaker Cascade 2 Right BiQuad 5", BIQUAD_SIZE
, 0x74),
2244 COEFF_RAM_CTL("Speaker Cascade 2 Right BiQuad 6", BIQUAD_SIZE
, 0x79),
2246 COEFF_RAM_CTL("Speaker Cascade 2 Left Prescale", COEFF_SIZE
, 0x5f),
2247 COEFF_RAM_CTL("Speaker Cascade 2 Right Prescale", COEFF_SIZE
, 0x7f),
2249 COEFF_RAM_CTL("Speaker Bass Extraction BiQuad 1", BIQUAD_SIZE
, 0x80),
2250 COEFF_RAM_CTL("Speaker Bass Extraction BiQuad 2", BIQUAD_SIZE
, 0x85),
2252 COEFF_RAM_CTL("Speaker Bass Non Linear Function 1", COEFF_SIZE
, 0x8a),
2253 COEFF_RAM_CTL("Speaker Bass Non Linear Function 2", COEFF_SIZE
, 0x8b),
2255 COEFF_RAM_CTL("Speaker Bass Limiter BiQuad", BIQUAD_SIZE
, 0x8c),
2257 COEFF_RAM_CTL("Speaker Bass Cut Off BiQuad", BIQUAD_SIZE
, 0x91),
2259 COEFF_RAM_CTL("Speaker Bass Mix", COEFF_SIZE
, 0x96),
2261 COEFF_RAM_CTL("Speaker Treb Extraction BiQuad 1", BIQUAD_SIZE
, 0x97),
2262 COEFF_RAM_CTL("Speaker Treb Extraction BiQuad 2", BIQUAD_SIZE
, 0x9c),
2264 COEFF_RAM_CTL("Speaker Treb Non Linear Function 1", COEFF_SIZE
, 0xa1),
2265 COEFF_RAM_CTL("Speaker Treb Non Linear Function 2", COEFF_SIZE
, 0xa2),
2267 COEFF_RAM_CTL("Speaker Treb Limiter BiQuad", BIQUAD_SIZE
, 0xa3),
2269 COEFF_RAM_CTL("Speaker Treb Cut Off BiQuad", BIQUAD_SIZE
, 0xa8),
2271 COEFF_RAM_CTL("Speaker Treb Mix", COEFF_SIZE
, 0xad),
2273 COEFF_RAM_CTL("Speaker 3D", COEFF_SIZE
, 0xae),
2275 COEFF_RAM_CTL("Speaker 3D Mix", COEFF_SIZE
, 0xaf),
2277 COEFF_RAM_CTL("Speaker MBC 1 BiQuad 1", BIQUAD_SIZE
, 0xb0),
2278 COEFF_RAM_CTL("Speaker MBC 1 BiQuad 2", BIQUAD_SIZE
, 0xb5),
2280 COEFF_RAM_CTL("Speaker MBC 2 BiQuad 1", BIQUAD_SIZE
, 0xba),
2281 COEFF_RAM_CTL("Speaker MBC 2 BiQuad 2", BIQUAD_SIZE
, 0xbf),
2283 COEFF_RAM_CTL("Speaker MBC 3 BiQuad 1", BIQUAD_SIZE
, 0xc4),
2284 COEFF_RAM_CTL("Speaker MBC 3 BiQuad 2", BIQUAD_SIZE
, 0xc9),
2286 COEFF_RAM_CTL("Sub Cascade 1 Left BiQuad 1", BIQUAD_SIZE
, 0x00),
2287 COEFF_RAM_CTL("Sub Cascade 1 Left BiQuad 2", BIQUAD_SIZE
, 0x05),
2288 COEFF_RAM_CTL("Sub Cascade 1 Left BiQuad 3", BIQUAD_SIZE
, 0x0a),
2289 COEFF_RAM_CTL("Sub Cascade 1 Left BiQuad 4", BIQUAD_SIZE
, 0x0f),
2290 COEFF_RAM_CTL("Sub Cascade 1 Left BiQuad 5", BIQUAD_SIZE
, 0x14),
2291 COEFF_RAM_CTL("Sub Cascade 1 Left BiQuad 6", BIQUAD_SIZE
, 0x19),
2293 COEFF_RAM_CTL("Sub Cascade 1 Right BiQuad 1", BIQUAD_SIZE
, 0x20),
2294 COEFF_RAM_CTL("Sub Cascade 1 Right BiQuad 2", BIQUAD_SIZE
, 0x25),
2295 COEFF_RAM_CTL("Sub Cascade 1 Right BiQuad 3", BIQUAD_SIZE
, 0x2a),
2296 COEFF_RAM_CTL("Sub Cascade 1 Right BiQuad 4", BIQUAD_SIZE
, 0x2f),
2297 COEFF_RAM_CTL("Sub Cascade 1 Right BiQuad 5", BIQUAD_SIZE
, 0x34),
2298 COEFF_RAM_CTL("Sub Cascade 1 Right BiQuad 6", BIQUAD_SIZE
, 0x39),
2300 COEFF_RAM_CTL("Sub Cascade 1 Left Prescale", COEFF_SIZE
, 0x1f),
2301 COEFF_RAM_CTL("Sub Cascade 1 Right Prescale", COEFF_SIZE
, 0x3f),
2303 COEFF_RAM_CTL("Sub Cascade 2 Left BiQuad 1", BIQUAD_SIZE
, 0x40),
2304 COEFF_RAM_CTL("Sub Cascade 2 Left BiQuad 2", BIQUAD_SIZE
, 0x45),
2305 COEFF_RAM_CTL("Sub Cascade 2 Left BiQuad 3", BIQUAD_SIZE
, 0x4a),
2306 COEFF_RAM_CTL("Sub Cascade 2 Left BiQuad 4", BIQUAD_SIZE
, 0x4f),
2307 COEFF_RAM_CTL("Sub Cascade 2 Left BiQuad 5", BIQUAD_SIZE
, 0x54),
2308 COEFF_RAM_CTL("Sub Cascade 2 Left BiQuad 6", BIQUAD_SIZE
, 0x59),
2310 COEFF_RAM_CTL("Sub Cascade 2 Right BiQuad 1", BIQUAD_SIZE
, 0x60),
2311 COEFF_RAM_CTL("Sub Cascade 2 Right BiQuad 2", BIQUAD_SIZE
, 0x65),
2312 COEFF_RAM_CTL("Sub Cascade 2 Right BiQuad 3", BIQUAD_SIZE
, 0x6a),
2313 COEFF_RAM_CTL("Sub Cascade 2 Right BiQuad 4", BIQUAD_SIZE
, 0x6f),
2314 COEFF_RAM_CTL("Sub Cascade 2 Right BiQuad 5", BIQUAD_SIZE
, 0x74),
2315 COEFF_RAM_CTL("Sub Cascade 2 Right BiQuad 6", BIQUAD_SIZE
, 0x79),
2317 COEFF_RAM_CTL("Sub Cascade 2 Left Prescale", COEFF_SIZE
, 0x5f),
2318 COEFF_RAM_CTL("Sub Cascade 2 Right Prescale", COEFF_SIZE
, 0x7f),
2320 COEFF_RAM_CTL("Sub Bass Extraction BiQuad 1", BIQUAD_SIZE
, 0x80),
2321 COEFF_RAM_CTL("Sub Bass Extraction BiQuad 2", BIQUAD_SIZE
, 0x85),
2323 COEFF_RAM_CTL("Sub Bass Non Linear Function 1", COEFF_SIZE
, 0x8a),
2324 COEFF_RAM_CTL("Sub Bass Non Linear Function 2", COEFF_SIZE
, 0x8b),
2326 COEFF_RAM_CTL("Sub Bass Limiter BiQuad", BIQUAD_SIZE
, 0x8c),
2328 COEFF_RAM_CTL("Sub Bass Cut Off BiQuad", BIQUAD_SIZE
, 0x91),
2330 COEFF_RAM_CTL("Sub Bass Mix", COEFF_SIZE
, 0x96),
2332 COEFF_RAM_CTL("Sub Treb Extraction BiQuad 1", BIQUAD_SIZE
, 0x97),
2333 COEFF_RAM_CTL("Sub Treb Extraction BiQuad 2", BIQUAD_SIZE
, 0x9c),
2335 COEFF_RAM_CTL("Sub Treb Non Linear Function 1", COEFF_SIZE
, 0xa1),
2336 COEFF_RAM_CTL("Sub Treb Non Linear Function 2", COEFF_SIZE
, 0xa2),
2338 COEFF_RAM_CTL("Sub Treb Limiter BiQuad", BIQUAD_SIZE
, 0xa3),
2340 COEFF_RAM_CTL("Sub Treb Cut Off BiQuad", BIQUAD_SIZE
, 0xa8),
2342 COEFF_RAM_CTL("Sub Treb Mix", COEFF_SIZE
, 0xad),
2344 COEFF_RAM_CTL("Sub 3D", COEFF_SIZE
, 0xae),
2346 COEFF_RAM_CTL("Sub 3D Mix", COEFF_SIZE
, 0xaf),
2348 COEFF_RAM_CTL("Sub MBC 1 BiQuad 1", BIQUAD_SIZE
, 0xb0),
2349 COEFF_RAM_CTL("Sub MBC 1 BiQuad 2", BIQUAD_SIZE
, 0xb5),
2351 COEFF_RAM_CTL("Sub MBC 2 BiQuad 1", BIQUAD_SIZE
, 0xba),
2352 COEFF_RAM_CTL("Sub MBC 2 BiQuad 2", BIQUAD_SIZE
, 0xbf),
2354 COEFF_RAM_CTL("Sub MBC 3 BiQuad 1", BIQUAD_SIZE
, 0xc4),
2355 COEFF_RAM_CTL("Sub MBC 3 BiQuad 2", BIQUAD_SIZE
, 0xc9),
2358 static struct snd_soc_dapm_widget
const tscs454_dapm_widgets
[] = {
2359 /* R_PLLCTL PG 0 ADDR 0x15 */
2360 SND_SOC_DAPM_SUPPLY("PLL 1 Power", R_PLLCTL
, FB_PLLCTL_PU_PLL1
, 0,
2362 SND_SOC_DAPM_POST_PMU
|SND_SOC_DAPM_PRE_PMD
),
2363 SND_SOC_DAPM_SUPPLY("PLL 2 Power", R_PLLCTL
, FB_PLLCTL_PU_PLL2
, 0,
2365 SND_SOC_DAPM_POST_PMU
|SND_SOC_DAPM_PRE_PMD
),
2366 /* R_I2SPINC0 PG 0 ADDR 0x22 */
2367 SND_SOC_DAPM_AIF_OUT("DAI 3 Out", "DAI 3 Capture", 0,
2368 R_I2SPINC0
, FB_I2SPINC0_SDO3TRI
, 1),
2369 SND_SOC_DAPM_AIF_OUT("DAI 2 Out", "DAI 2 Capture", 0,
2370 R_I2SPINC0
, FB_I2SPINC0_SDO2TRI
, 1),
2371 SND_SOC_DAPM_AIF_OUT("DAI 1 Out", "DAI 1 Capture", 0,
2372 R_I2SPINC0
, FB_I2SPINC0_SDO1TRI
, 1),
2373 /* R_PWRM0 PG 0 ADDR 0x33 */
2374 SND_SOC_DAPM_ADC("Input Processor Channel 3", NULL
,
2375 R_PWRM0
, FB_PWRM0_INPROC3PU
, 0),
2376 SND_SOC_DAPM_ADC("Input Processor Channel 2", NULL
,
2377 R_PWRM0
, FB_PWRM0_INPROC2PU
, 0),
2378 SND_SOC_DAPM_ADC("Input Processor Channel 1", NULL
,
2379 R_PWRM0
, FB_PWRM0_INPROC1PU
, 0),
2380 SND_SOC_DAPM_ADC("Input Processor Channel 0", NULL
,
2381 R_PWRM0
, FB_PWRM0_INPROC0PU
, 0),
2382 SND_SOC_DAPM_SUPPLY("Mic Bias 2",
2383 R_PWRM0
, FB_PWRM0_MICB2PU
, 0, NULL
, 0),
2384 SND_SOC_DAPM_SUPPLY("Mic Bias 1", R_PWRM0
,
2385 FB_PWRM0_MICB1PU
, 0, NULL
, 0),
2386 /* R_PWRM1 PG 0 ADDR 0x34 */
2387 SND_SOC_DAPM_SUPPLY("Sub Power", R_PWRM1
, FB_PWRM1_SUBPU
, 0, NULL
, 0),
2388 SND_SOC_DAPM_SUPPLY("Headphone Left Power",
2389 R_PWRM1
, FB_PWRM1_HPLPU
, 0, NULL
, 0),
2390 SND_SOC_DAPM_SUPPLY("Headphone Right Power",
2391 R_PWRM1
, FB_PWRM1_HPRPU
, 0, NULL
, 0),
2392 SND_SOC_DAPM_SUPPLY("Speaker Left Power",
2393 R_PWRM1
, FB_PWRM1_SPKLPU
, 0, NULL
, 0),
2394 SND_SOC_DAPM_SUPPLY("Speaker Right Power",
2395 R_PWRM1
, FB_PWRM1_SPKRPU
, 0, NULL
, 0),
2396 SND_SOC_DAPM_SUPPLY("Differential Input 2 Power",
2397 R_PWRM1
, FB_PWRM1_D2S2PU
, 0, NULL
, 0),
2398 SND_SOC_DAPM_SUPPLY("Differential Input 1 Power",
2399 R_PWRM1
, FB_PWRM1_D2S1PU
, 0, NULL
, 0),
2400 /* R_PWRM2 PG 0 ADDR 0x35 */
2401 SND_SOC_DAPM_SUPPLY("DAI 3 Out Power",
2402 R_PWRM2
, FB_PWRM2_I2S3OPU
, 0, NULL
, 0),
2403 SND_SOC_DAPM_SUPPLY("DAI 2 Out Power",
2404 R_PWRM2
, FB_PWRM2_I2S2OPU
, 0, NULL
, 0),
2405 SND_SOC_DAPM_SUPPLY("DAI 1 Out Power",
2406 R_PWRM2
, FB_PWRM2_I2S1OPU
, 0, NULL
, 0),
2407 SND_SOC_DAPM_SUPPLY("DAI 3 In Power",
2408 R_PWRM2
, FB_PWRM2_I2S3IPU
, 0, NULL
, 0),
2409 SND_SOC_DAPM_SUPPLY("DAI 2 In Power",
2410 R_PWRM2
, FB_PWRM2_I2S2IPU
, 0, NULL
, 0),
2411 SND_SOC_DAPM_SUPPLY("DAI 1 In Power",
2412 R_PWRM2
, FB_PWRM2_I2S1IPU
, 0, NULL
, 0),
2413 /* R_PWRM3 PG 0 ADDR 0x36 */
2414 SND_SOC_DAPM_SUPPLY("Line Out Left Power",
2415 R_PWRM3
, FB_PWRM3_LLINEPU
, 0, NULL
, 0),
2416 SND_SOC_DAPM_SUPPLY("Line Out Right Power",
2417 R_PWRM3
, FB_PWRM3_RLINEPU
, 0, NULL
, 0),
2418 /* R_PWRM4 PG 0 ADDR 0x37 */
2419 SND_SOC_DAPM_DAC("Sub", NULL
, R_PWRM4
, FB_PWRM4_OPSUBPU
, 0),
2420 SND_SOC_DAPM_DAC("DAC Left", NULL
, R_PWRM4
, FB_PWRM4_OPDACLPU
, 0),
2421 SND_SOC_DAPM_DAC("DAC Right", NULL
, R_PWRM4
, FB_PWRM4_OPDACRPU
, 0),
2422 SND_SOC_DAPM_DAC("ClassD Left", NULL
, R_PWRM4
, FB_PWRM4_OPSPKLPU
, 0),
2423 SND_SOC_DAPM_DAC("ClassD Right", NULL
, R_PWRM4
, FB_PWRM4_OPSPKRPU
, 0),
2424 /* R_AUDIOMUX1 PG 0 ADDR 0x3A */
2425 SND_SOC_DAPM_MUX("DAI 2 Out Mux", SND_SOC_NOPM
, 0, 0,
2426 &dai2_mux_dapm_enum
),
2427 SND_SOC_DAPM_MUX("DAI 1 Out Mux", SND_SOC_NOPM
, 0, 0,
2428 &dai1_mux_dapm_enum
),
2429 /* R_AUDIOMUX2 PG 0 ADDR 0x3B */
2430 SND_SOC_DAPM_MUX("DAC Mux", SND_SOC_NOPM
, 0, 0,
2431 &dac_mux_dapm_enum
),
2432 SND_SOC_DAPM_MUX("DAI 3 Out Mux", SND_SOC_NOPM
, 0, 0,
2433 &dai3_mux_dapm_enum
),
2434 /* R_AUDIOMUX3 PG 0 ADDR 0x3C */
2435 SND_SOC_DAPM_MUX("Sub Mux", SND_SOC_NOPM
, 0, 0,
2436 &sub_mux_dapm_enum
),
2437 SND_SOC_DAPM_MUX("Speaker Mux", SND_SOC_NOPM
, 0, 0,
2438 &classd_mux_dapm_enum
),
2439 /* R_HSDCTL1 PG 1 ADDR 0x01 */
2440 SND_SOC_DAPM_SUPPLY("GHS Detect Power", R_HSDCTL1
,
2441 FB_HSDCTL1_CON_DET_PWD
, 1, NULL
, 0),
2442 /* R_CH0AIC PG 1 ADDR 0x06 */
2443 SND_SOC_DAPM_MUX("Input Boost Channel 0 Mux", SND_SOC_NOPM
, 0, 0,
2444 &in_bst_mux_ch0_dapm_enum
),
2445 SND_SOC_DAPM_MUX("ADC Channel 0 Mux", SND_SOC_NOPM
, 0, 0,
2446 &adc_mux_ch0_dapm_enum
),
2447 SND_SOC_DAPM_MUX("Input Processor Channel 0 Mux", SND_SOC_NOPM
, 0, 0,
2448 &in_proc_mux_ch0_dapm_enum
),
2449 /* R_CH1AIC PG 1 ADDR 0x07 */
2450 SND_SOC_DAPM_MUX("Input Boost Channel 1 Mux", SND_SOC_NOPM
, 0, 0,
2451 &in_bst_mux_ch1_dapm_enum
),
2452 SND_SOC_DAPM_MUX("ADC Channel 1 Mux", SND_SOC_NOPM
, 0, 0,
2453 &adc_mux_ch1_dapm_enum
),
2454 SND_SOC_DAPM_MUX("Input Processor Channel 1 Mux", SND_SOC_NOPM
, 0, 0,
2455 &in_proc_mux_ch1_dapm_enum
),
2457 SND_SOC_DAPM_AIF_IN("DAI 3 In", "DAI 3 Playback", 0,
2458 SND_SOC_NOPM
, 0, 0),
2459 SND_SOC_DAPM_AIF_IN("DAI 2 In", "DAI 2 Playback", 0,
2460 SND_SOC_NOPM
, 0, 0),
2461 SND_SOC_DAPM_AIF_IN("DAI 1 In", "DAI 1 Playback", 0,
2462 SND_SOC_NOPM
, 0, 0),
2463 SND_SOC_DAPM_SUPPLY("PLLs", SND_SOC_NOPM
, 0, 0, NULL
, 0),
2464 SND_SOC_DAPM_OUTPUT("Sub Out"),
2465 SND_SOC_DAPM_OUTPUT("Headphone Left"),
2466 SND_SOC_DAPM_OUTPUT("Headphone Right"),
2467 SND_SOC_DAPM_OUTPUT("Speaker Left"),
2468 SND_SOC_DAPM_OUTPUT("Speaker Right"),
2469 SND_SOC_DAPM_OUTPUT("Line Out Left"),
2470 SND_SOC_DAPM_OUTPUT("Line Out Right"),
2471 SND_SOC_DAPM_INPUT("D2S 2"),
2472 SND_SOC_DAPM_INPUT("D2S 1"),
2473 SND_SOC_DAPM_INPUT("Line In 1 Left"),
2474 SND_SOC_DAPM_INPUT("Line In 1 Right"),
2475 SND_SOC_DAPM_INPUT("Line In 2 Left"),
2476 SND_SOC_DAPM_INPUT("Line In 2 Right"),
2477 SND_SOC_DAPM_INPUT("Line In 3 Left"),
2478 SND_SOC_DAPM_INPUT("Line In 3 Right"),
2479 SND_SOC_DAPM_INPUT("DMic 1"),
2480 SND_SOC_DAPM_INPUT("DMic 2"),
2482 SND_SOC_DAPM_MUX("CH 0_1 Mux", SND_SOC_NOPM
, 0, 0,
2483 &ch_0_1_mux_dapm_enum
),
2484 SND_SOC_DAPM_MUX("CH 2_3 Mux", SND_SOC_NOPM
, 0, 0,
2485 &ch_2_3_mux_dapm_enum
),
2486 SND_SOC_DAPM_MUX("CH 4_5 Mux", SND_SOC_NOPM
, 0, 0,
2487 &ch_4_5_mux_dapm_enum
),
2490 static struct snd_soc_dapm_route
const tscs454_intercon
[] = {
2492 {"PLLs", NULL
, "PLL 1 Power", pll_connected
},
2493 {"PLLs", NULL
, "PLL 2 Power", pll_connected
},
2495 {"DAI 3 In", NULL
, "DAI 3 In Power"},
2496 {"DAI 2 In", NULL
, "DAI 2 In Power"},
2497 {"DAI 1 In", NULL
, "DAI 1 In Power"},
2499 {"DAI 3 Out", NULL
, "DAI 3 Out Power"},
2500 {"DAI 2 Out", NULL
, "DAI 2 Out Power"},
2501 {"DAI 1 Out", NULL
, "DAI 1 Out Power"},
2503 {"CH 0_1 Mux", "DAI 1", "DAI 1 In"},
2504 {"CH 0_1 Mux", "TDM 0_1", "DAI 1 In"},
2505 {"CH 2_3 Mux", "DAI 2", "DAI 2 In"},
2506 {"CH 2_3 Mux", "TDM 2_3", "DAI 1 In"},
2507 {"CH 4_5 Mux", "DAI 3", "DAI 2 In"},
2508 {"CH 4_5 Mux", "TDM 4_5", "DAI 1 In"},
2510 {"DAI 1 Out Mux", "CH 0_1", "CH 0_1 Mux"},
2511 {"DAI 1 Out Mux", "CH 2_3", "CH 2_3 Mux"},
2512 {"DAI 1 Out Mux", "CH 4_5", "CH 4_5 Mux"},
2513 {"DAI 2 Out Mux", "CH 0_1", "CH 0_1 Mux"},
2514 {"DAI 2 Out Mux", "CH 2_3", "CH 2_3 Mux"},
2515 {"DAI 2 Out Mux", "CH 4_5", "CH 4_5 Mux"},
2516 {"DAI 3 Out Mux", "CH 0_1", "CH 0_1 Mux"},
2517 {"DAI 3 Out Mux", "CH 2_3", "CH 2_3 Mux"},
2518 {"DAI 3 Out Mux", "CH 4_5", "CH 4_5 Mux"},
2523 {"DAC Mux", "CH 4_5", "CH 4_5 Mux"},
2524 {"DAC Mux", "CH 2_3", "CH 2_3 Mux"},
2525 {"DAC Mux", "CH 0_1", "CH 0_1 Mux"},
2526 {"DAC Left", NULL
, "DAC Mux"},
2527 {"DAC Right", NULL
, "DAC Mux"},
2528 {"DAC Left", NULL
, "PLLs"},
2529 {"DAC Right", NULL
, "PLLs"},
2530 {"Headphone Left", NULL
, "Headphone Left Power"},
2531 {"Headphone Right", NULL
, "Headphone Right Power"},
2532 {"Headphone Left", NULL
, "DAC Left"},
2533 {"Headphone Right", NULL
, "DAC Right"},
2535 {"Line Out Left", NULL
, "Line Out Left Power"},
2536 {"Line Out Right", NULL
, "Line Out Right Power"},
2537 {"Line Out Left", NULL
, "DAC Left"},
2538 {"Line Out Right", NULL
, "DAC Right"},
2540 {"Speaker Mux", "CH 4_5", "CH 4_5 Mux"},
2541 {"Speaker Mux", "CH 2_3", "CH 2_3 Mux"},
2542 {"Speaker Mux", "CH 0_1", "CH 0_1 Mux"},
2543 {"ClassD Left", NULL
, "Speaker Mux"},
2544 {"ClassD Right", NULL
, "Speaker Mux"},
2545 {"ClassD Left", NULL
, "PLLs"},
2546 {"ClassD Right", NULL
, "PLLs"},
2547 {"Speaker Left", NULL
, "Speaker Left Power"},
2548 {"Speaker Right", NULL
, "Speaker Right Power"},
2549 {"Speaker Left", NULL
, "ClassD Left"},
2550 {"Speaker Right", NULL
, "ClassD Right"},
2552 {"Sub Mux", "CH 4", "CH 4_5 Mux"},
2553 {"Sub Mux", "CH 5", "CH 4_5 Mux"},
2554 {"Sub Mux", "CH 4 + 5", "CH 4_5 Mux"},
2555 {"Sub Mux", "CH 2", "CH 2_3 Mux"},
2556 {"Sub Mux", "CH 3", "CH 2_3 Mux"},
2557 {"Sub Mux", "CH 2 + 3", "CH 2_3 Mux"},
2558 {"Sub Mux", "CH 0", "CH 0_1 Mux"},
2559 {"Sub Mux", "CH 1", "CH 0_1 Mux"},
2560 {"Sub Mux", "CH 0 + 1", "CH 0_1 Mux"},
2561 {"Sub Mux", "ADC/DMic 1 Left", "Input Processor Channel 0"},
2562 {"Sub Mux", "ADC/DMic 1 Right", "Input Processor Channel 1"},
2563 {"Sub Mux", "ADC/DMic 1 Left Plus Right", "Input Processor Channel 0"},
2564 {"Sub Mux", "ADC/DMic 1 Left Plus Right", "Input Processor Channel 1"},
2565 {"Sub Mux", "DMic 2 Left", "DMic 2"},
2566 {"Sub Mux", "DMic 2 Right", "DMic 2"},
2567 {"Sub Mux", "DMic 2 Left Plus Right", "DMic 2"},
2568 {"Sub Mux", "ClassD Left", "ClassD Left"},
2569 {"Sub Mux", "ClassD Right", "ClassD Right"},
2570 {"Sub Mux", "ClassD Left Plus Right", "ClassD Left"},
2571 {"Sub Mux", "ClassD Left Plus Right", "ClassD Right"},
2572 {"Sub", NULL
, "Sub Mux"},
2573 {"Sub", NULL
, "PLLs"},
2574 {"Sub Out", NULL
, "Sub Power"},
2575 {"Sub Out", NULL
, "Sub"},
2579 {"Input Boost Channel 0 Mux", "Input 3", "Line In 3 Left"},
2580 {"Input Boost Channel 0 Mux", "Input 2", "Line In 2 Left"},
2581 {"Input Boost Channel 0 Mux", "Input 1", "Line In 1 Left"},
2582 {"Input Boost Channel 0 Mux", "D2S", "D2S 1"},
2584 {"Input Boost Channel 1 Mux", "Input 3", "Line In 3 Right"},
2585 {"Input Boost Channel 1 Mux", "Input 2", "Line In 2 Right"},
2586 {"Input Boost Channel 1 Mux", "Input 1", "Line In 1 Right"},
2587 {"Input Boost Channel 1 Mux", "D2S", "D2S 2"},
2589 {"ADC Channel 0 Mux", "Input 3 Boost Bypass", "Line In 3 Left"},
2590 {"ADC Channel 0 Mux", "Input 2 Boost Bypass", "Line In 2 Left"},
2591 {"ADC Channel 0 Mux", "Input 1 Boost Bypass", "Line In 1 Left"},
2592 {"ADC Channel 0 Mux", "Input Boost", "Input Boost Channel 0 Mux"},
2594 {"ADC Channel 1 Mux", "Input 3 Boost Bypass", "Line In 3 Right"},
2595 {"ADC Channel 1 Mux", "Input 2 Boost Bypass", "Line In 2 Right"},
2596 {"ADC Channel 1 Mux", "Input 1 Boost Bypass", "Line In 1 Right"},
2597 {"ADC Channel 1 Mux", "Input Boost", "Input Boost Channel 1 Mux"},
2599 {"Input Processor Channel 0 Mux", "ADC", "ADC Channel 0 Mux"},
2600 {"Input Processor Channel 0 Mux", "DMic", "DMic 1"},
2602 {"Input Processor Channel 0", NULL
, "PLLs"},
2603 {"Input Processor Channel 0", NULL
, "Input Processor Channel 0 Mux"},
2605 {"Input Processor Channel 1 Mux", "ADC", "ADC Channel 1 Mux"},
2606 {"Input Processor Channel 1 Mux", "DMic", "DMic 1"},
2608 {"Input Processor Channel 1", NULL
, "PLLs"},
2609 {"Input Processor Channel 1", NULL
, "Input Processor Channel 1 Mux"},
2611 {"Input Processor Channel 2", NULL
, "PLLs"},
2612 {"Input Processor Channel 2", NULL
, "DMic 2"},
2614 {"Input Processor Channel 3", NULL
, "PLLs"},
2615 {"Input Processor Channel 3", NULL
, "DMic 2"},
2617 {"DAI 1 Out Mux", "ADC/DMic 1", "Input Processor Channel 0"},
2618 {"DAI 1 Out Mux", "ADC/DMic 1", "Input Processor Channel 1"},
2619 {"DAI 1 Out Mux", "DMic 2", "Input Processor Channel 2"},
2620 {"DAI 1 Out Mux", "DMic 2", "Input Processor Channel 3"},
2622 {"DAI 2 Out Mux", "ADC/DMic 1", "Input Processor Channel 0"},
2623 {"DAI 2 Out Mux", "ADC/DMic 1", "Input Processor Channel 1"},
2624 {"DAI 2 Out Mux", "DMic 2", "Input Processor Channel 2"},
2625 {"DAI 2 Out Mux", "DMic 2", "Input Processor Channel 3"},
2627 {"DAI 3 Out Mux", "ADC/DMic 1", "Input Processor Channel 0"},
2628 {"DAI 3 Out Mux", "ADC/DMic 1", "Input Processor Channel 1"},
2629 {"DAI 3 Out Mux", "DMic 2", "Input Processor Channel 2"},
2630 {"DAI 3 Out Mux", "DMic 2", "Input Processor Channel 3"},
2632 {"DAI 1 Out", NULL
, "DAI 1 Out Mux"},
2633 {"DAI 2 Out", NULL
, "DAI 2 Out Mux"},
2634 {"DAI 3 Out", NULL
, "DAI 3 Out Mux"},
2637 /* This is used when BCLK is sourcing the PLLs */
2638 static int tscs454_set_sysclk(struct snd_soc_dai
*dai
,
2639 int clk_id
, unsigned int freq
, int dir
)
2641 struct snd_soc_component
*component
= dai
->component
;
2642 struct tscs454
*tscs454
= snd_soc_component_get_drvdata(component
);
2647 dev_dbg(component
->dev
, "%s(): freq = %u\n", __func__
, freq
);
2649 ret
= snd_soc_component_read(component
, R_PLLCTL
, &val
);
2653 bclk_dai
= (val
& FM_PLLCTL_BCLKSEL
) >> FB_PLLCTL_BCLKSEL
;
2654 if (bclk_dai
!= dai
->id
)
2657 tscs454
->bclk_freq
= freq
;
2658 return set_sysclk(component
);
2661 static int tscs454_set_bclk_ratio(struct snd_soc_dai
*dai
,
2666 struct snd_soc_component
*component
= dai
->component
;
2670 dev_dbg(component
->dev
, "set_bclk_ratio() id = %d ratio = %u\n",
2674 case TSCS454_DAI1_ID
:
2675 mask
= FM_I2SCMC_BCMP1
;
2676 shift
= FB_I2SCMC_BCMP1
;
2678 case TSCS454_DAI2_ID
:
2679 mask
= FM_I2SCMC_BCMP2
;
2680 shift
= FB_I2SCMC_BCMP2
;
2682 case TSCS454_DAI3_ID
:
2683 mask
= FM_I2SCMC_BCMP3
;
2684 shift
= FB_I2SCMC_BCMP3
;
2688 dev_err(component
->dev
, "Unknown audio interface (%d)\n", ret
);
2694 val
= I2SCMC_BCMP_32X
;
2697 val
= I2SCMC_BCMP_40X
;
2700 val
= I2SCMC_BCMP_64X
;
2704 dev_err(component
->dev
, "Unsupported bclk ratio (%d)\n", ret
);
2708 ret
= snd_soc_component_update_bits(component
,
2709 R_I2SCMC
, mask
, val
<< shift
);
2711 dev_err(component
->dev
,
2712 "Failed to set DAI BCLK ratio (%d)\n", ret
);
2719 static inline int set_aif_master_from_fmt(struct snd_soc_component
*component
,
2720 struct aif
*aif
, unsigned int fmt
)
2724 switch (fmt
& SND_SOC_DAIFMT_MASTER_MASK
) {
2725 case SND_SOC_DAIFMT_CBM_CFM
:
2728 case SND_SOC_DAIFMT_CBS_CFS
:
2729 aif
->master
= false;
2733 dev_err(component
->dev
, "Unsupported format (%d)\n", ret
);
2740 static inline int set_aif_tdm_delay(struct snd_soc_component
*component
,
2741 unsigned int dai_id
, bool delay
)
2747 case TSCS454_DAI1_ID
:
2750 case TSCS454_DAI2_ID
:
2753 case TSCS454_DAI3_ID
:
2758 dev_err(component
->dev
,
2759 "DAI %d unknown (%d)\n", dai_id
+ 1, ret
);
2762 ret
= snd_soc_component_update_bits(component
,
2763 reg
, FM_TDMCTL0_BDELAY
, delay
);
2765 dev_err(component
->dev
, "Failed to setup tdm format (%d)\n",
2773 static inline int set_aif_format_from_fmt(struct snd_soc_component
*component
,
2774 unsigned int dai_id
, unsigned int fmt
)
2781 case TSCS454_DAI1_ID
:
2784 case TSCS454_DAI2_ID
:
2787 case TSCS454_DAI3_ID
:
2792 dev_err(component
->dev
,
2793 "DAI %d unknown (%d)\n", dai_id
+ 1, ret
);
2797 switch (fmt
& SND_SOC_DAIFMT_FORMAT_MASK
) {
2798 case SND_SOC_DAIFMT_RIGHT_J
:
2799 val
= FV_FORMAT_RIGHT
;
2801 case SND_SOC_DAIFMT_LEFT_J
:
2802 val
= FV_FORMAT_LEFT
;
2804 case SND_SOC_DAIFMT_I2S
:
2805 val
= FV_FORMAT_I2S
;
2807 case SND_SOC_DAIFMT_DSP_A
:
2808 ret
= set_aif_tdm_delay(component
, dai_id
, true);
2811 val
= FV_FORMAT_TDM
;
2813 case SND_SOC_DAIFMT_DSP_B
:
2814 ret
= set_aif_tdm_delay(component
, dai_id
, false);
2817 val
= FV_FORMAT_TDM
;
2821 dev_err(component
->dev
, "Format unsupported (%d)\n", ret
);
2825 ret
= snd_soc_component_update_bits(component
,
2826 reg
, FM_I2SPCTL_FORMAT
, val
);
2828 dev_err(component
->dev
, "Failed to set DAI %d format (%d)\n",
2837 set_aif_clock_format_from_fmt(struct snd_soc_component
*component
,
2838 unsigned int dai_id
, unsigned int fmt
)
2845 case TSCS454_DAI1_ID
:
2848 case TSCS454_DAI2_ID
:
2851 case TSCS454_DAI3_ID
:
2856 dev_err(component
->dev
,
2857 "DAI %d unknown (%d)\n", dai_id
+ 1, ret
);
2861 switch (fmt
& SND_SOC_DAIFMT_INV_MASK
) {
2862 case SND_SOC_DAIFMT_NB_NF
:
2863 val
= FV_BCLKP_NOT_INVERTED
| FV_LRCLKP_NOT_INVERTED
;
2865 case SND_SOC_DAIFMT_NB_IF
:
2866 val
= FV_BCLKP_NOT_INVERTED
| FV_LRCLKP_INVERTED
;
2868 case SND_SOC_DAIFMT_IB_NF
:
2869 val
= FV_BCLKP_INVERTED
| FV_LRCLKP_NOT_INVERTED
;
2871 case SND_SOC_DAIFMT_IB_IF
:
2872 val
= FV_BCLKP_INVERTED
| FV_LRCLKP_INVERTED
;
2876 dev_err(component
->dev
, "Format unknown (%d)\n", ret
);
2880 ret
= snd_soc_component_update_bits(component
, reg
,
2881 FM_I2SPCTL_BCLKP
| FM_I2SPCTL_LRCLKP
, val
);
2883 dev_err(component
->dev
,
2884 "Failed to set clock polarity for DAI%d (%d)\n",
2892 static int tscs454_set_dai_fmt(struct snd_soc_dai
*dai
, unsigned int fmt
)
2894 struct snd_soc_component
*component
= dai
->component
;
2895 struct tscs454
*tscs454
= snd_soc_component_get_drvdata(component
);
2896 struct aif
*aif
= &tscs454
->aifs
[dai
->id
];
2899 ret
= set_aif_master_from_fmt(component
, aif
, fmt
);
2903 ret
= set_aif_format_from_fmt(component
, dai
->id
, fmt
);
2907 ret
= set_aif_clock_format_from_fmt(component
, dai
->id
, fmt
);
2914 static int tscs454_dai1_set_tdm_slot(struct snd_soc_dai
*dai
,
2915 unsigned int tx_mask
, unsigned int rx_mask
, int slots
,
2918 struct snd_soc_component
*component
= dai
->component
;
2925 if (tx_mask
>= (1 << slots
) || rx_mask
>= (1 << slots
)) {
2927 dev_err(component
->dev
, "Invalid TDM slot mask (%d)\n", ret
);
2933 val
= FV_TDMSO_2
| FV_TDMSI_2
;
2936 val
= FV_TDMSO_4
| FV_TDMSI_4
;
2939 val
= FV_TDMSO_6
| FV_TDMSI_6
;
2943 dev_err(component
->dev
, "Invalid number of slots (%d)\n", ret
);
2947 switch (slot_width
) {
2949 val
= val
| FV_TDMDSS_16
;
2952 val
= val
| FV_TDMDSS_24
;
2955 val
= val
| FV_TDMDSS_32
;
2959 dev_err(component
->dev
, "Invalid TDM slot width (%d)\n", ret
);
2962 ret
= snd_soc_component_write(component
, R_TDMCTL1
, val
);
2964 dev_err(component
->dev
, "Failed to set slots (%d)\n", ret
);
2971 static int tscs454_dai23_set_tdm_slot(struct snd_soc_dai
*dai
,
2972 unsigned int tx_mask
, unsigned int rx_mask
, int slots
,
2975 struct snd_soc_component
*component
= dai
->component
;
2983 if (tx_mask
>= (1 << slots
) || rx_mask
>= (1 << slots
)) {
2985 dev_err(component
->dev
, "Invalid TDM slot mask (%d)\n", ret
);
2990 case TSCS454_DAI2_ID
:
2993 case TSCS454_DAI3_ID
:
2998 dev_err(component
->dev
, "Unrecognized interface %d (%d)\n",
3005 val
= FV_PCMSOP_1
| FV_PCMSIP_1
;
3008 val
= FV_PCMSOP_2
| FV_PCMSIP_2
;
3012 dev_err(component
->dev
, "Invalid number of slots (%d)\n", ret
);
3016 switch (slot_width
) {
3018 val
= val
| FV_PCMDSSP_16
;
3021 val
= val
| FV_PCMDSSP_24
;
3024 val
= val
| FV_PCMDSSP_32
;
3028 dev_err(component
->dev
, "Invalid TDM slot width (%d)\n", ret
);
3031 ret
= snd_soc_component_write(component
, reg
, val
);
3033 dev_err(component
->dev
, "Failed to set slots (%d)\n", ret
);
3040 static int set_aif_fs(struct snd_soc_component
*component
,
3052 bm
= FV_I2SMBM_0PT25
;
3056 bm
= FV_I2SMBM_0PT5
;
3060 bm
= FV_I2SMBM_0PT5
;
3075 br
= FV_I2SMBR_44PT1
;
3076 bm
= FV_I2SMBM_0PT25
;
3079 br
= FV_I2SMBR_44PT1
;
3080 bm
= FV_I2SMBM_0PT5
;
3083 br
= FV_I2SMBR_44PT1
;
3087 br
= FV_I2SMBR_44PT1
;
3092 dev_err(component
->dev
, "Unsupported sample rate (%d)\n", ret
);
3097 case TSCS454_DAI1_ID
:
3100 case TSCS454_DAI2_ID
:
3103 case TSCS454_DAI3_ID
:
3108 dev_err(component
->dev
, "DAI ID not recognized (%d)\n", ret
);
3112 ret
= snd_soc_component_update_bits(component
, reg
,
3113 FM_I2SMRATE_I2SMBR
| FM_I2SMRATE_I2SMBM
, br
|bm
);
3115 dev_err(component
->dev
,
3116 "Failed to update register (%d)\n", ret
);
3123 static int set_aif_sample_format(struct snd_soc_component
*component
,
3124 snd_pcm_format_t format
,
3132 case SNDRV_PCM_FORMAT_S16_LE
:
3135 case SNDRV_PCM_FORMAT_S20_3LE
:
3138 case SNDRV_PCM_FORMAT_S24_3LE
:
3141 case SNDRV_PCM_FORMAT_S24_LE
:
3142 case SNDRV_PCM_FORMAT_S32_LE
:
3147 dev_err(component
->dev
, "Unsupported format width (%d)\n", ret
);
3152 case TSCS454_DAI1_ID
:
3155 case TSCS454_DAI2_ID
:
3158 case TSCS454_DAI3_ID
:
3163 dev_err(component
->dev
, "AIF ID not recognized (%d)\n", ret
);
3167 ret
= snd_soc_component_update_bits(component
,
3168 reg
, FM_I2SPCTL_WL
, width
);
3170 dev_err(component
->dev
,
3171 "Failed to set sample width (%d)\n", ret
);
3178 static int tscs454_hw_params(struct snd_pcm_substream
*substream
,
3179 struct snd_pcm_hw_params
*params
,
3180 struct snd_soc_dai
*dai
)
3182 struct snd_soc_component
*component
= dai
->component
;
3183 struct tscs454
*tscs454
= snd_soc_component_get_drvdata(component
);
3184 unsigned int fs
= params_rate(params
);
3185 struct aif
*aif
= &tscs454
->aifs
[dai
->id
];
3189 mutex_lock(&tscs454
->aifs_status_lock
);
3191 dev_dbg(component
->dev
, "%s(): aif %d fs = %u\n", __func__
,
3194 if (!aif_active(&tscs454
->aifs_status
, aif
->id
)) {
3195 if (PLL_44_1K_RATE
% fs
)
3196 aif
->pll
= &tscs454
->pll1
;
3198 aif
->pll
= &tscs454
->pll2
;
3200 dev_dbg(component
->dev
, "Reserving pll %d for aif %d\n",
3201 aif
->pll
->id
, aif
->id
);
3203 reserve_pll(aif
->pll
);
3206 if (!aifs_active(&tscs454
->aifs_status
)) { /* First active aif */
3207 ret
= snd_soc_component_read(component
, R_ISRC
, &val
);
3211 if ((val
& FM_ISRC_IBR
) == FV_IBR_48
)
3212 tscs454
->internal_rate
.pll
= &tscs454
->pll1
;
3214 tscs454
->internal_rate
.pll
= &tscs454
->pll2
;
3216 dev_dbg(component
->dev
, "Reserving pll %d for ir\n",
3217 tscs454
->internal_rate
.pll
->id
);
3219 reserve_pll(tscs454
->internal_rate
.pll
);
3222 ret
= set_aif_fs(component
, aif
->id
, fs
);
3224 dev_err(component
->dev
, "Failed to set aif fs (%d)\n", ret
);
3228 ret
= set_aif_sample_format(component
, params_format(params
), aif
->id
);
3230 dev_err(component
->dev
,
3231 "Failed to set aif sample format (%d)\n", ret
);
3235 set_aif_status_active(&tscs454
->aifs_status
, aif
->id
,
3236 substream
->stream
== SNDRV_PCM_STREAM_PLAYBACK
);
3238 dev_dbg(component
->dev
, "Set aif %d active. Streams status is 0x%x\n",
3239 aif
->id
, tscs454
->aifs_status
.streams
);
3243 mutex_unlock(&tscs454
->aifs_status_lock
);
3248 static int tscs454_hw_free(struct snd_pcm_substream
*substream
,
3249 struct snd_soc_dai
*dai
)
3251 struct snd_soc_component
*component
= dai
->component
;
3252 struct tscs454
*tscs454
= snd_soc_component_get_drvdata(component
);
3253 struct aif
*aif
= &tscs454
->aifs
[dai
->id
];
3255 return aif_free(component
, aif
,
3256 substream
->stream
== SNDRV_PCM_STREAM_PLAYBACK
);
3259 static int tscs454_prepare(struct snd_pcm_substream
*substream
,
3260 struct snd_soc_dai
*dai
)
3263 struct snd_soc_component
*component
= dai
->component
;
3264 struct tscs454
*tscs454
= snd_soc_component_get_drvdata(component
);
3265 struct aif
*aif
= &tscs454
->aifs
[dai
->id
];
3267 ret
= aif_prepare(component
, aif
);
3274 static struct snd_soc_dai_ops
const tscs454_dai1_ops
= {
3275 .set_sysclk
= tscs454_set_sysclk
,
3276 .set_bclk_ratio
= tscs454_set_bclk_ratio
,
3277 .set_fmt
= tscs454_set_dai_fmt
,
3278 .set_tdm_slot
= tscs454_dai1_set_tdm_slot
,
3279 .hw_params
= tscs454_hw_params
,
3280 .hw_free
= tscs454_hw_free
,
3281 .prepare
= tscs454_prepare
,
3284 static struct snd_soc_dai_ops
const tscs454_dai23_ops
= {
3285 .set_sysclk
= tscs454_set_sysclk
,
3286 .set_bclk_ratio
= tscs454_set_bclk_ratio
,
3287 .set_fmt
= tscs454_set_dai_fmt
,
3288 .set_tdm_slot
= tscs454_dai23_set_tdm_slot
,
3289 .hw_params
= tscs454_hw_params
,
3290 .hw_free
= tscs454_hw_free
,
3291 .prepare
= tscs454_prepare
,
3294 static int tscs454_probe(struct snd_soc_component
*component
)
3296 struct tscs454
*tscs454
= snd_soc_component_get_drvdata(component
);
3300 switch (tscs454
->sysclk_src_id
) {
3301 case PLL_INPUT_XTAL
:
3302 val
= FV_PLLISEL_XTAL
;
3304 case PLL_INPUT_MCLK1
:
3305 val
= FV_PLLISEL_MCLK1
;
3307 case PLL_INPUT_MCLK2
:
3308 val
= FV_PLLISEL_MCLK2
;
3310 case PLL_INPUT_BCLK
:
3311 val
= FV_PLLISEL_BCLK
;
3315 dev_err(component
->dev
, "Invalid sysclk src id (%d)\n", ret
);
3319 ret
= snd_soc_component_update_bits(component
, R_PLLCTL
,
3320 FM_PLLCTL_PLLISEL
, val
);
3322 dev_err(component
->dev
, "Failed to set PLL input (%d)\n", ret
);
3326 if (tscs454
->sysclk_src_id
< PLL_INPUT_BCLK
)
3327 ret
= set_sysclk(component
);
3332 static const struct snd_soc_component_driver soc_component_dev_tscs454
= {
3333 .probe
= tscs454_probe
,
3334 .dapm_widgets
= tscs454_dapm_widgets
,
3335 .num_dapm_widgets
= ARRAY_SIZE(tscs454_dapm_widgets
),
3336 .dapm_routes
= tscs454_intercon
,
3337 .num_dapm_routes
= ARRAY_SIZE(tscs454_intercon
),
3338 .controls
= tscs454_snd_controls
,
3339 .num_controls
= ARRAY_SIZE(tscs454_snd_controls
),
3342 #define TSCS454_RATES SNDRV_PCM_RATE_8000_96000
3344 #define TSCS454_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE \
3345 | SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S24_LE \
3346 | SNDRV_PCM_FMTBIT_S32_LE)
3348 static struct snd_soc_dai_driver tscs454_dais
[] = {
3350 .name
= "tscs454-dai1",
3351 .id
= TSCS454_DAI1_ID
,
3353 .stream_name
= "DAI 1 Playback",
3356 .rates
= TSCS454_RATES
,
3357 .formats
= TSCS454_FORMATS
,},
3359 .stream_name
= "DAI 1 Capture",
3362 .rates
= TSCS454_RATES
,
3363 .formats
= TSCS454_FORMATS
,},
3364 .ops
= &tscs454_dai1_ops
,
3365 .symmetric_rates
= 1,
3366 .symmetric_channels
= 1,
3367 .symmetric_samplebits
= 1,
3370 .name
= "tscs454-dai2",
3371 .id
= TSCS454_DAI2_ID
,
3373 .stream_name
= "DAI 2 Playback",
3376 .rates
= TSCS454_RATES
,
3377 .formats
= TSCS454_FORMATS
,},
3379 .stream_name
= "DAI 2 Capture",
3382 .rates
= TSCS454_RATES
,
3383 .formats
= TSCS454_FORMATS
,},
3384 .ops
= &tscs454_dai23_ops
,
3385 .symmetric_rates
= 1,
3386 .symmetric_channels
= 1,
3387 .symmetric_samplebits
= 1,
3390 .name
= "tscs454-dai3",
3391 .id
= TSCS454_DAI3_ID
,
3393 .stream_name
= "DAI 3 Playback",
3396 .rates
= TSCS454_RATES
,
3397 .formats
= TSCS454_FORMATS
,},
3399 .stream_name
= "DAI 3 Capture",
3402 .rates
= TSCS454_RATES
,
3403 .formats
= TSCS454_FORMATS
,},
3404 .ops
= &tscs454_dai23_ops
,
3405 .symmetric_rates
= 1,
3406 .symmetric_channels
= 1,
3407 .symmetric_samplebits
= 1,
3411 static char const * const src_names
[] = {
3412 "xtal", "mclk1", "mclk2", "bclk"};
3414 static int tscs454_i2c_probe(struct i2c_client
*i2c
,
3415 const struct i2c_device_id
*id
)
3417 struct tscs454
*tscs454
;
3421 tscs454
= devm_kzalloc(&i2c
->dev
, sizeof(*tscs454
), GFP_KERNEL
);
3425 ret
= tscs454_data_init(tscs454
, i2c
);
3429 i2c_set_clientdata(i2c
, tscs454
);
3431 for (src
= PLL_INPUT_XTAL
; src
< PLL_INPUT_BCLK
; src
++) {
3432 tscs454
->sysclk
= devm_clk_get(&i2c
->dev
, src_names
[src
]);
3433 if (!IS_ERR(tscs454
->sysclk
)) {
3435 } else if (PTR_ERR(tscs454
->sysclk
) != -ENOENT
) {
3436 ret
= PTR_ERR(tscs454
->sysclk
);
3437 dev_err(&i2c
->dev
, "Failed to get sysclk (%d)\n", ret
);
3441 dev_dbg(&i2c
->dev
, "PLL input is %s\n", src_names
[src
]);
3442 tscs454
->sysclk_src_id
= src
;
3444 ret
= regmap_write(tscs454
->regmap
,
3445 R_RESET
, FV_RESET_PWR_ON_DEFAULTS
);
3447 dev_err(&i2c
->dev
, "Failed to reset the component (%d)\n", ret
);
3450 regcache_mark_dirty(tscs454
->regmap
);
3452 ret
= regmap_register_patch(tscs454
->regmap
, tscs454_patch
,
3453 ARRAY_SIZE(tscs454_patch
));
3455 dev_err(&i2c
->dev
, "Failed to apply patch (%d)\n", ret
);
3458 /* Sync pg sel reg with cache */
3459 regmap_write(tscs454
->regmap
, R_PAGESEL
, 0x00);
3461 ret
= devm_snd_soc_register_component(&i2c
->dev
, &soc_component_dev_tscs454
,
3462 tscs454_dais
, ARRAY_SIZE(tscs454_dais
));
3464 dev_err(&i2c
->dev
, "Failed to register component (%d)\n", ret
);
3471 static const struct i2c_device_id tscs454_i2c_id
[] = {
3475 MODULE_DEVICE_TABLE(i2c
, tscs454_i2c_id
);
3477 static const struct of_device_id tscs454_of_match
[] = {
3478 { .compatible
= "tempo,tscs454", },
3481 MODULE_DEVICE_TABLE(of
, tscs454_of_match
);
3483 static struct i2c_driver tscs454_i2c_driver
= {
3486 .of_match_table
= tscs454_of_match
,
3488 .probe
= tscs454_i2c_probe
,
3489 .id_table
= tscs454_i2c_id
,
3492 module_i2c_driver(tscs454_i2c_driver
);
3494 MODULE_AUTHOR("Tempo Semiconductor <steven.eckhoff.opensource@gmail.com");
3495 MODULE_DESCRIPTION("ASoC TSCS454 driver");
3496 MODULE_LICENSE("GPL v2");