From nobody Thu Dec 18 17:51:26 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1496338244757442.3457943172874; Thu, 1 Jun 2017 10:30:44 -0700 (PDT) Received: from localhost ([::1]:45889 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGTvm-0002Zj-6r for importer@patchew.org; Thu, 01 Jun 2017 13:30:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35371) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGTcd-0001CI-Af for qemu-devel@nongnu.org; Thu, 01 Jun 2017 13:10:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dGTcc-0006Hn-Ji for qemu-devel@nongnu.org; Thu, 01 Jun 2017 13:10:55 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:37151) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dGTcc-0006Gg-C5 for qemu-devel@nongnu.org; Thu, 01 Jun 2017 13:10:54 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.84_2) (envelope-from ) id 1dGTcb-0007VY-Au for qemu-devel@nongnu.org; Thu, 01 Jun 2017 18:10:53 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 1 Jun 2017 18:10:33 +0100 Message-Id: <1496337035-30213-26-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1496337035-30213-1-git-send-email-peter.maydell@linaro.org> References: <1496337035-30213-1-git-send-email-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 25/27] aspeed: add a temp sensor device on I2C bus 3 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 From: C=C3=A9dric Le Goater Temperatures can be changed from the monitor with : (qemu) qom-set /machine/unattached/device[2] temperature0 12000 Signed-off-by: C=C3=A9dric Le Goater Message-id: 1494827476-1487-7-git-send-email-clg@kaod.org Signed-off-by: Peter Maydell Reviewed-by: Peter Maydell --- hw/arm/aspeed.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index e824ea8..155eeb2 100644 --- a/hw/arm/aspeed.c +++ b/hw/arm/aspeed.c @@ -239,10 +239,19 @@ static void aspeed_board_init(MachineState *machine, static void palmetto_bmc_i2c_init(AspeedBoardState *bmc) { AspeedSoCState *soc =3D &bmc->soc; + DeviceState *dev; =20 /* The palmetto platform expects a ds3231 RTC but a ds1338 is * enough to provide basic RTC features. Alarms will be missing */ i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 0), "ds1338", 0= x68); + + /* add a TMP423 temperature sensor */ + dev =3D i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 2), + "tmp423", 0x4c); + object_property_set_int(OBJECT(dev), 31000, "temperature0", &error_abo= rt); + object_property_set_int(OBJECT(dev), 28000, "temperature1", &error_abo= rt); + object_property_set_int(OBJECT(dev), 20000, "temperature2", &error_abo= rt); + object_property_set_int(OBJECT(dev), 110000, "temperature3", &error_ab= ort); } =20 static void palmetto_bmc_init(MachineState *machine) --=20 2.7.4