aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/via/vt1636.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/via/vt1636.c')
-rw-r--r--drivers/video/via/vt1636.c34
1 files changed, 14 insertions, 20 deletions
diff --git a/drivers/video/via/vt1636.c b/drivers/video/via/vt1636.c
index a6b37494e79a..d65bf1aee87c 100644
--- a/drivers/video/via/vt1636.c
+++ b/drivers/video/via/vt1636.c
@@ -19,6 +19,8 @@
19 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 */ 20 */
21 21
22#include <linux/via-core.h>
23#include <linux/via_i2c.h>
22#include "global.h" 24#include "global.h"
23 25
24u8 viafb_gpio_i2c_read_lvds(struct lvds_setting_information 26u8 viafb_gpio_i2c_read_lvds(struct lvds_setting_information
@@ -27,9 +29,8 @@ u8 viafb_gpio_i2c_read_lvds(struct lvds_setting_information
27{ 29{
28 u8 data; 30 u8 data;
29 31
30 viaparinfo->shared->i2c_stuff.i2c_port = plvds_chip_info->i2c_port; 32 viafb_i2c_readbyte(plvds_chip_info->i2c_port,
31 viafb_i2c_readbyte(plvds_chip_info->lvds_chip_slave_addr, index, &data); 33 plvds_chip_info->lvds_chip_slave_addr, index, &data);
32
33 return data; 34 return data;
34} 35}
35 36
@@ -39,14 +40,13 @@ void viafb_gpio_i2c_write_mask_lvds(struct lvds_setting_information
39{ 40{
40 int index, data; 41 int index, data;
41 42
42 viaparinfo->shared->i2c_stuff.i2c_port = plvds_chip_info->i2c_port;
43
44 index = io_data.Index; 43 index = io_data.Index;
45 data = viafb_gpio_i2c_read_lvds(plvds_setting_info, plvds_chip_info, 44 data = viafb_gpio_i2c_read_lvds(plvds_setting_info, plvds_chip_info,
46 index); 45 index);
47 data = (data & (~io_data.Mask)) | io_data.Data; 46 data = (data & (~io_data.Mask)) | io_data.Data;
48 47
49 viafb_i2c_writebyte(plvds_chip_info->lvds_chip_slave_addr, index, data); 48 viafb_i2c_writebyte(plvds_chip_info->i2c_port,
49 plvds_chip_info->lvds_chip_slave_addr, index, data);
50} 50}
51 51
52void viafb_init_lvds_vt1636(struct lvds_setting_information 52void viafb_init_lvds_vt1636(struct lvds_setting_information
@@ -159,7 +159,7 @@ void viafb_disable_lvds_vt1636(struct lvds_setting_information
159 } 159 }
160} 160}
161 161
162bool viafb_lvds_identify_vt1636(void) 162bool viafb_lvds_identify_vt1636(u8 i2c_adapter)
163{ 163{
164 u8 Buffer[2]; 164 u8 Buffer[2];
165 165
@@ -167,26 +167,20 @@ bool viafb_lvds_identify_vt1636(void)
167 167
168 /* Sense VT1636 LVDS Transmiter */ 168 /* Sense VT1636 LVDS Transmiter */
169 viaparinfo->chip_info->lvds_chip_info.lvds_chip_slave_addr = 169 viaparinfo->chip_info->lvds_chip_info.lvds_chip_slave_addr =
170 VT1636_LVDS_I2C_ADDR; 170 VT1636_LVDS_I2C_ADDR;
171 171
172 /* Check vendor ID first: */ 172 /* Check vendor ID first: */
173 viafb_i2c_readbyte((u8) viaparinfo->chip_info->lvds_chip_info. 173 if (viafb_i2c_readbyte(i2c_adapter, VT1636_LVDS_I2C_ADDR,
174 lvds_chip_slave_addr, 174 0x00, &Buffer[0]))
175 0x00, &Buffer[0]); 175 return false;
176 viafb_i2c_readbyte((u8) viaparinfo->chip_info->lvds_chip_info. 176 viafb_i2c_readbyte(i2c_adapter, VT1636_LVDS_I2C_ADDR, 0x01, &Buffer[1]);
177 lvds_chip_slave_addr,
178 0x01, &Buffer[1]);
179 177
180 if (!((Buffer[0] == 0x06) && (Buffer[1] == 0x11))) 178 if (!((Buffer[0] == 0x06) && (Buffer[1] == 0x11)))
181 return false; 179 return false;
182 180
183 /* Check Chip ID: */ 181 /* Check Chip ID: */
184 viafb_i2c_readbyte((u8) viaparinfo->chip_info->lvds_chip_info. 182 viafb_i2c_readbyte(i2c_adapter, VT1636_LVDS_I2C_ADDR, 0x02, &Buffer[0]);
185 lvds_chip_slave_addr, 183 viafb_i2c_readbyte(i2c_adapter, VT1636_LVDS_I2C_ADDR, 0x03, &Buffer[1]);
186 0x02, &Buffer[0]);
187 viafb_i2c_readbyte((u8) viaparinfo->chip_info->lvds_chip_info.
188 lvds_chip_slave_addr,
189 0x03, &Buffer[1]);
190 if ((Buffer[0] == 0x45) && (Buffer[1] == 0x33)) { 184 if ((Buffer[0] == 0x45) && (Buffer[1] == 0x33)) {
191 viaparinfo->chip_info->lvds_chip_info.lvds_chip_name = 185 viaparinfo->chip_info->lvds_chip_info.lvds_chip_name =
192 VT1636_LVDS; 186 VT1636_LVDS;