diff options
Diffstat (limited to 'arch/avr32/mach-at32ap/at32ap700x.c')
-rw-r--r-- | arch/avr32/mach-at32ap/at32ap700x.c | 29 |
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 | ||
2056 | struct platform_device *__init at32_add_device_abdac(unsigned int id) | 2058 | struct platform_device *__init |
2059 | at32_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 | ||
2083 | err_add_resources: | 2098 | out_free_resources: |
2084 | platform_device_put(pdev); | 2099 | platform_device_put(pdev); |
2085 | return NULL; | 2100 | return NULL; |
2086 | } | 2101 | } |