summaryrefslogtreecommitdiffstats
path: root/drivers/video/via/lcd.c
diff options
context:
space:
mode:
authorHarald Welte2009-05-22 18:35:39 +0200
committerJonathan Corbet2010-04-27 21:01:45 +0200
commit277d32a36cba0b42c9c6836ff07f9b978566e95c (patch)
tree7161c2ddeb6064a42ba4babe3678a0493ecf6365 /drivers/video/via/lcd.c
parentviafb: Add 1200x900 DCON/LCD panel modes for OLPC XO-1.5 (diff)
downloadkernel-qcow2-linux-277d32a36cba0b42c9c6836ff07f9b978566e95c.tar.gz
kernel-qcow2-linux-277d32a36cba0b42c9c6836ff07f9b978566e95c.tar.xz
kernel-qcow2-linux-277d32a36cba0b42c9c6836ff07f9b978566e95c.zip
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)
int viafb_lvds_trasmitter_identify(void)
{
- viaparinfo->shared->i2c_stuff.i2c_port = I2CPORTINDEX;
- if (viafb_lvds_identify_vt1636()) {
- viaparinfo->chip_info->lvds_chip_info.i2c_port = I2CPORTINDEX;
+ if (viafb_lvds_identify_vt1636(VIA_I2C_ADAP_31)) {
+ viaparinfo->chip_info->lvds_chip_info.i2c_port = VIA_I2C_ADAP_31;
DEBUG_MSG(KERN_INFO
- "Found VIA VT1636 LVDS on port i2c 0x31 \n");
+ "Found VIA VT1636 LVDS on port i2c 0x31\n");
} else {
- viaparinfo->shared->i2c_stuff.i2c_port = GPIOPORTINDEX;
- if (viafb_lvds_identify_vt1636()) {
+ if (viafb_lvds_identify_vt1636(VIA_I2C_ADAP_2C)) {
viaparinfo->chip_info->lvds_chip_info.i2c_port =
- GPIOPORTINDEX;
+ VIA_I2C_ADAP_2C;
DEBUG_MSG(KERN_INFO
- "Found VIA VT1636 LVDS on port gpio 0x2c \n");
+ "Found VIA VT1636 LVDS on port gpio 0x2c\n");
}
}
@@ -421,9 +419,8 @@ static int lvds_register_read(int index)
{
u8 data;
- viaparinfo->shared->i2c_stuff.i2c_port = GPIOPORTINDEX;
- viafb_i2c_readbyte((u8) viaparinfo->chip_info->
- lvds_chip_info.lvds_chip_slave_addr,
+ viafb_i2c_readbyte(VIA_I2C_ADAP_2C,
+ (u8) viaparinfo->chip_info->lvds_chip_info.lvds_chip_slave_addr,
(u8) index, &data);
return data;
}