From patchwork Mon Apr 29 17:00:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 163083 Delivered-To: patch@linaro.org Received: by 2002:a92:7e86:0:0:0:0:0 with SMTP id q6csp2169447ill; Mon, 29 Apr 2019 10:35:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqwBCyanr8m6F0xYZQbllld10n7B/k1Rn807fNK18MEtl1AiiH6hMURi5+GFZvhfw8YUmrrT X-Received: by 2002:a05:6000:45:: with SMTP id k5mr13440676wrx.261.1556559339749; Mon, 29 Apr 2019 10:35:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556559339; cv=none; d=google.com; s=arc-20160816; b=scl2paXFDji0iHcdAa2uJuwn3Poy8Wt5BatpmQo7cmDfULZXNb2vEgmdNIQuG9shrJ 9+TNA8vguJywOo8AIs5wbOe7SkOpSoE/UKBVRFObUxKn/kVMjw4Otjsnj6jurxYgSnKr NWJl+SF+2HZ/IqlipUYZVHTU/qIrd1jKhD5b1RTdj20yhM7zYEK/dIKOcGK6j+9UOIx1 imP/hkEmyU42lWVBAzuOF+9Qtz6Op14HF+I5coRN+kXaxtrSQH9lm3tV7yFtHIzhm0lr VdSTFjY9ZPfm6mYKzegk0EamzRGHEKF6WiaSDz7wIgvqz9mbopxF/bygYd+VEv/y+4bN 9aUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=lwRLvPOYXyQlnpWWoMVUzPzdVHw8aYM3HaWE/wvgSrI=; b=dEvFnpX/W1vjU2tHnEJK2w4Axfo//dLU+iSqpHp4Me3SNERnzc6v1pHT6i93DvF+Sq MuYmqEpUtuBiYY8eDmQWNir+L6Btw3bOdO/rbwh6ZF+19P3zWVW1WJWz+XgT8sY8YZVL y3yXYVX8xpZVqDfjUEyt16CJFPmNkUMI4mIp65n8gTAqTtLTyJPPR0k6SaqsnUBTVK28 7se80ZQD6R+rDlx80P1eIGSuH62r0klp2Hy0NOFoMwHfDMmcLQkOgj4GCh7DBg0vZu/G LCkfTIon5T6j58+E/a27vm1zBfi1ZGJmsbR6v+JdsY43HN3XhblGt/keI/5AxVxAA0ke wq4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=pX0mHP6E; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id j185si85552wma.130.2019.04.29.10.35.39 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 29 Apr 2019 10:35:39 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=pX0mHP6E; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:32880 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLABm-0000uo-LE for patch@linaro.org; Mon, 29 Apr 2019 13:35:38 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34754) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hL9fQ-0005WK-Ab for qemu-devel@nongnu.org; Mon, 29 Apr 2019 13:02:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hL9fO-00075R-78 for qemu-devel@nongnu.org; Mon, 29 Apr 2019 13:02:12 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:55632) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hL9fM-0006ao-5N for qemu-devel@nongnu.org; Mon, 29 Apr 2019 13:02:10 -0400 Received: by mail-wm1-x32e.google.com with SMTP id o25so150876wmf.5 for ; Mon, 29 Apr 2019 10:01:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=lwRLvPOYXyQlnpWWoMVUzPzdVHw8aYM3HaWE/wvgSrI=; b=pX0mHP6ETodKIkkgksVjb5SEiHgIBuWUA8bKgd3cNb2xH4oi/0bN+DVm9XA0UN3pK3 2MOmscfvEv7DIWsl4b4rFle3OZwrZ6WaYTbhKgQa9/SJMZIUipi1z26IK8IHorqYdiLj GHEABOe8g4TEPuEtvVWL7cmPF1sltZs9aUYqgP40hS6ho5uWshxnmiq+Qp3LAMefrB3F 83r3EB1WehQHUFm4OkY9IjW3DeuBU9L6Nco2BAZEgTHoOQlYUg++Fo/B1edy1IvHPjX0 FlbV0i8/Pm2kw4XcuPcBP8i7nBoRlFDiOSLNjRHGsC3mHcKWMiiDbNY7KJ7WFNWTg0rt GLnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lwRLvPOYXyQlnpWWoMVUzPzdVHw8aYM3HaWE/wvgSrI=; b=ou30xp7hlMeE3zIbVXhJkEjEw/xyJ/s4xad96YCD2Rsm/fcahrBehN2slcMR/LxzSt XJKX7/a52e+q95puAFxnF4hHE4oA7U3Ymm9p2O8LGkZ80tVWvRY53bemfDFZuOTFsY6K YT2hA1GbBafZ2ahrq/gWm6fRBs/N8hOedzaRxoAlkKUhVEYDNDDNOYNC86XFLkemXAoK 32deLWFKbMjgb8SZw6Jw/dvd6NEWpuULjACxJSMcpyHpaTuhwbtzOeAp/FSz1PpvNm8z SxHe2KtGAT8BDMzP9DBb2wXTaD8utBreFofnf4pC4Tlc/ROpyoWW5c5aKOw/38tHQ09P f06A== X-Gm-Message-State: APjAAAVzAqLxZ0t5bmBpJFtqV03EiJA+1SSHWjhHbruCGyjbQyATRPci QSKKtHhOGr6e3AvGHqA9PjHBgbUAd2g= X-Received: by 2002:a1c:4e0a:: with SMTP id g10mr46263wmh.128.1556557272577; Mon, 29 Apr 2019 10:01:12 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id a13sm36896wmj.39.2019.04.29.10.01.11 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Apr 2019 10:01:11 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Date: Mon, 29 Apr 2019 18:00:19 +0100 Message-Id: <20190429170030.11323-32-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190429170030.11323-1-peter.maydell@linaro.org> References: <20190429170030.11323-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32e Subject: [Qemu-devel] [PULL 31/42] hw/arm/aspeed: Use TYPE_TMP105/TYPE_PCA9552 instead of hardcoded string 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Reviewed-by: Cédric Le Goater Reviewed-by: Markus Armbruster Signed-off-by: Philippe Mathieu-Daudé Message-id: 20190412165416.7977-2-philmd@redhat.com Signed-off-by: Peter Maydell --- hw/arm/aspeed.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) -- 2.20.1 diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index 996812498dc..1c23ebd9925 100644 --- a/hw/arm/aspeed.c +++ b/hw/arm/aspeed.c @@ -19,6 +19,8 @@ #include "hw/arm/aspeed_soc.h" #include "hw/boards.h" #include "hw/i2c/smbus_eeprom.h" +#include "hw/misc/pca9552.h" +#include "hw/misc/tmp105.h" #include "qemu/log.h" #include "sysemu/block-backend.h" #include "hw/loader.h" @@ -267,7 +269,8 @@ static void ast2500_evb_i2c_init(AspeedBoardState *bmc) eeprom_buf); /* The AST2500 EVB expects a LM75 but a TMP105 is compatible */ - i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 7), "tmp105", 0x4d); + i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 7), + TYPE_TMP105, 0x4d); /* The AST2500 EVB does not have an RTC. Let's pretend that one is * plugged on the I2C bus header */ @@ -288,13 +291,15 @@ static void witherspoon_bmc_i2c_init(AspeedBoardState *bmc) AspeedSoCState *soc = &bmc->soc; uint8_t *eeprom_buf = g_malloc0(8 * 1024); - i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 3), "pca9552", 0x60); + i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 3), TYPE_PCA9552, + 0x60); i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 4), "tmp423", 0x4c); i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 5), "tmp423", 0x4c); /* The Witherspoon expects a TMP275 but a TMP105 is compatible */ - i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 9), "tmp105", 0x4a); + i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 9), TYPE_TMP105, + 0x4a); /* The witherspoon board expects Epson RX8900 I2C RTC but a ds1338 is * good enough */ @@ -302,7 +307,7 @@ static void witherspoon_bmc_i2c_init(AspeedBoardState *bmc) smbus_eeprom_init_one(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 11), 0x51, eeprom_buf); - i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 11), "pca9552", + i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 11), TYPE_PCA9552, 0x60); }