aboutsummaryrefslogtreecommitdiffstats
path: root/arch/avr32/mach-at32ap
diff options
context:
space:
mode:
Diffstat (limited to 'arch/avr32/mach-at32ap')
-rw-r--r--arch/avr32/mach-at32ap/at32ap700x.c29
-rw-r--r--arch/avr32/mach-at32ap/include/mach/board.h7
2 files changed, 27 insertions, 9 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}
diff --git a/arch/avr32/mach-at32ap/include/mach/board.h b/arch/avr32/mach-at32ap/include/mach/board.h
index cff8e84f78f2..63ec4008b253 100644
--- a/arch/avr32/mach-at32ap/include/mach/board.h
+++ b/arch/avr32/mach-at32ap/include/mach/board.h
@@ -13,7 +13,7 @@
13 * in this array is chip-dependent. 13 * in this array is chip-dependent.
14 */ 14 */
15extern unsigned long at32_board_osc_rates[]; 15extern unsigned long at32_board_osc_rates[];
16 16
17/* 17/*
18 * This used to add essential system devices, but this is now done 18 * This used to add essential system devices, but this is now done
19 * automatically. Please don't use it in new board code. 19 * automatically. Please don't use it in new board code.
@@ -97,7 +97,10 @@ struct ac97c_platform_data {
97struct platform_device * 97struct platform_device *
98at32_add_device_ac97c(unsigned int id, struct ac97c_platform_data *data); 98at32_add_device_ac97c(unsigned int id, struct ac97c_platform_data *data);
99 99
100struct platform_device *at32_add_device_abdac(unsigned int id); 100struct atmel_abdac_pdata;
101struct platform_device *
102at32_add_device_abdac(unsigned int id, struct atmel_abdac_pdata *data);
103
101struct platform_device *at32_add_device_psif(unsigned int id); 104struct platform_device *at32_add_device_psif(unsigned int id);
102 105
103struct cf_platform_data { 106struct cf_platform_data {