| OLD | NEW |
| 1 /* | 1 /* |
| 2 * linux/sound/soc/pxa/palm27x.c | 2 * linux/sound/soc/pxa/palm27x.c |
| 3 * | 3 * |
| 4 * SoC Audio driver for Palm T|X, T5 and LifeDrive | 4 * SoC Audio driver for Palm T|X, T5 and LifeDrive |
| 5 * | 5 * |
| 6 * based on tosa.c | 6 * based on tosa.c |
| 7 * | 7 * |
| 8 * Copyright (C) 2008 Marek Vasut <marek.vasut@gmail.com> | 8 * Copyright (C) 2008 Marek Vasut <marek.vasut@gmail.com> |
| 9 * | 9 * |
| 10 * This program is free software; you can redistribute it and/or modify | 10 * This program is free software; you can redistribute it and/or modify |
| 11 * it under the terms of the GNU General Public License version 2 as | 11 * it under the terms of the GNU General Public License version 2 as |
| 12 * published by the Free Software Foundation. | 12 * published by the Free Software Foundation. |
| 13 * | 13 * |
| 14 */ | 14 */ |
| 15 | 15 |
| 16 #include <linux/module.h> | 16 #include <linux/module.h> |
| 17 #include <linux/moduleparam.h> | 17 #include <linux/moduleparam.h> |
| 18 #include <linux/device.h> | 18 #include <linux/device.h> |
| 19 #include <linux/gpio.h> | 19 #include <linux/gpio.h> |
| 20 | 20 |
| 21 #include <sound/core.h> | 21 #include <sound/core.h> |
| 22 #include <sound/pcm.h> | 22 #include <sound/pcm.h> |
| 23 #include <sound/soc.h> | 23 #include <sound/soc.h> |
| 24 #include <sound/soc-dapm.h> | |
| 25 #include <sound/jack.h> | 24 #include <sound/jack.h> |
| 26 | 25 |
| 27 #include <asm/mach-types.h> | 26 #include <asm/mach-types.h> |
| 28 #include <mach/audio.h> | 27 #include <mach/audio.h> |
| 29 #include <mach/palmasoc.h> | 28 #include <mach/palmasoc.h> |
| 30 | 29 |
| 31 #include "../codecs/wm9712.h" | 30 #include "../codecs/wm9712.h" |
| 32 #include "pxa2xx-ac97.h" | 31 #include "pxa2xx-ac97.h" |
| 33 | 32 |
| 34 static struct snd_soc_jack hs_jack; | 33 static struct snd_soc_jack hs_jack; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 | 69 |
| 71 /* mic connected to MIC1 */ | 70 /* mic connected to MIC1 */ |
| 72 {"Ext. Microphone", NULL, "MIC1"}, | 71 {"Ext. Microphone", NULL, "MIC1"}, |
| 73 }; | 72 }; |
| 74 | 73 |
| 75 static struct snd_soc_card palm27x_asoc; | 74 static struct snd_soc_card palm27x_asoc; |
| 76 | 75 |
| 77 static int palm27x_ac97_init(struct snd_soc_pcm_runtime *rtd) | 76 static int palm27x_ac97_init(struct snd_soc_pcm_runtime *rtd) |
| 78 { | 77 { |
| 79 struct snd_soc_codec *codec = rtd->codec; | 78 struct snd_soc_codec *codec = rtd->codec; |
| 79 struct snd_soc_dapm_context *dapm = &codec->dapm; |
| 80 int err; | 80 int err; |
| 81 | 81 |
| 82 /* add palm27x specific widgets */ | 82 /* add palm27x specific widgets */ |
| 83 » err = snd_soc_dapm_new_controls(codec, palm27x_dapm_widgets, | 83 » err = snd_soc_dapm_new_controls(dapm, palm27x_dapm_widgets, |
| 84 ARRAY_SIZE(palm27x_dapm_widgets)); | 84 ARRAY_SIZE(palm27x_dapm_widgets)); |
| 85 if (err) | 85 if (err) |
| 86 return err; | 86 return err; |
| 87 | 87 |
| 88 /* set up palm27x specific audio path audio_map */ | 88 /* set up palm27x specific audio path audio_map */ |
| 89 » err = snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map)); | 89 » err = snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); |
| 90 if (err) | 90 if (err) |
| 91 return err; | 91 return err; |
| 92 | 92 |
| 93 /* connected pins */ | 93 /* connected pins */ |
| 94 if (machine_is_palmld()) | 94 if (machine_is_palmld()) |
| 95 » » snd_soc_dapm_enable_pin(codec, "MIC1"); | 95 » » snd_soc_dapm_enable_pin(dapm, "MIC1"); |
| 96 » snd_soc_dapm_enable_pin(codec, "HPOUTL"); | 96 » snd_soc_dapm_enable_pin(dapm, "HPOUTL"); |
| 97 » snd_soc_dapm_enable_pin(codec, "HPOUTR"); | 97 » snd_soc_dapm_enable_pin(dapm, "HPOUTR"); |
| 98 » snd_soc_dapm_enable_pin(codec, "LOUT2"); | 98 » snd_soc_dapm_enable_pin(dapm, "LOUT2"); |
| 99 » snd_soc_dapm_enable_pin(codec, "ROUT2"); | 99 » snd_soc_dapm_enable_pin(dapm, "ROUT2"); |
| 100 | 100 |
| 101 /* not connected pins */ | 101 /* not connected pins */ |
| 102 » snd_soc_dapm_nc_pin(codec, "OUT3"); | 102 » snd_soc_dapm_nc_pin(dapm, "OUT3"); |
| 103 » snd_soc_dapm_nc_pin(codec, "MONOOUT"); | 103 » snd_soc_dapm_nc_pin(dapm, "MONOOUT"); |
| 104 » snd_soc_dapm_nc_pin(codec, "LINEINL"); | 104 » snd_soc_dapm_nc_pin(dapm, "LINEINL"); |
| 105 » snd_soc_dapm_nc_pin(codec, "LINEINR"); | 105 » snd_soc_dapm_nc_pin(dapm, "LINEINR"); |
| 106 » snd_soc_dapm_nc_pin(codec, "PCBEEP"); | 106 » snd_soc_dapm_nc_pin(dapm, "PCBEEP"); |
| 107 » snd_soc_dapm_nc_pin(codec, "PHONE"); | 107 » snd_soc_dapm_nc_pin(dapm, "PHONE"); |
| 108 » snd_soc_dapm_nc_pin(codec, "MIC2"); | 108 » snd_soc_dapm_nc_pin(dapm, "MIC2"); |
| 109 | 109 |
| 110 » err = snd_soc_dapm_sync(codec); | 110 » err = snd_soc_dapm_sync(dapm); |
| 111 if (err) | 111 if (err) |
| 112 return err; | 112 return err; |
| 113 | 113 |
| 114 /* Jack detection API stuff */ | 114 /* Jack detection API stuff */ |
| 115 err = snd_soc_jack_new(codec, "Headphone Jack", | 115 err = snd_soc_jack_new(codec, "Headphone Jack", |
| 116 SND_JACK_HEADPHONE, &hs_jack); | 116 SND_JACK_HEADPHONE, &hs_jack); |
| 117 if (err) | 117 if (err) |
| 118 return err; | 118 return err; |
| 119 | 119 |
| 120 err = snd_soc_jack_add_pins(&hs_jack, ARRAY_SIZE(hs_jack_pins), | 120 err = snd_soc_jack_add_pins(&hs_jack, ARRAY_SIZE(hs_jack_pins), |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 platform_driver_unregister(&palm27x_wm9712_driver); | 215 platform_driver_unregister(&palm27x_wm9712_driver); |
| 216 } | 216 } |
| 217 | 217 |
| 218 module_init(palm27x_asoc_init); | 218 module_init(palm27x_asoc_init); |
| 219 module_exit(palm27x_asoc_exit); | 219 module_exit(palm27x_asoc_exit); |
| 220 | 220 |
| 221 /* Module information */ | 221 /* Module information */ |
| 222 MODULE_AUTHOR("Marek Vasut <marek.vasut@gmail.com>"); | 222 MODULE_AUTHOR("Marek Vasut <marek.vasut@gmail.com>"); |
| 223 MODULE_DESCRIPTION("ALSA SoC Palm T|X, T5 and LifeDrive"); | 223 MODULE_DESCRIPTION("ALSA SoC Palm T|X, T5 and LifeDrive"); |
| 224 MODULE_LICENSE("GPL"); | 224 MODULE_LICENSE("GPL"); |
| OLD | NEW |