@@ -104,7 +104,7 @@ static int tas2781_amp_putvol(struct snd_kcontrol *kcontrol,
104
104
return tasdevice_amp_putvol (tas_priv , ucontrol , mc );
105
105
}
106
106
107
- static int tas2781_force_fwload_get (struct snd_kcontrol * kcontrol ,
107
+ static int tasdev_force_fwload_get (struct snd_kcontrol * kcontrol ,
108
108
struct snd_ctl_elem_value * ucontrol )
109
109
{
110
110
struct snd_soc_component * component =
@@ -119,7 +119,7 @@ static int tas2781_force_fwload_get(struct snd_kcontrol *kcontrol,
119
119
return 0 ;
120
120
}
121
121
122
- static int tas2781_force_fwload_put (struct snd_kcontrol * kcontrol ,
122
+ static int tasdev_force_fwload_put (struct snd_kcontrol * kcontrol ,
123
123
struct snd_ctl_elem_value * ucontrol )
124
124
{
125
125
struct snd_soc_component * component =
@@ -140,15 +140,18 @@ static int tas2781_force_fwload_put(struct snd_kcontrol *kcontrol,
140
140
return change ;
141
141
}
142
142
143
+ static const struct snd_kcontrol_new tasdevice_snd_controls [] = {
144
+ SOC_SINGLE_BOOL_EXT ("Speaker Force Firmware Load" , 0 ,
145
+ tasdev_force_fwload_get , tasdev_force_fwload_put ),
146
+ };
147
+
143
148
static const struct snd_kcontrol_new tas2781_snd_controls [] = {
144
149
SOC_SINGLE_RANGE_EXT_TLV ("Speaker Analog Gain" , TAS2781_AMP_LEVEL ,
145
150
1 , 0 , 20 , 0 , tas2781_amp_getvol ,
146
151
tas2781_amp_putvol , amp_vol_tlv ),
147
152
SOC_SINGLE_RANGE_EXT_TLV ("Speaker Digital Gain" , TAS2781_DVC_LVL ,
148
153
0 , 0 , 200 , 1 , tas2781_digital_getvol ,
149
154
tas2781_digital_putvol , dvc_tlv ),
150
- SOC_SINGLE_BOOL_EXT ("Speaker Force Firmware Load" , 0 ,
151
- tas2781_force_fwload_get , tas2781_force_fwload_put ),
152
155
};
153
156
154
157
static int tasdevice_set_profile_id (struct snd_kcontrol * kcontrol ,
@@ -590,6 +593,18 @@ static struct snd_soc_dai_driver tasdevice_dai_driver[] = {
590
593
static int tasdevice_codec_probe (struct snd_soc_component * codec )
591
594
{
592
595
struct tasdevice_priv * tas_priv = snd_soc_component_get_drvdata (codec );
596
+ int rc ;
597
+
598
+ if (tas_priv -> chip_id == TAS2781 ) {
599
+ rc = snd_soc_add_component_controls (codec ,
600
+ tas2781_snd_controls ,
601
+ ARRAY_SIZE (tas2781_snd_controls ));
602
+ if (rc < 0 ) {
603
+ dev_err (tas_priv -> dev , "%s: Add control err rc = %d" ,
604
+ __func__ , rc );
605
+ return rc ;
606
+ }
607
+ }
593
608
594
609
tas_priv -> name_prefix = codec -> name_prefix ;
595
610
return tascodec_init (tas_priv , codec , THIS_MODULE , tasdevice_fw_ready );
@@ -617,8 +632,8 @@ static const struct snd_soc_component_driver
617
632
soc_codec_driver_tasdevice = {
618
633
.probe = tasdevice_codec_probe ,
619
634
.remove = tasdevice_codec_remove ,
620
- .controls = tas2781_snd_controls ,
621
- .num_controls = ARRAY_SIZE (tas2781_snd_controls ),
635
+ .controls = tasdevice_snd_controls ,
636
+ .num_controls = ARRAY_SIZE (tasdevice_snd_controls ),
622
637
.dapm_widgets = tasdevice_dapm_widgets ,
623
638
.num_dapm_widgets = ARRAY_SIZE (tasdevice_dapm_widgets ),
624
639
.dapm_routes = tasdevice_audio_map ,
@@ -759,7 +774,7 @@ MODULE_DEVICE_TABLE(acpi, tasdevice_acpi_match);
759
774
760
775
static struct i2c_driver tasdevice_i2c_driver = {
761
776
.driver = {
762
- .name = "tas2781 -codec" ,
777
+ .name = "tasdev -codec" ,
763
778
.of_match_table = of_match_ptr (tasdevice_of_match ),
764
779
#ifdef CONFIG_ACPI
765
780
.acpi_match_table = ACPI_PTR (tasdevice_acpi_match ),
0 commit comments