| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Handles the Mitac mioa701 SoC system | 2 * Handles the Mitac mioa701 SoC system |
| 3 * | 3 * |
| 4 * Copyright (C) 2008 Robert Jarzmik | 4 * Copyright (C) 2008 Robert Jarzmik |
| 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 as published by | 7 * it under the terms of the GNU General Public License as published by |
| 8 * the Free Software Foundation in version 2 of the License. | 8 * the Free Software Foundation in version 2 of the License. |
| 9 * | 9 * |
| 10 * This program is distributed in the hope that it will be useful, | 10 * This program is distributed in the hope that it will be useful, |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 #include <linux/module.h> | 43 #include <linux/module.h> |
| 44 #include <linux/moduleparam.h> | 44 #include <linux/moduleparam.h> |
| 45 #include <linux/platform_device.h> | 45 #include <linux/platform_device.h> |
| 46 | 46 |
| 47 #include <asm/mach-types.h> | 47 #include <asm/mach-types.h> |
| 48 #include <mach/audio.h> | 48 #include <mach/audio.h> |
| 49 | 49 |
| 50 #include <sound/core.h> | 50 #include <sound/core.h> |
| 51 #include <sound/pcm.h> | 51 #include <sound/pcm.h> |
| 52 #include <sound/soc.h> | 52 #include <sound/soc.h> |
| 53 #include <sound/soc-dapm.h> | |
| 54 #include <sound/initval.h> | 53 #include <sound/initval.h> |
| 55 #include <sound/ac97_codec.h> | 54 #include <sound/ac97_codec.h> |
| 56 | 55 |
| 57 #include "pxa2xx-ac97.h" | 56 #include "pxa2xx-ac97.h" |
| 58 #include "../codecs/wm9713.h" | 57 #include "../codecs/wm9713.h" |
| 59 | 58 |
| 60 #define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x) | 59 #define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x) |
| 61 | 60 |
| 62 #define AC97_GPIO_PULL 0x58 | 61 #define AC97_GPIO_PULL 0x58 |
| 63 | 62 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 {"Front Speaker", NULL, "OUT3"}, | 122 {"Front Speaker", NULL, "OUT3"}, |
| 124 | 123 |
| 125 /* rear speaker connected to SPKL, SPKR */ | 124 /* rear speaker connected to SPKL, SPKR */ |
| 126 {"Rear Speaker", NULL, "SPKL"}, | 125 {"Rear Speaker", NULL, "SPKL"}, |
| 127 {"Rear Speaker", NULL, "SPKR"}, | 126 {"Rear Speaker", NULL, "SPKR"}, |
| 128 }; | 127 }; |
| 129 | 128 |
| 130 static int mioa701_wm9713_init(struct snd_soc_pcm_runtime *rtd) | 129 static int mioa701_wm9713_init(struct snd_soc_pcm_runtime *rtd) |
| 131 { | 130 { |
| 132 struct snd_soc_codec *codec = rtd->codec; | 131 struct snd_soc_codec *codec = rtd->codec; |
| 132 struct snd_soc_dapm_context *dapm = &codec->dapm; |
| 133 unsigned short reg; | 133 unsigned short reg; |
| 134 | 134 |
| 135 /* Add mioa701 specific widgets */ | 135 /* Add mioa701 specific widgets */ |
| 136 » snd_soc_dapm_new_controls(codec, ARRAY_AND_SIZE(mioa701_dapm_widgets)); | 136 » snd_soc_dapm_new_controls(dapm, ARRAY_AND_SIZE(mioa701_dapm_widgets)); |
| 137 | 137 |
| 138 /* Set up mioa701 specific audio path audio_mapnects */ | 138 /* Set up mioa701 specific audio path audio_mapnects */ |
| 139 » snd_soc_dapm_add_routes(codec, ARRAY_AND_SIZE(audio_map)); | 139 » snd_soc_dapm_add_routes(dapm, ARRAY_AND_SIZE(audio_map)); |
| 140 | 140 |
| 141 /* Prepare GPIO8 for rear speaker amplifier */ | 141 /* Prepare GPIO8 for rear speaker amplifier */ |
| 142 reg = codec->driver->read(codec, AC97_GPIO_CFG); | 142 reg = codec->driver->read(codec, AC97_GPIO_CFG); |
| 143 codec->driver->write(codec, AC97_GPIO_CFG, reg | 0x0100); | 143 codec->driver->write(codec, AC97_GPIO_CFG, reg | 0x0100); |
| 144 | 144 |
| 145 /* Prepare MIC input */ | 145 /* Prepare MIC input */ |
| 146 reg = codec->driver->read(codec, AC97_3D_CONTROL); | 146 reg = codec->driver->read(codec, AC97_3D_CONTROL); |
| 147 codec->driver->write(codec, AC97_3D_CONTROL, reg | 0xc000); | 147 codec->driver->write(codec, AC97_3D_CONTROL, reg | 0xc000); |
| 148 | 148 |
| 149 » snd_soc_dapm_enable_pin(codec, "Front Speaker"); | 149 » snd_soc_dapm_enable_pin(dapm, "Front Speaker"); |
| 150 » snd_soc_dapm_enable_pin(codec, "Rear Speaker"); | 150 » snd_soc_dapm_enable_pin(dapm, "Rear Speaker"); |
| 151 » snd_soc_dapm_enable_pin(codec, "Front Mic"); | 151 » snd_soc_dapm_enable_pin(dapm, "Front Mic"); |
| 152 » snd_soc_dapm_enable_pin(codec, "GSM Line In"); | 152 » snd_soc_dapm_enable_pin(dapm, "GSM Line In"); |
| 153 » snd_soc_dapm_enable_pin(codec, "GSM Line Out"); | 153 » snd_soc_dapm_enable_pin(dapm, "GSM Line Out"); |
| 154 » snd_soc_dapm_sync(codec); | 154 » snd_soc_dapm_sync(dapm); |
| 155 | 155 |
| 156 return 0; | 156 return 0; |
| 157 } | 157 } |
| 158 | 158 |
| 159 static struct snd_soc_ops mioa701_ops; | 159 static struct snd_soc_ops mioa701_ops; |
| 160 | 160 |
| 161 static struct snd_soc_dai_link mioa701_dai[] = { | 161 static struct snd_soc_dai_link mioa701_dai[] = { |
| 162 { | 162 { |
| 163 .name = "AC97", | 163 .name = "AC97", |
| 164 .stream_name = "AC97 HiFi", | 164 .stream_name = "AC97 HiFi", |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 platform_driver_unregister(&mioa701_wm9713_driver); | 238 platform_driver_unregister(&mioa701_wm9713_driver); |
| 239 } | 239 } |
| 240 | 240 |
| 241 module_init(mioa701_asoc_init); | 241 module_init(mioa701_asoc_init); |
| 242 module_exit(mioa701_asoc_exit); | 242 module_exit(mioa701_asoc_exit); |
| 243 | 243 |
| 244 /* Module information */ | 244 /* Module information */ |
| 245 MODULE_AUTHOR("Robert Jarzmik (rjarzmik@free.fr)"); | 245 MODULE_AUTHOR("Robert Jarzmik (rjarzmik@free.fr)"); |
| 246 MODULE_DESCRIPTION("ALSA SoC WM9713 MIO A701"); | 246 MODULE_DESCRIPTION("ALSA SoC WM9713 MIO A701"); |
| 247 MODULE_LICENSE("GPL"); | 247 MODULE_LICENSE("GPL"); |
| OLD | NEW |