Jean-Christophe PLAGNIOL-VILLARD | bf4289c | 2011-12-29 14:43:24 +0800 | [diff] [blame] | 1 | /* |
| 2 | * atmel platform data |
| 3 | * |
| 4 | * GPL v2 Only |
| 5 | */ |
| 6 | |
Paul Gortmaker | 3d92e05 | 2012-04-01 16:38:40 -0400 | [diff] [blame] | 7 | #ifndef __ATMEL_H__ |
| 8 | #define __ATMEL_H__ |
Jean-Christophe PLAGNIOL-VILLARD | bf4289c | 2011-12-29 14:43:24 +0800 | [diff] [blame] | 9 | |
| 10 | #include <linux/mtd/nand.h> |
Jean-Christophe PLAGNIOL-VILLARD | bcd2360 | 2012-10-30 05:12:23 +0800 | [diff] [blame] | 11 | #include <linux/mtd/partitions.h> |
| 12 | #include <linux/device.h> |
| 13 | #include <linux/i2c.h> |
| 14 | #include <linux/leds.h> |
| 15 | #include <linux/spi/spi.h> |
| 16 | #include <linux/usb/atmel_usba_udc.h> |
| 17 | #include <linux/atmel-mci.h> |
| 18 | #include <sound/atmel-ac97c.h> |
| 19 | #include <linux/serial.h> |
| 20 | #include <linux/platform_data/macb.h> |
| 21 | |
Jean-Christophe PLAGNIOL-VILLARD | 2abb74e | 2012-11-17 23:05:06 +0100 | [diff] [blame] | 22 | /* |
| 23 | * at91: 6 USARTs and one DBGU port (SAM9260) |
| 24 | * avr32: 4 |
| 25 | */ |
| 26 | #define ATMEL_MAX_UART 7 |
| 27 | |
Jean-Christophe PLAGNIOL-VILLARD | bcd2360 | 2012-10-30 05:12:23 +0800 | [diff] [blame] | 28 | /* USB Device */ |
| 29 | struct at91_udc_data { |
| 30 | int vbus_pin; /* high == host powering us */ |
| 31 | u8 vbus_active_low; /* vbus polarity */ |
| 32 | u8 vbus_polled; /* Use polling, not interrupt */ |
| 33 | int pullup_pin; /* active == D+ pulled up */ |
| 34 | u8 pullup_active_low; /* true == pullup_pin is active low */ |
| 35 | }; |
| 36 | |
| 37 | /* Compact Flash */ |
| 38 | struct at91_cf_data { |
| 39 | int irq_pin; /* I/O IRQ */ |
| 40 | int det_pin; /* Card detect */ |
| 41 | int vcc_pin; /* power switching */ |
| 42 | int rst_pin; /* card reset */ |
| 43 | u8 chipselect; /* EBI Chip Select number */ |
| 44 | u8 flags; |
| 45 | #define AT91_CF_TRUE_IDE 0x01 |
| 46 | #define AT91_IDE_SWAP_A0_A2 0x02 |
| 47 | }; |
| 48 | |
| 49 | /* USB Host */ |
| 50 | #define AT91_MAX_USBH_PORTS 3 |
| 51 | struct at91_usbh_data { |
| 52 | int vbus_pin[AT91_MAX_USBH_PORTS]; /* port power-control pin */ |
| 53 | int overcurrent_pin[AT91_MAX_USBH_PORTS]; |
| 54 | u8 ports; /* number of ports on root hub */ |
| 55 | u8 overcurrent_supported; |
| 56 | u8 vbus_pin_active_low[AT91_MAX_USBH_PORTS]; |
| 57 | u8 overcurrent_status[AT91_MAX_USBH_PORTS]; |
| 58 | u8 overcurrent_changed[AT91_MAX_USBH_PORTS]; |
| 59 | }; |
Jean-Christophe PLAGNIOL-VILLARD | bf4289c | 2011-12-29 14:43:24 +0800 | [diff] [blame] | 60 | |
| 61 | /* NAND / SmartMedia */ |
| 62 | struct atmel_nand_data { |
| 63 | int enable_pin; /* chip enable */ |
| 64 | int det_pin; /* card detect */ |
| 65 | int rdy_pin; /* ready/busy */ |
| 66 | u8 rdy_pin_active_low; /* rdy_pin value is inverted */ |
| 67 | u8 ale; /* address line number connected to ALE */ |
| 68 | u8 cle; /* address line number connected to CLE */ |
| 69 | u8 bus_width_16; /* buswidth is 16 bit */ |
| 70 | u8 ecc_mode; /* ecc mode */ |
Jean-Christophe PLAGNIOL-VILLARD | 3dcb7ea | 2011-12-29 14:59:54 +0800 | [diff] [blame] | 71 | u8 on_flash_bbt; /* bbt on flash */ |
Jean-Christophe PLAGNIOL-VILLARD | bf4289c | 2011-12-29 14:43:24 +0800 | [diff] [blame] | 72 | struct mtd_partition *parts; |
| 73 | unsigned int num_parts; |
| 74 | }; |
| 75 | |
Jean-Christophe PLAGNIOL-VILLARD | bcd2360 | 2012-10-30 05:12:23 +0800 | [diff] [blame] | 76 | /* Serial */ |
| 77 | struct atmel_uart_data { |
| 78 | int num; /* port num */ |
| 79 | short use_dma_tx; /* use transmit DMA? */ |
| 80 | short use_dma_rx; /* use receive DMA? */ |
| 81 | void __iomem *regs; /* virt. base address, if any */ |
| 82 | struct serial_rs485 rs485; /* rs485 settings */ |
| 83 | }; |
| 84 | |
| 85 | /* Touchscreen Controller */ |
| 86 | struct at91_tsadcc_data { |
| 87 | unsigned int adc_clock; |
| 88 | u8 pendet_debounce; |
| 89 | u8 ts_sample_hold_time; |
| 90 | }; |
| 91 | |
| 92 | /* CAN */ |
| 93 | struct at91_can_data { |
| 94 | void (*transceiver_switch)(int on); |
| 95 | }; |
| 96 | |
| 97 | /* FIXME: this needs a better location, but gets stuff building again */ |
| 98 | extern int at91_suspend_entering_slow_clock(void); |
| 99 | |
Paul Gortmaker | 3d92e05 | 2012-04-01 16:38:40 -0400 | [diff] [blame] | 100 | #endif /* __ATMEL_H__ */ |