Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2592731lqp; Mon, 25 Mar 2024 03:54:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWX4maaMQp5O55yFxUf6JJ9POpHzkBCN1TybhhXqvdHONiYH6MjeviYbaBg2vO6EhWqP6n6JibnNcj669Cno1ztf2T6It3IHu/SQ5cHHg== X-Google-Smtp-Source: AGHT+IEngl1OCIylPme08wGej5maX/WgLCQaA5R0xUF7U/8cvS+w8x6zYklIAg5x13dVxkpAcYnb X-Received: by 2002:a17:906:2846:b0:a46:f8d8:77a9 with SMTP id s6-20020a170906284600b00a46f8d877a9mr4224302ejc.43.1711364083196; Mon, 25 Mar 2024 03:54:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711364083; cv=pass; d=google.com; s=arc-20160816; b=jmaADt30fS0LwDCcCiJ77JlcHB/HuYOBc/Qq68HtiKfbqY1Tg0sqvh+TXkH/nLGRsm 55cE5+hszIrEl8hRnKr87/72dlZSBejMez0sPkEVrug+Yji2YP++cuw5iIEMupDIffN9 tFpbT1RFKqiFfD4bUASnU5U3o8tfsrvTc/ES1f67+h3NH/8ZlVeOBnTUoZHuWRWwkpUZ +3yne2JJC9hQWKTSBE0zgFPgPlb/TT4NR8S9UE/5TKKrPEYZPlrXWXB2OcVV/G2za/WT OGE2NBYR1t8XbHRf3iHhPUJeR9ztthTpagD47RqVxAHod/ZUC91knfsPWjt252sfGaje 827A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=rGjll7ntvOyzZZDB58zbZvjK9L2jjBQwAsKT9FRfZ2A=; fh=euGTfaJ4k6G1wN3oSPdxyy5D1Om6vwc+TNuK+fbT0xU=; b=OQQeyk8ndmPxqDFLcTDuM/ldW2cyUTIWn+yLfHMYd85/SwkVpPMIoOOWAS1WDZ9SBY dDWxGqRzL0Qf0RCZdw6zf9uEnYF2kpnNhjuB52NH/n2kveUwLn/dw4EDNbCbRm82ewzX gYjscLdc+MyD7Zr9pr03Q7H/Z8slCgmYzMtFEScswxNd1GivXQJmHDXHLhwqkzV20jsJ nWYKi1fhZRAP0ku/HEj4EVB3Sa06+//IWabR1UJujwPtdjdtCCqwUV+84NVICfnqum1N CG8tOvdirUObBxHvrPA9MFKmheUK5y1DNakrkJs7BUlkyzxnE1EuxDYKiBDuyvODHL+9 x0jA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="ZadyfjM/"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115427-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115427-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id gt18-20020a170906f21200b00a487200f648si1034051ejb.591.2024.03.25.03.54.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 03:54:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-115427-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="ZadyfjM/"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115427-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115427-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id D22621F35A6D for ; Mon, 25 Mar 2024 10:54:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1F3BA20D5C5; Mon, 25 Mar 2024 02:37:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZadyfjM/" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 306B41D6850; Sun, 24 Mar 2024 22:51:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320719; cv=none; b=rykb2vB3WzbWuKBPfhxa+AX+YXAB+dV5DuedUHR25itT3TQMpvAYvaWy85cgUDeDCvkCRQcpY7fPJ80zTeUzUMnJX2+Uj91ZiCfVjZPzPX+3FZWN17QoU0XUKk3vRfcLeW3v2s7C7nEK83rMEtgaq3KUCE7LwcjxsYAjY8eGNGw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320719; c=relaxed/simple; bh=IIAH9R+wJulgFrXMraygEhGyRL+cuXpt2/Ip4olD4X8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ilPU06a030cS6i5byxIWwBPaR1wJMcGvfR9vAHoG8/OPbf31619e/COsX5Mm0gb6UfMdryTTrNr6Hz/9zdruu+y001cpErBdx1PaLmDi0yi54ypVUEITvZ9pIPB+ny3wOKA4A+IsZvzTVHRVRaol8OicmWH9NFBGL8CstURiGnA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ZadyfjM/; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id EA9E9C43394; Sun, 24 Mar 2024 22:51:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711320717; bh=IIAH9R+wJulgFrXMraygEhGyRL+cuXpt2/Ip4olD4X8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZadyfjM/b0fd4VhwgEW9IfUZCkhOnu1RTYdjYYdSp7GtLezDhajyeHYPEuquyTvCS m9PCwYX6hq/w9i5P+ofUW76EhE5lsrQ3aAs9RK7spfOTK3zKwDIppMxJ4rFNlZbxe7 WsOc3o49VK956s06LmgvSI1kwmRMBW0ssOTeWO7egpceVfpEPDbLlfs67V7HiIvEmO SMZZNY+1xSAUAWSTERXABLpH9Uwe4O4MCRBCm651S3yaPHAHTmOMaKmKkhmfy/rM9u cPyCxRQ6ID3Nqg4nbgwp80CAzM4bHGlpHMbTzTxc0GAH+Vr+BYO1/EQkwdk89TC3qF dm0qTAjXXGmDQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: =?UTF-8?q?Alexis=20Lothor=C3=A9?= , Conor Dooley , Ajay Singh , Kalle Valo , Sasha Levin Subject: [PATCH 6.7 280/713] wifi: wilc1000: revert reset line logic flip Date: Sun, 24 Mar 2024 18:40:06 -0400 Message-ID: <20240324224720.1345309-281-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324224720.1345309-1-sashal@kernel.org> References: <20240324224720.1345309-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Alexis Lothoré [ Upstream commit f3ec643947634bed41b97bd56b248f7c78498eab ] This reverts commit fcf690b0b47494df51d214db5c5a714a400b0257. When using a wilc1000 chip over a spi bus, users can optionally define a reset gpio and a chip enable gpio. The reset line of wilc1000 is active low, so to hold the chip in reset, a low (physical) value must be applied. The corresponding device tree binding documentation was introduced by commit f31ee3c0a555 ("wilc1000: Document enable-gpios and reset-gpios properties") and correctly indicates that the reset line is an active-low signal. The corresponding driver part, brought by commit ec031ac4792c ("wilc1000: Add reset/enable GPIO support to SPI driver") was applying the correct logic. But commit fcf690b0b474 ("wifi: wilc1000: use correct sequence of RESET for chip Power-UP/Down") eventually flipped this logic and started misusing the gpiod APIs, applying an inverted logic when powering up/down the chip (for example, setting the reset line to a logic "1" during power up, which in fact asserts the reset line when device tree describes the reset line as GPIO_ACTIVE_LOW). As a consequence, any platform currently using the driver in SPI mode must use a faulty reset line description in device tree, or else chip will be maintained in reset and will not even allow to bring up the chip. Fix reset line usage by inverting back the gpiod APIs usage, setting the reset line to the logic value "0" when powering the chip, and the logic value "1" when powering off the chip. Fixes: fcf690b0b474 ("wifi: wilc1000: use correct sequence of RESET for chip Power-UP/Down") Signed-off-by: Alexis Lothoré Acked-by: Conor Dooley Acked-by: Ajay Singh Signed-off-by: Kalle Valo Link: https://msgid.link/20240217-wilc_1000_reset_line-v2-1-b216f433d7d5@bootlin.com Signed-off-by: Sasha Levin --- drivers/net/wireless/microchip/wilc1000/spi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/microchip/wilc1000/spi.c b/drivers/net/wireless/microchip/wilc1000/spi.c index 77b4cdff73c37..4cf8586ed55ae 100644 --- a/drivers/net/wireless/microchip/wilc1000/spi.c +++ b/drivers/net/wireless/microchip/wilc1000/spi.c @@ -192,11 +192,11 @@ static void wilc_wlan_power(struct wilc *wilc, bool on) /* assert ENABLE: */ gpiod_set_value(gpios->enable, 1); mdelay(5); - /* assert RESET: */ - gpiod_set_value(gpios->reset, 1); - } else { /* deassert RESET: */ gpiod_set_value(gpios->reset, 0); + } else { + /* assert RESET: */ + gpiod_set_value(gpios->reset, 1); /* deassert ENABLE: */ gpiod_set_value(gpios->enable, 0); } -- 2.43.0