blob: 61ab15aae97008e798f5b89d6a225d195ca1b578 [file] [log] [blame]
Haavard Skinnemoen5f97f7f2006-09-25 23:32:13 -07001/*
2 * Copyright (C) 2006 Atmel Corporation
3 *
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.
7 */
8
9#include <linux/clk.h>
10#include <linux/err.h>
11#include <linux/init.h>
12#include <linux/platform_device.h>
13
Haavard Skinnemoen5f97f7f2006-09-25 23:32:13 -070014static int __init pdc_probe(struct platform_device *pdev)
15{
16 struct clk *pclk, *hclk;
17
18 pclk = clk_get(&pdev->dev, "pclk");
19 if (IS_ERR(pclk)) {
20 dev_err(&pdev->dev, "no pclk defined\n");
21 return PTR_ERR(pclk);
22 }
23 hclk = clk_get(&pdev->dev, "hclk");
24 if (IS_ERR(hclk)) {
25 dev_err(&pdev->dev, "no hclk defined\n");
26 clk_put(pclk);
27 return PTR_ERR(hclk);
28 }
29
30 clk_enable(pclk);
31 clk_enable(hclk);
32
33 dev_info(&pdev->dev, "Atmel Peripheral DMA Controller enabled\n");
34 return 0;
35}
36
37static struct platform_driver pdc_driver = {
Haavard Skinnemoen5f97f7f2006-09-25 23:32:13 -070038 .driver = {
39 .name = "pdc",
40 },
41};
42
43static int __init pdc_init(void)
44{
Uwe Kleine-König787928e2008-09-21 23:52:08 +020045 return platform_driver_probe(&pdc_driver, pdc_probe);
Haavard Skinnemoen5f97f7f2006-09-25 23:32:13 -070046}
47arch_initcall(pdc_init);