Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp3029802lqt; Tue, 23 Apr 2024 08:32:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWAS0LnKqSH0HNYUqPIce8mBHGaLajBKV2jn2a2EYZwzjqYayCV92PR5gW2B3HWP5dbaxdoPW5Ye2j7192QuhRSvo8ph80uHfL+blFEUg== X-Google-Smtp-Source: AGHT+IFTHedwjxe2X1kV4Mq9RHG2YjN8NU6XfYic0OjRjI4GcddBpzelvgFLuiJnzC6dJnY00Hru X-Received: by 2002:a50:d703:0:b0:56f:e4a2:1640 with SMTP id t3-20020a50d703000000b0056fe4a21640mr9554582edi.21.1713886360362; Tue, 23 Apr 2024 08:32:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713886360; cv=pass; d=google.com; s=arc-20160816; b=yBm/D3IEOYG4sNGe0FTR2T7YbxpCsU9YUARKGwPuMa/cdZHPQss38ZqvUED8P6M2Pu p9a/dVA+pQk3KY+JlVroCIL7kSh2/JrT0qaOHj99CpAsBOL30D7eKggpRt/yoqIAUgdP aPRI8N81Y9wGy0XgI+LXOmO1HxdBbrVYeWkc8gqYwiTWfW7lVU5h46DSw9Ne/OvWQHTo 11WhyWs+Ovz6LWt2rCyCUdvoHfRnSu+aR3S5jR4kx6APGXH/N5jy5vLpncWZVOrLA8xL iQJ5Y+xaJceRStnlKyxMR/4evxtLJdEPZk/cVg4B6GZW33ifUQbu4jGROMHAxZMLLvdV e4Dg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:message-id:in-reply-to:date:references:subject:cc:to :from:dkim-signature; bh=Eeb4BX6QpLYU/h9LYc3wF8FaTktwVCdJ8zIJ4ekR02Q=; fh=G/r5esoIKMLYbsgvWq+HLmQQX1K9FV06Qm1ljBUn8VI=; b=e5Dh+w3H02KjXFFEJDbPS23Y9UoZ22zHO3ttgx9LD5C1V3jSHuLM4xN58XYGvBX21F XM8d+5FewNReQCWDMuuZA1qNL8CqsstFmLb0A4Z5KWt4zW9qaT5Fz0K1xSSYEjz9cLK9 GxSsHNc3rh7oDGKaXvT8ogTo1VRqNbF9M6YcVpeiN7ySDQjYV73mevEl33DkExQesK41 bS9yyV9nVAU87CjgxOcDOtxrkgERuHXPw1DK9CiYfQ2rQtlXQU4FEUnoWNRWpjiTLK0n PPJXpsM2KN0CEwN7ooLXWfljdGbWH3sCSSlUOkqMHLz9IqiZgLycwL/WGd05k4t+U2fV 8RAw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=E9Suwh23; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-6732-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6732-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. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id v4-20020aa7d644000000b0056e5c5c072fsi7530546edr.598.2024.04.23.08.32.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 08:32:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-6732-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=E9Suwh23; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-6732-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6732-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 4324C1F25BB6 for ; Tue, 23 Apr 2024 15:32:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8B46113C66C; Tue, 23 Apr 2024 15:32:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="E9Suwh23" X-Original-To: linux-wireless@vger.kernel.org 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 613E113C3E3; Tue, 23 Apr 2024 15:32:13 +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=1713886333; cv=none; b=pmlK2RARl5z6ke4R5lJgxqhflXxqQAtC0wg3LraaSRi6Thwa4iJnaVM5DoTDq3fr3WS4yYNsbkgDQHCz7I8ZjqYj7gPHl66k2qNLrInaiH9DDuQW6APsk2mfWKp78lDZVaGiQxtHUbHZzJ/h2rpJrIMidX81i1LcIcg2ISgK6Fc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713886333; c=relaxed/simple; bh=loKLUZOtD2Ahu5u6ZjVLLzhH7+gsOeQjN/iG5Ye4+LQ=; h=From:To:Cc:Subject:References:Date:In-Reply-To:Message-ID: MIME-Version:Content-Type; b=tiFgH5VXmXIt83++ohvpAOwneJDDCe60vgamg5vVNoOsS2vR7Y52a28sdj4dP14SLQJTgL+ePx0MnTUDZp5bmDBQZ27I2gJ3CyAWYeLDrGguI6uhp3XWJIa2Hy3pBIXWkTT5ZVFeXk9gHYVywjJSs8oBmRnvx/VUQg0lves3q6Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=E9Suwh23; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A5777C116B1; Tue, 23 Apr 2024 15:32:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713886333; bh=loKLUZOtD2Ahu5u6ZjVLLzhH7+gsOeQjN/iG5Ye4+LQ=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=E9Suwh23sx3IIB9Z4pNt8T3srnBCr1SXJeKfITWC9nJdUUAEgGeoLHY3vPzwf2l7J PbIlygKMPxrjsWiugzGcnIo0YwCqESO5UXHg+SnqMmg+pDrQr1Au3eX8/3UUtcLqcJ 5huwrjYTxZKD1fA5MJcG84xh0LbhcElv9IlkKd/Pj8D0JYzgVH1GDuMBhLSuQgHl3p F8fZN+wiUbzWSfqmznAM3NtpvdsYkMYouebc9tkT5n3TDxcA+FTCXZg75hWLn1wJ7/ hX84vsv3KTvjBXSqQfU+Jz3YapjUAHCDeUMyRR/AngQBui1KUCyVEJU9ox8Isar3jg S1aB3BjHhTtVw== From: Kalle Valo To: Linus Walleij Cc: Andy Shevchenko , Arnd Bergmann , Alban Bedel , Bartosz Golaszewski , Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= , linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, linux-gpio@vger.kernel.org Subject: Re: [PATCH v2] wifi: ath9k: Obtain system GPIOS from descriptors References: <20240423-descriptors-wireless-v2-1-6d1d03b30bfa@linaro.org> Date: Tue, 23 Apr 2024 18:32:08 +0300 In-Reply-To: <20240423-descriptors-wireless-v2-1-6d1d03b30bfa@linaro.org> (Linus Walleij's message of "Tue, 23 Apr 2024 14:12:33 +0200") Message-ID: <87v848t7rb.fsf@kernel.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain 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. > > Register all 32 GPIOs at index 0..31 directly in the ATH79K > GPIO driver and associate with WIFI if and only if we are probing > ATH79K wifi from the AHB bus (used for SoCs). > > Signed-off-by: Linus Walleij > --- > Changes in v2: > - Define all the descriptors directly in the ATH79K > GPIO driver in case the driver want to request them directly. > - Link to v1: https://lore.kernel.org/r/20240131-descriptors-wireless-v1-0-e1c7c5d68746@linaro.org Linus, via which tree should this go? -- https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches