From patchwork Tue Feb 13 15:52:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 772317 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp324733wre; Tue, 13 Feb 2024 07:53:03 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVjbhAnTTz/QRTWCgaeT5qcSLc5XRJrJPf6EozLcj/fysHy+gdvfDB5htMJdDfgAhpexN+T+mqG9lkRpqAjRreu X-Google-Smtp-Source: AGHT+IFum2178pPS+Bdtrz26Xjvd2WsLmYRBcLGCOW3DLbvAEsKXGPeLYO84ThbNEkIpQ2vQW8uI X-Received: by 2002:a05:6870:1585:b0:218:43e6:716 with SMTP id j5-20020a056870158500b0021843e60716mr9006258oab.33.1707839583112; Tue, 13 Feb 2024 07:53:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707839583; cv=none; d=google.com; s=arc-20160816; b=Jksh5Iuhb53uDeZzuOMKhP0sqSeLHhyDMFs6RPETc8/jnYOWMyoq3dfdmNkEpCjCAa W0DYt3LSXBm8EI0pxUcQ/n1mlXfO+n8tH8iJfChPkuA2AfFnrssuC9gbAxrkZQRPN2Ts oNeZm2aUGyQiLyrgENkFx8FfSo6Y+O0EjT4xmf7o1p3v0pTTCzrCWYI0HX4tjCdP3JBD ohPs01raWhxZaE0N57TTGiP89+SsvjT6lD34TsMvLzOox4mM1Z+kfxvrzEd4pDvUxTJK /OIten9cOsecHZktjkKHLDT1+nBGzfFBNXZXXPA8boWR8+RvUtLodQ/+QpAQ3KlTImhU ba0A== 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:cc:to :from:dkim-signature; bh=U+S0PIyuWqj36dfp8C1T50Axcx5KgHwe/rvIuK8sOt8=; fh=9JFGUO3HtgNHzXQWIKcz7j3umnaK9fOSBBfAN5k7TuI=; b=qDOvTpzdOBLYkF73xDNAIaI3Gxs+b34Mh1GdrXoPxeAAQerJrMLqiibXLCbpdiy64i hgQJeXE5kKSitKvizZpYGTw3f8mXx764DcHTEDWR2uye3uXvoNNdxbpC4NyLhiOqRmHj phEtqbQiekC7IFpGywDRRoSUXb4FvxmjtLoTr148OBOQwJWrX+RM8jsUufw0jgEynGxJ dq8ekS/ADM91++Ufi4y4gAjoMH/wRtTZoUQelIKR27y8kBOCHBjss6c8j+OIM1io0M8N mG90SJZebt4twm7iKud0TUNuV+2Uf5dKzLx38nu4WYJ2AREWmgoX2oO+4NEZEpQrNPtl +13g==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DGvGivEO; 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 X-Forwarded-Encrypted: i=1; AJvYcCWz624OH2FfytFz8PbZPHYz25jWLjUoRXOntPgheuMTqqPWzcmKkZmnRUYQUD6fuGR0ljnV/qGAbQ1RxgoMwP/E Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id po10-20020a05620a384a00b00785767af0f3si8239572qkn.664.2024.02.13.07.53.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Feb 2024 07:53:03 -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=DGvGivEO; 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 1rZv5C-00016W-LK; Tue, 13 Feb 2024 10:52:30 -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 1rZv5A-00014Z-1L for qemu-devel@nongnu.org; Tue, 13 Feb 2024 10:52:28 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rZv57-0005lg-8m for qemu-devel@nongnu.org; Tue, 13 Feb 2024 10:52:27 -0500 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-3392b045e0aso3059563f8f.2 for ; Tue, 13 Feb 2024 07:52:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707839543; x=1708444343; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=U+S0PIyuWqj36dfp8C1T50Axcx5KgHwe/rvIuK8sOt8=; b=DGvGivEOHnaarw4F+qcovDKo0ff/GUPOGq80idnwoVP28T5Y7gQzXudt0NWtSepMGz OmIKf5c2aO+Um2q66HRF/xc9DjWFTjFi886dYHhfTciL8IlUEFQ+2PrSC1q6ty4qwnx+ J35rOnIWaQHC5SjPFb/ZgeFvYpFK+WFyVSOza45vJYmSUxcOQ8NCr99hJ0UTLN1KOSU9 io8gxFDwFLes63mNbmPxI02SYR7E9xiDPzLxr/9t9Tn+MHXm+JxvTcBoyH0zzo8RdAfa MOudmZtZpNspUhDePwoPoRbNFHKphqaydtTaQDZbTAIsFaBD/U95zM3rqMQOYveuIx1u oK8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707839543; x=1708444343; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=U+S0PIyuWqj36dfp8C1T50Axcx5KgHwe/rvIuK8sOt8=; b=GiVKtBzVYYVgD3sA+wIbsDDrGsuO6WzSOkH84QTI3b/46l9on0SF6Gp8MPXf3/lsnx xz+hrF/svZA9pOv10WmLhzGxXUgf57NiBTuDA69FCvOvXeAWxMw5FF5syaxneZXWCQ1I 1k4sLl+gowqLRGNubqVf6YuLmSaYArLBn70AH/xGCuBlhNkm1zgzLMwhQEL1r49Lvf54 TR2hG/7DDrrbbkbI7kDdxpDZ83ZnPQsgmrqGP6+qzhp8bs5lz7SGBLyYrr0nbGPm9Wtp o7pEgFGYj1SxiiRWD9e6e3AH4y/oux/S6JOJd8JkyqUhRpnrTswinSfSWoPfZePbXs96 tjcQ== X-Gm-Message-State: AOJu0YwBEmo5YrkwonQM6jNYBUifMU1TFvZEhruHWOtEdAr9RyadtQgZ cwcDQ9rKPuZJssPcBVW/kR2QqQwDPgM+tAqUAIdBqUnIUs/g71TWrV/I55G/4TKAb2Fc0Ja4YD7 W X-Received: by 2002:adf:f84c:0:b0:33b:87fb:7106 with SMTP id d12-20020adff84c000000b0033b87fb7106mr3637882wrq.55.1707839543457; Tue, 13 Feb 2024 07:52:23 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWnaSTh5pd2/gZQHNTqQL/MOMe5XV8x67kfuVtsDxZkhKSMw/YkqmWW6rboCuiZ7dnlXqAhvVC9zeIFrQK8Lnh/T94oembmr1OxLwVtvAdOgJz4ZKC+fcJQ646eoAYshHbuvpQ0PNe/i3FRTVbMqSp8WQ== Received: from m1x-phil.lan ([176.176.128.243]) by smtp.gmail.com with ESMTPSA id bu13-20020a056000078d00b0033b6d5a1244sm9873617wrb.12.2024.02.13.07.52.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 13 Feb 2024 07:52:23 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , Gustavo Romero , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 1/4] hw/arm/stellaris: Convert ADC controller to Resettable interface Date: Tue, 13 Feb 2024 16:52:11 +0100 Message-ID: <20240213155214.13619-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240213155214.13619-1-philmd@linaro.org> References: <20240213155214.13619-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.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=unavailable 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 Signed-off-by: Philippe Mathieu-Daudé Reviewed-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 34c5a86ac2..4fa857970b 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; }