Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp85948rdb; Thu, 1 Feb 2024 02:57:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IELY29gmDIUT84zvA9BG5ulN6OW1XOb4q+54hFUORXvgAGZ/i0tazTwYWin1MqEi7poLFKg X-Received: by 2002:a05:620a:4553:b0:783:95bc:4efe with SMTP id u19-20020a05620a455300b0078395bc4efemr2356858qkp.36.1706785050555; Thu, 01 Feb 2024 02:57:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706785050; cv=pass; d=google.com; s=arc-20160816; b=Ji27ZfZ/wzzm6EZ0gix2Kf5y+nPHMzO8LYPW3sBysTnaKR5e1ieI6uxZvotP0lgxZq MfY7l93EDi0jYRZcvmiKitY11uqBa0txUtiyBABIhbmL8Pf5fO0M+GHwg5JJPRdYA5a+ K5D4nkkPdTcsW954uq3+ylIBTURXPdVPgzj/JSE9skf2nnav3bUcjQjBpDSgjXQBNVHq 3H8zyospYJCJf0qFnVW0ZJxx+LVbtk9/dR6lAvAgeJXCaPVSDj9dle5WACvTCDPOxuM8 53dhM+LhHhxOSXeUgTgZoJlllUG7QDL6D1oK3eJyR7hXQ7pWT2jly3oBI3YAiWQ6vKDJ IOAg== 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:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:from; bh=zdboCHuFeDc7soYCcRwFVQFzlEM/8RLziqnSKsaOInw=; fh=Hzsvg/+w1YiHeUOPsDnt1y8vhMGb8xX6V42UEP4t1GE=; b=TVdOOKetQte0v4yT8pYgj6cDM7JkvN2I/Kcxa6dlDTrKefWejWA/uReCv4rcvq2nWU o8/a+hJdMgoim/5nepTiWpOdLxDbePmUmzafo5w3HPlv3c4nQQaWQY7o2hSPUJGHAa4W XydA2oOkmHdT/ks239brAgOXqgd7qPnXCn1RT6O1B1/XT6Ijf1RYfMiZeoE8debCFOW/ c4B9W9FtTAllOne97HlvUx7sje6nzjtbRPVvzZFYafrCerErVGe8fVT1fevU2KVgdver Zarq1wilSMvD9bXXa0mHxBVcNTGRmRIgoE7iZxDC6lRpm786R6nDDwCVkkrnh2y4V/ZI SeCg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@toke.dk header.s=20161023 header.b=eShVOcAM; arc=pass (i=1 spf=pass spfdomain=toke.dk dkim=pass dkdomain=toke.dk dmarc=pass fromdomain=toke.dk); spf=pass (google.com: domain of linux-wireless+bounces-2938-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-2938-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=toke.dk X-Forwarded-Encrypted: i=1; AJvYcCXO0pSwD0eW3YjZjWimihehvIDwzuWYoPBWrBZSdSfwD7gDSmvXvo2qs7YeyHMF8Y8o1ymVDV+Z2P2yrrpl2ULjzRNNrTejKrXEDWfQrw== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 25-20020a05620a04d900b0078542ba9d96si1504928qks.334.2024.02.01.02.57.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 02:57:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-2938-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=@toke.dk header.s=20161023 header.b=eShVOcAM; arc=pass (i=1 spf=pass spfdomain=toke.dk dkim=pass dkdomain=toke.dk dmarc=pass fromdomain=toke.dk); spf=pass (google.com: domain of linux-wireless+bounces-2938-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-2938-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=toke.dk 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 539E31C232CA for ; Thu, 1 Feb 2024 10:57:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 72020158D9A; Thu, 1 Feb 2024 10:57:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=toke.dk header.i=@toke.dk header.b="eShVOcAM" X-Original-To: linux-wireless@vger.kernel.org Received: from mail.toke.dk (mail.toke.dk [45.145.95.4]) (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 5965A15B973; Thu, 1 Feb 2024 10:57:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.145.95.4 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706785045; cv=none; b=abr3rwNokHf8Xaf/+gDHLhAOgXuHAHE1lbiJbaKhmS+yHvRJmSecf6G5XVIEQzVaDlTl6Zlmyszq9tr1S/b6JZoWQWZdcP1y6rFA4v6E0RzF/pYmM5YqRCZiQnoO9bIWl+6pRNvQ2G8Hy7J1XDjBQ1MS8gWiN5CAfD5XAfh91qM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706785045; c=relaxed/simple; bh=TobCazIkkY/DGv6KVites0C1Weh4sD9kwXNvynrufss=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=eIE1tD3khz7n8+YRyDw79zundERn0eMY6vLYbrmohcSxYB9HjmwT6aWDsnCovJrHxhO7ps6dKFMPyph6PkGoNZzFdzbUa1tOq7qrxYI9zNq+69Jou7mMBDKB9iR+ccLc7QwXSFX2BtAfiEf70/glCnRbpnfV8E+9MiRrGzLsra0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=toke.dk; spf=pass smtp.mailfrom=toke.dk; dkim=pass (2048-bit key) header.d=toke.dk header.i=@toke.dk header.b=eShVOcAM; arc=none smtp.client-ip=45.145.95.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=toke.dk Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=toke.dk From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=toke.dk; s=20161023; t=1706785029; bh=TobCazIkkY/DGv6KVites0C1Weh4sD9kwXNvynrufss=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=eShVOcAMm+cB+X0RWgH5IO3/4QM6fJlOkepkyv9YFeLf9Ubga5dDB0QYXpoKJIYWD zTXLuhWsmkSJv1OJd+fZUH9O3184GgJ97cZCPTDO4GEtQyOLZ61hjV9KNHlfkdGZrt sqy496ZNlUE9OaYrNn126NvH86DetjmwS0NO+BjMN2wbhFyZfHzKkAn6fQeCDmTuiN ucFXyauK26qHskcEJgfY/rAbaeBHTQsyEh5x0o+sWJyypkOvrdeqV4J1RmzNGWV1MG U6rIdftsYYAsUSiCaIvDkMGxKiWXT/l4L/L9bLTgHSqESniazOnDVhW/oJWjuogy1C D35hkn76NvQyA== To: Linus Walleij , Kalle Valo , Arend van Spriel , Franky Lin , Hante Meuleman , Andy Shevchenko , Arnd Bergmann , Lee Jones , Brian Norris , Srinivasan Raju Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, Linus Walleij Subject: Re: [PATCH 1/6] wifi: ath9k: Obtain system GPIOS from descriptors In-Reply-To: <20240131-descriptors-wireless-v1-1-e1c7c5d68746@linaro.org> References: <20240131-descriptors-wireless-v1-0-e1c7c5d68746@linaro.org> <20240131-descriptors-wireless-v1-1-e1c7c5d68746@linaro.org> Date: Thu, 01 Feb 2024 11:57:09 +0100 X-Clacks-Overhead: GNU Terry Pratchett Message-ID: <874jeszc3e.fsf@toke.dk> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Linus Walleij writes: > The ath9k has an odd use of system-wide GPIOs: if the chip > does not have internal GPIO capability, it will try to obtain a > GPIO line from the system GPIO controller: > > if (BIT(gpio) & ah->caps.gpio_mask) > ath9k_hw_gpio_cfg_wmac(...); > else if (AR_SREV_SOC(ah)) > ath9k_hw_gpio_cfg_soc(ah, gpio, out, label); > > Where ath9k_hw_gpio_cfg_soc() will attempt to issue > gpio_request_one() passing the local GPIO number of the controller > (0..31) to gpio_request_one(). > > This is somewhat peculiar and possibly even dangerous: there is > nowadays no guarantee of the numbering of these system-wide > GPIOs, and assuming that GPIO 0..31 as used by ath9k would > correspond to GPIOs 0..31 on the system as a whole seems a bit > wild. > > My best guess is that everyone actually using this driver has > support for the local (custom) GPIO API and the bit in > h->caps.gpio_mask is always set for any GPIO the driver may > try to obtain, so this facility to use system-wide GPIOs is > actually unused and could be deleted. > > Anyway: I cannot know if this is really the case, so implement > a fallback handling using GPIO descriptors obtained from the > ah->dev device indexed 0..31. These can for example be passed > in the device tree, ACPI or through board files. I doubt that > anyone will use them, but this makes it possible to obtain a > system-wide GPIO for any of the 0..31 GPIOs potentially > requested by the driver. > > Signed-off-by: Linus Walleij This seems reasonable, thanks! Acked-by: Toke H=C3=B8iland-J=C3=B8rgensen