@@ -536,12 +536,12 @@ static bool smu_v11_0_i2c_bus_unlock(struct i2c_adapter *control)
536
536
return false;
537
537
}
538
538
539
- /***************************** EEPROM I2C GLUE ****************************/
539
+ /***************************** I2C GLUE ****************************/
540
540
541
- static uint32_t smu_v11_0_i2c_eeprom_read_data (struct i2c_adapter * control ,
542
- uint8_t address ,
543
- uint8_t * data ,
544
- uint32_t numbytes )
541
+ static uint32_t smu_v11_0_i2c_read_data (struct i2c_adapter * control ,
542
+ uint8_t address ,
543
+ uint8_t * data ,
544
+ uint32_t numbytes )
545
545
{
546
546
uint32_t ret = 0 ;
547
547
@@ -561,10 +561,10 @@ static uint32_t smu_v11_0_i2c_eeprom_read_data(struct i2c_adapter *control,
561
561
return ret ;
562
562
}
563
563
564
- static uint32_t smu_v11_0_i2c_eeprom_write_data (struct i2c_adapter * control ,
565
- uint8_t address ,
566
- uint8_t * data ,
567
- uint32_t numbytes )
564
+ static uint32_t smu_v11_0_i2c_write_data (struct i2c_adapter * control ,
565
+ uint8_t address ,
566
+ uint8_t * data ,
567
+ uint32_t numbytes )
568
568
{
569
569
uint32_t ret ;
570
570
@@ -624,7 +624,7 @@ static const struct i2c_lock_operations smu_v11_0_i2c_i2c_lock_ops = {
624
624
.unlock_bus = unlock_bus ,
625
625
};
626
626
627
- static int smu_v11_0_i2c_eeprom_i2c_xfer (struct i2c_adapter * i2c_adap ,
627
+ static int smu_v11_0_i2c_xfer (struct i2c_adapter * i2c_adap ,
628
628
struct i2c_msg * msgs , int num )
629
629
{
630
630
int i , ret ;
@@ -639,13 +639,13 @@ static int smu_v11_0_i2c_eeprom_i2c_xfer(struct i2c_adapter *i2c_adap,
639
639
640
640
for (i = 0 ; i < num ; i ++ ) {
641
641
if (msgs [i ].flags & I2C_M_RD )
642
- ret = smu_v11_0_i2c_eeprom_read_data (i2c_adap ,
643
- (uint8_t )msgs [i ].addr ,
644
- msgs [i ].buf , msgs [i ].len );
642
+ ret = smu_v11_0_i2c_read_data (i2c_adap ,
643
+ (uint8_t )msgs [i ].addr ,
644
+ msgs [i ].buf , msgs [i ].len );
645
645
else
646
- ret = smu_v11_0_i2c_eeprom_write_data (i2c_adap ,
647
- (uint8_t )msgs [i ].addr ,
648
- msgs [i ].buf , msgs [i ].len );
646
+ ret = smu_v11_0_i2c_write_data (i2c_adap ,
647
+ (uint8_t )msgs [i ].addr ,
648
+ msgs [i ].buf , msgs [i ].len );
649
649
650
650
if (ret != I2C_OK ) {
651
651
num = - EIO ;
@@ -657,27 +657,27 @@ static int smu_v11_0_i2c_eeprom_i2c_xfer(struct i2c_adapter *i2c_adap,
657
657
return num ;
658
658
}
659
659
660
- static u32 smu_v11_0_i2c_eeprom_i2c_func (struct i2c_adapter * adap )
660
+ static u32 smu_v11_0_i2c_func (struct i2c_adapter * adap )
661
661
{
662
662
return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL ;
663
663
}
664
664
665
665
666
- static const struct i2c_algorithm smu_v11_0_i2c_eeprom_i2c_algo = {
667
- .master_xfer = smu_v11_0_i2c_eeprom_i2c_xfer ,
668
- .functionality = smu_v11_0_i2c_eeprom_i2c_func ,
666
+ static const struct i2c_algorithm smu_v11_0_i2c_algo = {
667
+ .master_xfer = smu_v11_0_i2c_xfer ,
668
+ .functionality = smu_v11_0_i2c_func ,
669
669
};
670
670
671
- int smu_v11_0_i2c_eeprom_control_init (struct i2c_adapter * control )
671
+ int smu_v11_0_i2c_control_init (struct i2c_adapter * control )
672
672
{
673
673
struct amdgpu_device * adev = to_amdgpu_device (control );
674
674
int res ;
675
675
676
676
control -> owner = THIS_MODULE ;
677
677
control -> class = I2C_CLASS_SPD ;
678
678
control -> dev .parent = & adev -> pdev -> dev ;
679
- control -> algo = & smu_v11_0_i2c_eeprom_i2c_algo ;
680
- snprintf (control -> name , sizeof (control -> name ), "AMDGPU EEPROM " );
679
+ control -> algo = & smu_v11_0_i2c_algo ;
680
+ snprintf (control -> name , sizeof (control -> name ), "AMDGPU SMU " );
681
681
control -> lock_ops = & smu_v11_0_i2c_i2c_lock_ops ;
682
682
683
683
res = i2c_add_adapter (control );
@@ -687,7 +687,7 @@ int smu_v11_0_i2c_eeprom_control_init(struct i2c_adapter *control)
687
687
return res ;
688
688
}
689
689
690
- void smu_v11_0_i2c_eeprom_control_fini (struct i2c_adapter * control )
690
+ void smu_v11_0_i2c_control_fini (struct i2c_adapter * control )
691
691
{
692
692
i2c_del_adapter (control );
693
693
}
@@ -715,9 +715,9 @@ bool smu_v11_0_i2c_test_bus(struct i2c_adapter *control)
715
715
smu_v11_0_i2c_init (control );
716
716
717
717
/* Write 0xde to address 0x0000 on the EEPROM */
718
- ret = smu_v11_0_i2c_eeprom_write_data (control , I2C_TARGET_ADDR , data , 6 );
718
+ ret = smu_v11_0_i2c_write_data (control , I2C_TARGET_ADDR , data , 6 );
719
719
720
- ret = smu_v11_0_i2c_eeprom_read_data (control , I2C_TARGET_ADDR , data , 6 );
720
+ ret = smu_v11_0_i2c_read_data (control , I2C_TARGET_ADDR , data , 6 );
721
721
722
722
smu_v11_0_i2c_fini (control );
723
723
0 commit comments