@@ -385,13 +385,13 @@ static void palmetto_bmc_i2c_init(AspeedMachineState *bmc)
385
385
386
386
/* The palmetto platform expects a ds3231 RTC but a ds1338 is
387
387
* enough to provide basic RTC features. Alarms will be missing */
388
- i2c_create_slave (aspeed_i2c_get_bus (DEVICE ( & soc -> i2c ) , 0 ), "ds1338" , 0x68 );
388
+ i2c_create_slave (aspeed_i2c_get_bus (& soc -> i2c , 0 ), "ds1338" , 0x68 );
389
389
390
- smbus_eeprom_init_one (aspeed_i2c_get_bus (DEVICE ( & soc -> i2c ) , 0 ), 0x50 ,
390
+ smbus_eeprom_init_one (aspeed_i2c_get_bus (& soc -> i2c , 0 ), 0x50 ,
391
391
eeprom_buf );
392
392
393
393
/* add a TMP423 temperature sensor */
394
- dev = i2c_create_slave (aspeed_i2c_get_bus (DEVICE ( & soc -> i2c ) , 2 ),
394
+ dev = i2c_create_slave (aspeed_i2c_get_bus (& soc -> i2c , 2 ),
395
395
"tmp423" , 0x4c );
396
396
object_property_set_int (OBJECT (dev ), "temperature0" , 31000 , & error_abort );
397
397
object_property_set_int (OBJECT (dev ), "temperature1" , 28000 , & error_abort );
@@ -404,16 +404,16 @@ static void ast2500_evb_i2c_init(AspeedMachineState *bmc)
404
404
AspeedSoCState * soc = & bmc -> soc ;
405
405
uint8_t * eeprom_buf = g_malloc0 (8 * 1024 );
406
406
407
- smbus_eeprom_init_one (aspeed_i2c_get_bus (DEVICE ( & soc -> i2c ) , 3 ), 0x50 ,
407
+ smbus_eeprom_init_one (aspeed_i2c_get_bus (& soc -> i2c , 3 ), 0x50 ,
408
408
eeprom_buf );
409
409
410
410
/* The AST2500 EVB expects a LM75 but a TMP105 is compatible */
411
- i2c_create_slave (aspeed_i2c_get_bus (DEVICE ( & soc -> i2c ) , 7 ),
411
+ i2c_create_slave (aspeed_i2c_get_bus (& soc -> i2c , 7 ),
412
412
TYPE_TMP105 , 0x4d );
413
413
414
414
/* The AST2500 EVB does not have an RTC. Let's pretend that one is
415
415
* plugged on the I2C bus header */
416
- i2c_create_slave (aspeed_i2c_get_bus (DEVICE ( & soc -> i2c ) , 11 ), "ds1338" , 0x32 );
416
+ i2c_create_slave (aspeed_i2c_get_bus (& soc -> i2c , 11 ), "ds1338" , 0x32 );
417
417
}
418
418
419
419
static void ast2600_evb_i2c_init (AspeedMachineState * bmc )
@@ -428,69 +428,69 @@ static void romulus_bmc_i2c_init(AspeedMachineState *bmc)
428
428
429
429
/* The romulus board expects Epson RX8900 I2C RTC but a ds1338 is
430
430
* good enough */
431
- i2c_create_slave (aspeed_i2c_get_bus (DEVICE ( & soc -> i2c ) , 11 ), "ds1338" , 0x32 );
431
+ i2c_create_slave (aspeed_i2c_get_bus (& soc -> i2c , 11 ), "ds1338" , 0x32 );
432
432
}
433
433
434
434
static void swift_bmc_i2c_init (AspeedMachineState * bmc )
435
435
{
436
436
AspeedSoCState * soc = & bmc -> soc ;
437
437
438
- i2c_create_slave (aspeed_i2c_get_bus (DEVICE ( & soc -> i2c ) , 3 ), "pca9552" , 0x60 );
438
+ i2c_create_slave (aspeed_i2c_get_bus (& soc -> i2c , 3 ), "pca9552" , 0x60 );
439
439
440
440
/* The swift board expects a TMP275 but a TMP105 is compatible */
441
- i2c_create_slave (aspeed_i2c_get_bus (DEVICE ( & soc -> i2c ) , 7 ), "tmp105" , 0x48 );
441
+ i2c_create_slave (aspeed_i2c_get_bus (& soc -> i2c , 7 ), "tmp105" , 0x48 );
442
442
/* The swift board expects a pca9551 but a pca9552 is compatible */
443
- i2c_create_slave (aspeed_i2c_get_bus (DEVICE ( & soc -> i2c ) , 7 ), "pca9552" , 0x60 );
443
+ i2c_create_slave (aspeed_i2c_get_bus (& soc -> i2c , 7 ), "pca9552" , 0x60 );
444
444
445
445
/* The swift board expects an Epson RX8900 RTC but a ds1338 is compatible */
446
- i2c_create_slave (aspeed_i2c_get_bus (DEVICE ( & soc -> i2c ) , 8 ), "ds1338" , 0x32 );
447
- i2c_create_slave (aspeed_i2c_get_bus (DEVICE ( & soc -> i2c ) , 8 ), "pca9552" , 0x60 );
446
+ i2c_create_slave (aspeed_i2c_get_bus (& soc -> i2c , 8 ), "ds1338" , 0x32 );
447
+ i2c_create_slave (aspeed_i2c_get_bus (& soc -> i2c , 8 ), "pca9552" , 0x60 );
448
448
449
- i2c_create_slave (aspeed_i2c_get_bus (DEVICE ( & soc -> i2c ) , 9 ), "tmp423" , 0x4c );
449
+ i2c_create_slave (aspeed_i2c_get_bus (& soc -> i2c , 9 ), "tmp423" , 0x4c );
450
450
/* The swift board expects a pca9539 but a pca9552 is compatible */
451
- i2c_create_slave (aspeed_i2c_get_bus (DEVICE ( & soc -> i2c ) , 9 ), "pca9552" , 0x74 );
451
+ i2c_create_slave (aspeed_i2c_get_bus (& soc -> i2c , 9 ), "pca9552" , 0x74 );
452
452
453
- i2c_create_slave (aspeed_i2c_get_bus (DEVICE ( & soc -> i2c ) , 10 ), "tmp423" , 0x4c );
453
+ i2c_create_slave (aspeed_i2c_get_bus (& soc -> i2c , 10 ), "tmp423" , 0x4c );
454
454
/* The swift board expects a pca9539 but a pca9552 is compatible */
455
- i2c_create_slave (aspeed_i2c_get_bus (DEVICE ( & soc -> i2c ) , 10 ), "pca9552" ,
455
+ i2c_create_slave (aspeed_i2c_get_bus (& soc -> i2c , 10 ), "pca9552" ,
456
456
0x74 );
457
457
458
458
/* The swift board expects a TMP275 but a TMP105 is compatible */
459
- i2c_create_slave (aspeed_i2c_get_bus (DEVICE ( & soc -> i2c ) , 12 ), "tmp105" , 0x48 );
460
- i2c_create_slave (aspeed_i2c_get_bus (DEVICE ( & soc -> i2c ) , 12 ), "tmp105" , 0x4a );
459
+ i2c_create_slave (aspeed_i2c_get_bus (& soc -> i2c , 12 ), "tmp105" , 0x48 );
460
+ i2c_create_slave (aspeed_i2c_get_bus (& soc -> i2c , 12 ), "tmp105" , 0x4a );
461
461
}
462
462
463
463
static void sonorapass_bmc_i2c_init (AspeedMachineState * bmc )
464
464
{
465
465
AspeedSoCState * soc = & bmc -> soc ;
466
466
467
467
/* bus 2 : */
468
- i2c_create_slave (aspeed_i2c_get_bus (DEVICE ( & soc -> i2c ) , 2 ), "tmp105" , 0x48 );
469
- i2c_create_slave (aspeed_i2c_get_bus (DEVICE ( & soc -> i2c ) , 2 ), "tmp105" , 0x49 );
468
+ i2c_create_slave (aspeed_i2c_get_bus (& soc -> i2c , 2 ), "tmp105" , 0x48 );
469
+ i2c_create_slave (aspeed_i2c_get_bus (& soc -> i2c , 2 ), "tmp105" , 0x49 );
470
470
/* bus 2 : pca9546 @ 0x73 */
471
471
472
472
/* bus 3 : pca9548 @ 0x70 */
473
473
474
474
/* bus 4 : */
475
475
uint8_t * eeprom4_54 = g_malloc0 (8 * 1024 );
476
- smbus_eeprom_init_one (aspeed_i2c_get_bus (DEVICE ( & soc -> i2c ) , 4 ), 0x54 ,
476
+ smbus_eeprom_init_one (aspeed_i2c_get_bus (& soc -> i2c , 4 ), 0x54 ,
477
477
eeprom4_54 );
478
478
/* PCA9539 @ 0x76, but PCA9552 is compatible */
479
- i2c_create_slave (aspeed_i2c_get_bus (DEVICE ( & soc -> i2c ) , 4 ), "pca9552" , 0x76 );
479
+ i2c_create_slave (aspeed_i2c_get_bus (& soc -> i2c , 4 ), "pca9552" , 0x76 );
480
480
/* PCA9539 @ 0x77, but PCA9552 is compatible */
481
- i2c_create_slave (aspeed_i2c_get_bus (DEVICE ( & soc -> i2c ) , 4 ), "pca9552" , 0x77 );
481
+ i2c_create_slave (aspeed_i2c_get_bus (& soc -> i2c , 4 ), "pca9552" , 0x77 );
482
482
483
483
/* bus 6 : */
484
- i2c_create_slave (aspeed_i2c_get_bus (DEVICE ( & soc -> i2c ) , 6 ), "tmp105" , 0x48 );
485
- i2c_create_slave (aspeed_i2c_get_bus (DEVICE ( & soc -> i2c ) , 6 ), "tmp105" , 0x49 );
484
+ i2c_create_slave (aspeed_i2c_get_bus (& soc -> i2c , 6 ), "tmp105" , 0x48 );
485
+ i2c_create_slave (aspeed_i2c_get_bus (& soc -> i2c , 6 ), "tmp105" , 0x49 );
486
486
/* bus 6 : pca9546 @ 0x73 */
487
487
488
488
/* bus 8 : */
489
489
uint8_t * eeprom8_56 = g_malloc0 (8 * 1024 );
490
- smbus_eeprom_init_one (aspeed_i2c_get_bus (DEVICE ( & soc -> i2c ) , 8 ), 0x56 ,
490
+ smbus_eeprom_init_one (aspeed_i2c_get_bus (& soc -> i2c , 8 ), 0x56 ,
491
491
eeprom8_56 );
492
- i2c_create_slave (aspeed_i2c_get_bus (DEVICE ( & soc -> i2c ) , 8 ), "pca9552" , 0x60 );
493
- i2c_create_slave (aspeed_i2c_get_bus (DEVICE ( & soc -> i2c ) , 8 ), "pca9552" , 0x61 );
492
+ i2c_create_slave (aspeed_i2c_get_bus (& soc -> i2c , 8 ), "pca9552" , 0x60 );
493
+ i2c_create_slave (aspeed_i2c_get_bus (& soc -> i2c , 8 ), "pca9552" , 0x61 );
494
494
/* bus 8 : adc128d818 @ 0x1d */
495
495
/* bus 8 : adc128d818 @ 0x1f */
496
496
@@ -515,25 +515,25 @@ static void witherspoon_bmc_i2c_init(AspeedMachineState *bmc)
515
515
/* Bus 3: TODO dps310@76 */
516
516
dev = i2c_try_create_slave (TYPE_PCA9552 , 0x60 );
517
517
qdev_prop_set_string (dev , "description" , "pca1" );
518
- i2c_realize_and_unref (dev , aspeed_i2c_get_bus (DEVICE ( & soc -> i2c ) , 3 ),
518
+ i2c_realize_and_unref (dev , aspeed_i2c_get_bus (& soc -> i2c , 3 ),
519
519
& error_fatal );
520
520
521
- i2c_create_slave (aspeed_i2c_get_bus (DEVICE ( & soc -> i2c ) , 4 ), "tmp423" , 0x4c );
522
- i2c_create_slave (aspeed_i2c_get_bus (DEVICE ( & soc -> i2c ) , 5 ), "tmp423" , 0x4c );
521
+ i2c_create_slave (aspeed_i2c_get_bus (& soc -> i2c , 4 ), "tmp423" , 0x4c );
522
+ i2c_create_slave (aspeed_i2c_get_bus (& soc -> i2c , 5 ), "tmp423" , 0x4c );
523
523
524
524
/* The Witherspoon expects a TMP275 but a TMP105 is compatible */
525
- i2c_create_slave (aspeed_i2c_get_bus (DEVICE ( & soc -> i2c ) , 9 ), TYPE_TMP105 ,
525
+ i2c_create_slave (aspeed_i2c_get_bus (& soc -> i2c , 9 ), TYPE_TMP105 ,
526
526
0x4a );
527
527
528
528
/* The witherspoon board expects Epson RX8900 I2C RTC but a ds1338 is
529
529
* good enough */
530
- i2c_create_slave (aspeed_i2c_get_bus (DEVICE ( & soc -> i2c ) , 11 ), "ds1338" , 0x32 );
530
+ i2c_create_slave (aspeed_i2c_get_bus (& soc -> i2c , 11 ), "ds1338" , 0x32 );
531
531
532
- smbus_eeprom_init_one (aspeed_i2c_get_bus (DEVICE ( & soc -> i2c ) , 11 ), 0x51 ,
532
+ smbus_eeprom_init_one (aspeed_i2c_get_bus (& soc -> i2c , 11 ), 0x51 ,
533
533
eeprom_buf );
534
534
dev = i2c_try_create_slave (TYPE_PCA9552 , 0x60 );
535
535
qdev_prop_set_string (dev , "description" , "pca0" );
536
- i2c_realize_and_unref (dev , aspeed_i2c_get_bus (DEVICE ( & soc -> i2c ) , 11 ),
536
+ i2c_realize_and_unref (dev , aspeed_i2c_get_bus (& soc -> i2c , 11 ),
537
537
& error_fatal );
538
538
/* Bus 11: TODO ucd90160@64 */
539
539
}
0 commit comments