]>
Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | /* |
2 | * ssp.h | |
3 | * | |
4 | * Copyright (C) 2003 Russell King, All Rights Reserved. | |
5 | * | |
6 | * This program is free software; you can redistribute it and/or modify | |
7 | * it under the terms of the GNU General Public License version 2 as | |
8 | * published by the Free Software Foundation. | |
9 | * | |
10 | * This driver supports the following PXA CPU/SSP ports:- | |
11 | * | |
12 | * PXA250 SSP | |
13 | * PXA255 SSP, NSSP | |
14 | * PXA26x SSP, NSSP, ASSP | |
15 | * PXA27x SSP1, SSP2, SSP3 | |
88286450 | 16 | * PXA3xx SSP1, SSP2, SSP3, SSP4 |
1da177e4 LT |
17 | */ |
18 | ||
88286450 | 19 | #ifndef __ASM_ARCH_SSP_H |
20 | #define __ASM_ARCH_SSP_H | |
21 | ||
22 | #include <linux/list.h> | |
63bef547 | 23 | #include <linux/io.h> |
88286450 | 24 | |
25 | enum pxa_ssp_type { | |
26 | SSP_UNDEFINED = 0, | |
27 | PXA25x_SSP, /* pxa 210, 250, 255, 26x */ | |
28 | PXA25x_NSSP, /* pxa 255, 26x (including ASSP) */ | |
29 | PXA27x_SSP, | |
30 | }; | |
31 | ||
32 | struct ssp_device { | |
33 | struct platform_device *pdev; | |
34 | struct list_head node; | |
35 | ||
36 | struct clk *clk; | |
37 | void __iomem *mmio_base; | |
38 | unsigned long phys_base; | |
39 | ||
40 | const char *label; | |
41 | int port_id; | |
42 | int type; | |
43 | int use_count; | |
44 | int irq; | |
45 | int drcmr_rx; | |
46 | int drcmr_tx; | |
47 | }; | |
1da177e4 | 48 | |
63bef547 MB |
49 | /** |
50 | * ssp_write_reg - Write to a SSP register | |
51 | * | |
52 | * @dev: SSP device to access | |
53 | * @reg: Register to write to | |
54 | * @val: Value to be written. | |
55 | */ | |
56 | static inline void ssp_write_reg(struct ssp_device *dev, u32 reg, u32 val) | |
57 | { | |
58 | __raw_writel(val, dev->mmio_base + reg); | |
59 | } | |
60 | ||
61 | /** | |
62 | * ssp_read_reg - Read from a SSP register | |
63 | * | |
64 | * @dev: SSP device to access | |
65 | * @reg: Register to read from | |
66 | */ | |
67 | static inline u32 ssp_read_reg(struct ssp_device *dev, u32 reg) | |
68 | { | |
69 | return __raw_readl(dev->mmio_base + reg); | |
70 | } | |
71 | ||
88286450 | 72 | struct ssp_device *ssp_request(int port, const char *label); |
73 | void ssp_free(struct ssp_device *); | |
74 | #endif /* __ASM_ARCH_SSP_H */ |