Blame view

arch/avr32/mach-at32ap/pdc.c 1 KB
5f97f7f94   Haavard Skinnemoen   [PATCH] avr32 arc...
1
2
3
4
5
6
7
8
9
10
11
12
  /*
   * Copyright (C) 2006 Atmel Corporation
   *
   * This program is free software; you can redistribute it and/or modify
   * it under the terms of the GNU General Public License version 2 as
   * published by the Free Software Foundation.
   */
  
  #include <linux/clk.h>
  #include <linux/err.h>
  #include <linux/init.h>
  #include <linux/platform_device.h>
5f97f7f94   Haavard Skinnemoen   [PATCH] avr32 arc...
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
  static int __init pdc_probe(struct platform_device *pdev)
  {
  	struct clk *pclk, *hclk;
  
  	pclk = clk_get(&pdev->dev, "pclk");
  	if (IS_ERR(pclk)) {
  		dev_err(&pdev->dev, "no pclk defined
  ");
  		return PTR_ERR(pclk);
  	}
  	hclk = clk_get(&pdev->dev, "hclk");
  	if (IS_ERR(hclk)) {
  		dev_err(&pdev->dev, "no hclk defined
  ");
  		clk_put(pclk);
  		return PTR_ERR(hclk);
  	}
  
  	clk_enable(pclk);
  	clk_enable(hclk);
  
  	dev_info(&pdev->dev, "Atmel Peripheral DMA Controller enabled
  ");
  	return 0;
  }
  
  static struct platform_driver pdc_driver = {
5f97f7f94   Haavard Skinnemoen   [PATCH] avr32 arc...
40
41
42
43
44
45
46
  	.driver		= {
  		.name	= "pdc",
  	},
  };
  
  static int __init pdc_init(void)
  {
787928e74   Uwe Kleine-König   avr32: Use platfo...
47
  	return platform_driver_probe(&pdc_driver, pdc_probe);
5f97f7f94   Haavard Skinnemoen   [PATCH] avr32 arc...
48
49
  }
  arch_initcall(pdc_init);