blob: a012882c9ee601d1c4c5723c35e9663dfc14bbc2 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
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
eric miao88286452007-12-06 17:56:42 +080016 * PXA3xx SSP1, SSP2, SSP3, SSP4
Linus Torvalds1da177e2005-04-16 15:20:36 -070017 */
18
eric miao88286452007-12-06 17:56:42 +080019#ifndef __ASM_ARCH_SSP_H
20#define __ASM_ARCH_SSP_H
21
22#include <linux/list.h>
23
24enum pxa_ssp_type {
25 SSP_UNDEFINED = 0,
26 PXA25x_SSP, /* pxa 210, 250, 255, 26x */
27 PXA25x_NSSP, /* pxa 255, 26x (including ASSP) */
28 PXA27x_SSP,
29};
30
31struct ssp_device {
32 struct platform_device *pdev;
33 struct list_head node;
34
35 struct clk *clk;
36 void __iomem *mmio_base;
37 unsigned long phys_base;
38
39 const char *label;
40 int port_id;
41 int type;
42 int use_count;
43 int irq;
44 int drcmr_rx;
45 int drcmr_tx;
46};
Linus Torvalds1da177e2005-04-16 15:20:36 -070047
Liam Girdwoodb216c012005-11-10 17:45:39 +000048/*
49 * SSP initialisation flags
50 */
51#define SSP_NO_IRQ 0x1 /* don't register an irq handler in SSP driver */
52
Linus Torvalds1da177e2005-04-16 15:20:36 -070053struct ssp_state {
54 u32 cr0;
55 u32 cr1;
56 u32 to;
57 u32 psp;
58};
59
60struct ssp_dev {
eric miao88286452007-12-06 17:56:42 +080061 struct ssp_device *ssp;
Linus Torvalds1da177e2005-04-16 15:20:36 -070062 u32 port;
63 u32 mode;
64 u32 flags;
65 u32 psp_flags;
66 u32 speed;
Liam Girdwoodb216c012005-11-10 17:45:39 +000067 int irq;
Linus Torvalds1da177e2005-04-16 15:20:36 -070068};
69
70int ssp_write_word(struct ssp_dev *dev, u32 data);
Paul Sokolovsky8f1bf872006-08-27 12:54:56 +010071int ssp_read_word(struct ssp_dev *dev, u32 *data);
72int ssp_flush(struct ssp_dev *dev);
Linus Torvalds1da177e2005-04-16 15:20:36 -070073void ssp_enable(struct ssp_dev *dev);
74void ssp_disable(struct ssp_dev *dev);
75void ssp_save_state(struct ssp_dev *dev, struct ssp_state *ssp);
76void ssp_restore_state(struct ssp_dev *dev, struct ssp_state *ssp);
Liam Girdwoodb216c012005-11-10 17:45:39 +000077int ssp_init(struct ssp_dev *dev, u32 port, u32 init_flags);
Linus Torvalds1da177e2005-04-16 15:20:36 -070078int ssp_config(struct ssp_dev *dev, u32 mode, u32 flags, u32 psp_flags, u32 speed);
79void ssp_exit(struct ssp_dev *dev);
80
eric miao88286452007-12-06 17:56:42 +080081struct ssp_device *ssp_request(int port, const char *label);
82void ssp_free(struct ssp_device *);
83#endif /* __ASM_ARCH_SSP_H */