| OLD | NEW |
| 1 /* | 1 /* |
| 2 * tavorevb3.c -- SoC audio for Tavor EVB3 | 2 * tavorevb3.c -- SoC audio for Tavor EVB3 |
| 3 * | 3 * |
| 4 * Copyright (C) 2010 Marvell International Ltd. | 4 * Copyright (C) 2010 Marvell International Ltd. |
| 5 * Haojian Zhuang <haojian.zhuang@marvell.com> | 5 * Haojian Zhuang <haojian.zhuang@marvell.com> |
| 6 * | 6 * |
| 7 * This program is free software; you can redistribute it and/or modify | 7 * This program is free software; you can redistribute it and/or modify |
| 8 * it under the terms of the GNU General Public License version 2 as | 8 * it under the terms of the GNU General Public License version 2 as |
| 9 * published by the Free Software Foundation. | 9 * published by the Free Software Foundation. |
| 10 */ | 10 */ |
| 11 | 11 |
| 12 #include <linux/module.h> | 12 #include <linux/module.h> |
| 13 #include <linux/moduleparam.h> | 13 #include <linux/moduleparam.h> |
| 14 #include <linux/device.h> | 14 #include <linux/device.h> |
| 15 #include <linux/clk.h> | 15 #include <linux/clk.h> |
| 16 #include <linux/i2c.h> | 16 #include <linux/i2c.h> |
| 17 #include <sound/core.h> | 17 #include <sound/core.h> |
| 18 #include <sound/pcm.h> | 18 #include <sound/pcm.h> |
| 19 #include <sound/pcm_params.h> | 19 #include <sound/pcm_params.h> |
| 20 #include <sound/soc.h> | 20 #include <sound/soc.h> |
| 21 #include <sound/soc-dapm.h> | |
| 22 #include <sound/jack.h> | 21 #include <sound/jack.h> |
| 23 | 22 |
| 24 #include <asm/mach-types.h> | 23 #include <asm/mach-types.h> |
| 25 | 24 |
| 26 #include "../codecs/88pm860x-codec.h" | 25 #include "../codecs/88pm860x-codec.h" |
| 27 #include "pxa-ssp.h" | 26 #include "pxa-ssp.h" |
| 28 | 27 |
| 29 static int evb3_pm860x_init(struct snd_soc_pcm_runtime *rtd); | 28 static int evb3_pm860x_init(struct snd_soc_pcm_runtime *rtd); |
| 30 | 29 |
| 31 static struct platform_device *evb3_snd_device; | 30 static struct platform_device *evb3_snd_device; |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 | 125 |
| 127 static struct snd_soc_card snd_soc_card_evb3 = { | 126 static struct snd_soc_card snd_soc_card_evb3 = { |
| 128 .name = "Tavor EVB3", | 127 .name = "Tavor EVB3", |
| 129 .dai_link = evb3_dai, | 128 .dai_link = evb3_dai, |
| 130 .num_links = ARRAY_SIZE(evb3_dai), | 129 .num_links = ARRAY_SIZE(evb3_dai), |
| 131 }; | 130 }; |
| 132 | 131 |
| 133 static int evb3_pm860x_init(struct snd_soc_pcm_runtime *rtd) | 132 static int evb3_pm860x_init(struct snd_soc_pcm_runtime *rtd) |
| 134 { | 133 { |
| 135 struct snd_soc_codec *codec = rtd->codec; | 134 struct snd_soc_codec *codec = rtd->codec; |
| 135 struct snd_soc_dapm_context *dapm = &codec->dapm; |
| 136 int ret; | 136 int ret; |
| 137 | 137 |
| 138 » snd_soc_dapm_new_controls(codec, evb3_dapm_widgets, | 138 » snd_soc_dapm_new_controls(dapm, evb3_dapm_widgets, |
| 139 ARRAY_SIZE(evb3_dapm_widgets)); | 139 ARRAY_SIZE(evb3_dapm_widgets)); |
| 140 » snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); | 140 » snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); |
| 141 | 141 |
| 142 /* connected pins */ | 142 /* connected pins */ |
| 143 » snd_soc_dapm_enable_pin(codec, "Ext Speaker"); | 143 » snd_soc_dapm_enable_pin(dapm, "Ext Speaker"); |
| 144 » snd_soc_dapm_enable_pin(codec, "Ext Mic 1"); | 144 » snd_soc_dapm_enable_pin(dapm, "Ext Mic 1"); |
| 145 » snd_soc_dapm_enable_pin(codec, "Ext Mic 3"); | 145 » snd_soc_dapm_enable_pin(dapm, "Ext Mic 3"); |
| 146 » snd_soc_dapm_disable_pin(codec, "Headset Mic 2"); | 146 » snd_soc_dapm_disable_pin(dapm, "Headset Mic 2"); |
| 147 » snd_soc_dapm_disable_pin(codec, "Headset Stereophone"); | 147 » snd_soc_dapm_disable_pin(dapm, "Headset Stereophone"); |
| 148 | 148 |
| 149 » ret = snd_soc_dapm_sync(codec); | 149 » ret = snd_soc_dapm_sync(dapm); |
| 150 if (ret) | 150 if (ret) |
| 151 return ret; | 151 return ret; |
| 152 | 152 |
| 153 /* Headset jack detection */ | 153 /* Headset jack detection */ |
| 154 snd_soc_jack_new(codec, "Headphone Jack", SND_JACK_HEADPHONE | 154 snd_soc_jack_new(codec, "Headphone Jack", SND_JACK_HEADPHONE |
| 155 | SND_JACK_BTN_0 | SND_JACK_BTN_1 | SND_JACK_BTN_2, | 155 | SND_JACK_BTN_0 | SND_JACK_BTN_1 | SND_JACK_BTN_2, |
| 156 &hs_jack); | 156 &hs_jack); |
| 157 snd_soc_jack_add_pins(&hs_jack, ARRAY_SIZE(hs_jack_pins), | 157 snd_soc_jack_add_pins(&hs_jack, ARRAY_SIZE(hs_jack_pins), |
| 158 hs_jack_pins); | 158 hs_jack_pins); |
| 159 snd_soc_jack_new(codec, "Microphone Jack", SND_JACK_MICROPHONE, | 159 snd_soc_jack_new(codec, "Microphone Jack", SND_JACK_MICROPHONE, |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 { | 191 { |
| 192 platform_device_unregister(evb3_snd_device); | 192 platform_device_unregister(evb3_snd_device); |
| 193 } | 193 } |
| 194 | 194 |
| 195 module_init(tavorevb3_init); | 195 module_init(tavorevb3_init); |
| 196 module_exit(tavorevb3_exit); | 196 module_exit(tavorevb3_exit); |
| 197 | 197 |
| 198 MODULE_AUTHOR("Haojian Zhuang <haojian.zhuang@marvell.com>"); | 198 MODULE_AUTHOR("Haojian Zhuang <haojian.zhuang@marvell.com>"); |
| 199 MODULE_DESCRIPTION("ALSA SoC 88PM860x Tavor EVB3"); | 199 MODULE_DESCRIPTION("ALSA SoC 88PM860x Tavor EVB3"); |
| 200 MODULE_LICENSE("GPL"); | 200 MODULE_LICENSE("GPL"); |
| OLD | NEW |