aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/via/via_i2c.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/via/via_i2c.h')
-rw-r--r--drivers/video/via/via_i2c.h43
1 files changed, 29 insertions, 14 deletions
diff --git a/drivers/video/via/via_i2c.h b/drivers/video/via/via_i2c.h
index 3a13242a3152..00ed97886842 100644
--- a/drivers/video/via/via_i2c.h
+++ b/drivers/video/via/via_i2c.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright 1998-2008 VIA Technologies, Inc. All Rights Reserved. 2 * Copyright 1998-2009 VIA Technologies, Inc. All Rights Reserved.
3 * Copyright 2001-2008 S3 Graphics, Inc. All Rights Reserved. 3 * Copyright 2001-2008 S3 Graphics, Inc. All Rights Reserved.
4 4
5 * This program is free software; you can redistribute it and/or 5 * This program is free software; you can redistribute it and/or
@@ -24,23 +24,38 @@
24#include <linux/i2c.h> 24#include <linux/i2c.h>
25#include <linux/i2c-algo-bit.h> 25#include <linux/i2c-algo-bit.h>
26 26
27enum via_i2c_type {
28 VIA_I2C_NONE,
29 VIA_I2C_I2C,
30 VIA_I2C_GPIO,
31};
32
33/* private data for each adapter */
34struct via_i2c_adap_cfg {
35 enum via_i2c_type type;
36 u_int16_t io_port;
37 u_int8_t ioport_index;
38};
39
27struct via_i2c_stuff { 40struct via_i2c_stuff {
28 u16 i2c_port; /* GPIO or I2C port */ 41 u16 i2c_port; /* GPIO or I2C port */
29 struct i2c_adapter adapter; 42 struct i2c_adapter adapter;
30 struct i2c_algo_bit_data algo; 43 struct i2c_algo_bit_data algo;
31}; 44};
32 45
33#define I2CPORT 0x3c4 46enum viafb_i2c_adap {
34#define I2CPORTINDEX 0x31 47 VIA_I2C_ADAP_26,
35#define GPIOPORT 0x3C4 48 VIA_I2C_ADAP_31,
36#define GPIOPORTINDEX 0x2C 49 VIA_I2C_ADAP_25,
37#define I2C_BUS 1 50 VIA_I2C_ADAP_2C,
38#define GPIO_BUS 2 51 VIA_I2C_ADAP_3D,
39#define DELAYPORT 0x3C3 52};
40 53
41int viafb_i2c_readbyte(u8 slave_addr, u8 index, u8 *pdata); 54int viafb_i2c_readbyte(u8 adap, u8 slave_addr, u8 index, u8 *pdata);
42int viafb_i2c_writebyte(u8 slave_addr, u8 index, u8 data); 55int viafb_i2c_writebyte(u8 adap, u8 slave_addr, u8 index, u8 data);
43int viafb_i2c_readbytes(u8 slave_addr, u8 index, u8 *buff, int buff_len); 56int viafb_i2c_readbytes(u8 adap, u8 slave_addr, u8 index, u8 *buff, int buff_len);
44int viafb_create_i2c_bus(void *par); 57
45void viafb_delete_i2c_buss(void *par); 58struct viafb_par;
59int viafb_create_i2c_busses(struct viafb_par *par);
60void viafb_delete_i2c_busses(struct viafb_par *par);
46#endif /* __VIA_I2C_H__ */ 61#endif /* __VIA_I2C_H__ */