xref: /linux/arch/arm/include/asm/hardware/scoop.h (revision 75bf465f0bc33e9b776a46d6a1b9b990f5fb7c37)
1*d2912cb1SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */
24baa9922SRussell King /*
34baa9922SRussell King  *  Definitions for the SCOOP interface found on various Sharp PDAs
44baa9922SRussell King  *
54baa9922SRussell King  *  Copyright (c) 2004 Richard Purdie
64baa9922SRussell King  */
74baa9922SRussell King 
84baa9922SRussell King #define SCOOP_MCR  0x00
94baa9922SRussell King #define SCOOP_CDR  0x04
104baa9922SRussell King #define SCOOP_CSR  0x08
114baa9922SRussell King #define SCOOP_CPR  0x0C
124baa9922SRussell King #define SCOOP_CCR  0x10
134baa9922SRussell King #define SCOOP_IRR  0x14
144baa9922SRussell King #define SCOOP_IRM  0x14
154baa9922SRussell King #define SCOOP_IMR  0x18
164baa9922SRussell King #define SCOOP_ISR  0x1C
174baa9922SRussell King #define SCOOP_GPCR 0x20
184baa9922SRussell King #define SCOOP_GPWR 0x24
194baa9922SRussell King #define SCOOP_GPRR 0x28
204baa9922SRussell King 
21983536e7SMarek Vasut #define SCOOP_CPR_OUT	(1 << 7)
22983536e7SMarek Vasut #define SCOOP_CPR_SD_3V	(1 << 2)
23983536e7SMarek Vasut #define SCOOP_CPR_CF_XV	(1 << 1)
24983536e7SMarek Vasut #define SCOOP_CPR_CF_3V	(1 << 0)
25983536e7SMarek Vasut 
264baa9922SRussell King #define SCOOP_GPCR_PA22	(1 << 12)
274baa9922SRussell King #define SCOOP_GPCR_PA21	(1 << 11)
284baa9922SRussell King #define SCOOP_GPCR_PA20	(1 << 10)
294baa9922SRussell King #define SCOOP_GPCR_PA19	(1 << 9)
304baa9922SRussell King #define SCOOP_GPCR_PA18	(1 << 8)
314baa9922SRussell King #define SCOOP_GPCR_PA17	(1 << 7)
324baa9922SRussell King #define SCOOP_GPCR_PA16	(1 << 6)
334baa9922SRussell King #define SCOOP_GPCR_PA15	(1 << 5)
344baa9922SRussell King #define SCOOP_GPCR_PA14	(1 << 4)
354baa9922SRussell King #define SCOOP_GPCR_PA13	(1 << 3)
364baa9922SRussell King #define SCOOP_GPCR_PA12	(1 << 2)
374baa9922SRussell King #define SCOOP_GPCR_PA11	(1 << 1)
384baa9922SRussell King 
394baa9922SRussell King struct scoop_config {
404baa9922SRussell King 	unsigned short io_out;
414baa9922SRussell King 	unsigned short io_dir;
424baa9922SRussell King 	unsigned short suspend_clr;
434baa9922SRussell King 	unsigned short suspend_set;
444baa9922SRussell King 	int gpio_base;
454baa9922SRussell King };
464baa9922SRussell King 
474baa9922SRussell King /* Structure for linking scoop devices to PCMCIA sockets */
484baa9922SRussell King struct scoop_pcmcia_dev {
494baa9922SRussell King 	struct device *dev;     /* Pointer to this socket's scoop device */
504baa9922SRussell King 	int	irq;                /* irq for socket */
514baa9922SRussell King 	int cd_irq;
524baa9922SRussell King 	const char *cd_irq_str;
534baa9922SRussell King 	unsigned char keep_vs;
544baa9922SRussell King 	unsigned char keep_rd;
554baa9922SRussell King };
564baa9922SRussell King 
574baa9922SRussell King struct scoop_pcmcia_config {
584baa9922SRussell King 	struct scoop_pcmcia_dev *devs;
594baa9922SRussell King 	int num_devs;
604baa9922SRussell King 	void (*power_ctrl)(struct device *scoop, unsigned short cpr, int nr);
614baa9922SRussell King };
624baa9922SRussell King 
634baa9922SRussell King extern struct scoop_pcmcia_config *platform_scoop_config;
644baa9922SRussell King 
654baa9922SRussell King void reset_scoop(struct device *dev);
664baa9922SRussell King unsigned short read_scoop_reg(struct device *dev, unsigned short reg);
674baa9922SRussell King void write_scoop_reg(struct device *dev, unsigned short reg, unsigned short data);
68