Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 99231
b: refs/heads/master
c: d86d314
h: refs/heads/master
i:
  99229: 9e3d0dc
  99227: 84bc4ab
  99223: d5159a6
  99215: eb5236c
  99199: d2845a5
v: v3
  • Loading branch information
Hans-Christian Egtvedt authored and Haavard Skinnemoen committed Jun 27, 2008
1 parent d6188e2 commit 9f0921a
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 47882cf620bcd7b014f6f7fc11be8c045787adac
refs/heads/master: d86d314f67191011e6f494f6517b8cbd7dd3dc39
77 changes: 77 additions & 0 deletions trunk/arch/avr32/mach-at32ap/at32ap700x.c
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,81 @@ void __init at32_add_system_devices(void)
platform_device_register(&pio4_device);
}

/* --------------------------------------------------------------------
* PSIF
* -------------------------------------------------------------------- */
static struct resource atmel_psif0_resource[] __initdata = {
{
.start = 0xffe03c00,
.end = 0xffe03cff,
.flags = IORESOURCE_MEM,
},
IRQ(18),
};
static struct clk atmel_psif0_pclk = {
.name = "pclk",
.parent = &pba_clk,
.mode = pba_clk_mode,
.get_rate = pba_clk_get_rate,
.index = 15,
};

static struct resource atmel_psif1_resource[] __initdata = {
{
.start = 0xffe03d00,
.end = 0xffe03dff,
.flags = IORESOURCE_MEM,
},
IRQ(18),
};
static struct clk atmel_psif1_pclk = {
.name = "pclk",
.parent = &pba_clk,
.mode = pba_clk_mode,
.get_rate = pba_clk_get_rate,
.index = 15,
};

struct platform_device *__init at32_add_device_psif(unsigned int id)
{
struct platform_device *pdev;

if (!(id == 0 || id == 1))
return NULL;

pdev = platform_device_alloc("atmel_psif", id);
if (!pdev)
return NULL;

switch (id) {
case 0:
if (platform_device_add_resources(pdev, atmel_psif0_resource,
ARRAY_SIZE(atmel_psif0_resource)))
goto err_add_resources;
atmel_psif0_pclk.dev = &pdev->dev;
select_peripheral(PA(8), PERIPH_A, 0); /* CLOCK */
select_peripheral(PA(9), PERIPH_A, 0); /* DATA */
break;
case 1:
if (platform_device_add_resources(pdev, atmel_psif1_resource,
ARRAY_SIZE(atmel_psif1_resource)))
goto err_add_resources;
atmel_psif1_pclk.dev = &pdev->dev;
select_peripheral(PB(11), PERIPH_A, 0); /* CLOCK */
select_peripheral(PB(12), PERIPH_A, 0); /* DATA */
break;
default:
return NULL;
}

platform_device_add(pdev);
return pdev;

err_add_resources:
platform_device_put(pdev);
return NULL;
}

/* --------------------------------------------------------------------
* USART
* -------------------------------------------------------------------- */
Expand Down Expand Up @@ -1934,6 +2009,8 @@ struct clk *at32_clock_list[] = {
&pio4_mck,
&at32_tcb0_t0_clk,
&at32_tcb1_t0_clk,
&atmel_psif0_pclk,
&atmel_psif1_pclk,
&atmel_usart0_usart,
&atmel_usart1_usart,
&atmel_usart2_usart,
Expand Down
1 change: 1 addition & 0 deletions trunk/include/asm-avr32/arch-at32ap/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ struct platform_device *at32_add_device_twi(unsigned int id,
struct platform_device *at32_add_device_mci(unsigned int id);
struct platform_device *at32_add_device_ac97c(unsigned int id);
struct platform_device *at32_add_device_abdac(unsigned int id);
struct platform_device *at32_add_device_psif(unsigned int id);

struct cf_platform_data {
int detect_pin;
Expand Down

0 comments on commit 9f0921a

Please sign in to comment.