From patchwork Thu Apr 25 10:39:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 792019 Delivered-To: patch@linaro.org Received: by 2002:a5d:4884:0:b0:346:15ad:a2a with SMTP id g4csp1313414wrq; Thu, 25 Apr 2024 03:46:40 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVe3ddoJrvFi3OWkeRD8HuGIrc7a7oynwWHbSnxYSlkk2N5FkjkMGPKjEG7QSmV+wrb4DZCuG4fMndXExKCtM3f X-Google-Smtp-Source: AGHT+IFHvrMwYcIb63DdomH05ZtLv6dk1xwRI4I+QS+Xl64NcYtyPIgbiubwDyT3RZlgkQ/ym2Sq X-Received: by 2002:a05:620a:170b:b0:790:98f4:62f6 with SMTP id az11-20020a05620a170b00b0079098f462f6mr2930832qkb.33.1714042000397; Thu, 25 Apr 2024 03:46:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714042000; cv=none; d=google.com; s=arc-20160816; b=DXLp+LyKl8d3tJEa1DAd2YS0Ks9kvqPcNR5y3LJFthrRL7KQAQjWXrJRoM50g4dk+B VJ76AUlcVKH1TI4jQZ0CRLcszN5Wsr709eEGV+i9pzhA4Qf2bIyTALmLkNnz4nzypcOx gptHXPqemvvBy1CkZgGmhORnY5aMtn/PheqrkS/LkDYOwRp06XgPff3TdySWJOq+UlJE 8zOZpkatRCS26bRadvljKQt2cin491sL/AqJ4JPyQmV/kh696EBGKUJ4OjLbHpjtqblz pbE6IJN3qiXBceUx+JN6tbUwdbpUz52RRI3lJ28uljXPz29RxSTTfSKM54fXNG5/yEbR 3iaQ== 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=VCI8k2+9/ICoqj/E8reGAYIBlYDi3yFxDCuQaY0oqJg=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=EoJbWhFGmhAY6TkkvZySer+x60I+4ul6S6Fa2jZBo5k0Otb2WyzMmh36ZIOPX5UeAt 42tlWF+up4K4lsGKBHrbEfTGboIEipoXJBcaN2/LesawlKfWH+iyJt2c5K1whBmRFkRA PBe+5GV7J9qPi9shTP3WUjtYUnosSbs/Uch+uuVO5Y7GV2Z4IVPPkKakR1Nh8d7rffdA cw8b83ecQNMGcn1fwZyyO3YTkwx9l0/06CUXZN9mzMW1YY2+sI1MbV8/6XcgQ5HQSGlG hHPoSv5NqSi5f0hl+hK6eckqR4gwm02a1WzotB7jtnas9SH3EZhATs0sh0fOrRwOR0Cp LDTA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oWtVe8kq; 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 pj41-20020a05620a1da900b0078f066ae1c8si16167647qkn.470.2024.04.25.03.46.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Apr 2024 03:46:40 -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=pass header.i=@linaro.org header.s=google header.b=oWtVe8kq; 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 1rzwWf-0002Oz-BP; Thu, 25 Apr 2024 06:40:25 -0400 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 1rzwWX-00023N-S4 for qemu-devel@nongnu.org; Thu, 25 Apr 2024 06:40:17 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rzwWV-0007E0-Pd for qemu-devel@nongnu.org; Thu, 25 Apr 2024 06:40:17 -0400 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-34b1e35155aso940123f8f.3 for ; Thu, 25 Apr 2024 03:40:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714041614; x=1714646414; 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=VCI8k2+9/ICoqj/E8reGAYIBlYDi3yFxDCuQaY0oqJg=; b=oWtVe8kqOKvx1mb1CUVGSPYmsElUzI+sUjuUbP/0XJ68Qknwhhyqo/zHCd2YV+YFeF AdCP03z7mUTvOxR91N10tJXQ8yDBtuZvcV2YqgU3ZWTkus1fYiF4ODrD6VysEhWK/xkc rjeNGjLL6QcZFmD/94HdBJegXwmuc7cdovd5RX8tzUNWN3UgS/8b2MVWugKkLxsIeOIC QlDm8gDrdLT/KEPjlrIS7oMFC1l1nVgHJsoCI8mMbH95+4H+P4NOs+9/5PEt8aLkFXFn PSxKirUfxGXfT/K/6xNuplWQittjrqCwuGfV58nQl8qrCFI85Bgw4YyvnbqO2NxqlmBN 4YQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714041614; x=1714646414; 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=VCI8k2+9/ICoqj/E8reGAYIBlYDi3yFxDCuQaY0oqJg=; b=wGG4KZSvSRXvkI2TEpxF597Ii4dbB8ElSem5bI7s2nIhL0dUv1KbRWFPtLASFEDQ5f l6coq6Mwkg/7r2CCeny70ZdwsvNuu6lsSo/17o1vpQsmis2qf+agQQwwMaOUIAyMebm4 AD4eAOhT60Ugtk7gYVx7bTtHOGpCTX3RWFaNUY2ndnRsnL0H3dkFwJxovRlEvsfUnILD CWq/TbpnIdW9efrY/DlzKDPscL7XHDSNMYArHBDb9qA7tES7+ALwIBv4ndKCYZlC2cqV ZikNLXdLdfko1th6tCumnzoycXXAnFl5p2rN+oKn/dWNUujFOmdJB6PnlhclZt5ItevF 804Q== X-Gm-Message-State: AOJu0Yx5RT0shAr0ySaWkslf6qggWrAzQyyZMgMTv49BhW/yyisgA4s6 +zgSX0X/6Iv7XQMCwQ28fhTwrzJvAP0xVFNU/hCfeL4rA1oY2eWhkI4kke2TA/PtlrXJE57748X O X-Received: by 2002:a5d:4746:0:b0:349:f83f:9ebf with SMTP id o6-20020a5d4746000000b00349f83f9ebfmr4958412wrs.5.1714041614439; Thu, 25 Apr 2024 03:40:14 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id h15-20020a056000000f00b003434c764f01sm19485768wrx.107.2024.04.25.03.40.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 03:40:14 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 28/37] allwinner-i2c, adm1272: Use device_cold_reset() for software-triggered reset Date: Thu, 25 Apr 2024 11:39:49 +0100 Message-Id: <20240425103958.3237225-29-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240425103958.3237225-1-peter.maydell@linaro.org> References: <20240425103958.3237225-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42e.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 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 Rather than directly calling the device's implementation of its 'hold' reset phase, call device_cold_reset(). This means we don't have to adjust this callsite when we add another argument to the function signature for the hold and exit reset methods. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Reviewed-by: Luc Michel Message-id: 20240412160809.1260625-3-peter.maydell@linaro.org --- hw/i2c/allwinner-i2c.c | 3 +-- hw/sensor/adm1272.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/i2c/allwinner-i2c.c b/hw/i2c/allwinner-i2c.c index 8abcc39a5c2..96c20c86372 100644 --- a/hw/i2c/allwinner-i2c.c +++ b/hw/i2c/allwinner-i2c.c @@ -385,8 +385,7 @@ static void allwinner_i2c_write(void *opaque, hwaddr offset, break; case TWI_SRST_REG: if (((value & TWI_SRST_MASK) == 0) && (s->srst & TWI_SRST_MASK)) { - /* Perform reset */ - allwinner_i2c_reset_hold(OBJECT(s)); + device_cold_reset(DEVICE(s)); } s->srst = value & TWI_SRST_MASK; break; diff --git a/hw/sensor/adm1272.c b/hw/sensor/adm1272.c index 1f7c8abb838..a19557ec9ea 100644 --- a/hw/sensor/adm1272.c +++ b/hw/sensor/adm1272.c @@ -386,7 +386,7 @@ static int adm1272_write_data(PMBusDevice *pmdev, const uint8_t *buf, break; case ADM1272_MFR_POWER_CYCLE: - adm1272_exit_reset((Object *)s); + device_cold_reset(DEVICE(s)); break; case ADM1272_HYSTERESIS_LOW: