[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v1 15/15] aspeed: add tmp105 in i2c bus 0 for AST2700
From: |
Jamin Lin |
Subject: |
[PATCH v1 15/15] aspeed: add tmp105 in i2c bus 0 for AST2700 |
Date: |
Thu, 18 Jul 2024 14:49:25 +0800 |
ASPEED SDK add lm75 in i2c bus 0 for AST2700.
LM75 is compatible with TMP105 driver.
Introduce a new i2c init function and
add tmp105 device model in i2c bus 0.
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
---
hw/arm/aspeed.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
index f8766ea462..ed98758708 100644
--- a/hw/arm/aspeed.c
+++ b/hw/arm/aspeed.c
@@ -1604,6 +1604,15 @@ static void
aspeed_minibmc_machine_ast1030_evb_class_init(ObjectClass *oc,
}
#ifdef TARGET_AARCH64
+static void ast2700_evb_i2c_init(AspeedMachineState *bmc)
+{
+ AspeedSoCState *soc = bmc->soc;
+
+ /* LM75 is compatible with TMP105 driver */
+ i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 0),
+ TYPE_TMP105, 0x4d);
+}
+
static void aspeed_machine_ast2700_evb_class_init(ObjectClass *oc, void *data)
{
MachineClass *mc = MACHINE_CLASS(oc);
@@ -1618,6 +1627,7 @@ static void
aspeed_machine_ast2700_evb_class_init(ObjectClass *oc, void *data)
amc->num_cs = 2;
amc->macs_mask = ASPEED_MAC0_ON | ASPEED_MAC1_ON | ASPEED_MAC2_ON;
amc->uart_default = ASPEED_DEV_UART12;
+ amc->i2c_init = ast2700_evb_i2c_init;
mc->default_ram_size = 1 * GiB;
aspeed_machine_class_init_cpus_defaults(mc);
}
--
2.34.1
- [PATCH v1 09/15] hw/i2c/aspeed: Add AST2700 support, (continued)
- [PATCH v1 09/15] hw/i2c/aspeed: Add AST2700 support, Jamin Lin, 2024/07/18
- [PATCH v1 11/15] hw/i2c/aspeed: support high part dram offset for DMA 64 bits, Jamin Lin, 2024/07/18
- [PATCH v1 12/15] aspeed/soc: introduce a new API to get the INTC orgate information, Jamin Lin, 2024/07/18
- [PATCH v1 13/15] aspeed/soc: support I2C for AST2700, Jamin Lin, 2024/07/18
- [PATCH v1 14/15] aspeed: fix coding style, Jamin Lin, 2024/07/18
- [PATCH v1 15/15] aspeed: add tmp105 in i2c bus 0 for AST2700,
Jamin Lin <=
- Re: [PATCH v1 00/15] support ADC and I2C for AST2700, Cédric Le Goater, 2024/07/18