Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2373250lqp; Sun, 24 Mar 2024 16:24:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXWJmxryglOO2Ba23sfy+WGCaYObEPJ1zQtGNocF80W0ul2iqpvSkIUS5LXJ+7LMKZ0sK/vE6z3Myp/OlBrmSeBRmKmk0setWwRVeoAiw== X-Google-Smtp-Source: AGHT+IH56jSNCErkvdCcZ9WlWS6Pi5KDhpluu8xXWQzJ+sQm8W/yFteqx2PCgGKP0eIuz2GZioyv X-Received: by 2002:a05:6214:410a:b0:691:1a11:312f with SMTP id kc10-20020a056214410a00b006911a11312fmr8620371qvb.22.1711322696961; Sun, 24 Mar 2024 16:24:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711322696; cv=pass; d=google.com; s=arc-20160816; b=xSvLAQvneb7adpPV0SQRn6Oot0Q6XqYF/Bx+kBBxE25umSOql5+qm3e0RCyekQJgea IOGHRfNO88zszDj6rPMkiAwlQmzB0u9NDhr5reET/mtI+ErdunGfZIaIYX56tCmo2zdl DlXhDAbj4WhjsoMoVGsroR/weY8+Q7Ci5zI5qRtVWqDtnCc8hAZJjdvJNAmFtpP3O/83 tJ193WNcmemb4IFBkBquchOnJp3LYjWU3KsRzDRYoSZ82Px8CsvbbsuPkRfU57kCiVzQ xIFr7Gkni+88pLpyXqvIZ8+ryqQmVb11xCElmJTuz2mWcs81YF9qbxGlFai3kihWZUqJ H8rw== 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=w7coW56TfZ6+O1Nb9eoEbzYn2Sv3lsBtJgDs2tYL4WI=; fh=euGTfaJ4k6G1wN3oSPdxyy5D1Om6vwc+TNuK+fbT0xU=; b=H5mKXpbYlOAxv1z/4ZYF5xsDi+GQRoLRFAmYDXzRrI2O6CDHfFOmcQqVWM4cTYP13m Pzru68A26AHJaBo4tXwmJIv6Z/LQP5d4KjKubVCymcl4Qo3xl88ZWCm0C3441S9HFepI AQV3+8PkwkreENyzf6kBDwGU4/a/Kiz4Ak3SmKGDZXfK1U3ZZFuN3abzsuC5dqcmh+t2 3GAZfLnksw/mxfljVIIKNPefJY/gSdVIrX4qsvzu7loR43cvmNfgLzdDp5Anutfj5+zS 0slDa3MzfbyKU7/L1b46kZgubxlaQ07cBUUn5tpkhZBGtqORbeZAgzQ6TnrwyHkL0bjK 3bqw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nnD09Lxq; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113117-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113117-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id ed14-20020ad44eae000000b0069685a3332fsi2450901qvb.463.2024.03.24.16.24.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 16:24:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113117-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nnD09Lxq; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113117-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113117-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 9E29A1C21B7F for ; Sun, 24 Mar 2024 23:24:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 26A9515B0E2; Sun, 24 Mar 2024 22:38:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="nnD09Lxq" 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 28BB015AACA; Sun, 24 Mar 2024 22:38:45 +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=1711319925; cv=none; b=Rv8qJDF0vpKepTV1NHMFkjqizE25LcxcgLB0oYQ/WD+0jsaKg6x+4gik7v0uIPgeDMXDOm7fomhWV5UK8KoSNbFTyQcUXGnZrV4VB9U3N0dC+SCE7E5C7Tmp7Ropc5C7HVD0UtH3O3OSKQutY3Xk3IVa6EyPvEEMeT/vk3nGW1o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711319925; c=relaxed/simple; bh=hbKIBNSWUPiHR4rMABXrgLXVEZf8rqQ5ZcXfkHHMod8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=DG0iE8bQxhVmnBx1muL7vFxCgQ575PpO7r2SVHm99S4R2Fem58+wW0ql+Yvxc1RI1ZMsJcxKxf3Izp/PsgT6NCMl1ooMYvSOZMLhEQ6IHVzZwfAxOWinFSwQIqUMdSxCfxJERCFaYSvUfKRePoe2LaUd3nGtD2WII10Ed+EqMKo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nnD09Lxq; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3318DC433F1; Sun, 24 Mar 2024 22:38:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711319925; bh=hbKIBNSWUPiHR4rMABXrgLXVEZf8rqQ5ZcXfkHHMod8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nnD09LxqSknO0ys30zh+0VeL/hf8tlMwPONH9qCgJqsGh4z4Z80fbN2oMdnzyl2EY jcYaV8uZ+OMiUT9SX86MJszbzlfcCpgPSlTkg2SGGD4NVOdYUmYlf9xBIryHjGo4UK 8HaJfu6c5bANI12rOTLvGdjEZdtyrSWzK2s34HOhZlH540sB7BPjYFo9LPmqZ2qxz+ ZO43+B2LXO0n132hPzVGG6Asd9Qzgt5P9T3IIXWK+bpGPoN+o/9eHDI+q+auMwefoC jGPqk6AdrB4bK+hd/EA7+FDsEW4TEju8+fZzdwV44pSrs/U2rNiGxPNuDWCq3gC9Uo TrBCW9arBLBOg== 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.8 230/715] wifi: wilc1000: revert reset line logic flip Date: Sun, 24 Mar 2024 18:26:49 -0400 Message-ID: <20240324223455.1342824-231-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-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 1d8b241ce43ca..6a82b6ca2769e 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