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]
Message-ID: <20221221144505.GA2848091-robh@kernel.org>
Date:   Wed, 21 Dec 2022 08:45:05 -0600
From:   Rob Herring <robh@...nel.org>
To:     Philipp Zabel <p.zabel@...gutronix.de>
Cc:     Johannes Berg <johannes@...solutions.net>, netdev@...r.kernel.org,
        devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-wireless@...r.kernel.org, kernel@...gutronix.de
Subject: Re: [PATCH 1/2] dt-bindings: net: Add rfkill-gpio binding

On Wed, Dec 21, 2022 at 11:48:02AM +0100, Philipp Zabel wrote:
> Add a device tree binding document for GPIO controlled rfkill switches.
> The name, type, shutdown-gpios and reset-gpios properties are the same
> as defined for ACPI.
> 
> Signed-off-by: Philipp Zabel <p.zabel@...gutronix.de>
> ---
>  .../devicetree/bindings/net/rfkill-gpio.yaml  | 60 +++++++++++++++++++
>  1 file changed, 60 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/net/rfkill-gpio.yaml
> 
> diff --git a/Documentation/devicetree/bindings/net/rfkill-gpio.yaml b/Documentation/devicetree/bindings/net/rfkill-gpio.yaml
> new file mode 100644
> index 000000000000..6e62e6c96456
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/rfkill-gpio.yaml
> @@ -0,0 +1,60 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: "http://devicetree.org/schemas/net/rfkill-gpio.yaml#"
> +$schema: "http://devicetree.org/meta-schemas/core.yaml#"
> +
> +title: GPIO controlled rfkill switch
> +
> +maintainers:
> +  - Johannes Berg <johannes@...solutions.net>
> +  - Philipp Zabel <p.zabel@...gutronix.de>
> +
> +properties:
> +  compatible:
> +    const: rfkill-gpio
> +
> +  name:

Did you test this? Something should complain, but maybe not. The problem 
is 'name' is already a property in the unflattened DT (and old FDT 
formats).

'label' would be appropriate perhaps, but why do we care what the name 
is? 

> +    $ref: /schemas/types.yaml#/definitions/string
> +    description: rfkill switch name, defaults to node name
> +
> +  type:

Too generic. Property names should ideally have 1 type globally. I think 
'type' is already in use. 'radio-type' instead?


> +    description: rfkill radio type
> +    enum:
> +      - wlan
> +      - bluetooth
> +      - ultrawideband
> +      - wimax
> +      - wwan
> +      - gps
> +      - fm
> +      - nfc
> +
> +  shutdown-gpios:
> +    maxItems: 1
> +
> +  reset-gpios:
> +    maxItems: 1

I'm lost as to why there are 2 GPIOs.

> +
> +required:
> +  - compatible
> +  - type
> +
> +oneOf:
> +  - required:
> +      - shutdown-gpios
> +  - required:
> +      - reset-gpios

But only 1 can be present? So just define 1 GPIO name.

> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/gpio/gpio.h>
> +
> +    rfkill-pcie-wlan {

Node names should be generic.

> +        compatible = "rfkill-gpio";
> +        name = "rfkill-pcie-wlan";
> +        type = "wlan";
> +        shutdown-gpios = <&gpio2 25 GPIO_ACTIVE_HIGH>;
> +    };
> -- 
> 2.30.2
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ