blob: 58cdf5d84122adc867598123c608894a4b1e226e [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * Definitions for the SCOOP interface found on various Sharp PDAs
3 *
4 * Copyright (c) 2004 Richard Purdie
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 */
11
12#define SCOOP_MCR 0x00
13#define SCOOP_CDR 0x04
14#define SCOOP_CSR 0x08
15#define SCOOP_CPR 0x0C
16#define SCOOP_CCR 0x10
17#define SCOOP_IRR 0x14
18#define SCOOP_IRM 0x14
19#define SCOOP_IMR 0x18
20#define SCOOP_ISR 0x1C
21#define SCOOP_GPCR 0x20
22#define SCOOP_GPWR 0x24
23#define SCOOP_GPRR 0x28
24
Marek Vasut983536e2010-06-24 16:02:11 +020025#define SCOOP_CPR_OUT (1 << 7)
26#define SCOOP_CPR_SD_3V (1 << 2)
27#define SCOOP_CPR_CF_XV (1 << 1)
28#define SCOOP_CPR_CF_3V (1 << 0)
29
30#define SCOOP_GPCR_PA22 (1 << 12)
31#define SCOOP_GPCR_PA21 (1 << 11)
32#define SCOOP_GPCR_PA20 (1 << 10)
33#define SCOOP_GPCR_PA19 (1 << 9)
34#define SCOOP_GPCR_PA18 (1 << 8)
35#define SCOOP_GPCR_PA17 (1 << 7)
36#define SCOOP_GPCR_PA16 (1 << 6)
37#define SCOOP_GPCR_PA15 (1 << 5)
38#define SCOOP_GPCR_PA14 (1 << 4)
39#define SCOOP_GPCR_PA13 (1 << 3)
40#define SCOOP_GPCR_PA12 (1 << 2)
41#define SCOOP_GPCR_PA11 (1 << 1)
Linus Torvalds1da177e2005-04-16 15:20:36 -070042
43struct scoop_config {
44 unsigned short io_out;
45 unsigned short io_dir;
Richard Purdie7c398982005-10-10 10:20:06 +010046 unsigned short suspend_clr;
47 unsigned short suspend_set;
Dmitry Baryshkovb43a9e62008-04-10 13:36:53 +010048 int gpio_base;
Linus Torvalds1da177e2005-04-16 15:20:36 -070049};
50
Richard Purdie0ce76252005-09-05 20:49:54 +010051/* Structure for linking scoop devices to PCMCIA sockets */
52struct scoop_pcmcia_dev {
53 struct device *dev; /* Pointer to this socket's scoop device */
54 int irq; /* irq for socket */
55 int cd_irq;
56 const char *cd_irq_str;
57 unsigned char keep_vs;
58 unsigned char keep_rd;
59};
60
Richard Purdiea63ae442005-11-08 19:15:43 +000061struct scoop_pcmcia_config {
62 struct scoop_pcmcia_dev *devs;
63 int num_devs;
Richard Purdiea63ae442005-11-08 19:15:43 +000064 void (*power_ctrl)(struct device *scoop, unsigned short cpr, int nr);
65};
66
67extern struct scoop_pcmcia_config *platform_scoop_config;
Richard Purdie0ce76252005-09-05 20:49:54 +010068
Linus Torvalds1da177e2005-04-16 15:20:36 -070069void reset_scoop(struct device *dev);
Linus Torvalds1da177e2005-04-16 15:20:36 -070070unsigned short read_scoop_reg(struct device *dev, unsigned short reg);
71void write_scoop_reg(struct device *dev, unsigned short reg, unsigned short data);