diff options
author | Shengjiu Wang <b02247@freescale.com> | 2014-04-29 21:31:53 -0400 |
---|---|---|
committer | Shengjiu Wang <b02247@freescale.com> | 2014-04-30 01:11:47 -0400 |
commit | 9d1e3bc509ada992be89b74791f0f0e44478f335 (patch) | |
tree | 7e99328545d4e86b6cd430e37d301d83217b3a39 /sound/soc/fsl | |
parent | 3cc94225a28269c2d5892c5148d54cb3e9764c76 (diff) |
ENGR00311068 ASoC: fsl_hdmi: passthrough can't work for android
Android need driver to export several kcontrol. "Support channels",
"Support Rates", "Support Formats".
Signed-off-by: Shengjiu Wang <b02247@freescale.com>
Diffstat (limited to 'sound/soc/fsl')
-rw-r--r-- | sound/soc/fsl/fsl_hdmi.c | 102 |
1 files changed, 101 insertions, 1 deletions
diff --git a/sound/soc/fsl/fsl_hdmi.c b/sound/soc/fsl/fsl_hdmi.c index fb9e8526b81c..cfa8677e88e7 100644 --- a/sound/soc/fsl/fsl_hdmi.c +++ b/sound/soc/fsl/fsl_hdmi.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * ALSA SoC HDMI Audio Layer for Freescale i.MX | 2 | * ALSA SoC HDMI Audio Layer for Freescale i.MX |
3 | * | 3 | * |
4 | * Copyright (C) 2011-2013 Freescale Semiconductor, Inc. | 4 | * Copyright (C) 2011-2014 Freescale Semiconductor, Inc. |
5 | * | 5 | * |
6 | * Some code from patch_hdmi.c | 6 | * Some code from patch_hdmi.c |
7 | * Copyright (c) 2008-2010 Intel Corporation. All rights reserved. | 7 | * Copyright (c) 2008-2010 Intel Corporation. All rights reserved. |
@@ -454,6 +454,82 @@ static int fsl_hdmi_iec_put(struct snd_kcontrol *kcontrol, | |||
454 | return 0; | 454 | return 0; |
455 | } | 455 | } |
456 | 456 | ||
457 | static int fsl_hdmi_channels_info(struct snd_kcontrol *kcontrol, | ||
458 | struct snd_ctl_elem_info *uinfo) | ||
459 | { | ||
460 | hdmi_get_edid_cfg(&edid_cfg); | ||
461 | fsl_hdmi_get_playback_channels(); | ||
462 | |||
463 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; | ||
464 | uinfo->count = playback_constraint_channels.count; | ||
465 | |||
466 | return 0; | ||
467 | } | ||
468 | |||
469 | |||
470 | static int fsl_hdmi_channels_get(struct snd_kcontrol *kcontrol, | ||
471 | struct snd_ctl_elem_value *uvalue) | ||
472 | { | ||
473 | int i; | ||
474 | hdmi_get_edid_cfg(&edid_cfg); | ||
475 | fsl_hdmi_get_playback_channels(); | ||
476 | |||
477 | for (i = 0 ; i < playback_constraint_channels.count ; i++) | ||
478 | uvalue->value.integer.value[i] = playback_channels[i]; | ||
479 | |||
480 | return 0; | ||
481 | } | ||
482 | |||
483 | static int fsl_hdmi_rates_info(struct snd_kcontrol *kcontrol, | ||
484 | struct snd_ctl_elem_info *uinfo) | ||
485 | { | ||
486 | hdmi_get_edid_cfg(&edid_cfg); | ||
487 | fsl_hdmi_get_playback_rates(); | ||
488 | |||
489 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; | ||
490 | uinfo->count = playback_constraint_rates.count; | ||
491 | |||
492 | return 0; | ||
493 | } | ||
494 | |||
495 | static int fsl_hdmi_rates_get(struct snd_kcontrol *kcontrol, | ||
496 | struct snd_ctl_elem_value *uvalue) | ||
497 | { | ||
498 | int i; | ||
499 | hdmi_get_edid_cfg(&edid_cfg); | ||
500 | fsl_hdmi_get_playback_rates(); | ||
501 | |||
502 | for (i = 0 ; i < playback_constraint_rates.count ; i++) | ||
503 | uvalue->value.integer.value[i] = playback_rates[i]; | ||
504 | |||
505 | return 0; | ||
506 | } | ||
507 | |||
508 | static int fsl_hdmi_formats_info(struct snd_kcontrol *kcontrol, | ||
509 | struct snd_ctl_elem_info *uinfo) | ||
510 | { | ||
511 | hdmi_get_edid_cfg(&edid_cfg); | ||
512 | fsl_hdmi_get_playback_sample_size(); | ||
513 | |||
514 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; | ||
515 | uinfo->count = playback_constraint_bits.count; | ||
516 | |||
517 | return 0; | ||
518 | } | ||
519 | |||
520 | static int fsl_hdmi_formats_get(struct snd_kcontrol *kcontrol, | ||
521 | struct snd_ctl_elem_value *uvalue) | ||
522 | { | ||
523 | int i; | ||
524 | hdmi_get_edid_cfg(&edid_cfg); | ||
525 | fsl_hdmi_get_playback_sample_size(); | ||
526 | |||
527 | for (i = 0 ; i < playback_constraint_bits.count ; i++) | ||
528 | uvalue->value.integer.value[i] = playback_sample_size[i]; | ||
529 | |||
530 | return 0; | ||
531 | } | ||
532 | |||
457 | static struct snd_kcontrol_new fsl_hdmi_ctrls[] = { | 533 | static struct snd_kcontrol_new fsl_hdmi_ctrls[] = { |
458 | /* Status cchanel controller */ | 534 | /* Status cchanel controller */ |
459 | { | 535 | { |
@@ -466,6 +542,30 @@ static struct snd_kcontrol_new fsl_hdmi_ctrls[] = { | |||
466 | .get = fsl_hdmi_iec_get, | 542 | .get = fsl_hdmi_iec_get, |
467 | .put = fsl_hdmi_iec_put, | 543 | .put = fsl_hdmi_iec_put, |
468 | }, | 544 | }, |
545 | { | ||
546 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | ||
547 | .name = "HDMI Support Channels", | ||
548 | .access = SNDRV_CTL_ELEM_ACCESS_READ | | ||
549 | SNDRV_CTL_ELEM_ACCESS_VOLATILE, | ||
550 | .info = fsl_hdmi_channels_info, | ||
551 | .get = fsl_hdmi_channels_get, | ||
552 | }, | ||
553 | { | ||
554 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | ||
555 | .name = "HDMI Support Rates", | ||
556 | .access = SNDRV_CTL_ELEM_ACCESS_READ | | ||
557 | SNDRV_CTL_ELEM_ACCESS_VOLATILE, | ||
558 | .info = fsl_hdmi_rates_info, | ||
559 | .get = fsl_hdmi_rates_get, | ||
560 | }, | ||
561 | { | ||
562 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | ||
563 | .name = "HDMI Support Formats", | ||
564 | .access = SNDRV_CTL_ELEM_ACCESS_READ | | ||
565 | SNDRV_CTL_ELEM_ACCESS_VOLATILE, | ||
566 | .info = fsl_hdmi_formats_info, | ||
567 | .get = fsl_hdmi_formats_get, | ||
568 | }, | ||
469 | }; | 569 | }; |
470 | 570 | ||
471 | static int fsl_hdmi_soc_dai_probe(struct snd_soc_dai *dai) | 571 | static int fsl_hdmi_soc_dai_probe(struct snd_soc_dai *dai) |