1 /*
2  * atmel platform data
3  *
4  * GPL v2 Only
5  */
6 
7 #ifndef __ATMEL_H__
8 #define __ATMEL_H__
9 
10 #include <linux/mtd/nand.h>
11 #include <linux/mtd/partitions.h>
12 #include <linux/serial.h>
13 
14 /*
15  * at91: 6 USARTs and one DBGU port (SAM9260)
16  * avr32: 4
17  */
18 #define ATMEL_MAX_UART	7
19 
20  /* USB Device */
21 struct at91_udc_data {
22 	int	vbus_pin;		/* high == host powering us */
23 	u8	vbus_active_low;	/* vbus polarity */
24 	u8	vbus_polled;		/* Use polling, not interrupt */
25 	int	pullup_pin;		/* active == D+ pulled up */
26 	u8	pullup_active_low;	/* true == pullup_pin is active low */
27 };
28 
29  /* Compact Flash */
30 struct at91_cf_data {
31 	int	irq_pin;		/* I/O IRQ */
32 	int	det_pin;		/* Card detect */
33 	int	vcc_pin;		/* power switching */
34 	int	rst_pin;		/* card reset */
35 	u8	chipselect;		/* EBI Chip Select number */
36 	u8	flags;
37 #define AT91_CF_TRUE_IDE	0x01
38 #define AT91_IDE_SWAP_A0_A2	0x02
39 };
40 
41  /* NAND / SmartMedia */
42 struct atmel_nand_data {
43 	int		enable_pin;		/* chip enable */
44 	int		det_pin;		/* card detect */
45 	int		rdy_pin;		/* ready/busy */
46 	u8		rdy_pin_active_low;	/* rdy_pin value is inverted */
47 	u8		ale;			/* address line number connected to ALE */
48 	u8		cle;			/* address line number connected to CLE */
49 	u8		bus_width_16;		/* buswidth is 16 bit */
50 	u8		ecc_mode;		/* ecc mode */
51 	u8		on_flash_bbt;		/* bbt on flash */
52 	struct mtd_partition *parts;
53 	unsigned int	num_parts;
54 	bool		has_dma;		/* support dma transfer */
55 
56 	/* default is false, only for at32ap7000 chip is true */
57 	bool		need_reset_workaround;
58 };
59 
60  /* Serial */
61 struct atmel_uart_data {
62 	int			num;		/* port num */
63 	short			use_dma_tx;	/* use transmit DMA? */
64 	short			use_dma_rx;	/* use receive DMA? */
65 	void __iomem		*regs;		/* virt. base address, if any */
66 	struct serial_rs485	rs485;		/* rs485 settings */
67 };
68 
69 /* CAN */
70 struct at91_can_data {
71 	void (*transceiver_switch)(int on);
72 };
73 
74 /* FIXME: this needs a better location, but gets stuff building again */
75 extern int at91_suspend_entering_slow_clock(void);
76 
77 #endif /* __ATMEL_H__ */
78