From patchwork Thu Feb 15 17:35:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 772931 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp954220wre; Thu, 15 Feb 2024 09:39:04 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX/gskzz34qZadU84xLJLWsPl/LCRmDcqosdhfwB+WNFmwv2WVyYV/5SN1S/aMOA7FSg5gB1KPyiwDycBGE1VVk X-Google-Smtp-Source: AGHT+IFDZwkyvgomfRXWCH6JK/EGSMwCHKYQydmjYxIdgTGeeusxUDrVcLqNkWk2gcOWYCi4kq3Y X-Received: by 2002:ac8:5dc9:0:b0:42c:78bd:5207 with SMTP id e9-20020ac85dc9000000b0042c78bd5207mr3263788qtx.2.1708018744193; Thu, 15 Feb 2024 09:39:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708018744; cv=none; d=google.com; s=arc-20160816; b=mGiQc/XYrHXJcI+erOYFIL2O9phIxsQPYcR+LcB6ckIzW+X2iqL6ra00KWasspzIw6 2Ijm9YYaPV17m73L0PJFb9Wv/IRarmjGpK8Vd5Z5nBvSuqGMh/XqYVS9gfLciENrY68a pnhu7seitDWbUzFCsMO+mioNIC/HvBoca10CIiqPgTgUD3gIhAvpzqrSbp+vggnJThff 1B/j+UzUV5FJ30elEvxPm8u+Uh6GEs36fI58PDd29TAC7OfDVcHNCizDbWPs8oQRIko3 pbPEzMR/D6YGZXJJYuou5U1xheYjTXyFQ8jUYDfxmHe/i0wuyHaesnr4xuomZNuuyNmo eO4g== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=zrPXjJVkURtLVPskkolIG/BC8kmZaryoEfEKDL7oHWs=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=JxplfilQF+EXn4009CYp4tHYXOBENWyVhFe/GDFPRdb5liV+7WaOhKx0iEDlQDCVT9 kZsITleOS98ZxWxzWxp8XMa7TS26BPeDSz5oKiCDiV2wmDlyP8dOIkonKIE8rI1Fejio hadgy35NWNcCxffKa5MulPSbpJ7J+zGzhmc6IQlRcwTqYbwPJKg5XfpUvI1/d7lu03+r nsBtC0KRrYzjK7mZlYEJMpd8+Wo8AyWLRGuJUX7xBMFs8FidrPq1PWtq/PUVFCqNvsow pr1C8jNS/g6S8j9YAoo9TeRuFJwjOhcf9QmJbaPKx7KqNKhgdUxNiWXEEqyM83B3i/pD 1FLQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hAb6csiC; 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=pass (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 x4-20020ac85384000000b0042c7bd6fcbbsi1694429qtp.249.2024.02.15.09.39.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Feb 2024 09:39:04 -0800 (PST) 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=pass header.i=@linaro.org header.s=google header.b=hAb6csiC; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rafey-0000n6-Ty; Thu, 15 Feb 2024 12:36:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rafeM-0007zE-GL for qemu-devel@nongnu.org; Thu, 15 Feb 2024 12:35:55 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rafeH-0003yN-9B for qemu-devel@nongnu.org; Thu, 15 Feb 2024 12:35:54 -0500 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-33934567777so663778f8f.1 for ; Thu, 15 Feb 2024 09:35:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708018547; x=1708623347; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=zrPXjJVkURtLVPskkolIG/BC8kmZaryoEfEKDL7oHWs=; b=hAb6csiC/YNfrMelLXU0KsKIYvWu4YWrhyZaDu7IlaHQk3jyVGCrIqobkIGSScuoID 4Xaiac5V5LloW32QdWsRAuxOLOeF9sDb6lDNFN7gVoMCovNuYmkkYRnbB1YBacFjf334 BJmWIIepmdPj+6Z1n0PabByehB3XTWY8ltO/hdDwMHymLnopWCs9ONNuhTSmAq+GkONd Qp7Oac0q2x1sS+4J5FBTId6HZxpfWxY/H1ctU8lKZDLX9IZfkTRhFGHxbouos4KBz8XL DQcrwQKux2B5MEODQyNtkiW9VKX3Lagl4q4CyLVincrli2u6jXey3NeSq3/oywkm6HKq qWZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708018547; x=1708623347; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zrPXjJVkURtLVPskkolIG/BC8kmZaryoEfEKDL7oHWs=; b=eCkYXymX6v+ii2yLkZ9B0j3vOETZZhsSEhgQbAzm1AUN2yQkD6CGrWTwxUp5Ct8TD+ yFiV+j9CyAmP44tJFCbDA3Gw0aRgQNJe282HmW6pXMPPi9UK8RufVyrHanoTEtYuGLY7 +qhDZr47y2mbHT5JjBHAZBNWu5DIKS4AC3u9/XVQpSqLeKgxgB2tgKtZ43zaQ+hpcNPD h7OIkwBbfeXTJYOrNHc3xfXxdk4Yg22hzTZKsuFpKmCNyMJQJj3FmMjjAgbo0xr/vV5k ZkJZDvODIwKgRaJejI8jLKbeTAIJo+WWOwQd65ioiKQsoAkivcDAQ73DlFhZnRwb7gDH LwbQ== X-Gm-Message-State: AOJu0YyWA4vRTMbUbspjUmYiXxFh9dyMQttdeMcMZyPHvcClHO+3OIZS EJLnfsswuvV8ksneG8BJpwuzjSLkwU6Uh6Zike1S64gbT7dZjhXvnC6FGPCk1LFeE8LWdfEobzI J X-Received: by 2002:a5d:4fc1:0:b0:33b:d225:3640 with SMTP id h1-20020a5d4fc1000000b0033bd2253640mr1929210wrw.59.1708018547825; Thu, 15 Feb 2024 09:35:47 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id q16-20020adfea10000000b0033cfa00e497sm2384129wrm.64.2024.02.15.09.35.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 09:35:47 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 19/35] hw/arm/stellaris: Convert ADC controller to Resettable interface Date: Thu, 15 Feb 2024 17:35:22 +0000 Message-Id: <20240215173538.2430599-20-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240215173538.2430599-1-peter.maydell@linaro.org> References: <20240215173538.2430599-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x436.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell Message-id: 20240213155214.13619-2-philmd@linaro.org Signed-off-by: Peter Maydell --- hw/arm/stellaris.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c index 34c5a86ac2e..4fa857970b4 100644 --- a/hw/arm/stellaris.c +++ b/hw/arm/stellaris.c @@ -773,8 +773,9 @@ static void stellaris_adc_trigger(void *opaque, int irq, int level) } } -static void stellaris_adc_reset(StellarisADCState *s) +static void stellaris_adc_reset_hold(Object *obj) { + StellarisADCState *s = STELLARIS_ADC(obj); int n; for (n = 0; n < 4; n++) { @@ -946,7 +947,6 @@ static void stellaris_adc_init(Object *obj) memory_region_init_io(&s->iomem, obj, &stellaris_adc_ops, s, "adc", 0x1000); sysbus_init_mmio(sbd, &s->iomem); - stellaris_adc_reset(s); qdev_init_gpio_in(dev, stellaris_adc_trigger, 1); } @@ -1411,7 +1411,9 @@ static const TypeInfo stellaris_i2c_info = { static void stellaris_adc_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); + ResettableClass *rc = RESETTABLE_CLASS(klass); + rc->phases.hold = stellaris_adc_reset_hold; dc->vmsd = &vmstate_stellaris_adc; }