diff options
author | Ola Lilja <ola.o.lilja@stericsson.com> | 2010-12-06 09:19:37 +0100 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@stericsson.com> | 2011-09-19 15:14:43 +0200 |
commit | 69fbc8b4f9bb2ae66c96455e3cb0d0a40bc6113c (patch) | |
tree | 6436704beaa2b5c8fda60bf03cfa6964f7d79d5a /sound | |
parent | e4a38277c902e7f0f4e7f2fcd5e3985983ceb557 (diff) |
Ux500 ASoC: Support for MSP3.
Added support for a fourth MSP-block.
Change-Id: I48cc0d13597e5887d85ac8ab0acff9de29a934a8
Signed-off-by: Ola Lilja <ola.o.lilja@stericsson.com>
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/10298
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/ux500/ux500_msp_dai.c | 81 | ||||
-rw-r--r-- | sound/soc/ux500/ux500_msp_dai.h | 2 |
2 files changed, 75 insertions, 8 deletions
diff --git a/sound/soc/ux500/ux500_msp_dai.c b/sound/soc/ux500/ux500_msp_dai.c index c6528a7aeed..b0d327f9ba6 100644 --- a/sound/soc/ux500/ux500_msp_dai.c +++ b/sound/soc/ux500/ux500_msp_dai.c @@ -15,7 +15,7 @@ #include <linux/slab.h> #include <asm/dma.h> #include <linux/bitops.h> - +#include <mach/hardware.h> #include <mach/msp.h> #include <linux/i2s/i2s.h> @@ -58,6 +58,17 @@ static struct ux500_platform_drvdata platform_drvdata[UX500_NBR_OF_DAI] = { .capture_active = false, .configured = 0, }, + { + .i2s = NULL, + .fmt = 0, + .slots = 1, + .tx_mask = 0x01, + .rx_mask = 0x01, + .slot_width = 16, + .playback_active = false, + .capture_active = false, + .configured = 0, + }, }; bool ux500_msp_dai_i2s_get_underrun_status(int dai_idx) @@ -815,6 +826,36 @@ static struct snd_soc_dai_driver ux500_msp_dai_drv[UX500_NBR_OF_DAI] = { } }, }, + { + .name = "ux500-msp.3", + .id = 3, + .suspend = NULL, + .resume = NULL, + .playback = { + .channels_min = UX500_MSP_MIN_CHANNELS, + .channels_max = UX500_MSP_MAX_CHANNELS, + .rates = UX500_I2S_RATES, + .formats = UX500_I2S_FORMATS, + }, + .capture = { + .channels_min = UX500_MSP_MIN_CHANNELS, + .channels_max = UX500_MSP_MAX_CHANNELS, + .rates = UX500_I2S_RATES, + .formats = UX500_I2S_FORMATS, + }, + .ops = (struct snd_soc_dai_ops[]) { + { + .set_sysclk = NULL, + .set_fmt = ux500_msp_dai_set_dai_fmt, + .set_tdm_slot = ux500_msp_dai_set_tdm_slot, + .startup = ux500_msp_dai_startup, + .shutdown = ux500_msp_dai_shutdown, + .prepare = ux500_msp_dai_prepare, + .trigger = ux500_msp_dai_trigger, + .hw_params = ux500_msp_dai_hw_params, + } + }, + }, }; EXPORT_SYMBOL(ux500_msp_dai_drv); @@ -869,34 +910,60 @@ static int ux500_msp_drv_remove(struct i2s_device *i2s_dev) return 0; } -static const struct i2s_device_id dev_id_table[] = { +static const struct i2s_device_id dev_id_table_v1[] = { + { "i2s_device.0", 0, 0 }, + { "i2s_device.1", 1, 0 }, + { "i2s_device.2", 2, 0 }, + { }, +}; +MODULE_DEVICE_TABLE(i2s, dev_id_table_v1); + +static const struct i2s_device_id dev_id_table_v2[] = { { "i2s_device.0", 0, 0 }, { "i2s_device.1", 1, 0 }, { "i2s_device.2", 2, 0 }, + { "i2s_device.3", 2, 0 }, { }, }; -MODULE_DEVICE_TABLE(i2s, dev_id_table); +MODULE_DEVICE_TABLE(i2s, dev_id_table_v2); + + +static struct i2s_driver i2sdrv_i2s_v1 = { + .driver = { + .name = "i2s", + .owner = THIS_MODULE, + }, + .probe = ux500_msp_drv_probe, + .remove = __devexit_p(ux500_msp_drv_remove), + .id_table = dev_id_table_v1, +}; -static struct i2s_driver i2sdrv_i2s = { +static struct i2s_driver i2sdrv_i2s_v2 = { .driver = { .name = "i2s", .owner = THIS_MODULE, }, .probe = ux500_msp_drv_probe, .remove = __devexit_p(ux500_msp_drv_remove), - .id_table = dev_id_table, + .id_table = dev_id_table_v2, }; static int __init ux500_msp_init(void) { - return i2s_register_driver(&i2sdrv_i2s); + if (cpu_is_u8500ed() || cpu_is_u8500v1() || cpu_is_u8500v11()) + return i2s_register_driver(&i2sdrv_i2s_v1); + else + return i2s_register_driver(&i2sdrv_i2s_v2); } static void __exit ux500_msp_exit(void) { pr_debug("%s: Enter.\n", __func__); - i2s_unregister_driver(&i2sdrv_i2s); + if (cpu_is_u8500ed() || cpu_is_u8500v1() || cpu_is_u8500v11()) + i2s_unregister_driver(&i2sdrv_i2s_v1); + else + i2s_unregister_driver(&i2sdrv_i2s_v2); } module_init(ux500_msp_init); diff --git a/sound/soc/ux500/ux500_msp_dai.h b/sound/soc/ux500/ux500_msp_dai.h index d531f7246c7..84130f5d624 100644 --- a/sound/soc/ux500/ux500_msp_dai.h +++ b/sound/soc/ux500/ux500_msp_dai.h @@ -19,7 +19,7 @@ #include <linux/spinlock.h> #include <linux/i2s/i2s.h> -#define UX500_NBR_OF_DAI 3 +#define UX500_NBR_OF_DAI 4 #define UX500_I2S_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 | \ SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000) |