Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A5EB2C05027 for ; Tue, 14 Mar 2023 19:57:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229840AbjCNT5V (ORCPT ); Tue, 14 Mar 2023 15:57:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229436AbjCNT5U (ORCPT ); Tue, 14 Mar 2023 15:57:20 -0400 Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA11C497C1 for ; Tue, 14 Mar 2023 12:57:18 -0700 (PDT) Received: by mail-ed1-x532.google.com with SMTP id o12so66764357edb.9 for ; Tue, 14 Mar 2023 12:57:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678823837; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=aORkeEWyO4el94Bv6We6yy/BW+bw5NjQvuZusdWHXhw=; b=gr18aPzM5zECvOkClsBTCdIMXKpwux+V1a6gMKvaYD7cxf8xfCzZFnwTplfRbntBe+ pBvDyOSmdKO8kWrmxOskVrIOGRk9Pex1nzNb0goa0jkia5LwixA+rneqPQM3iQfp0C51 s2EefWp9yN8cUY3QUv4nuKg6X8aM+WgZwDvIhcbzshhyPV4dqqSz9fXz9w6t6M+8lHf1 I+biZuTX+mYJBpYz4OZ8zOAFr99syPdi6A+eboC3FsZBfm+fU3psVzJD0aePAq5n4LZU CQ3lVGIYOMc+LaWysoxc+lTzEw5+z/DKx3Gw4IqFNa9O9x/b53pkMtJIPBifAyfHBcP7 vw8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678823837; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=aORkeEWyO4el94Bv6We6yy/BW+bw5NjQvuZusdWHXhw=; b=d8FwDhJPs78987K+I1QqmbA4P6+d6dr+HO55CeWrCIGJWri7sIoIWRGRhzcjtKUqu5 y03r1toKXXfZjhClwsTXtcQfTvR9oM+sg7NWbZHoYg3ZrH9+cIHClIZUF88+RMg60DrA 6w01jdHOezlBTBHRT+ZTAhdXi/lJJtlMSbUvl1nY+Np632EvcVKuOVxE3MGuvknVmfH1 dh132YMbAEglXLcSt+4DiNyqwsT+X52w8AXjJPsX3ryBhPn6Ywwf58NXX3sdPvsSljw7 DynkiQjv8cQQGBnZxVh4Az3/F9BHT5yP1bQFBJx9SPoDJS4TXtNCn0oI58gYvCWjJiJo 68Qw== X-Gm-Message-State: AO0yUKX4RbwwaNZpqev4FencQNU7/RgE5bagJbdJDxE1aVN46ndBWbUN 2InAX+E2x3oo3LG8J2PB2aZPjw== X-Google-Smtp-Source: AK7set/XAW5ciHQcJno6hH/Z88UfN6YapdX8vcLUOlfdJ3yyprHp0j3qR3GzULGcqsy5r/vRByYzFQ== X-Received: by 2002:a17:906:a0e:b0:91e:acf4:b009 with SMTP id w14-20020a1709060a0e00b0091eacf4b009mr4068970ejf.22.1678823837351; Tue, 14 Mar 2023 12:57:17 -0700 (PDT) Received: from ?IPV6:2a02:810d:15c0:828:642b:87c2:1efc:c8af? ([2a02:810d:15c0:828:642b:87c2:1efc:c8af]) by smtp.gmail.com with ESMTPSA id c37-20020a509fa8000000b004fb17f10326sm1514478edf.10.2023.03.14.12.57.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 Mar 2023 12:57:16 -0700 (PDT) Message-ID: <4ac809d2-3924-3839-479f-0b4be9f18a1f@linaro.org> Date: Tue, 14 Mar 2023 20:57:15 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH] p54spi: convert to devicetree Content-Language: en-US To: Arnd Bergmann , Christian Lamparter , Kalle Valo Cc: Linus Walleij , Bartosz Golaszewski , linux-gpio@vger.kernel.org, linux-omap@vger.kernel.org, Tony Lindgren , Aaro Koskinen , Felipe Balbi , Arnd Bergmann , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , =?UTF-8?Q?Beno=c3=aet_Cousson?= , Russell King , Dmitry Torokhov , Johannes Berg , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20230314163201.955689-1-arnd@kernel.org> From: Krzysztof Kozlowski In-Reply-To: <20230314163201.955689-1-arnd@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On 14/03/2023 17:30, Arnd Bergmann wrote: > From: Arnd Bergmann > > The Prism54 SPI driver hardcodes GPIO numbers and expects users to > pass them as module parameters, apparently a relic from its life as a > staging driver. This works because there is only one user, the Nokia > N8x0 tablet. > > Convert this to the gpio descriptor interface and move the gpio > line information into devicetree to improve this and simplify the > code at the same time. > > Signed-off-by: Arnd Bergmann > --- > As I don't have an N8x0, this is completely untested. > > I listed the driver authors (Johannes and Christian) as the maintainers > of the binding document, but I don't know if they actually have this > hardware. It might be better to list someone who is actually using it. > > Among the various chip identifications, I wasn't sure which one to > use for the compatible string and the name of the binding document. > I picked st,stlc4560 as that was cited as the version in the N800 > on multiple websites. > --- > .../bindings/net/wireless/st,stlc45xx.yaml | 64 +++++++++++++++++ Please split bindings to separate patch. > MAINTAINERS | 1 + > arch/arm/boot/dts/omap2.dtsi | 4 ++ > arch/arm/boot/dts/omap2420-n8x0-common.dtsi | 12 ++++ DTS as well... > arch/arm/mach-omap2/board-n8x0.c | 18 ----- > drivers/net/wireless/intersil/p54/p54spi.c | 69 +++++++------------ > drivers/net/wireless/intersil/p54/p54spi.h | 3 + > 7 files changed, 109 insertions(+), 62 deletions(-) > create mode 100644 Documentation/devicetree/bindings/net/wireless/st,stlc45xx.yaml > > diff --git a/Documentation/devicetree/bindings/net/wireless/st,stlc45xx.yaml b/Documentation/devicetree/bindings/net/wireless/st,stlc45xx.yaml > new file mode 100644 > index 000000000000..45bc4fab409a > --- /dev/null > +++ b/Documentation/devicetree/bindings/net/wireless/st,stlc45xx.yaml > @@ -0,0 +1,64 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/net/wireless/st,stlc45xx.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: ST/Intersil/Conexant stlc45xx/p54spi/cx3110x SPI wireless device > + > +maintainers: > + - Johannes Berg > + - Christian Lamparter > + > +description: | You can drop '|'. > + The SPI variant of the Intersil Prism54 wireless device was sold > + under a variety of names, including ST Microelectronics STLC5460 > + and Conexant CX3110x. > + > +allOf: > + - $ref: ieee80211.yaml# > + - $ref: /schemas/spi/spi-peripheral-props.yaml# > + > +properties: > + compatible: > + enum: > + - st,stlc4550 > + - st,stlc4560 > + - isil,p54spi > + - cnxt,3110x Order above entries by name. > + > + reg: > + maxItems: 1 > + > + interrupts: > + maxItems: 1 > + > + power-gpios: If this is GPIO driving some power pin, then it should be "powerdown-gpios" (like in /bindings/gpio/gpio-consumer-common.yaml) > + maxItems: 1 > + > +required: > + - compatible > + - reg > + - interrupts > + > +unevaluatedProperties: false > + > +examples: > + - | > + gpio { Align example with above |, so four spaces. Or better indent entire example with four spaces. > + gpio-controller; > + #gpio-cells = <1>; > + #interupt-cells = <1>; > + }; Drop "gpio" node. It's not needed for the example. > + spi { > + #address-cells = <1>; > + #size-cells = <0>; > + > + wifi@0 { > + reg = <0>; > + compatible = "st,stlc4560"; compatible before reg. > + spi-max-frequency = <48000000>; > + interrupts-extended = <&gpio 23>; > + power-gpios = <&gpio 1>; > + }; > + }; Best regards, Krzysztof