From patchwork Tue Jan 30 19:03:14 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: 768106 Delivered-To: patch@linaro.org Received: by 2002:adf:ee41:0:b0:33a:e5bd:fedd with SMTP id w1csp1525866wro; Tue, 30 Jan 2024 11:05:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IEAp1XyKA+h0GsU+sdjCVn4kmrLY7XRS/CNvmwhl7NEcurdQep72Af1Zy5cdr/yFgHn2Wzf X-Received: by 2002:ac8:4e54:0:b0:42a:59a3:c1ef with SMTP id e20-20020ac84e54000000b0042a59a3c1efmr2360486qtw.19.1706641509500; Tue, 30 Jan 2024 11:05:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706641509; cv=none; d=google.com; s=arc-20160816; b=IBWAP6GNG9ICKk3HFa6A47Gp6pCBvOc+W6kwXg6c0oYpwBjHhunagPZrJAAsKLsvta WY0Qlv++AJtgrHKO7mXrhGgBvNPh0JmjZ7ucWwcAhRBmgg1S6uB0fpqrDVgdoUpZ6Yfh CErJmTHBUd9uXTF8fML8dt3siYZ/g6hIrMPw9hEK+YJOzWnSL/lf+cC7NBnWjpjd4NFX zMv9fabdyk5PTsn/AGxY7L1s9FpegqYMhd1gqED2krpRxYuUlDklMjHQNpOCvE+bxS6y fTJq9q0QphV/9lT5pfsuXomzofL04Z4G9OaROpLDzWr2DsIpwsi4HBb7IL4ssQi6/VGe 26TA== 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=Uha9WaUXkaJpBldRkVdewGQYlJYY1NU670ANqpxdAMg=; fh=SR+8DozJdQxNforhpK7RQJlJqxcnmmBQq9YEbztxGAo=; b=S95N2GV5X6Zi2yGv+FFe1uXUZYTXWn2Ghreaia8zTBsCqyI9I7A6uo7/Fl2/FjOVbc iMAEiR/53au/e86TH9Wy7nX/CdCfoTvZZr3UQvMxfhKoh/DfWO6iH3bu3H9aX3aYYOB2 mpvSAOTRAW++r8DYcu6Q1KVP8hgYe5kB8eji6gY5DvNbszkKKaTywbpxxw8j0SMxqcNW sSGh2KRvCm5+P1FZ1rIDzxuuOFVOknK54OlJdf3dSBf7regGKrhDtOh8hoFpLIZwOerp LbWfI18HjZ+LKgQsN0t8GiwD93OKVb6eRzYijgL9arK5NhInXPV9WBzQYgFaF0Y73jbN yTRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MSSwV83e; 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 p15-20020a05622a13cf00b0042a86d14547si9744076qtk.691.2024.01.30.11.05.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 30 Jan 2024 11:05:09 -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=MSSwV83e; 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 1rUtOO-0000ws-M4; Tue, 30 Jan 2024 14:03: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 1rUtOM-0000w1-J0 for qemu-devel@nongnu.org; Tue, 30 Jan 2024 14:03:30 -0500 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rUtOK-0008UV-Gm for qemu-devel@nongnu.org; Tue, 30 Jan 2024 14:03:30 -0500 Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-55f0b2c79cdso3656404a12.3 for ; Tue, 30 Jan 2024 11:03:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706641406; x=1707246206; 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=Uha9WaUXkaJpBldRkVdewGQYlJYY1NU670ANqpxdAMg=; b=MSSwV83eNR9FGLpmJSssxUslPb6W8kIccTFl5XC672cIbn6RhLZOHKd2oN80hEXwkU nJJ2Ovd6rUPHIkWxzcaR64AFnh33WPKAOReWeyAbYQx51QEX5912SOZpqS71fhstQOKx SWlkqFm44H9nnjX4IarKtpio9aADYSYs2xKiZ6My2CAekgAsbs6osR6AoHboXTApTsQs 3eFvzHIP7COPqMHwuzYX67cavcFC/e5/cfvgr3ey5wxnPla3hpJiKqviK0MvWtIrhFRf +lcBdsh4oheTrDH3KPFsj3l+yNhvr+hEAt1Y0rkhI2jKud6Wdjf7tIJy6tiUnlctFu77 H5bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706641406; x=1707246206; 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=Uha9WaUXkaJpBldRkVdewGQYlJYY1NU670ANqpxdAMg=; b=wBkRVKEKrJ10AhTEojF0rKkIJSkFXSnOsyMJRED3OROPgU4/BGyaUS8ORy17YsFPcP 8pnUtVuHM/Kg4zUflFa7v3usk3OE5scScYzFrHYabeFS+oLS31EVMrfFgeok2RX6xGkx o8CXsBGXZnxwcZStFSysMD5pvb4nBMx3nH7oFoYfyaaqBgzERF+rEGxu6kQrnurNrx1F 6LY12kodLUxPSgpyJW6k1yiDKHRHMAMGLeOvWakGGidvr0oG2wmlumTXjQ0Vl7hGOpO8 IRUCFPQqxt/VHJF6jqkeEv3ucsXDSOuhkBhgz2TdRfM7WvuP8Lg5etgWfb9Ca26FyqYT a6xg== X-Gm-Message-State: AOJu0YxNeqI99ETrI53clkEH+arRsO/0wgYBwFU2OOD12b9XnCqQ7H/G FW0MvDv+AlcTMK9oH7wRVet7o5Ww1RTknLmz9WuIrYNd95c68TjzOFd2JMHlS29nsRin14vPA3z O X-Received: by 2002:a17:906:489:b0:a35:ad04:dcb7 with SMTP id f9-20020a170906048900b00a35ad04dcb7mr5066014eja.17.1706641406542; Tue, 30 Jan 2024 11:03:26 -0800 (PST) Received: from m1x-phil.lan ([176.187.218.134]) by smtp.gmail.com with ESMTPSA id rg9-20020a1709076b8900b00a35464aab52sm4190773ejc.96.2024.01.30.11.03.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 30 Jan 2024 11:03:26 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Manos Pitsidianakis , Markus Armbruster , Gustavo Romero , qemu-arm@nongnu.org, Peter Maydell , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH 1/4] hw/arm/stellaris: Convert ADC controller to Resettable interface Date: Tue, 30 Jan 2024 20:03:14 +0100 Message-ID: <20240130190317.25692-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240130190317.25692-1-philmd@linaro.org> References: <20240130190317.25692-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52d; envelope-from=philmd@linaro.org; helo=mail-ed1-x52d.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 d18b1144af..afbc83f1e6 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); } @@ -1397,7 +1397,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; }