lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 14 Mar 2023 20:57:15 +0100
From:   Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
To:     Arnd Bergmann <arnd@...nel.org>,
        Christian Lamparter <chunkeey@...glemail.com>,
        Kalle Valo <kvalo@...nel.org>
Cc:     Linus Walleij <linus.walleij@...aro.org>,
        Bartosz Golaszewski <brgl@...ev.pl>,
        linux-gpio@...r.kernel.org, linux-omap@...r.kernel.org,
        Tony Lindgren <tony@...mide.com>,
        Aaro Koskinen <aaro.koskinen@....fi>,
        Felipe Balbi <balbi@...nel.org>, Arnd Bergmann <arnd@...db.de>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        BenoƮt Cousson <bcousson@...libre.com>,
        Russell King <linux@...linux.org.uk>,
        Dmitry Torokhov <dmitry.torokhov@...il.com>,
        Johannes Berg <johannes@...solutions.net>,
        linux-wireless@...r.kernel.org, netdev@...r.kernel.org,
        devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH] p54spi: convert to devicetree

On 14/03/2023 17:30, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@...db.de>
> 
> 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 <arnd@...db.de>
> ---
> 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 <johannes@...solutions.net>
> +  - Christian Lamparter <chunkeey@....de>
> +
> +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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ