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)
52 /* FIXME: This doesn't belong here */
53 at32_setup_serial_console(1);
56 static int __init pdc_probe(struct platform_device *pdev)
58 struct clk *pclk, *hclk;
60 pclk = clk_get(&pdev->dev, "pclk");
62 dev_err(&pdev->dev, "no pclk defined\n");
65 hclk = clk_get(&pdev->dev, "hclk");
67 dev_err(&pdev->dev, "no hclk defined\n");
75 dev_info(&pdev->dev, "Atmel Peripheral DMA Controller enabled\n");
79 static struct platform_driver pdc_driver = {
86 static int __init pdc_init(void)
88 return platform_driver_register(&pdc_driver);
90 arch_initcall(pdc_init);