via-core.h revision f045f77bc0bf238a871b10bea9e425329a8e4abc
1f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet/*
2f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet * Copyright 1998-2009 VIA Technologies, Inc. All Rights Reserved.
3f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet * Copyright 2001-2008 S3 Graphics, Inc. All Rights Reserved.
4f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet * Copyright 2009 Jonathan Corbet <corbet@lwn.net>
5f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet *
6f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet * This program is free software; you can redistribute it and/or
7f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet * modify it under the terms of the GNU General Public
8f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet * License as published by the Free Software Foundation;
9f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet * either version 2, or (at your option) any later version.
10f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet *
11f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet * This program is distributed in the hope that it will be useful,
12f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet * but WITHOUT ANY WARRANTIES OR REPRESENTATIONS; without even
13f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet * the implied warranty of MERCHANTABILITY or FITNESS FOR
14f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet * A PARTICULAR PURPOSE.See the GNU General Public License
15f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet * for more details.
16f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet *
17f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet * You should have received a copy of the GNU General Public License
18f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet * along with this program; if not, write to the Free Software
19f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet * Foundation, Inc.,
20f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet */
22f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet
23f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet#ifndef __VIA_CORE_H__
24f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet#define __VIA_CORE_H__
25f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet/*
26f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet * A description of each known serial I2C/GPIO port.
27f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet */
28f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbetenum via_port_type {
29f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet	VIA_PORT_NONE = 0,
30f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet	VIA_PORT_I2C,
31f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet	VIA_PORT_GPIO,
32f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet};
33f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet
34f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbetenum via_port_mode {
35f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet	VIA_MODE_OFF = 0,
36f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet	VIA_MODE_I2C,		/* Used as I2C port */
37f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet	VIA_MODE_GPIO,	/* Two GPIO ports */
38f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet};
39f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet
40f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbetenum viafb_i2c_adap {
41f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet	VIA_PORT_26 = 0,
42f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet	VIA_PORT_31,
43f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet	VIA_PORT_25,
44f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet	VIA_PORT_2C,
45f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet	VIA_PORT_3D,
46f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet};
47f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet#define VIAFB_NUM_PORTS 5
48f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet
49f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbetstruct via_port_cfg {
50f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet	enum via_port_type	type;
51f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet	enum via_port_mode	mode;
52f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet	u_int16_t		io_port;
53f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet	u_int8_t		ioport_index;
54f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet};
55f045f77bc0bf238a871b10bea9e425329a8e4abcJonathan Corbet#endif /* __VIA_CORE_H__ */
56