|
@@ -2117,130 +2117,6 @@ int snd_hda_mixer_amp_switch_put(struct snd_kcontrol *kcontrol,
|
|
|
}
|
|
|
EXPORT_SYMBOL_GPL(snd_hda_mixer_amp_switch_put);
|
|
|
|
|
|
-/**
|
|
|
- * snd_hda_mixer_bind_ctls_info - Info callback for a generic bound control
|
|
|
- * @kcontrol: referred ctl element
|
|
|
- * @uinfo: pointer to get/store the data
|
|
|
- *
|
|
|
- * The control element is supposed to have the private_value field
|
|
|
- * set up via HDA_BIND_VOL() or HDA_BIND_SW() macros.
|
|
|
- */
|
|
|
-int snd_hda_mixer_bind_ctls_info(struct snd_kcontrol *kcontrol,
|
|
|
- struct snd_ctl_elem_info *uinfo)
|
|
|
-{
|
|
|
- struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
|
|
|
- struct hda_bind_ctls *c;
|
|
|
- int err;
|
|
|
-
|
|
|
- mutex_lock(&codec->control_mutex);
|
|
|
- c = (struct hda_bind_ctls *)kcontrol->private_value;
|
|
|
- kcontrol->private_value = *c->values;
|
|
|
- err = c->ops->info(kcontrol, uinfo);
|
|
|
- kcontrol->private_value = (long)c;
|
|
|
- mutex_unlock(&codec->control_mutex);
|
|
|
- return err;
|
|
|
-}
|
|
|
-EXPORT_SYMBOL_GPL(snd_hda_mixer_bind_ctls_info);
|
|
|
-
|
|
|
-/**
|
|
|
- * snd_hda_mixer_bind_ctls_get - Get callback for a generic bound control
|
|
|
- * @kcontrol: ctl element
|
|
|
- * @ucontrol: pointer to get/store the data
|
|
|
- *
|
|
|
- * The control element is supposed to have the private_value field
|
|
|
- * set up via HDA_BIND_VOL() or HDA_BIND_SW() macros.
|
|
|
- */
|
|
|
-int snd_hda_mixer_bind_ctls_get(struct snd_kcontrol *kcontrol,
|
|
|
- struct snd_ctl_elem_value *ucontrol)
|
|
|
-{
|
|
|
- struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
|
|
|
- struct hda_bind_ctls *c;
|
|
|
- int err;
|
|
|
-
|
|
|
- mutex_lock(&codec->control_mutex);
|
|
|
- c = (struct hda_bind_ctls *)kcontrol->private_value;
|
|
|
- kcontrol->private_value = *c->values;
|
|
|
- err = c->ops->get(kcontrol, ucontrol);
|
|
|
- kcontrol->private_value = (long)c;
|
|
|
- mutex_unlock(&codec->control_mutex);
|
|
|
- return err;
|
|
|
-}
|
|
|
-EXPORT_SYMBOL_GPL(snd_hda_mixer_bind_ctls_get);
|
|
|
-
|
|
|
-/**
|
|
|
- * snd_hda_mixer_bind_ctls_put - Put callback for a generic bound control
|
|
|
- * @kcontrol: ctl element
|
|
|
- * @ucontrol: pointer to get/store the data
|
|
|
- *
|
|
|
- * The control element is supposed to have the private_value field
|
|
|
- * set up via HDA_BIND_VOL() or HDA_BIND_SW() macros.
|
|
|
- */
|
|
|
-int snd_hda_mixer_bind_ctls_put(struct snd_kcontrol *kcontrol,
|
|
|
- struct snd_ctl_elem_value *ucontrol)
|
|
|
-{
|
|
|
- struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
|
|
|
- struct hda_bind_ctls *c;
|
|
|
- unsigned long *vals;
|
|
|
- int err = 0, change = 0;
|
|
|
-
|
|
|
- mutex_lock(&codec->control_mutex);
|
|
|
- c = (struct hda_bind_ctls *)kcontrol->private_value;
|
|
|
- for (vals = c->values; *vals; vals++) {
|
|
|
- kcontrol->private_value = *vals;
|
|
|
- err = c->ops->put(kcontrol, ucontrol);
|
|
|
- if (err < 0)
|
|
|
- break;
|
|
|
- change |= err;
|
|
|
- }
|
|
|
- kcontrol->private_value = (long)c;
|
|
|
- mutex_unlock(&codec->control_mutex);
|
|
|
- return err < 0 ? err : change;
|
|
|
-}
|
|
|
-EXPORT_SYMBOL_GPL(snd_hda_mixer_bind_ctls_put);
|
|
|
-
|
|
|
-/**
|
|
|
- * snd_hda_mixer_bind_tlv - TLV callback for a generic bound control
|
|
|
- * @kcontrol: ctl element
|
|
|
- * @op_flag: operation flag
|
|
|
- * @size: byte size of input TLV
|
|
|
- * @tlv: TLV data
|
|
|
- *
|
|
|
- * The control element is supposed to have the private_value field
|
|
|
- * set up via HDA_BIND_VOL() macro.
|
|
|
- */
|
|
|
-int snd_hda_mixer_bind_tlv(struct snd_kcontrol *kcontrol, int op_flag,
|
|
|
- unsigned int size, unsigned int __user *tlv)
|
|
|
-{
|
|
|
- struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
|
|
|
- struct hda_bind_ctls *c;
|
|
|
- int err;
|
|
|
-
|
|
|
- mutex_lock(&codec->control_mutex);
|
|
|
- c = (struct hda_bind_ctls *)kcontrol->private_value;
|
|
|
- kcontrol->private_value = *c->values;
|
|
|
- err = c->ops->tlv(kcontrol, op_flag, size, tlv);
|
|
|
- kcontrol->private_value = (long)c;
|
|
|
- mutex_unlock(&codec->control_mutex);
|
|
|
- return err;
|
|
|
-}
|
|
|
-EXPORT_SYMBOL_GPL(snd_hda_mixer_bind_tlv);
|
|
|
-
|
|
|
-struct hda_ctl_ops snd_hda_bind_vol = {
|
|
|
- .info = snd_hda_mixer_amp_volume_info,
|
|
|
- .get = snd_hda_mixer_amp_volume_get,
|
|
|
- .put = snd_hda_mixer_amp_volume_put,
|
|
|
- .tlv = snd_hda_mixer_amp_tlv
|
|
|
-};
|
|
|
-EXPORT_SYMBOL_GPL(snd_hda_bind_vol);
|
|
|
-
|
|
|
-struct hda_ctl_ops snd_hda_bind_sw = {
|
|
|
- .info = snd_hda_mixer_amp_switch_info,
|
|
|
- .get = snd_hda_mixer_amp_switch_get,
|
|
|
- .put = snd_hda_mixer_amp_switch_put,
|
|
|
- .tlv = snd_hda_mixer_amp_tlv
|
|
|
-};
|
|
|
-EXPORT_SYMBOL_GPL(snd_hda_bind_sw);
|
|
|
-
|
|
|
/*
|
|
|
* SPDIF out controls
|
|
|
*/
|