The Chrome chip has two serial I2C channels and the
driver currently only exposes one of them. This patch
exposes both of them and also cleans up some structure
naming to be be less confusing.
This is specifically needed on the XO-1.5 platform as
the DCON chip is connected via Chrome I2C channel 0
and the current driver only exploses channel 1.
Signed-off-by: Deepak Saxena
---
This patch is not the cleanest way to export the second port, but
in my opinion the whole via_i2c code and its users need a rewrite
to use the driver model instead of what we're doing right now,
which is to have the chip drivers directly call the I2C read/write
functions after poking at the adapter's I/O address. This patch is
meant as a stop gap until that happens since I don't currently have
time to do a full cleanup and I need the both ports working ASAP. :)
Patch is against top of Linus' tree (e9e961)
drivers/video/via/chip.h |4 +-
drivers/video/via/dvi.c | 20
drivers/video/via/lcd.c | 10 ++--
drivers/video/via/via_i2c.c | 120 ++---
drivers/video/via/via_i2c.h |7 ++-
drivers/video/via/viafbdev.h |3 +-
drivers/video/via/vt1636.c |4 +-
7 files changed, 101 insertions(+), 67 deletions(-)
diff --git a/drivers/video/via/chip.h b/drivers/video/via/chip.h
index dde95ed..442cd8a 100644
--- a/drivers/video/via/chip.h
+++ b/drivers/video/via/chip.h
@@ -107,7 +107,7 @@ struct tmds_chip_information {
int dvi_panel_id;
int data_mode;
int output_interface;
- int i2c_port;
+ int i2c_ioport;
int device_type;
};
@@ -116,7 +116,7 @@ struct lvds_chip_information {
int lvds_chip_slave_addr;
int data_mode;
int output_interface;
- int i2c_port;
+ int i2c_ioport;
};
struct chip_information {
diff --git a/drivers/video/via/dvi.c b/drivers/video/via/dvi.c
index d696544..f826aaf 100644
--- a/drivers/video/via/dvi.c
+++ b/drivers/video/via/dvi.c
@@ -96,7 +96,7 @@ int viafb_tmds_trasmitter_identify(void)
viaparinfo->chip_info->tmds_chip_info.tmds_chip_name = VT1632_TMDS;
viaparinfo->chip_info->
tmds_chip_info.tmds_chip_slave_addr = VT1632_TMDS_I2C_ADDR;
- viaparinfo->chip_info->tmds_chip_info.i2c_port = I2CPORTINDEX;
+ viaparinfo->chip_info->tmds_chip_info.i2c_ioport = I2CPORT1INDEX;
if (check_tmds_chip(VT1632_DEVICE_ID_REG, VT1632_DEVICE_ID) != FAIL) {
/*
* Currently only support 12bits,dual edge,add 24bits mode later
@@ -107,10 +107,10 @@ int viafb_tmds_trasmitter_identify(void)
DEBUG_MSG(KERN_INFO "\n %2d",
viaparinfo->chip_info->tmds_chip_info.tmds_chip_name);
DEBUG_MSG(KERN_INFO "\n %2d",
- viaparinfo->chip_info->tmds_chip_info.i2c_port);
+ viaparinfo->chip_info->tmds_chip_info.i2c_ioport);
return OK;
} else {
- viaparinfo->chip_info->tmds_chip_info.i2c_port = GPIOPORTINDEX;
+ viaparinfo->chip_info->tmds_chip_info.i2c_ioport =
GPIOPORTINDEX;
if (check_tmds_chip(VT1632_DEVICE_ID_REG, VT1632_DEVICE_ID)
!= FAIL) {
tmds_register_write(0x08, 0x3b);
@@ -120,7 +120,7 @@ int viafb_tmds_trasmitter_identify(void)
tmds_chip_info.tmds_chip_name);
DEBUG_MSG(KERN_INFO "\n %2d",
viaparinfo->chip_info->
- tmds_chip_info.i2c_port);
+ tmds_chip_info.i2c_ioport);
return OK;
}
}
@@ -160,8 +160,8 @@ int viafb_tmds_trasmitter_identify(void)
static void tmds_register_write(int index, u8 data)
{
- viaparinfo->i2c_stuff.i2c_port =
- viaparinfo->chip_info->tmds_chip_info.i2c_port;
+ viaparinfo->i2c_port1.i2c_ioport =
+ viaparinfo->chip_info->tmds_chip_info.i2c_ioport;
viafb_i2c_writebyte(viaparinfo->chip_info->tmds_chip_info.
tmds_chip_slave_addr, index,
@@ -172,8 +172,8 @@ static int tmds_register_read(int index)
{
u8 data;
- viaparinfo->i2c_stuff.i2c_port =
- viaparinfo->chip_info->tmds_chip_info.i2c_port;
+ viaparinfo->i2c_port1.i2c_ioport =
+ viaparinfo->chip_info->tmds_chip_info.i2c_ioport;
viafb_i2c_readbyte((u8) viaparinfo->chip_info->
tmds_chip_info.tmds_chip_slave_addr,
(u8) index, &data);
@@ -182,8 +182,8 @@ static int tmds_register_read(int index)
static int tmds_register_read_bytes(int index, u8 *buff, int buff_len)
{
- viaparinfo->i2c_stuff.i2c_port =
- viaparinfo->chip_info->tmds_chip_info.i2c_port;
+ viaparinfo->i2c_port1.i2c_ioport =
+ viaparinfo->chip_info->tmds_chip_i