Received: by 2002:a19:5205:0:0:0:0:0 with SMTP id m5csp1613905lfb; Fri, 3 Sep 2021 12:54:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMhZ7yifMcegDbsKNQiTZI3sEuD1KkCI7r3wvRTo7P+iTEpILVzr9S3WXvu685cEA/ebKK X-Received: by 2002:a92:4a10:: with SMTP id m16mr437747ilf.233.1630698863945; Fri, 03 Sep 2021 12:54:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630698863; cv=none; d=google.com; s=arc-20160816; b=dCSu7ZkNaXNcia+eIxeZTkOl8yr7ha6RViGRs4EJvk6MqtMjokItTYUUco4gSV2I0M 2h5GUvAzuDgA24blFjadIp6OAXdva3ys8Qf7RUA5UoNmnYYPthziIsCto/D/c7hcDzk0 Tj5TwOegPzUa+oPYfypYykKU3bLU91qGunMY4+3OhZqHRZ+9RbuY8cvemYmwQBouWKkN GKa08mWWOENCcpG2g+6UIEmYwrXVYG7f/zQo0Mogn9XHN2u0wqZremI7GKa0WQAnBKmS uOoUxnBFGjZCxd/ZVV/I67Bt49i75cowLwx0zBZ/yBfwZZ6GsZLzV47UNcsEXiLLyN40 //FQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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; bh=pbiTOvx6RsCP92KhzgMBHfxj9Tl0ke/ERVVqRBmQ+es=; b=CYOCrWYQHyvUjvAnccjKzwrT0nqteRAjSwIUHcHTcuKrOTcZ+M0VrhV1a+V8txmogO 6HA1mUe/Z2gAWt9U8984UD3Unx03D5HIZ/yQnpSKgjvY5VcbLK5mqj8qmj8NLHvoMoE+ LpskZXuMcsRrWTydYtzrinlJKpHMCP/nxeLEj7vTwqd5wsdAoONv1KF1geHRMNrUwcUe zIvuICDpgHdI4D3q5D9SArsPomKqJs4jt3SncHT5bZ8LZ3F8ELfBdGIpQenAwzvDHdfM PlFSnQ+LEBG36yQCZegKtI5+P/GHONvm+4hxsH+vMaZ1sFuRaSf7reVOuqKDPqBrqiQw Lr4A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id m22si300196jaa.92.2021.09.03.12.54.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Sep 2021 12:54:23 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org" Received: from localhost ([::1]:41960 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMFGZ-0004vR-Ah for alex.bennee@linaro.org; Fri, 03 Sep 2021 15:54:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44178) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMF44-0004Ay-S2; Fri, 03 Sep 2021 15:41:28 -0400 Received: from smtpout1.mo529.mail-out.ovh.net ([178.32.125.2]:35339) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMF3z-0002Hn-Eb; Fri, 03 Sep 2021 15:41:28 -0400 Received: from mxplan5.mail.ovh.net (unknown [10.108.20.7]) by mo529.mail-out.ovh.net (Postfix) with ESMTPS id D38B3BC4DEF4; Fri, 3 Sep 2021 21:41:13 +0200 (CEST) Received: from kaod.org (37.59.142.103) by DAG4EX1.mxp5.local (172.16.2.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.14; Fri, 3 Sep 2021 21:41:13 +0200 Authentication-Results: garm.ovh; auth=pass (GARM-103G005529ff3e3-5baf-4015-8e80-cd1cd6ced47f, 15E2C03324B5D6AD2543493448FEC157D625CB40) smtp.auth=clg@kaod.org X-OVh-ClientIp: 82.64.250.170 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: Peter Maydell Subject: [PULL 07/14] misc/pca9552: Fix LED status register indexing in pca955x_get_led() Date: Fri, 3 Sep 2021 21:41:01 +0200 Message-ID: <20210903194108.131403-8-clg@kaod.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210903194108.131403-1-clg@kaod.org> References: <20210903194108.131403-1-clg@kaod.org> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [37.59.142.103] X-ClientProxiedBy: DAG6EX2.mxp5.local (172.16.2.52) To DAG4EX1.mxp5.local (172.16.2.31) X-Ovh-Tracer-GUID: 75a1462f-297b-451b-9824-4b63a407bee8 X-Ovh-Tracer-Id: 8816077749439793958 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvtddruddvjedgudefkecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffufffkofgjfhggtgfgihesthekredtredtjeenucfhrhhomhepveorughrihgtucfnvgcuifhorghtvghruceotghlgheskhgrohgurdhorhhgqeenucggtffrrghtthgvrhhnpeehheefgeejiedtffefteejudevjeeufeeugfdtfeeuleeuteevleeihffhgfdtleenucfkpheptddrtddrtddrtddpfeejrdehledrudegvddruddtfeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphdqohhuthdphhgvlhhopehmgihplhgrnhehrdhmrghilhdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomheptghlgheskhgrohgurdhorhhgpdhrtghpthhtoheptghlgheskhgrohgurdhorhhg Received-SPF: pass client-ip=178.32.125.2; envelope-from=clg@kaod.org; helo=smtpout1.mo529.mail-out.ovh.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-arm@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , qemu-arm@nongnu.org, Joel Stanley , qemu-devel@nongnu.org Errors-To: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org Sender: "Qemu-arm" X-TUID: w198NWghGwgP From: Andrew Jeffery There was a bit of a thinko in the state calculation where every odd pin in was reported in e.g. "pwm0" mode rather than "off". This was the result of an incorrect bit shift for the 2-bit field representing each LED state. Fixes: a90d8f84674d ("misc/pca9552: Add qom set and get") Signed-off-by: Andrew Jeffery Reviewed-by: Cédric Le Goater Message-Id: <20210723043624.348158-1-andrew@aj.id.au> Signed-off-by: Cédric Le Goater --- hw/misc/pca9552.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/misc/pca9552.c b/hw/misc/pca9552.c index b7686e27d7fa..fff19e369a39 100644 --- a/hw/misc/pca9552.c +++ b/hw/misc/pca9552.c @@ -272,7 +272,7 @@ static void pca955x_get_led(Object *obj, Visitor *v, const char *name, * reading the INPUTx reg */ reg = PCA9552_LS0 + led / 4; - state = (pca955x_read(s, reg) >> (led % 8)) & 0x3; + state = (pca955x_read(s, reg) >> ((led % 4) * 2)) & 0x3; visit_type_str(v, name, (char **)&led_state[state], errp); } -- 2.31.1