@@ -142,19 +142,18 @@ static int vt596_transaction(u8 size)
142142 /* Make sure the SMBus host is ready to start transmitting */
143143 if ((temp = inb_p (SMBHSTSTS )) & 0x1F ) {
144144 dev_dbg (& vt596_adapter .dev , "SMBus busy (0x%02x). "
145- "Resetting... " , temp );
145+ "Resetting...\n " , temp );
146146
147147 outb_p (temp , SMBHSTSTS );
148148 if ((temp = inb_p (SMBHSTSTS )) & 0x1F ) {
149- printk ("Failed! (0x%02x)\n" , temp );
149+ dev_err (& vt596_adapter .dev , "SMBus reset failed! "
150+ "(0x%02x)\n" , temp );
150151 return -1 ;
151- } else {
152- printk ("Successful!\n" );
153152 }
154153 }
155154
156155 /* Start the transaction by setting bit 6 */
157- outb_p (0x40 | ( size & 0x3C ) , SMBHSTCNT );
156+ outb_p (0x40 | size , SMBHSTCNT );
158157
159158 /* We will always wait for a fraction of a second */
160159 do {
@@ -171,7 +170,7 @@ static int vt596_transaction(u8 size)
171170 if (temp & 0x10 ) {
172171 result = -1 ;
173172 dev_err (& vt596_adapter .dev , "Transaction failed (0x%02x)\n" ,
174- inb_p ( SMBHSTCNT ) & 0x3C );
173+ size );
175174 }
176175
177176 if (temp & 0x08 ) {
@@ -180,11 +179,13 @@ static int vt596_transaction(u8 size)
180179 }
181180
182181 if (temp & 0x04 ) {
182+ int read = inb_p (SMBHSTADD ) & 0x01 ;
183183 result = -1 ;
184- /* Quick commands are used to probe for chips, so
185- errors are expected, and we don't want to frighten the
186- user. */
187- if ((inb_p (SMBHSTCNT ) & 0x3C ) != VT596_QUICK )
184+ /* The quick and receive byte commands are used to probe
185+ for chips, so errors are expected, and we don't want
186+ to frighten the user. */
187+ if (!((size == VT596_QUICK && !read ) ||
188+ (size == VT596_BYTE && read )))
188189 dev_err (& vt596_adapter .dev , "Transaction error!\n" );
189190 }
190191
@@ -462,9 +463,9 @@ static void __exit i2c_vt596_exit(void)
462463 }
463464}
464465
465- MODULE_AUTHOR (
466- "Frodo Looijaard <frodol@dds.nl > and "
467- "Philip Edelbrock <phil@netroedge.com >" );
466+ MODULE_AUTHOR ("Kyosti Malkki <kmalkki@cc.hut.fi>, "
467+ "Mark D. Studebaker <mdsxyz123@yahoo.com > and "
468+ "Jean Delvare <khali@linux-fr.org >" );
468469MODULE_DESCRIPTION ("vt82c596 SMBus driver" );
469470MODULE_LICENSE ("GPL" );
470471
0 commit comments