| OLD | NEW |
| 1 /* | 1 /* |
| 2 * ALSA SoC driver for Migo-R | 2 * ALSA SoC driver for Migo-R |
| 3 * | 3 * |
| 4 * Copyright (C) 2009-2010 Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 4 * Copyright (C) 2009-2010 Guennadi Liakhovetski <g.liakhovetski@gmx.de> |
| 5 * | 5 * |
| 6 * This program is free software; you can redistribute it and/or modify | 6 * This program is free software; you can redistribute it and/or modify |
| 7 * it under the terms of the GNU General Public License version 2 as | 7 * it under the terms of the GNU General Public License version 2 as |
| 8 * published by the Free Software Foundation. | 8 * published by the Free Software Foundation. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 #include <linux/clkdev.h> |
| 11 #include <linux/device.h> | 12 #include <linux/device.h> |
| 12 #include <linux/firmware.h> | 13 #include <linux/firmware.h> |
| 13 #include <linux/module.h> | 14 #include <linux/module.h> |
| 14 | 15 |
| 15 #include <asm/clkdev.h> | |
| 16 #include <asm/clock.h> | 16 #include <asm/clock.h> |
| 17 | 17 |
| 18 #include <cpu/sh7722.h> | 18 #include <cpu/sh7722.h> |
| 19 | 19 |
| 20 #include <sound/core.h> | 20 #include <sound/core.h> |
| 21 #include <sound/pcm.h> | 21 #include <sound/pcm.h> |
| 22 #include <sound/soc.h> | 22 #include <sound/soc.h> |
| 23 #include <sound/soc-dapm.h> | |
| 24 | 23 |
| 25 #include "../codecs/wm8978.h" | 24 #include "../codecs/wm8978.h" |
| 26 #include "siu.h" | 25 #include "siu.h" |
| 27 | 26 |
| 28 /* Default 8000Hz sampling frequency */ | 27 /* Default 8000Hz sampling frequency */ |
| 29 static unsigned long codec_freq = 8000 * 512; | 28 static unsigned long codec_freq = 8000 * 512; |
| 30 | 29 |
| 31 static unsigned int use_count; | 30 static unsigned int use_count; |
| 32 | 31 |
| 33 /* External clock, sourced from the codec at the SIUMCKB pin */ | 32 /* External clock, sourced from the codec at the SIUMCKB pin */ |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 | 132 |
| 134 /* External microphone */ | 133 /* External microphone */ |
| 135 { "LMICN", NULL, "Mic Bias" }, | 134 { "LMICN", NULL, "Mic Bias" }, |
| 136 { "LMICP", NULL, "Mic Bias" }, | 135 { "LMICP", NULL, "Mic Bias" }, |
| 137 { "Mic Bias", NULL, "External Microphone" }, | 136 { "Mic Bias", NULL, "External Microphone" }, |
| 138 }; | 137 }; |
| 139 | 138 |
| 140 static int migor_dai_init(struct snd_soc_pcm_runtime *rtd) | 139 static int migor_dai_init(struct snd_soc_pcm_runtime *rtd) |
| 141 { | 140 { |
| 142 struct snd_soc_codec *codec = rtd->codec; | 141 struct snd_soc_codec *codec = rtd->codec; |
| 142 struct snd_soc_dapm_context *dapm = &codec->dapm; |
| 143 | 143 |
| 144 » snd_soc_dapm_new_controls(codec, migor_dapm_widgets, | 144 » snd_soc_dapm_new_controls(dapm, migor_dapm_widgets, |
| 145 ARRAY_SIZE(migor_dapm_widgets)); | 145 ARRAY_SIZE(migor_dapm_widgets)); |
| 146 | 146 |
| 147 » snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); | 147 » snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); |
| 148 | 148 |
| 149 return 0; | 149 return 0; |
| 150 } | 150 } |
| 151 | 151 |
| 152 /* migor digital audio interface glue - connects codec <--> CPU */ | 152 /* migor digital audio interface glue - connects codec <--> CPU */ |
| 153 static struct snd_soc_dai_link migor_dai = { | 153 static struct snd_soc_dai_link migor_dai = { |
| 154 .name = "wm8978", | 154 .name = "wm8978", |
| 155 .stream_name = "WM8978", | 155 .stream_name = "WM8978", |
| 156 .cpu_dai_name = "siu-i2s-dai", | 156 .cpu_dai_name = "siu-i2s-dai", |
| 157 .codec_dai_name = "wm8978-hifi", | 157 .codec_dai_name = "wm8978-hifi", |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 clk_unregister(&siumckb_clk); | 215 clk_unregister(&siumckb_clk); |
| 216 platform_device_unregister(migor_snd_device); | 216 platform_device_unregister(migor_snd_device); |
| 217 } | 217 } |
| 218 | 218 |
| 219 module_init(migor_init); | 219 module_init(migor_init); |
| 220 module_exit(migor_exit); | 220 module_exit(migor_exit); |
| 221 | 221 |
| 222 MODULE_AUTHOR("Guennadi Liakhovetski <g.liakhovetski@gmx.de>"); | 222 MODULE_AUTHOR("Guennadi Liakhovetski <g.liakhovetski@gmx.de>"); |
| 223 MODULE_DESCRIPTION("ALSA SoC Migor"); | 223 MODULE_DESCRIPTION("ALSA SoC Migor"); |
| 224 MODULE_LICENSE("GPL v2"); | 224 MODULE_LICENSE("GPL v2"); |
| OLD | NEW |