diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-12 11:00:30 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-12 11:00:30 -0500 |
commit | a429638cac1e5c656818a45aaff78df7b743004e (patch) | |
tree | 0465e0d7a431bff97a3dd5a1f91d9b30c69ae0d8 /sound/soc/davinci/davinci-mcasp.c | |
parent | 5cf9a4e69c1ff0ccdd1d2b7404f95c0531355274 (diff) | |
parent | 9e4ce164ee3a1d07580f017069c25d180b0aa785 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (526 commits)
ASoC: twl6040 - Add method to query optimum PDM_DL1 gain
ALSA: hda - Fix the lost power-setup of seconary pins after PM resume
ALSA: usb-audio: add Yamaha MOX6/MOX8 support
ALSA: virtuoso: add S/PDIF input support for all Xonars
ALSA: ice1724 - Support for ooAoo SQ210a
ALSA: ice1724 - Allow card info based on model only
ALSA: ice1724 - Create capture pcm only for ADC-enabled configurations
ALSA: hdspm - Provide unique driver id based on card serial
ASoC: Dynamically allocate the rtd device for a non-empty release()
ASoC: Fix recursive dependency due to select ATMEL_SSC in SND_ATMEL_SOC_SSC
ALSA: hda - Fix the detection of "Loopback Mixing" control for VIA codecs
ALSA: hda - Return the error from get_wcaps_type() for invalid NIDs
ALSA: hda - Use auto-parser for HP laptops with cx20459 codec
ALSA: asihpi - Fix potential Oops in snd_asihpi_cmode_info()
ALSA: hdsp - Fix potential Oops in snd_hdsp_info_pref_sync_ref()
ALSA: hda/cirrus - support for iMac12,2 model
ASoC: cx20442: add bias control over a platform provided regulator
ALSA: usb-audio - Avoid flood of frame-active debug messages
ALSA: snd-usb-us122l: Delete calls to preempt_disable
mfd: Put WM8994 into cache only mode when suspending
...
Fix up trivial conflicts in:
- arch/arm/mach-s3c64xx/mach-crag6410.c:
renamed speyside_wm8962 to tobermory, added littlemill right
next to it
- drivers/base/regmap/{regcache.c,regmap.c}:
duplicate diff that had already come in with other changes in
the regmap tree
Diffstat (limited to 'sound/soc/davinci/davinci-mcasp.c')
-rw-r--r-- | sound/soc/davinci/davinci-mcasp.c | 54 |
1 files changed, 14 insertions, 40 deletions
diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c index 7173df254a91..95441bfc8190 100644 --- a/sound/soc/davinci/davinci-mcasp.c +++ b/sound/soc/davinci/davinci-mcasp.c | |||
@@ -813,7 +813,7 @@ static int davinci_mcasp_startup(struct snd_pcm_substream *substream, | |||
813 | return 0; | 813 | return 0; |
814 | } | 814 | } |
815 | 815 | ||
816 | static struct snd_soc_dai_ops davinci_mcasp_dai_ops = { | 816 | static const struct snd_soc_dai_ops davinci_mcasp_dai_ops = { |
817 | .startup = davinci_mcasp_startup, | 817 | .startup = davinci_mcasp_startup, |
818 | .trigger = davinci_mcasp_trigger, | 818 | .trigger = davinci_mcasp_trigger, |
819 | .hw_params = davinci_mcasp_hw_params, | 819 | .hw_params = davinci_mcasp_hw_params, |
@@ -865,38 +865,35 @@ static int davinci_mcasp_probe(struct platform_device *pdev) | |||
865 | struct resource *mem, *ioarea, *res; | 865 | struct resource *mem, *ioarea, *res; |
866 | struct snd_platform_data *pdata; | 866 | struct snd_platform_data *pdata; |
867 | struct davinci_audio_dev *dev; | 867 | struct davinci_audio_dev *dev; |
868 | int ret = 0; | 868 | int ret; |
869 | 869 | ||
870 | dev = kzalloc(sizeof(struct davinci_audio_dev), GFP_KERNEL); | 870 | dev = devm_kzalloc(&pdev->dev, sizeof(struct davinci_audio_dev), |
871 | GFP_KERNEL); | ||
871 | if (!dev) | 872 | if (!dev) |
872 | return -ENOMEM; | 873 | return -ENOMEM; |
873 | 874 | ||
874 | mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 875 | mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
875 | if (!mem) { | 876 | if (!mem) { |
876 | dev_err(&pdev->dev, "no mem resource?\n"); | 877 | dev_err(&pdev->dev, "no mem resource?\n"); |
877 | ret = -ENODEV; | 878 | return -ENODEV; |
878 | goto err_release_data; | ||
879 | } | 879 | } |
880 | 880 | ||
881 | ioarea = request_mem_region(mem->start, | 881 | ioarea = devm_request_mem_region(&pdev->dev, mem->start, |
882 | resource_size(mem), pdev->name); | 882 | resource_size(mem), pdev->name); |
883 | if (!ioarea) { | 883 | if (!ioarea) { |
884 | dev_err(&pdev->dev, "Audio region already claimed\n"); | 884 | dev_err(&pdev->dev, "Audio region already claimed\n"); |
885 | ret = -EBUSY; | 885 | return -EBUSY; |
886 | goto err_release_data; | ||
887 | } | 886 | } |
888 | 887 | ||
889 | pdata = pdev->dev.platform_data; | 888 | pdata = pdev->dev.platform_data; |
890 | dev->clk = clk_get(&pdev->dev, NULL); | 889 | dev->clk = clk_get(&pdev->dev, NULL); |
891 | if (IS_ERR(dev->clk)) { | 890 | if (IS_ERR(dev->clk)) |
892 | ret = -ENODEV; | 891 | return -ENODEV; |
893 | goto err_release_region; | ||
894 | } | ||
895 | 892 | ||
896 | clk_enable(dev->clk); | 893 | clk_enable(dev->clk); |
897 | dev->clk_active = 1; | 894 | dev->clk_active = 1; |
898 | 895 | ||
899 | dev->base = ioremap(mem->start, resource_size(mem)); | 896 | dev->base = devm_ioremap(&pdev->dev, mem->start, resource_size(mem)); |
900 | if (!dev->base) { | 897 | if (!dev->base) { |
901 | dev_err(&pdev->dev, "ioremap failed\n"); | 898 | dev_err(&pdev->dev, "ioremap failed\n"); |
902 | ret = -ENOMEM; | 899 | ret = -ENOMEM; |
@@ -924,7 +921,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev) | |||
924 | if (!res) { | 921 | if (!res) { |
925 | dev_err(&pdev->dev, "no DMA resource\n"); | 922 | dev_err(&pdev->dev, "no DMA resource\n"); |
926 | ret = -ENODEV; | 923 | ret = -ENODEV; |
927 | goto err_iounmap; | 924 | goto err_release_clk; |
928 | } | 925 | } |
929 | 926 | ||
930 | dma_data->channel = res->start; | 927 | dma_data->channel = res->start; |
@@ -940,7 +937,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev) | |||
940 | if (!res) { | 937 | if (!res) { |
941 | dev_err(&pdev->dev, "no DMA resource\n"); | 938 | dev_err(&pdev->dev, "no DMA resource\n"); |
942 | ret = -ENODEV; | 939 | ret = -ENODEV; |
943 | goto err_iounmap; | 940 | goto err_release_clk; |
944 | } | 941 | } |
945 | 942 | ||
946 | dma_data->channel = res->start; | 943 | dma_data->channel = res->start; |
@@ -948,37 +945,24 @@ static int davinci_mcasp_probe(struct platform_device *pdev) | |||
948 | ret = snd_soc_register_dai(&pdev->dev, &davinci_mcasp_dai[pdata->op_mode]); | 945 | ret = snd_soc_register_dai(&pdev->dev, &davinci_mcasp_dai[pdata->op_mode]); |
949 | 946 | ||
950 | if (ret != 0) | 947 | if (ret != 0) |
951 | goto err_iounmap; | 948 | goto err_release_clk; |
952 | return 0; | 949 | return 0; |
953 | 950 | ||
954 | err_iounmap: | ||
955 | iounmap(dev->base); | ||
956 | err_release_clk: | 951 | err_release_clk: |
957 | clk_disable(dev->clk); | 952 | clk_disable(dev->clk); |
958 | clk_put(dev->clk); | 953 | clk_put(dev->clk); |
959 | err_release_region: | ||
960 | release_mem_region(mem->start, resource_size(mem)); | ||
961 | err_release_data: | ||
962 | kfree(dev); | ||
963 | |||
964 | return ret; | 954 | return ret; |
965 | } | 955 | } |
966 | 956 | ||
967 | static int davinci_mcasp_remove(struct platform_device *pdev) | 957 | static int davinci_mcasp_remove(struct platform_device *pdev) |
968 | { | 958 | { |
969 | struct davinci_audio_dev *dev = dev_get_drvdata(&pdev->dev); | 959 | struct davinci_audio_dev *dev = dev_get_drvdata(&pdev->dev); |
970 | struct resource *mem; | ||
971 | 960 | ||
972 | snd_soc_unregister_dai(&pdev->dev); | 961 | snd_soc_unregister_dai(&pdev->dev); |
973 | clk_disable(dev->clk); | 962 | clk_disable(dev->clk); |
974 | clk_put(dev->clk); | 963 | clk_put(dev->clk); |
975 | dev->clk = NULL; | 964 | dev->clk = NULL; |
976 | 965 | ||
977 | mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
978 | release_mem_region(mem->start, resource_size(mem)); | ||
979 | |||
980 | kfree(dev); | ||
981 | |||
982 | return 0; | 966 | return 0; |
983 | } | 967 | } |
984 | 968 | ||
@@ -991,17 +975,7 @@ static struct platform_driver davinci_mcasp_driver = { | |||
991 | }, | 975 | }, |
992 | }; | 976 | }; |
993 | 977 | ||
994 | static int __init davinci_mcasp_init(void) | 978 | module_platform_driver(davinci_mcasp_driver); |
995 | { | ||
996 | return platform_driver_register(&davinci_mcasp_driver); | ||
997 | } | ||
998 | module_init(davinci_mcasp_init); | ||
999 | |||
1000 | static void __exit davinci_mcasp_exit(void) | ||
1001 | { | ||
1002 | platform_driver_unregister(&davinci_mcasp_driver); | ||
1003 | } | ||
1004 | module_exit(davinci_mcasp_exit); | ||
1005 | 979 | ||
1006 | MODULE_AUTHOR("Steve Chen"); | 980 | MODULE_AUTHOR("Steve Chen"); |
1007 | MODULE_DESCRIPTION("TI DAVINCI McASP SoC Interface"); | 981 | MODULE_DESCRIPTION("TI DAVINCI McASP SoC Interface"); |