Author: myles Date: Tue Jun 22 22:36:52 2010 New Revision: 5641 URL: https://tracker.coreboot.org/trac/coreboot/changeset/5641
Log: Finish fixing Tyan s2881. Simplify ADT7463 initialization code.
Signed-off-by: Myles Watson mylesgw@gmail.com Acked-by: Ward Vandewege ward@gnu.org
Modified: trunk/src/drivers/i2c/adt7463/adt7463.c trunk/src/mainboard/tyan/s2881/Makefile.inc trunk/src/mainboard/tyan/s2881/devicetree.cb
Modified: trunk/src/drivers/i2c/adt7463/adt7463.c ============================================================================== --- trunk/src/drivers/i2c/adt7463/adt7463.c Tue Jun 22 21:12:58 2010 (r5640) +++ trunk/src/drivers/i2c/adt7463/adt7463.c Tue Jun 22 22:36:52 2010 (r5641) @@ -33,25 +33,11 @@ * See Analog Devices ADT7463 datasheet, Rev C (2004): * http://www.analog.com/en/prod/0,,766_825_ADT7463,00.html */ -static void adt7463_init(device_t dev) +static void adt7463_init(device_t adt7463) { - device_t smbus_dev, adt7463; - struct device_path path; int result;
- /* Find the SMBus controller (AMD-8111). */ - smbus_dev = dev_find_device(0x1022, 0x746b, 0); - if (!smbus_dev) - die("SMBus controller not found\n"); - printk(BIOS_DEBUG, "SMBus controller found\n"); - - /* Find the ADT7463 device. */ - path.type = DEVICE_PATH_I2C; - path.i2c.device = 0x2d; - adt7463 = find_dev_path(smbus_dev->link_list, &path); - if (!adt7463) - die("ADT7463 not found\n"); - printk(BIOS_DEBUG, "ADT7463 found\n"); + printk(BIOS_DEBUG, "ADT7463 is %s\n", dev_path(adt7463));
/* Set all fans to 'Fastest Speed Calculated by All 3 Temperature * Channels Controls PWMx'. @@ -116,7 +102,7 @@ dev->ops = &adt7463_operations; }
-struct chip_operations mainboard_ops = { +struct chip_operations drivers_i2c_adt7463_ops = { CHIP_NAME("adt7463") .enable_dev = enable_dev, };
Modified: trunk/src/mainboard/tyan/s2881/Makefile.inc ============================================================================== --- trunk/src/mainboard/tyan/s2881/Makefile.inc Tue Jun 22 21:12:58 2010 (r5640) +++ trunk/src/mainboard/tyan/s2881/Makefile.inc Tue Jun 22 22:36:52 2010 (r5641) @@ -1 +1 @@ -obj-y += ../../../drivers/i2c/adm1027/adm1027.o +obj-y += ../../../drivers/i2c/adt7463/adt7463.o
Modified: trunk/src/mainboard/tyan/s2881/devicetree.cb ============================================================================== --- trunk/src/mainboard/tyan/s2881/devicetree.cb Tue Jun 22 21:12:58 2010 (r5640) +++ trunk/src/mainboard/tyan/s2881/devicetree.cb Tue Jun 22 22:36:52 2010 (r5641) @@ -102,7 +102,7 @@ chip drivers/generic/generic #dimm 1-1-1 device i2c 57 on end end - chip drivers/i2c/adm1027 # ADT7463A CPU0/1 temp, CPU1 vid, SYS FAN 1/2/3 + chip drivers/i2c/adt7463 # CPU0/1 temp, CPU1 vid, SYS FAN 1/2/3 device i2c 2d on end end chip drivers/generic/generic # Winbond HWM 0x54 CPU0/1 VRM temp, SYSFAN 4,CPU0 vid, CPU0/1 FAN
repository service wrote:
Log: Finish fixing Tyan s2881. Simplify ADT7463 initialization code.
Very nice!!
//Peter