| OLD | NEW |
| 1 /* | 1 /* |
| 2 * raumfeld_audio.c -- SoC audio for Raumfeld audio devices | 2 * raumfeld_audio.c -- SoC audio for Raumfeld audio devices |
| 3 * | 3 * |
| 4 * Copyright (c) 2009 Daniel Mack <daniel@caiaq.de> | 4 * Copyright (c) 2009 Daniel Mack <daniel@caiaq.de> |
| 5 * | 5 * |
| 6 * based on code from: | 6 * based on code from: |
| 7 * | 7 * |
| 8 * Wolfson Microelectronics PLC. | 8 * Wolfson Microelectronics PLC. |
| 9 * Openedhand Ltd. | 9 * Openedhand Ltd. |
| 10 * Liam Girdwood <lrg@slimlogic.co.uk> | 10 * Liam Girdwood <lrg@slimlogic.co.uk> |
| 11 * Richard Purdie <richard@openedhand.com> | 11 * Richard Purdie <richard@openedhand.com> |
| 12 * | 12 * |
| 13 * This program is free software; you can redistribute it and/or modify it | 13 * This program is free software; you can redistribute it and/or modify it |
| 14 * under the terms of the GNU General Public License as published by the | 14 * under the terms of the GNU General Public License as published by the |
| 15 * Free Software Foundation; either version 2 of the License, or (at your | 15 * Free Software Foundation; either version 2 of the License, or (at your |
| 16 * option) any later version. | 16 * option) any later version. |
| 17 */ | 17 */ |
| 18 | 18 |
| 19 #include <linux/module.h> | 19 #include <linux/module.h> |
| 20 #include <linux/i2c.h> | 20 #include <linux/i2c.h> |
| 21 #include <linux/delay.h> | 21 #include <linux/delay.h> |
| 22 #include <linux/gpio.h> | 22 #include <linux/gpio.h> |
| 23 #include <sound/pcm.h> | 23 #include <sound/pcm.h> |
| 24 #include <sound/soc.h> | 24 #include <sound/soc.h> |
| 25 #include <sound/soc-dapm.h> | |
| 26 | 25 |
| 27 #include <asm/mach-types.h> | 26 #include <asm/mach-types.h> |
| 28 | 27 |
| 29 #include "pxa-ssp.h" | 28 #include "pxa-ssp.h" |
| 30 | 29 |
| 31 #define GPIO_SPDIF_RESET (38) | 30 #define GPIO_SPDIF_RESET (38) |
| 32 #define GPIO_MCLK_RESET (111) | 31 #define GPIO_MCLK_RESET (111) |
| 33 #define GPIO_CODEC_RESET (120) | 32 #define GPIO_CODEC_RESET (120) |
| 34 | 33 |
| 35 static struct i2c_client *max9486_client; | 34 static struct i2c_client *max9486_client; |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 | 144 |
| 146 return 0; | 145 return 0; |
| 147 } | 146 } |
| 148 | 147 |
| 149 static struct snd_soc_ops raumfeld_cs4270_ops = { | 148 static struct snd_soc_ops raumfeld_cs4270_ops = { |
| 150 .startup = raumfeld_cs4270_startup, | 149 .startup = raumfeld_cs4270_startup, |
| 151 .shutdown = raumfeld_cs4270_shutdown, | 150 .shutdown = raumfeld_cs4270_shutdown, |
| 152 .hw_params = raumfeld_cs4270_hw_params, | 151 .hw_params = raumfeld_cs4270_hw_params, |
| 153 }; | 152 }; |
| 154 | 153 |
| 155 static int raumfeld_line_suspend(struct platform_device *pdev, pm_message_t stat
e) | 154 static int raumfeld_line_suspend(struct snd_soc_card *card) |
| 156 { | 155 { |
| 157 raumfeld_enable_audio(false); | 156 raumfeld_enable_audio(false); |
| 158 return 0; | 157 return 0; |
| 159 } | 158 } |
| 160 | 159 |
| 161 static int raumfeld_line_resume(struct platform_device *pdev) | 160 static int raumfeld_line_resume(struct snd_soc_card *card) |
| 162 { | 161 { |
| 163 raumfeld_enable_audio(true); | 162 raumfeld_enable_audio(true); |
| 164 return 0; | 163 return 0; |
| 165 } | 164 } |
| 166 | 165 |
| 167 /* AK4104 */ | 166 /* AK4104 */ |
| 168 | 167 |
| 169 static int raumfeld_ak4104_hw_params(struct snd_pcm_substream *substream, | 168 static int raumfeld_ak4104_hw_params(struct snd_pcm_substream *substream, |
| 170 struct snd_pcm_hw_params *params) | 169 struct snd_pcm_hw_params *params) |
| 171 { | 170 { |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 } | 222 } |
| 224 | 223 |
| 225 static struct snd_soc_ops raumfeld_ak4104_ops = { | 224 static struct snd_soc_ops raumfeld_ak4104_ops = { |
| 226 .hw_params = raumfeld_ak4104_hw_params, | 225 .hw_params = raumfeld_ak4104_hw_params, |
| 227 }; | 226 }; |
| 228 | 227 |
| 229 static struct snd_soc_dai_link raumfeld_dai[] = { | 228 static struct snd_soc_dai_link raumfeld_dai[] = { |
| 230 { | 229 { |
| 231 .name = "ak4104", | 230 .name = "ak4104", |
| 232 .stream_name = "Playback", | 231 .stream_name = "Playback", |
| 233 » .cpu_dai_name = "pxa-ssp-dai.1", | 232 » .cpu_dai_name» = "pxa-ssp-dai.1", |
| 234 » .codec_dai_name = "ak4104-hifi", | 233 » .codec_dai_name»= "ak4104-hifi", |
| 235 » .platform_name = "pxa-pcm-audio", | 234 » .platform_name» = "pxa-pcm-audio", |
| 236 .ops = &raumfeld_ak4104_ops, | 235 .ops = &raumfeld_ak4104_ops, |
| 237 » .codec_name = "ak4104-codec.0", | 236 » .codec_name» = "ak4104-codec.0", |
| 238 }, | 237 }, |
| 239 { | 238 { |
| 240 .name = "CS4270", | 239 .name = "CS4270", |
| 241 .stream_name = "CS4270", | 240 .stream_name = "CS4270", |
| 242 » .cpu_dai_name = "pxa-ssp-dai.0", | 241 » .cpu_dai_name» = "pxa-ssp-dai.0", |
| 243 » .platform_name = "pxa-pcm-audio", | 242 » .platform_name» = "pxa-pcm-audio", |
| 244 » .codec_dai_name = "cs4270-hifi", | 243 » .codec_dai_name»= "cs4270-hifi", |
| 245 » .codec_name = "cs4270-codec.0-0048", | 244 » .codec_name» = "cs4270-codec.0-0048", |
| 246 .ops = &raumfeld_cs4270_ops, | 245 .ops = &raumfeld_cs4270_ops, |
| 247 },}; | 246 },}; |
| 248 | 247 |
| 249 static struct snd_soc_card snd_soc_raumfeld = { | 248 static struct snd_soc_card snd_soc_raumfeld = { |
| 250 .name = "Raumfeld", | 249 .name = "Raumfeld", |
| 251 .dai_link = raumfeld_dai, | 250 .dai_link = raumfeld_dai, |
| 252 .suspend_post = raumfeld_line_suspend, | 251 .suspend_post = raumfeld_line_suspend, |
| 253 .resume_pre = raumfeld_line_resume, | 252 .resume_pre = raumfeld_line_resume, |
| 254 .num_links = ARRAY_SIZE(raumfeld_dai), | 253 .num_links = ARRAY_SIZE(raumfeld_dai), |
| 255 }; | 254 }; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 gpio_free(GPIO_SPDIF_RESET); | 302 gpio_free(GPIO_SPDIF_RESET); |
| 304 } | 303 } |
| 305 | 304 |
| 306 module_init(raumfeld_audio_init); | 305 module_init(raumfeld_audio_init); |
| 307 module_exit(raumfeld_audio_exit); | 306 module_exit(raumfeld_audio_exit); |
| 308 | 307 |
| 309 /* Module information */ | 308 /* Module information */ |
| 310 MODULE_AUTHOR("Daniel Mack <daniel@caiaq.de>"); | 309 MODULE_AUTHOR("Daniel Mack <daniel@caiaq.de>"); |
| 311 MODULE_DESCRIPTION("Raumfeld audio SoC"); | 310 MODULE_DESCRIPTION("Raumfeld audio SoC"); |
| 312 MODULE_LICENSE("GPL"); | 311 MODULE_LICENSE("GPL"); |
| OLD | NEW |