aboutsummaryrefslogtreecommitdiff
path: root/include/asm-arm/arch-lh7a40x/ssp.h
blob: 132b1c4d5ce6faecdd91d6b5f0466edc1efa3aab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/* ssp.h
     $Id$

   written by Marc Singer
   6 Dec 2004

   Copyright (C) 2004 Marc Singer

   -----------
   DESCRIPTION
   -----------

   This SSP header is available throughout the kernel, for this
   machine/architecture, because drivers that use it may be dispersed.

   This file was cloned from the 7952x implementation.  It would be
   better to share them, but we're taking an easier approach for the
   time being.

*/

#if !defined (__SSP_H__)
#    define   __SSP_H__

/* ----- Includes */

/* ----- Types */

struct ssp_driver {
	int  (*init)		(void);
	void (*exit)		(void);
	void (*acquire)		(void);
	void (*release)		(void);
	int  (*configure)	(int device, int mode, int speed,
				 int frame_size_write, int frame_size_read);
	void (*chip_select)	(int enable);
	void (*set_callbacks)   (void* handle,
				 irqreturn_t (*callback_tx)(void*),
				 irqreturn_t (*callback_rx)(void*));
	void (*enable)		(void);
	void (*disable)		(void);
//	int  (*save_state)	(void*);
//	void (*restore_state)	(void*);
	int  (*read)		(void);
	int  (*write)		(u16 data);
	int  (*write_read)	(u16 data);
	void (*flush)		(void);
	void (*write_async)	(void* pv, size_t cb);
	size_t (*write_pos)	(void);
};

	/* These modes are only available on the LH79524 */
#define SSP_MODE_SPI		(1)
#define SSP_MODE_SSI		(2)
#define SSP_MODE_MICROWIRE	(3)
#define SSP_MODE_I2S		(4)

	/* CPLD SPI devices */
#define DEVICE_EEPROM	0	/* Configuration eeprom */
#define DEVICE_MAC	1	/* MAC eeprom (LPD79524) */
#define DEVICE_CODEC	2	/* Audio codec */
#define DEVICE_TOUCH	3	/* Touch screen (LPD79520) */

/* ----- Globals */

/* ----- Prototypes */

//extern struct ssp_driver lh79520_i2s_driver;
extern struct ssp_driver lh7a400_cpld_ssp_driver;

#endif  /* __SSP_H__ */