diff options
author | Lee Jones <lee.jones@linaro.org> | 2013-12-19 10:55:08 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-01-07 10:37:20 -0500 |
commit | 33899b19851db3d5baf1bcde49fe90cd5f68c82c (patch) | |
tree | d2971387869e9d349ffc735d7168d2100b2109b0 /sound/soc/ux500 | |
parent | 86a3fdfc63402ffbcee226c4a2503eee14a41afe (diff) |
ASoC: ux500: Dramatically reduce the size of the DAI driver data struct
We no longer have a means to differentiate between MSP devices at probe
time, mainly because we don't really have to. So rather than have an over-
sized static data structure in place, where the only difference between
devices is the ID and name (which are unused), we'll just create one
succinct, statically assigned and shared one instead.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/ux500')
-rw-r--r-- | sound/soc/ux500/ux500_msp_dai.c | 96 |
1 files changed, 14 insertions, 82 deletions
diff --git a/sound/soc/ux500/ux500_msp_dai.c b/sound/soc/ux500/ux500_msp_dai.c index f4d607a72668..5f4807b2c007 100644 --- a/sound/soc/ux500/ux500_msp_dai.c +++ b/sound/soc/ux500/ux500_msp_dai.c | |||
@@ -718,87 +718,19 @@ static struct snd_soc_dai_ops ux500_msp_dai_ops[] = { | |||
718 | } | 718 | } |
719 | }; | 719 | }; |
720 | 720 | ||
721 | static struct snd_soc_dai_driver ux500_msp_dai_drv[UX500_NBR_OF_DAI] = { | 721 | static struct snd_soc_dai_driver ux500_msp_dai_drv = { |
722 | { | 722 | .probe = ux500_msp_dai_probe, |
723 | .name = "ux500-msp-i2s.0", | 723 | .suspend = NULL, |
724 | .probe = ux500_msp_dai_probe, | 724 | .resume = NULL, |
725 | .id = 0, | 725 | .playback.channels_min = UX500_MSP_MIN_CHANNELS, |
726 | .suspend = NULL, | 726 | .playback.channels_max = UX500_MSP_MAX_CHANNELS, |
727 | .resume = NULL, | 727 | .playback.rates = UX500_I2S_RATES, |
728 | .playback = { | 728 | .playback.formats = UX500_I2S_FORMATS, |
729 | .channels_min = UX500_MSP_MIN_CHANNELS, | 729 | .capture.channels_min = UX500_MSP_MIN_CHANNELS, |
730 | .channels_max = UX500_MSP_MAX_CHANNELS, | 730 | .capture.channels_max = UX500_MSP_MAX_CHANNELS, |
731 | .rates = UX500_I2S_RATES, | 731 | .capture.rates = UX500_I2S_RATES, |
732 | .formats = UX500_I2S_FORMATS, | 732 | .capture.formats = UX500_I2S_FORMATS, |
733 | }, | 733 | .ops = ux500_msp_dai_ops, |
734 | .capture = { | ||
735 | .channels_min = UX500_MSP_MIN_CHANNELS, | ||
736 | .channels_max = UX500_MSP_MAX_CHANNELS, | ||
737 | .rates = UX500_I2S_RATES, | ||
738 | .formats = UX500_I2S_FORMATS, | ||
739 | }, | ||
740 | .ops = ux500_msp_dai_ops, | ||
741 | }, | ||
742 | { | ||
743 | .name = "ux500-msp-i2s.1", | ||
744 | .probe = ux500_msp_dai_probe, | ||
745 | .id = 1, | ||
746 | .suspend = NULL, | ||
747 | .resume = NULL, | ||
748 | .playback = { | ||
749 | .channels_min = UX500_MSP_MIN_CHANNELS, | ||
750 | .channels_max = UX500_MSP_MAX_CHANNELS, | ||
751 | .rates = UX500_I2S_RATES, | ||
752 | .formats = UX500_I2S_FORMATS, | ||
753 | }, | ||
754 | .capture = { | ||
755 | .channels_min = UX500_MSP_MIN_CHANNELS, | ||
756 | .channels_max = UX500_MSP_MAX_CHANNELS, | ||
757 | .rates = UX500_I2S_RATES, | ||
758 | .formats = UX500_I2S_FORMATS, | ||
759 | }, | ||
760 | .ops = ux500_msp_dai_ops, | ||
761 | }, | ||
762 | { | ||
763 | .name = "ux500-msp-i2s.2", | ||
764 | .id = 2, | ||
765 | .probe = ux500_msp_dai_probe, | ||
766 | .suspend = NULL, | ||
767 | .resume = NULL, | ||
768 | .playback = { | ||
769 | .channels_min = UX500_MSP_MIN_CHANNELS, | ||
770 | .channels_max = UX500_MSP_MAX_CHANNELS, | ||
771 | .rates = UX500_I2S_RATES, | ||
772 | .formats = UX500_I2S_FORMATS, | ||
773 | }, | ||
774 | .capture = { | ||
775 | .channels_min = UX500_MSP_MIN_CHANNELS, | ||
776 | .channels_max = UX500_MSP_MAX_CHANNELS, | ||
777 | .rates = UX500_I2S_RATES, | ||
778 | .formats = UX500_I2S_FORMATS, | ||
779 | }, | ||
780 | .ops = ux500_msp_dai_ops, | ||
781 | }, | ||
782 | { | ||
783 | .name = "ux500-msp-i2s.3", | ||
784 | .probe = ux500_msp_dai_probe, | ||
785 | .id = 3, | ||
786 | .suspend = NULL, | ||
787 | .resume = NULL, | ||
788 | .playback = { | ||
789 | .channels_min = UX500_MSP_MIN_CHANNELS, | ||
790 | .channels_max = UX500_MSP_MAX_CHANNELS, | ||
791 | .rates = UX500_I2S_RATES, | ||
792 | .formats = UX500_I2S_FORMATS, | ||
793 | }, | ||
794 | .capture = { | ||
795 | .channels_min = UX500_MSP_MIN_CHANNELS, | ||
796 | .channels_max = UX500_MSP_MAX_CHANNELS, | ||
797 | .rates = UX500_I2S_RATES, | ||
798 | .formats = UX500_I2S_FORMATS, | ||
799 | }, | ||
800 | .ops = ux500_msp_dai_ops, | ||
801 | }, | ||
802 | }; | 734 | }; |
803 | 735 | ||
804 | static const struct snd_soc_component_driver ux500_msp_component = { | 736 | static const struct snd_soc_component_driver ux500_msp_component = { |
@@ -868,7 +800,7 @@ static int ux500_msp_drv_probe(struct platform_device *pdev) | |||
868 | dev_set_drvdata(&pdev->dev, drvdata); | 800 | dev_set_drvdata(&pdev->dev, drvdata); |
869 | 801 | ||
870 | ret = snd_soc_register_component(&pdev->dev, &ux500_msp_component, | 802 | ret = snd_soc_register_component(&pdev->dev, &ux500_msp_component, |
871 | &ux500_msp_dai_drv[drvdata->msp->id], 1); | 803 | &ux500_msp_dai_drv, 1); |
872 | if (ret < 0) { | 804 | if (ret < 0) { |
873 | dev_err(&pdev->dev, "Error: %s: Failed to register MSP%d!\n", | 805 | dev_err(&pdev->dev, "Error: %s: Failed to register MSP%d!\n", |
874 | __func__, drvdata->msp->id); | 806 | __func__, drvdata->msp->id); |