blob: c377118884e66bd61fd87d5ffaa247effd5fb5ae [file] [log] [blame]
Dmitry Baryshkovf024ff12008-06-27 10:37:57 +01001#ifndef MFD_TMIO_H
2#define MFD_TMIO_H
3
Dmitry Baryshkovb53cde32008-10-15 22:03:55 -07004#include <linux/fb.h>
5
Ian Moltond3a2f712008-07-31 20:44:28 +02006#define tmio_ioread8(addr) readb(addr)
7#define tmio_ioread16(addr) readw(addr)
8#define tmio_ioread16_rep(r, b, l) readsw(r, b, l)
9#define tmio_ioread32(addr) \
10 (((u32) readw((addr))) | (((u32) readw((addr) + 2)) << 16))
11
12#define tmio_iowrite8(val, addr) writeb((val), (addr))
13#define tmio_iowrite16(val, addr) writew((val), (addr))
14#define tmio_iowrite16_rep(r, b, l) writesw(r, b, l)
15#define tmio_iowrite32(val, addr) \
16 do { \
17 writew((val), (addr)); \
18 writew((val) >> 16, (addr) + 2); \
19 } while (0)
20
Dmitry Baryshkovf024ff12008-06-27 10:37:57 +010021/*
Philipp Zabelf0e46cc2009-06-04 20:12:31 +020022 * data for the MMC controller
23 */
24struct tmio_mmc_data {
25 unsigned int hclk;
26};
27
28/*
Dmitry Baryshkovf024ff12008-06-27 10:37:57 +010029 * data for the NAND controller
30 */
31struct tmio_nand_data {
32 struct nand_bbt_descr *badblock_pattern;
33 struct mtd_partition *partition;
34 unsigned int num_partitions;
35};
36
Dmitry Baryshkovb53cde32008-10-15 22:03:55 -070037#define FBIO_TMIO_ACC_WRITE 0x7C639300
38#define FBIO_TMIO_ACC_SYNC 0x7C639301
39
40struct tmio_fb_data {
41 int (*lcd_set_power)(struct platform_device *fb_dev,
42 bool on);
43 int (*lcd_mode)(struct platform_device *fb_dev,
44 const struct fb_videomode *mode);
45 int num_modes;
46 struct fb_videomode *modes;
47
48 /* in mm: size of screen */
49 int height;
50 int width;
51};
52
53
Dmitry Baryshkovf024ff12008-06-27 10:37:57 +010054#endif