diff options
Diffstat (limited to 'drivers/video/via/dvi.c')
-rw-r--r-- | drivers/video/via/dvi.c | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/drivers/video/via/dvi.c b/drivers/video/via/dvi.c index abe59b8c7a05..39b040bb3817 100644 --- a/drivers/video/via/dvi.c +++ b/drivers/video/via/dvi.c | |||
@@ -18,6 +18,8 @@ | |||
18 | * Foundation, Inc., | 18 | * Foundation, Inc., |
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 | #include <linux/via-core.h> | ||
22 | #include <linux/via_i2c.h> | ||
21 | #include "global.h" | 23 | #include "global.h" |
22 | 24 | ||
23 | static void tmds_register_write(int index, u8 data); | 25 | static void tmds_register_write(int index, u8 data); |
@@ -96,7 +98,7 @@ int viafb_tmds_trasmitter_identify(void) | |||
96 | viaparinfo->chip_info->tmds_chip_info.tmds_chip_name = VT1632_TMDS; | 98 | viaparinfo->chip_info->tmds_chip_info.tmds_chip_name = VT1632_TMDS; |
97 | viaparinfo->chip_info-> | 99 | viaparinfo->chip_info-> |
98 | tmds_chip_info.tmds_chip_slave_addr = VT1632_TMDS_I2C_ADDR; | 100 | tmds_chip_info.tmds_chip_slave_addr = VT1632_TMDS_I2C_ADDR; |
99 | viaparinfo->chip_info->tmds_chip_info.i2c_port = I2CPORTINDEX; | 101 | viaparinfo->chip_info->tmds_chip_info.i2c_port = VIA_PORT_31; |
100 | if (check_tmds_chip(VT1632_DEVICE_ID_REG, VT1632_DEVICE_ID) != FAIL) { | 102 | if (check_tmds_chip(VT1632_DEVICE_ID_REG, VT1632_DEVICE_ID) != FAIL) { |
101 | /* | 103 | /* |
102 | * Currently only support 12bits,dual edge,add 24bits mode later | 104 | * Currently only support 12bits,dual edge,add 24bits mode later |
@@ -110,7 +112,7 @@ int viafb_tmds_trasmitter_identify(void) | |||
110 | viaparinfo->chip_info->tmds_chip_info.i2c_port); | 112 | viaparinfo->chip_info->tmds_chip_info.i2c_port); |
111 | return OK; | 113 | return OK; |
112 | } else { | 114 | } else { |
113 | viaparinfo->chip_info->tmds_chip_info.i2c_port = GPIOPORTINDEX; | 115 | viaparinfo->chip_info->tmds_chip_info.i2c_port = VIA_PORT_2C; |
114 | if (check_tmds_chip(VT1632_DEVICE_ID_REG, VT1632_DEVICE_ID) | 116 | if (check_tmds_chip(VT1632_DEVICE_ID_REG, VT1632_DEVICE_ID) |
115 | != FAIL) { | 117 | != FAIL) { |
116 | tmds_register_write(0x08, 0x3b); | 118 | tmds_register_write(0x08, 0x3b); |
@@ -160,32 +162,26 @@ int viafb_tmds_trasmitter_identify(void) | |||
160 | 162 | ||
161 | static void tmds_register_write(int index, u8 data) | 163 | static void tmds_register_write(int index, u8 data) |
162 | { | 164 | { |
163 | viaparinfo->shared->i2c_stuff.i2c_port = | 165 | viafb_i2c_writebyte(viaparinfo->chip_info->tmds_chip_info.i2c_port, |
164 | viaparinfo->chip_info->tmds_chip_info.i2c_port; | 166 | viaparinfo->chip_info->tmds_chip_info.tmds_chip_slave_addr, |
165 | 167 | index, data); | |
166 | viafb_i2c_writebyte(viaparinfo->chip_info->tmds_chip_info. | ||
167 | tmds_chip_slave_addr, index, | ||
168 | data); | ||
169 | } | 168 | } |
170 | 169 | ||
171 | static int tmds_register_read(int index) | 170 | static int tmds_register_read(int index) |
172 | { | 171 | { |
173 | u8 data; | 172 | u8 data; |
174 | 173 | ||
175 | viaparinfo->shared->i2c_stuff.i2c_port = | 174 | viafb_i2c_readbyte(viaparinfo->chip_info->tmds_chip_info.i2c_port, |
176 | viaparinfo->chip_info->tmds_chip_info.i2c_port; | 175 | (u8) viaparinfo->chip_info->tmds_chip_info.tmds_chip_slave_addr, |
177 | viafb_i2c_readbyte((u8) viaparinfo->chip_info-> | 176 | (u8) index, &data); |
178 | tmds_chip_info.tmds_chip_slave_addr, | ||
179 | (u8) index, &data); | ||
180 | return data; | 177 | return data; |
181 | } | 178 | } |
182 | 179 | ||
183 | static int tmds_register_read_bytes(int index, u8 *buff, int buff_len) | 180 | static int tmds_register_read_bytes(int index, u8 *buff, int buff_len) |
184 | { | 181 | { |
185 | viaparinfo->shared->i2c_stuff.i2c_port = | 182 | viafb_i2c_readbytes(viaparinfo->chip_info->tmds_chip_info.i2c_port, |
186 | viaparinfo->chip_info->tmds_chip_info.i2c_port; | 183 | (u8) viaparinfo->chip_info->tmds_chip_info.tmds_chip_slave_addr, |
187 | viafb_i2c_readbytes((u8) viaparinfo->chip_info->tmds_chip_info. | 184 | (u8) index, buff, buff_len); |
188 | tmds_chip_slave_addr, (u8) index, buff, buff_len); | ||
189 | return 0; | 185 | return 0; |
190 | } | 186 | } |
191 | 187 | ||
@@ -541,9 +537,10 @@ void viafb_dvi_enable(void) | |||
541 | else | 537 | else |
542 | data = 0x37; | 538 | data = 0x37; |
543 | viafb_i2c_writebyte(viaparinfo->chip_info-> | 539 | viafb_i2c_writebyte(viaparinfo->chip_info-> |
544 | tmds_chip_info. | 540 | tmds_chip_info.i2c_port, |
545 | tmds_chip_slave_addr, | 541 | viaparinfo->chip_info-> |
546 | 0x08, data); | 542 | tmds_chip_info.tmds_chip_slave_addr, |
543 | 0x08, data); | ||
547 | } | 544 | } |
548 | } | 545 | } |
549 | } | 546 | } |