Re: [PATCH] viafb: update driver to use both I2C Channels

2009-07-16 Thread Deepak Saxena
On Jul 15 2009, at 22:17, Harald Welte was caught saying:
> Hi Deepak,
> 
> as I have pointed out a couple of times to some OLPC folks (not sure if you
> were included), there is a via-viafb-i2c tree in my git tree 
> (http://git.gnumonks.org/cgi-bin/gitweb.cgi?p=linux-2.6-via.git;a=shortlog;h=refs/heads/via-viafb-i2c)
> that tries to clean up the i2c mess (after cleaning up a lot of other mess).

Hi Harald,

I pulled in these patches and they look great but I'm seeing an 
additional 3 second delay during bootup (even after removing the
KERN_DEBUG printk in via_i2c_setscl). I'll work on investigating 
why later as I'm focused on functionality at right now.

~Deepak

___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: [PATCH] viafb: update driver to use both I2C Channels

2009-07-15 Thread Deepak Saxena
On Jul 15 2009, at 22:17, Harald Welte was caught saying:
> Hi Deepak,
> 
> as I have pointed out a couple of times to some OLPC folks (not sure if you
> were included), there is a via-viafb-i2c tree in my git tree 
> (http://git.gnumonks.org/cgi-bin/gitweb.cgi?p=linux-2.6-via.git;a=shortlog;h=refs/heads/via-viafb-i2c)
> that tries to clean up the i2c mess (after cleaning up a lot of other mess).
> 
> I've submitted a long series of those viafb patches some time ago, but somehow
> none of them was merged mainline yet :(
> 
> Were you aware of this?  If yes, then it means that you're reluctant to merge
> the tons of not-yet-mainline cleanup code from my tree, which I could
> understand, too.

Nope, was not aware of this. Will grab that tree and take a look at it.

Thanks,
~Deepak


___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: [PATCH] viafb: update driver to use both I2C Channels

2009-07-15 Thread Harald Welte
Hi Deepak,

as I have pointed out a couple of times to some OLPC folks (not sure if you
were included), there is a via-viafb-i2c tree in my git tree 
(http://git.gnumonks.org/cgi-bin/gitweb.cgi?p=linux-2.6-via.git;a=shortlog;h=refs/heads/via-viafb-i2c)
that tries to clean up the i2c mess (after cleaning up a lot of other mess).

I've submitted a long series of those viafb patches some time ago, but somehow
none of them was merged mainline yet :(

Were you aware of this?  If yes, then it means that you're reluctant to merge
the tons of not-yet-mainline cleanup code from my tree, which I could
understand, too.

-- 
- Harald Welte http://linux.via.com.tw/

VIA Free and Open Source Software Liaison
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


[PATCH] viafb: update driver to use both I2C Channels

2009-07-15 Thread Deepak Saxena

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