Commit | Line | Data |
---|---|---|
f045f77b JC |
1 | /* |
2 | * Copyright 1998-2009 VIA Technologies, Inc. All Rights Reserved. | |
3 | * Copyright 2001-2008 S3 Graphics, Inc. All Rights Reserved. | |
4 | * Copyright 2009 Jonathan Corbet <corbet@lwn.net> | |
5 | * | |
6 | * This program is free software; you can redistribute it and/or | |
7 | * modify it under the terms of the GNU General Public | |
8 | * License as published by the Free Software Foundation; | |
9 | * either version 2, or (at your option) any later version. | |
10 | * | |
11 | * This program is distributed in the hope that it will be useful, | |
12 | * but WITHOUT ANY WARRANTIES OR REPRESENTATIONS; without even | |
13 | * the implied warranty of MERCHANTABILITY or FITNESS FOR | |
14 | * A PARTICULAR PURPOSE.See the GNU General Public License | |
15 | * for more details. | |
16 | * | |
17 | * You should have received a copy of the GNU General Public License | |
18 | * along with this program; if not, write to the Free Software | |
19 | * Foundation, Inc., | |
20 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
21 | */ | |
22 | ||
23 | #ifndef __VIA_CORE_H__ | |
24 | #define __VIA_CORE_H__ | |
24b4d82e JC |
25 | #include <linux/spinlock.h> |
26 | #include <linux/pci.h> | |
27 | ||
f045f77b JC |
28 | /* |
29 | * A description of each known serial I2C/GPIO port. | |
30 | */ | |
31 | enum via_port_type { | |
32 | VIA_PORT_NONE = 0, | |
33 | VIA_PORT_I2C, | |
34 | VIA_PORT_GPIO, | |
35 | }; | |
36 | ||
37 | enum via_port_mode { | |
38 | VIA_MODE_OFF = 0, | |
39 | VIA_MODE_I2C, /* Used as I2C port */ | |
40 | VIA_MODE_GPIO, /* Two GPIO ports */ | |
41 | }; | |
42 | ||
43 | enum viafb_i2c_adap { | |
44 | VIA_PORT_26 = 0, | |
45 | VIA_PORT_31, | |
46 | VIA_PORT_25, | |
47 | VIA_PORT_2C, | |
48 | VIA_PORT_3D, | |
49 | }; | |
50 | #define VIAFB_NUM_PORTS 5 | |
51 | ||
52 | struct via_port_cfg { | |
53 | enum via_port_type type; | |
54 | enum via_port_mode mode; | |
24b4d82e JC |
55 | u16 io_port; |
56 | u8 ioport_index; | |
f045f77b | 57 | }; |
24b4d82e JC |
58 | |
59 | /* | |
60 | * This is the global viafb "device" containing stuff needed by | |
61 | * all subdevs. | |
62 | */ | |
63 | struct viafb_dev { | |
64 | struct pci_dev *pdev; | |
65 | int chip_type; | |
66 | /* | |
67 | * Spinlock for access to device registers. Not yet | |
68 | * globally used. | |
69 | */ | |
70 | spinlock_t reg_lock; | |
71 | /* | |
72 | * The framebuffer MMIO region. Little, if anything, touches | |
73 | * this memory directly, and certainly nothing outside of the | |
74 | * framebuffer device itself. We *do* have to be able to allocate | |
75 | * chunks of this memory for other devices, though. | |
76 | */ | |
77 | unsigned long fbmem_start; | |
78 | long fbmem_len; | |
79 | void __iomem *fbmem; | |
80 | /* | |
81 | * The MMIO region for device registers. | |
82 | */ | |
83 | unsigned long engine_start; | |
84 | unsigned long engine_len; | |
85 | void __iomem *engine_mmio; | |
86 | ||
87 | }; | |
88 | ||
f045f77b | 89 | #endif /* __VIA_CORE_H__ */ |