diff options
author | b02247 <b02247@freescale.com> | 2012-10-23 15:11:16 +0800 |
---|---|---|
committer | b02247 <b02247@freescale.com> | 2012-10-25 10:09:05 +0800 |
commit | d3b20b0bf525c055a99a52eed9c72c0b566aba81 (patch) | |
tree | 46188253379b6791c740e1ba0dd5a32dc0960e8e /sound | |
parent | b3d5e59e1c4abeb93ef8592b5de173e22faec077 (diff) |
ENGR00225708 Add controls for HDMI codec
Add "HDMI Support channels" control for HDMI codec
Add "HDMI Support Rates" control for HDMI codec
Add "HDMI Support Formats" control for HDMI codec
Signed-off-by: b02247 <b02247@freescale.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/mxc_hdmi.c | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/sound/soc/codecs/mxc_hdmi.c b/sound/soc/codecs/mxc_hdmi.c index 9590181d4647..56dba0194871 100644 --- a/sound/soc/codecs/mxc_hdmi.c +++ b/sound/soc/codecs/mxc_hdmi.c @@ -503,6 +503,81 @@ static int mxc_hdmi_iec_put(struct snd_kcontrol *kcontrol, return 0; } +static int mxc_hdmi_channels_info(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_info *uinfo) +{ + hdmi_get_edid_cfg(&edid_cfg); + mxc_hdmi_get_playback_channels(); + + uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; + uinfo->count = playback_constraint_channels.count; + + return 0; +} + +static int mxc_hdmi_channels_get(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *uvalue) +{ + int i; + hdmi_get_edid_cfg(&edid_cfg); + mxc_hdmi_get_playback_channels(); + + for (i = 0 ; i < playback_constraint_channels.count ; i++) + uvalue->value.integer.value[i] = playback_channels[i]; + + return 0; +} + +static int mxc_hdmi_rates_info(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_info *uinfo) +{ + hdmi_get_edid_cfg(&edid_cfg); + mxc_hdmi_get_playback_rates(); + + uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; + uinfo->count = playback_constraint_rates.count; + + return 0; +} + +static int mxc_hdmi_rates_get(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *uvalue) +{ + int i; + hdmi_get_edid_cfg(&edid_cfg); + mxc_hdmi_get_playback_rates(); + + for (i = 0 ; i < playback_constraint_rates.count ; i++) + uvalue->value.integer.value[i] = playback_rates[i]; + + return 0; +} + +static int mxc_hdmi_formats_info(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_info *uinfo) +{ + hdmi_get_edid_cfg(&edid_cfg); + mxc_hdmi_get_playback_sample_size(); + + uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; + uinfo->count = playback_constraint_bits.count; + + return 0; +} + +static int mxc_hdmi_formats_get(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *uvalue) +{ + int i; + hdmi_get_edid_cfg(&edid_cfg); + mxc_hdmi_get_playback_sample_size(); + + for (i = 0 ; i < playback_constraint_bits.count ; i++) + uvalue->value.integer.value[i] = playback_sample_size[i]; + + return 0; +} + static struct snd_kcontrol_new mxc_hdmi_ctrls[] = { /* status cchanel controller */ { @@ -514,6 +589,30 @@ static struct snd_kcontrol_new mxc_hdmi_ctrls[] = { .get = mxc_hdmi_iec_get, .put = mxc_hdmi_iec_put, }, + { + .iface = SNDRV_CTL_ELEM_IFACE_MIXER, + .name = "HDMI Support Channels", + .access = SNDRV_CTL_ELEM_ACCESS_READ | + SNDRV_CTL_ELEM_ACCESS_VOLATILE, + .info = mxc_hdmi_channels_info, + .get = mxc_hdmi_channels_get, + }, + { + .iface = SNDRV_CTL_ELEM_IFACE_MIXER, + .name = "HDMI Support Rates", + .access = SNDRV_CTL_ELEM_ACCESS_READ | + SNDRV_CTL_ELEM_ACCESS_VOLATILE, + .info = mxc_hdmi_rates_info, + .get = mxc_hdmi_rates_get, + }, + { + .iface = SNDRV_CTL_ELEM_IFACE_MIXER, + .name = "HDMI Support Formats", + .access = SNDRV_CTL_ELEM_ACCESS_READ | + SNDRV_CTL_ELEM_ACCESS_VOLATILE, + .info = mxc_hdmi_formats_info, + .get = mxc_hdmi_formats_get, + }, }; static struct snd_soc_dai_ops mxc_hdmi_codec_dai_ops = { |