aboutsummaryrefslogtreecommitdiffstats
path: root/arch/avr32/mach-at32ap/at32ap700x.c
diff options
context:
space:
mode:
authorHans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>2009-03-24 08:59:22 -0400
committerHaavard Skinnemoen <haavard.skinnemoen@atmel.com>2009-03-27 11:15:39 -0400
commit6b0c9351426bdedcbe8fb81149a072de96991666 (patch)
tree48b4a924fe375adc3366160a8ca58a73984d5e7c /arch/avr32/mach-at32ap/at32ap700x.c
parentb92efa9abffc4a634cd2e7a0f81f8aa6310d67c9 (diff)
avr32: at32ap700x: setup DMA for ABDAC in the machine code
This patch will adjust the setup the DMA controller for the Audio Bistream DAC in the at32ap700x machine code. This setup matches the new ALSA driver for the ABDAC. Tested on ATSTK1006 + ATSTK1000. This patch will setup the needed platform data for the Audio Bistream DAC used by the Favr-32 board. Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com> [haavard.skinnemoen@atmel.com: fold board code update] Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
Diffstat (limited to 'arch/avr32/mach-at32ap/at32ap700x.c')
-rw-r--r--arch/avr32/mach-at32ap/at32ap700x.c29
1 files changed, 22 insertions, 7 deletions
diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c
index 402cae8f9205..1bc6389b20b0 100644
--- a/arch/avr32/mach-at32ap/at32ap700x.c
+++ b/arch/avr32/mach-at32ap/at32ap700x.c
@@ -26,6 +26,8 @@
26#include <mach/portmux.h> 26#include <mach/portmux.h>
27#include <mach/sram.h> 27#include <mach/sram.h>
28 28
29#include <sound/atmel-abdac.h>
30
29#include <video/atmel_lcdc.h> 31#include <video/atmel_lcdc.h>
30 32
31#include "clock.h" 33#include "clock.h"
@@ -2053,21 +2055,34 @@ static struct clk abdac0_sample_clk = {
2053 .index = 6, 2055 .index = 6,
2054}; 2056};
2055 2057
2056struct platform_device *__init at32_add_device_abdac(unsigned int id) 2058struct platform_device *__init
2059at32_add_device_abdac(unsigned int id, struct atmel_abdac_pdata *data)
2057{ 2060{
2058 struct platform_device *pdev; 2061 struct platform_device *pdev;
2059 u32 pin_mask; 2062 struct dw_dma_slave *dws;
2063 u32 pin_mask;
2060 2064
2061 if (id != 0) 2065 if (id != 0 || !data)
2062 return NULL; 2066 return NULL;
2063 2067
2064 pdev = platform_device_alloc("abdac", id); 2068 pdev = platform_device_alloc("atmel_abdac", id);
2065 if (!pdev) 2069 if (!pdev)
2066 return NULL; 2070 return NULL;
2067 2071
2068 if (platform_device_add_resources(pdev, abdac0_resource, 2072 if (platform_device_add_resources(pdev, abdac0_resource,
2069 ARRAY_SIZE(abdac0_resource))) 2073 ARRAY_SIZE(abdac0_resource)))
2070 goto err_add_resources; 2074 goto out_free_resources;
2075
2076 dws = &data->dws;
2077
2078 dws->dma_dev = &dw_dmac0_device.dev;
2079 dws->reg_width = DW_DMA_SLAVE_WIDTH_32BIT;
2080 dws->cfg_hi = DWC_CFGH_DST_PER(2);
2081 dws->cfg_lo &= ~(DWC_CFGL_HS_DST_POL | DWC_CFGL_HS_SRC_POL);
2082
2083 if (platform_device_add_data(pdev, data,
2084 sizeof(struct atmel_abdac_pdata)))
2085 goto out_free_resources;
2071 2086
2072 pin_mask = (1 << 20) | (1 << 22); /* DATA1 & DATAN1 */ 2087 pin_mask = (1 << 20) | (1 << 22); /* DATA1 & DATAN1 */
2073 pin_mask |= (1 << 21) | (1 << 23); /* DATA0 & DATAN0 */ 2088 pin_mask |= (1 << 21) | (1 << 23); /* DATA0 & DATAN0 */
@@ -2080,7 +2095,7 @@ struct platform_device *__init at32_add_device_abdac(unsigned int id)
2080 platform_device_add(pdev); 2095 platform_device_add(pdev);
2081 return pdev; 2096 return pdev;
2082 2097
2083err_add_resources: 2098out_free_resources:
2084 platform_device_put(pdev); 2099 platform_device_put(pdev);
2085 return NULL; 2100 return NULL;
2086} 2101}