xref: /linux/arch/arm/include/asm/hardware/scoop.h (revision 983536e7b5275d5d8a63c18b5632d9ce0771caa0)
14baa9922SRussell King /*
24baa9922SRussell King  *  Definitions for the SCOOP interface found on various Sharp PDAs
34baa9922SRussell King  *
44baa9922SRussell King  *  Copyright (c) 2004 Richard Purdie
54baa9922SRussell King  *
64baa9922SRussell King  *  This program is free software; you can redistribute it and/or modify
74baa9922SRussell King  *  it under the terms of the GNU General Public License version 2 as
84baa9922SRussell King  *  published by the Free Software Foundation.
94baa9922SRussell King  *
104baa9922SRussell King  */
114baa9922SRussell King 
124baa9922SRussell King #define SCOOP_MCR  0x00
134baa9922SRussell King #define SCOOP_CDR  0x04
144baa9922SRussell King #define SCOOP_CSR  0x08
154baa9922SRussell King #define SCOOP_CPR  0x0C
164baa9922SRussell King #define SCOOP_CCR  0x10
174baa9922SRussell King #define SCOOP_IRR  0x14
184baa9922SRussell King #define SCOOP_IRM  0x14
194baa9922SRussell King #define SCOOP_IMR  0x18
204baa9922SRussell King #define SCOOP_ISR  0x1C
214baa9922SRussell King #define SCOOP_GPCR 0x20
224baa9922SRussell King #define SCOOP_GPWR 0x24
234baa9922SRussell King #define SCOOP_GPRR 0x28
244baa9922SRussell King 
25*983536e7SMarek Vasut #define SCOOP_CPR_OUT	(1 << 7)
26*983536e7SMarek Vasut #define SCOOP_CPR_SD_3V	(1 << 2)
27*983536e7SMarek Vasut #define SCOOP_CPR_CF_XV	(1 << 1)
28*983536e7SMarek Vasut #define SCOOP_CPR_CF_3V	(1 << 0)
29*983536e7SMarek Vasut 
304baa9922SRussell King #define SCOOP_GPCR_PA22	(1 << 12)
314baa9922SRussell King #define SCOOP_GPCR_PA21	(1 << 11)
324baa9922SRussell King #define SCOOP_GPCR_PA20	(1 << 10)
334baa9922SRussell King #define SCOOP_GPCR_PA19	(1 << 9)
344baa9922SRussell King #define SCOOP_GPCR_PA18	(1 << 8)
354baa9922SRussell King #define SCOOP_GPCR_PA17	(1 << 7)
364baa9922SRussell King #define SCOOP_GPCR_PA16	(1 << 6)
374baa9922SRussell King #define SCOOP_GPCR_PA15	(1 << 5)
384baa9922SRussell King #define SCOOP_GPCR_PA14	(1 << 4)
394baa9922SRussell King #define SCOOP_GPCR_PA13	(1 << 3)
404baa9922SRussell King #define SCOOP_GPCR_PA12	(1 << 2)
414baa9922SRussell King #define SCOOP_GPCR_PA11	(1 << 1)
424baa9922SRussell King 
434baa9922SRussell King struct scoop_config {
444baa9922SRussell King 	unsigned short io_out;
454baa9922SRussell King 	unsigned short io_dir;
464baa9922SRussell King 	unsigned short suspend_clr;
474baa9922SRussell King 	unsigned short suspend_set;
484baa9922SRussell King 	int gpio_base;
494baa9922SRussell King };
504baa9922SRussell King 
514baa9922SRussell King /* Structure for linking scoop devices to PCMCIA sockets */
524baa9922SRussell King struct scoop_pcmcia_dev {
534baa9922SRussell King 	struct device *dev;     /* Pointer to this socket's scoop device */
544baa9922SRussell King 	int	irq;                /* irq for socket */
554baa9922SRussell King 	int cd_irq;
564baa9922SRussell King 	const char *cd_irq_str;
574baa9922SRussell King 	unsigned char keep_vs;
584baa9922SRussell King 	unsigned char keep_rd;
594baa9922SRussell King };
604baa9922SRussell King 
614baa9922SRussell King struct scoop_pcmcia_config {
624baa9922SRussell King 	struct scoop_pcmcia_dev *devs;
634baa9922SRussell King 	int num_devs;
644baa9922SRussell King 	void (*pcmcia_init)(void);
654baa9922SRussell King 	void (*power_ctrl)(struct device *scoop, unsigned short cpr, int nr);
664baa9922SRussell King };
674baa9922SRussell King 
684baa9922SRussell King extern struct scoop_pcmcia_config *platform_scoop_config;
694baa9922SRussell King 
704baa9922SRussell King void reset_scoop(struct device *dev);
714baa9922SRussell King unsigned short read_scoop_reg(struct device *dev, unsigned short reg);
724baa9922SRussell King void write_scoop_reg(struct device *dev, unsigned short reg, unsigned short data);
73