32
32
MODULE_LICENSE ("GPL" );
33
33
MODULE_AUTHOR (
"[email protected] " );
34
34
35
- struct i2c_device {
35
+ struct kpc_i2c {
36
36
unsigned long smba ;
37
37
struct i2c_adapter adapter ;
38
38
unsigned int features ;
@@ -131,7 +131,7 @@ struct i2c_device {
131
131
/* Make sure the SMBus host is ready to start transmitting.
132
132
* Return 0 if it is, -EBUSY if it is not.
133
133
*/
134
- static int i801_check_pre (struct i2c_device * priv )
134
+ static int i801_check_pre (struct kpc_i2c * priv )
135
135
{
136
136
int status ;
137
137
@@ -156,7 +156,7 @@ static int i801_check_pre(struct i2c_device *priv)
156
156
}
157
157
158
158
/* Convert the status register to an error code, and clear it. */
159
- static int i801_check_post (struct i2c_device * priv , int status , int timeout )
159
+ static int i801_check_post (struct kpc_i2c * priv , int status , int timeout )
160
160
{
161
161
int result = 0 ;
162
162
@@ -206,7 +206,7 @@ static int i801_check_post(struct i2c_device *priv, int status, int timeout)
206
206
return result ;
207
207
}
208
208
209
- static int i801_transaction (struct i2c_device * priv , int xact )
209
+ static int i801_transaction (struct kpc_i2c * priv , int xact )
210
210
{
211
211
int status ;
212
212
int result ;
@@ -235,7 +235,7 @@ static int i801_transaction(struct i2c_device *priv, int xact)
235
235
}
236
236
237
237
/* wait for INTR bit as advised by Intel */
238
- static void i801_wait_hwpec (struct i2c_device * priv )
238
+ static void i801_wait_hwpec (struct kpc_i2c * priv )
239
239
{
240
240
int timeout = 0 ;
241
241
int status ;
@@ -251,7 +251,7 @@ static void i801_wait_hwpec(struct i2c_device *priv)
251
251
outb_p (status , SMBHSTSTS (priv ));
252
252
}
253
253
254
- static int i801_block_transaction_by_block (struct i2c_device * priv ,
254
+ static int i801_block_transaction_by_block (struct kpc_i2c * priv ,
255
255
union i2c_smbus_data * data ,
256
256
char read_write , int hwpec )
257
257
{
@@ -285,7 +285,7 @@ static int i801_block_transaction_by_block(struct i2c_device *priv,
285
285
return 0 ;
286
286
}
287
287
288
- static int i801_block_transaction_byte_by_byte (struct i2c_device * priv ,
288
+ static int i801_block_transaction_byte_by_byte (struct kpc_i2c * priv ,
289
289
union i2c_smbus_data * data ,
290
290
char read_write , int command ,
291
291
int hwpec )
@@ -367,7 +367,7 @@ static int i801_block_transaction_byte_by_byte(struct i2c_device *priv,
367
367
return 0 ;
368
368
}
369
369
370
- static int i801_set_block_buffer_mode (struct i2c_device * priv )
370
+ static int i801_set_block_buffer_mode (struct kpc_i2c * priv )
371
371
{
372
372
outb_p (inb_p (SMBAUXCTL (priv )) | SMBAUXCTL_E32B , SMBAUXCTL (priv ));
373
373
if ((inb_p (SMBAUXCTL (priv )) & SMBAUXCTL_E32B ) == 0 )
@@ -376,7 +376,7 @@ static int i801_set_block_buffer_mode(struct i2c_device *priv)
376
376
}
377
377
378
378
/* Block transaction function */
379
- static int i801_block_transaction (struct i2c_device * priv ,
379
+ static int i801_block_transaction (struct kpc_i2c * priv ,
380
380
union i2c_smbus_data * data , char read_write ,
381
381
int command , int hwpec )
382
382
{
@@ -440,7 +440,7 @@ static s32 i801_access(struct i2c_adapter *adap, u16 addr,
440
440
int hwpec ;
441
441
int block = 0 ;
442
442
int ret , xact = 0 ;
443
- struct i2c_device * priv = i2c_get_adapdata (adap );
443
+ struct kpc_i2c * priv = i2c_get_adapdata (adap );
444
444
445
445
hwpec = (priv -> features & FEATURE_SMBUS_PEC ) &&
446
446
(flags & I2C_CLIENT_PEC ) &&
@@ -578,7 +578,7 @@ static s32 i801_access(struct i2c_adapter *adap, u16 addr,
578
578
579
579
static u32 i801_func (struct i2c_adapter * adapter )
580
580
{
581
- struct i2c_device * priv = i2c_get_adapdata (adapter );
581
+ struct kpc_i2c * priv = i2c_get_adapdata (adapter );
582
582
583
583
/* original settings
584
584
* u32 f = I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE |
@@ -648,10 +648,10 @@ static const struct i2c_algorithm smbus_algorithm = {
648
648
/********************************
649
649
*** Part 2 - Driver Handlers ***
650
650
********************************/
651
- static int pi2c_probe (struct platform_device * pldev )
651
+ static int kpc_i2c_probe (struct platform_device * pldev )
652
652
{
653
653
int err ;
654
- struct i2c_device * priv ;
654
+ struct kpc_i2c * priv ;
655
655
struct resource * res ;
656
656
657
657
priv = devm_kzalloc (& pldev -> dev , sizeof (* priv ), GFP_KERNEL );
@@ -700,11 +700,11 @@ static int pi2c_probe(struct platform_device *pldev)
700
700
return 0 ;
701
701
}
702
702
703
- static int pi2c_remove (struct platform_device * pldev )
703
+ static int kpc_i2c_remove (struct platform_device * pldev )
704
704
{
705
- struct i2c_device * lddev ;
705
+ struct kpc_i2c * lddev ;
706
706
707
- lddev = (struct i2c_device * )platform_get_drvdata (pldev );
707
+ lddev = (struct kpc_i2c * )platform_get_drvdata (pldev );
708
708
709
709
i2c_del_adapter (& lddev -> adapter );
710
710
@@ -718,12 +718,12 @@ static int pi2c_remove(struct platform_device *pldev)
718
718
return 0 ;
719
719
}
720
720
721
- static struct platform_driver i2c_plat_driver_i = {
722
- .probe = pi2c_probe ,
723
- .remove = pi2c_remove ,
721
+ static struct platform_driver kpc_i2c_driver = {
722
+ .probe = kpc_i2c_probe ,
723
+ .remove = kpc_i2c_remove ,
724
724
.driver = {
725
725
.name = KP_DRIVER_NAME_I2C ,
726
726
},
727
727
};
728
728
729
- module_platform_driver (i2c_plat_driver_i );
729
+ module_platform_driver (kpc_i2c_driver );
0 commit comments