aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/via/lcd.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2009-05-22 12:35:39 -0400
committerJonathan Corbet <corbet@lwn.net>2010-04-27 15:01:45 -0400
commit277d32a36cba0b42c9c6836ff07f9b978566e95c (patch)
tree7161c2ddeb6064a42ba4babe3678a0493ecf6365 /drivers/video/via/lcd.c
parentc205d932530719d2a6ddb9152650e5bbe80c9400 (diff)
viafb: rework the I2C support in the VIA framebuffer driver
This patch changes the way how the various I2C busses are used internally inside the viafb driver: Previosuly, only a single i2c_adapter was created, even though two different hardware I2C busses are accessed: A structure member in a global variable was modified to indicate the bus to be used. Now, all existing hardware busses are registered with the i2c core, and the viafb_i2c_{read,write}byte[s]() function take the adapter number as function call parameter, rather than referring to the global structure member. [jc: even more painful merge with mainline changes ->2.6.34] [jc: painful merge with OLPC changes] Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: ScottFang@viatech.com.cn Cc: JosephChan@via.com.tw Signed-off-by: Harald Welte <HaraldWelte@viatech.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'drivers/video/via/lcd.c')
-rw-r--r--drivers/video/via/lcd.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/video/via/lcd.c b/drivers/video/via/lcd.c
index 09020f0b2d2a..e19441d9e49f 100644
--- a/drivers/video/via/lcd.c
+++ b/drivers/video/via/lcd.c
@@ -172,18 +172,16 @@ static bool lvds_identify_integratedlvds(void)
172 172
173int viafb_lvds_trasmitter_identify(void) 173int viafb_lvds_trasmitter_identify(void)
174{ 174{
175 viaparinfo->shared->i2c_stuff.i2c_port = I2CPORTINDEX; 175 if (viafb_lvds_identify_vt1636(VIA_I2C_ADAP_31)) {
176 if (viafb_lvds_identify_vt1636()) { 176 viaparinfo->chip_info->lvds_chip_info.i2c_port = VIA_I2C_ADAP_31;
177 viaparinfo->chip_info->lvds_chip_info.i2c_port = I2CPORTINDEX;
178 DEBUG_MSG(KERN_INFO 177 DEBUG_MSG(KERN_INFO
179 "Found VIA VT1636 LVDS on port i2c 0x31 \n"); 178 "Found VIA VT1636 LVDS on port i2c 0x31\n");
180 } else { 179 } else {
181 viaparinfo->shared->i2c_stuff.i2c_port = GPIOPORTINDEX; 180 if (viafb_lvds_identify_vt1636(VIA_I2C_ADAP_2C)) {
182 if (viafb_lvds_identify_vt1636()) {
183 viaparinfo->chip_info->lvds_chip_info.i2c_port = 181 viaparinfo->chip_info->lvds_chip_info.i2c_port =
184 GPIOPORTINDEX; 182 VIA_I2C_ADAP_2C;
185 DEBUG_MSG(KERN_INFO 183 DEBUG_MSG(KERN_INFO
186 "Found VIA VT1636 LVDS on port gpio 0x2c \n"); 184 "Found VIA VT1636 LVDS on port gpio 0x2c\n");
187 } 185 }
188 } 186 }
189 187
@@ -421,9 +419,8 @@ static int lvds_register_read(int index)
421{ 419{
422 u8 data; 420 u8 data;
423 421
424 viaparinfo->shared->i2c_stuff.i2c_port = GPIOPORTINDEX; 422 viafb_i2c_readbyte(VIA_I2C_ADAP_2C,
425 viafb_i2c_readbyte((u8) viaparinfo->chip_info-> 423 (u8) viaparinfo->chip_info->lvds_chip_info.lvds_chip_slave_addr,
426 lvds_chip_info.lvds_chip_slave_addr,
427 (u8) index, &data); 424 (u8) index, &data);
428 return data; 425 return data;
429} 426}