2 * Copyright (C) 2006 Atmel Corporation
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
10 #include <linux/err.h>
11 #include <linux/init.h>
12 #include <linux/platform_device.h>
16 #include <asm/arch/init.h>
17 #include <asm/arch/sm.h>
19 struct at32_sm system_manager
;
21 static int __init
at32_sm_init(void)
23 struct resource
*regs
;
24 struct at32_sm
*sm
= &system_manager
;
27 regs
= platform_get_resource(&at32_sm_device
, IORESOURCE_MEM
, 0);
31 spin_lock_init(&sm
->lock
);
32 sm
->pdev
= &at32_sm_device
;
35 sm
->regs
= ioremap(regs
->start
, regs
->end
- regs
->start
+ 1);
42 printk(KERN_ERR
"Failed to initialize System Manager: %d\n", ret
);
46 void __init
setup_platform(void)
53 static int __init
pdc_probe(struct platform_device
*pdev
)
55 struct clk
*pclk
, *hclk
;
57 pclk
= clk_get(&pdev
->dev
, "pclk");
59 dev_err(&pdev
->dev
, "no pclk defined\n");
62 hclk
= clk_get(&pdev
->dev
, "hclk");
64 dev_err(&pdev
->dev
, "no hclk defined\n");
72 dev_info(&pdev
->dev
, "Atmel Peripheral DMA Controller enabled\n");
76 static struct platform_driver pdc_driver
= {
83 static int __init
pdc_init(void)
85 return platform_driver_register(&pdc_driver
);
87 arch_initcall(pdc_init
);