locomo.h revision 8d48427ecb0639593ccf14e807479b7873254ccb
11da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/*
21da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * linux/include/asm-arm/hardware/locomo.h
31da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds *
41da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * This file contains the definitions for the LoCoMo G/A Chip
51da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds *
61da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * (C) Copyright 2004 John Lenz
71da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds *
81da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * May be copied or modified under the terms of the GNU General Public
91da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * License.  See linux/COPYING for more information.
101da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds *
111da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * Based on sa1111.h
121da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds */
131da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#ifndef _ASM_ARCH_LOCOMO
141da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define _ASM_ARCH_LOCOMO
151da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
161da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define locomo_writel(val,addr)	({ *(volatile u16 *)(addr) = (val); })
171da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define locomo_readl(addr)	(*(volatile u16 *)(addr))
181da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
191da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* LOCOMO version */
201da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_VER	0x00
211da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
221da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* Pin status */
231da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_ST	0x04
241da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
251da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* Pin status */
261da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_C32K	0x08
271da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
281da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* Interrupt controller */
291da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_ICR	0x0C
301da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
311da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* MCS decoder for boot selecting */
321da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_MCSX0	0x10
331da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_MCSX1	0x14
341da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_MCSX2	0x18
351da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_MCSX3	0x1c
361da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
371da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* Touch panel controller */
381da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_ASD	0x20		/* AD start delay */
391da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_HSD	0x28		/* HSYS delay */
401da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_HSC	0x2c		/* HSYS period */
411da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_TADC	0x30		/* tablet ADC clock */
421da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
431da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
441da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* Long time timer */
451da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_LTC	0xd8		/* LTC interrupt setting */
461da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_LTINT	0xdc		/* LTC interrupt */
471da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
481da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* DAC control signal for LCD (COMADJ ) */
491da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_DAC		0xe0
501da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* DAC control */
511da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define	LOCOMO_DAC_SCLOEB	0x08	/* SCL pin output data       */
521da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define	LOCOMO_DAC_TEST		0x04	/* Test bit                  */
531da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define	LOCOMO_DAC_SDA		0x02	/* SDA pin level (read-only) */
541da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define	LOCOMO_DAC_SDAOEB	0x01	/* SDA pin output data       */
551da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
561da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* SPI interface */
571da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_SPIMD	0x60		/* SPI mode setting */
581da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_SPICT	0x64		/* SPI mode control */
591da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_SPIST	0x68		/* SPI status */
601da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_SPIIS	0x70		/* SPI interrupt status */
611da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_SPIWE	0x74		/* SPI interrupt status write enable */
621da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_SPIIE	0x78		/* SPI interrupt enable */
631da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_SPIIR	0x7c		/* SPI interrupt request */
641da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_SPITD	0x80		/* SPI transfer data write */
651da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_SPIRD	0x84		/* SPI receive data read */
661da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_SPITS	0x88		/* SPI transfer data shift */
671da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_SPIRS	0x8C		/* SPI receive data shift */
681da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define	LOCOMO_SPI_TEND	(1 << 3)	/* Transfer end bit */
691da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define	LOCOMO_SPI_OVRN	(1 << 2)	/* Over Run bit */
701da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define	LOCOMO_SPI_RFW	(1 << 1)	/* write buffer bit */
711da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define	LOCOMO_SPI_RFR	(1)		/* read buffer bit */
721da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
731da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* GPIO */
741da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_GPD		0x90	/* GPIO direction */
751da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_GPE		0x94	/* GPIO input enable */
761da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_GPL		0x98	/* GPIO level */
771da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_GPO		0x9c	/* GPIO out data setteing */
781da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_GRIE		0xa0	/* GPIO rise detection */
791da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_GFIE		0xa4	/* GPIO fall detection */
801da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_GIS		0xa8	/* GPIO edge detection status */
811da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_GWE		0xac	/* GPIO status write enable */
821da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_GIE		0xb0	/* GPIO interrupt enable */
831da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_GIR		0xb4	/* GPIO interrupt request */
841da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define	LOCOMO_GPIO(Nb)		(0x01 << (Nb))
851da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_GPIO_RTS		LOCOMO_GPIO(0)
861da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_GPIO_CTS		LOCOMO_GPIO(1)
871da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_GPIO_DSR		LOCOMO_GPIO(2)
881da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_GPIO_DTR		LOCOMO_GPIO(3)
891da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_GPIO_LCD_VSHA_ON	LOCOMO_GPIO(4)
901da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_GPIO_LCD_VSHD_ON	LOCOMO_GPIO(5)
911da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_GPIO_LCD_VEE_ON	LOCOMO_GPIO(6)
921da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_GPIO_LCD_MOD	LOCOMO_GPIO(7)
931da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_GPIO_DAC_ON	LOCOMO_GPIO(8)
941da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_GPIO_FL_VR	LOCOMO_GPIO(9)
951da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_GPIO_DAC_SDATA	LOCOMO_GPIO(10)
961da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_GPIO_DAC_SCK	LOCOMO_GPIO(11)
971da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_GPIO_DAC_SLOAD	LOCOMO_GPIO(12)
981da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
991da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* Start the definitions of the devices.  Each device has an initial
1001da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * base address and a series of offsets from that base address. */
1011da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1021da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* Keyboard controller */
1031da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_KEYBOARD		0x40
1041da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_KIB		0x00	/* KIB level */
1051da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_KSC		0x04	/* KSTRB control */
1061da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_KCMD		0x08	/* KSTRB command */
1071da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_KIC		0x0c	/* Key interrupt */
1081da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1091da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* Front light adjustment controller */
1101da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_FRONTLIGHT	0xc8
1111da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_ALS		0x00	/* Adjust light cycle */
1121da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_ALD		0x04	/* Adjust light duty */
1131da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
114e4423781850025726b6c4e24ba3d93c7ff9cd826Richard Purdie#define LOCOMO_ALC_EN		0x8000
115e4423781850025726b6c4e24ba3d93c7ff9cd826Richard Purdie
1161da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* Backlight controller: TFT signal */
1171da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_BACKLIGHT	0x38
1181da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_TC		0x00		/* TFT control signal */
1191da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_CPSD		0x04		/* CPS delay */
1201da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1211da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* Audio controller */
1221da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_AUDIO		0x54
1231da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_ACC		0x00	/* Audio clock */
1241da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_PAIF		0x7C	/* PCM audio interface */
1251da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* Audio clock */
1261da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define	LOCOMO_ACC_XON		0x80
1271da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define	LOCOMO_ACC_XEN		0x40
1281da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define	LOCOMO_ACC_XSEL0	0x00
1291da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define	LOCOMO_ACC_XSEL1	0x20
1301da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define	LOCOMO_ACC_MCLKEN	0x10
1311da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define	LOCOMO_ACC_64FSEN	0x08
1321da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define	LOCOMO_ACC_CLKSEL000	0x00	/* mclk  2 */
1331da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define	LOCOMO_ACC_CLKSEL001	0x01	/* mclk  3 */
1341da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define	LOCOMO_ACC_CLKSEL010	0x02	/* mclk  4 */
1351da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define	LOCOMO_ACC_CLKSEL011	0x03	/* mclk  6 */
1361da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define	LOCOMO_ACC_CLKSEL100	0x04	/* mclk  8 */
1371da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define	LOCOMO_ACC_CLKSEL101	0x05	/* mclk 12 */
1381da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* PCM audio interface */
1391da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define	LOCOMO_PAIF_SCINV	0x20
1401da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define	LOCOMO_PAIF_SCEN	0x10
1411da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define	LOCOMO_PAIF_LRCRST	0x08
1421da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define	LOCOMO_PAIF_LRCEVE	0x04
1431da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define	LOCOMO_PAIF_LRCINV	0x02
1441da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define	LOCOMO_PAIF_LRCEN	0x01
1451da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1461da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* LED controller */
1471da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_LED		0xe8
1481da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_LPT0		0x00
1491da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_LPT1		0x04
1501da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* LED control */
1511da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_LPT_TOFH		0x80
1521da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_LPT_TOFL		0x08
1531da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_LPT_TOH(TOH)	((TOH & 0x7) << 4)
1541da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_LPT_TOL(TOL)	((TOL & 0x7))
1551da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1561da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsextern struct bus_type locomo_bus_type;
1571da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1581da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_DEVID_KEYBOARD	0
1591da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_DEVID_FRONTLIGHT	1
1601da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_DEVID_BACKLIGHT	2
1611da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_DEVID_AUDIO	3
1621da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_DEVID_LED	4
1631da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_DEVID_UART	5
1641da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1651da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsstruct locomo_dev {
1661da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	struct device	dev;
1671da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	unsigned int	devid;
1681da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	unsigned int	irq[1];
1691da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1701da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	void		*mapbase;
1711da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	unsigned long	length;
1721da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1731da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	u64		dma_mask;
1741da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds};
1751da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1761da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_DEV(_d)	container_of((_d), struct locomo_dev, dev)
1771da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1781da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define locomo_get_drvdata(d)	dev_get_drvdata(&(d)->dev)
1791da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define locomo_set_drvdata(d,p)	dev_set_drvdata(&(d)->dev, p)
1801da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1811da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsstruct locomo_driver {
1821da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	struct device_driver	drv;
1831da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	unsigned int		devid;
1841da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	int (*probe)(struct locomo_dev *);
1851da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	int (*remove)(struct locomo_dev *);
1861da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	int (*suspend)(struct locomo_dev *, pm_message_t);
1871da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	int (*resume)(struct locomo_dev *);
1881da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds};
1891da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1901da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_DRV(_d)	container_of((_d), struct locomo_driver, drv)
1911da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1921da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LOCOMO_DRIVER_NAME(_ldev) ((_ldev)->dev.driver->name)
1931da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1941da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsvoid locomo_lcd_power(struct locomo_dev *, int, unsigned int);
1951da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1961da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsint locomo_driver_register(struct locomo_driver *);
1971da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsvoid locomo_driver_unregister(struct locomo_driver *);
1981da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1991da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* GPIO control functions */
2008d48427ecb0639593ccf14e807479b7873254ccbRichard Purdievoid locomo_gpio_set_dir(struct device *dev, unsigned int bits, unsigned int dir);
2018d48427ecb0639593ccf14e807479b7873254ccbRichard Purdieint locomo_gpio_read_level(struct device *dev, unsigned int bits);
2028d48427ecb0639593ccf14e807479b7873254ccbRichard Purdieint locomo_gpio_read_output(struct device *dev, unsigned int bits);
2038d48427ecb0639593ccf14e807479b7873254ccbRichard Purdievoid locomo_gpio_write(struct device *dev, unsigned int bits, unsigned int set);
2048d48427ecb0639593ccf14e807479b7873254ccbRichard Purdie
2051da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
2061da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* M62332 control function */
2071da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsvoid locomo_m62332_senddata(struct locomo_dev *ldev, unsigned int dac_data, int channel);
2081da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
209e4423781850025726b6c4e24ba3d93c7ff9cd826Richard Purdie/* Frontlight control */
210e4423781850025726b6c4e24ba3d93c7ff9cd826Richard Purdievoid locomo_frontlight_set(struct locomo_dev *dev, int duty, int vr, int bpwf);
211e4423781850025726b6c4e24ba3d93c7ff9cd826Richard Purdie
2121da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#endif
213