diff options
author | Jun Tian <jun.j.tian@intel.com> | 2014-04-28 23:47:03 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-05-04 03:47:18 +0400 |
commit | c3c1ba6640d6c8f87a7bca440841924b58df8fb8 (patch) | |
tree | c677a77aaf1dd5901f4293a7383629d6e02eb95a /drivers/staging | |
parent | 10f62861b4a2f22cbd6412b3c42c76f0bdfbd648 (diff) | |
download | linux-c3c1ba6640d6c8f87a7bca440841924b58df8fb8.tar.xz |
goldfish: 64-bit audio driver for goldfish platform
Enable the 64-bit goldfish audio driver.
Support 64-bit buffer address and data read/write.
Signed-off-by: Jun Tian <jun.j.tian@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/goldfish/goldfish_audio.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/drivers/staging/goldfish/goldfish_audio.c b/drivers/staging/goldfish/goldfish_audio.c index 9243845418d6..383bee687151 100644 --- a/drivers/staging/goldfish/goldfish_audio.c +++ b/drivers/staging/goldfish/goldfish_audio.c @@ -78,11 +78,18 @@ enum { /* set number of bytes in buffer to write */ AUDIO_WRITE_BUFFER_1 = 0x10, AUDIO_WRITE_BUFFER_2 = 0x14, +#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT + AUDIO_SET_WRITE_BUFFER_1_HIGH = 0x28, + AUDIO_SET_WRITE_BUFFER_2_HIGH = 0x30, +#endif /* true if audio input is supported */ AUDIO_READ_SUPPORTED = 0x18, /* buffer to use for audio input */ AUDIO_SET_READ_BUFFER = 0x1C, +#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT + AUDIO_SET_READ_BUFFER_HIGH = 0x34, +#endif /* driver writes number of bytes to read */ AUDIO_START_READ = 0x20, @@ -267,6 +274,9 @@ static int goldfish_audio_probe(struct platform_device *pdev) struct resource *r; struct goldfish_audio *data; dma_addr_t buf_addr; +#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT + u32 buf_addr_high, buf_addr_low; +#endif data = kzalloc(sizeof(*data), GFP_KERNEL); if (data == NULL) { @@ -322,6 +332,28 @@ static int goldfish_audio_probe(struct platform_device *pdev) goto err_misc_register_failed; } +#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT + buf_addr_low = (u32)(buf_addr); + buf_addr_high = (u32)((buf_addr) >> 32); + + AUDIO_WRITE(data, AUDIO_SET_WRITE_BUFFER_1, buf_addr_low); + AUDIO_WRITE(data, AUDIO_SET_WRITE_BUFFER_1_HIGH, buf_addr_high); + + buf_addr_low = (u32)(buf_addr + WRITE_BUFFER_SIZE); + buf_addr_high = (u32)((buf_addr + WRITE_BUFFER_SIZE) >> 32); + + AUDIO_WRITE(data, AUDIO_SET_WRITE_BUFFER_2, buf_addr_low); + AUDIO_WRITE(data, AUDIO_SET_WRITE_BUFFER_2_HIGH, buf_addr_high); + + buf_addr_low = (u32)(buf_addr + 2 * WRITE_BUFFER_SIZE); + buf_addr_high = (u32)((buf_addr + 2 * WRITE_BUFFER_SIZE) >> 32); + + data->read_supported = AUDIO_READ(data, AUDIO_READ_SUPPORTED); + if (data->read_supported){ + AUDIO_WRITE(data, AUDIO_SET_READ_BUFFER, buf_addr_low); + AUDIO_WRITE(data, AUDIO_SET_READ_BUFFER_HIGH, buf_addr_high); + } +#else AUDIO_WRITE(data, AUDIO_SET_WRITE_BUFFER_1, buf_addr); AUDIO_WRITE(data, AUDIO_SET_WRITE_BUFFER_2, buf_addr + WRITE_BUFFER_SIZE); @@ -330,6 +362,7 @@ static int goldfish_audio_probe(struct platform_device *pdev) if (data->read_supported) AUDIO_WRITE(data, AUDIO_SET_READ_BUFFER, buf_addr + 2 * WRITE_BUFFER_SIZE); +#endif audio_data = data; return 0; |