From: Rob Herring <robh@kernel.org>
To: wangshuaijie@awinic.com
Cc: dmitry.torokhov@gmail.com, krzk+dt@kernel.org,
conor+dt@kernel.org, jeff@labundy.com,
linux-input@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, liweilei@awinic.com,
kangjiajun@awinic.com
Subject: Re: [PATCH V1 1/5] dt-bindings: input: Add YAML to Awinic sar sensor.
Date: Thu, 30 May 2024 20:36:07 -0500 [thread overview]
Message-ID: <20240531013607.GA3665090-robh@kernel.org> (raw)
In-Reply-To: <20240529130608.783624-2-wangshuaijie@awinic.com>
On Wed, May 29, 2024 at 01:06:04PM +0000, wangshuaijie@awinic.com wrote:
> From: shuaijie wang <wangshuaijie@awinic.com>
>
> Add the awinic,aw_sar.yaml file to adapt to the awinic sar sensor driver.
>
> Signed-off-by: shuaijie wang <wangshuaijie@awinic.com>
> ---
> .../bindings/input/awinic,aw_sar.yaml | 110 ++++++++++++++++++
> 1 file changed, 110 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/input/awinic,aw_sar.yaml
>
> diff --git a/Documentation/devicetree/bindings/input/awinic,aw_sar.yaml b/Documentation/devicetree/bindings/input/awinic,aw_sar.yaml
> new file mode 100644
> index 000000000000..ed4ec29c9b4d
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/input/awinic,aw_sar.yaml
> @@ -0,0 +1,110 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/input/awinic,aw_sar.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Awinic sar sensor driver family
> +
> +maintainers:
> + - Shuaijie Wang <wangshuaijie@awinic.com>
> +
> +properties:
> + compatible:
> + enum:
> + - awinic,aw_aw96103
> + - awinic,aw_aw96105
> + - awinic,aw_aw96303
> + - awinic,aw_aw96305
> + - awinic,aw_aw96308
> +
> + reg:
> + maxItems: 1
> +
> + interrupts:
> + maxItems: 1
> +
> + sar-num:
Custom properties need vendor prefix.
> + $ref: /schemas/types.yaml#/definitions/uint32
> + description:
> + set the index of the sar sensor.
What is 'sar'? It's never defined.
How is the index determined? We generally don't do indexes in DT unless
there is some correlation to the h/w.
> +
> + vcc0-supply:
> + description:
> + Optional regulator for chip, 1.7V-3.6V.
> +
> + channel_use_flag:
vendor prefix needed plus use '-' rather than '_'. Here and elsewhere.
> + $ref: /schemas/types.yaml#/definitions/uint32
> + description:
> + The flag of channels used.
> + Configure according to the specific chip channel used.
> + Bit[31:0] Each bit represents a channel.
So a mask rather than a flag.
Up to 32 channels possible? If not, add constraints.
> + If the customer uses ch0 and ch2, then channel_use_flag=<0x05>
> +
> + aw_sar,update_fw:
> + type: boolean
> + description:
> + Choose if you want to update the firmware.
DT is mostly fixed. So someone would want to update the firmware every
time?
> +
> + aw_sar,monitor_esd:
> + type: boolean
> + description:
> + Choose if you want to monitor ESD.
> +
> + aw_sar,pin_set_inter_pull-up:
> + type: boolean
> + description:
> + Choose if you want to set the interrupt pin to internal pull-up.
> +
> + aw_sar,using_pm_ops:
> + type: boolean
> + description:
> + Choose if you want to use suspend and resume related function.
OS configuration. Doesn't belong in DT.
> +
> + aw_sar,use_plug_cail:
> + type: boolean
> + description:
> + Choose If you want to perform calibration when plugging and unplugging the charger.
> +
> + start-mode:
> + $ref: /schemas/types.yaml#/definitions/uint32
> + description:
> + When connecting to aw963xx, select the location where the firmware starts.
> + set 0 if start in rom.
> + set 1 if start in ram
Looks like constraints.
> +
> + irq-mux:
> + $ref: /schemas/types.yaml#/definitions/uint32
> + description:
> + set csx as irq pin. config this field when connect to aw96308/aw96305BFOR
Constraints? Can you imply this based on the compatible?
> +
> +required:
> + - compatible
> + - reg
> + - sar-num
> + - interrupts
> + - channel_use_flag
> +
> +unevaluatedProperties: false
> +
> +examples:
> + - |
> + #include <dt-bindings/gpio/gpio.h>
> + #include <dt-bindings/interrupt-controller/irq.h>
> + i2c {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + awinic_sar@12 {
> + compatible = "awinic,aw_sar";
> + reg = <0x12>;
> + sar-num = < 0 >;
> + interrupt-parent = < &tlmm >;
> + interrupts = <72 0>;
> + //vcc0-supply = <&pm660l_l4>;
Why commented?
> + channel_use_flag = <0xff>;
> + aw_sar,update_fw;
> + //aw_sar,monitor_esd;
> + start-mode = < 1 >;
> + irq-mux = < 2 >;
> + };
> + };
> --
> 2.45.1
>
next prev parent reply other threads:[~2024-05-31 1:36 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-29 13:06 [PATCH V1 0/5] Add support for Awinic SAR sensor wangshuaijie
2024-05-29 13:06 ` [PATCH V1 1/5] dt-bindings: input: Add YAML to Awinic sar sensor wangshuaijie
2024-05-29 14:25 ` Rob Herring (Arm)
2024-06-05 9:04 ` wangshuaijie
2024-05-31 1:36 ` Rob Herring [this message]
2024-06-05 9:02 ` wangshuaijie
2024-05-29 13:06 ` [PATCH V1 2/5] Add universal interface for the aw_sar driver wangshuaijie
2024-05-29 13:06 ` [PATCH V1 3/5] Add aw9610x series related interfaces to " wangshuaijie
2024-05-29 13:06 ` [PATCH V1 4/5] Add aw963xx " wangshuaijie
2024-05-29 13:06 ` [PATCH V1 5/5] Add support for Awinic sar sensor wangshuaijie
2024-05-29 22:49 ` kernel test robot
2024-06-05 9:03 ` wangshuaijie
2024-05-30 4:27 ` kernel test robot
2024-06-05 9:03 ` wangshuaijie
2024-05-31 8:12 ` Dan Carpenter
2024-06-05 8:42 ` wangshuaijie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240531013607.GA3665090-robh@kernel.org \
--to=robh@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=jeff@labundy.com \
--cc=kangjiajun@awinic.com \
--cc=krzk+dt@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liweilei@awinic.com \
--cc=wangshuaijie@awinic.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).