From: Macpaul Lin <macpaul.lin@mediatek.com>
To: Rob Herring <robh@kernel.org>
Cc: AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
Matthias Brugger <matthias.bgg@gmail.com>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>, <linux-leds@vger.kernel.org>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>,
Sebastian Reichel <sre@kernel.org>, Pavel Machek <pavel@ucw.cz>,
Sean Wang <sean.wang@mediatek.com>, Lee Jones <lee@kernel.org>,
Alexandre Mergnat <amergnat@baylibre.com>,
Flora Fu <flora.fu@mediatek.com>,
Bear Wang <bear.wang@mediatek.com>,
Pablo Sun <pablo.sun@mediatek.com>,
Macpaul Lin <macpaul@gmail.com>, Sen Chu <sen.chu@mediatek.com>,
Chris-qj chen <chris-qj.chen@mediatek.com>,
"MediaTek Chromebook Upstream"
<Project_Global_Chrome_Upstream_Group@mediatek.com>,
<linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-mediatek@lists.infradead.org>, <linux-pm@vger.kernel.org>,
<linux-rtc@vger.kernel.org>, <linux-sound@vger.kernel.org>,
<devicetree@vger.kernel.org>, Chen-Yu Tsai <wenst@chromium.org>
Subject: Re: [PATCH v2 2/7] dt-bindings: mfd: mediatek: mt6397: Convert to DT schema format
Date: Sat, 14 Sep 2024 02:15:50 +0800 [thread overview]
Message-ID: <963d092c-9288-2d38-f677-6d99d3d0bcce@mediatek.com> (raw)
In-Reply-To: <20240830153343.GA4175444-robh@kernel.org>
On 8/30/24 23:33, Rob Herring wrote:
>
>
> External email : Please do not click links or open attachments until you
> have verified the sender or the content.
>
> On Fri, Aug 30, 2024 at 07:07:27PM +0800, Macpaul Lin wrote:
>> Convert the mfd: mediatek: mt6397 binding to DT schema format.
>>
>> MT6323/MT6358/MT6397 are PMIC devices with multiple function of
>> subdevices. They have some variant of the combinations of subdevices
>> but share a common PMIC design.
>>
>> New updates in this conversion:
>> - RTC:
>> - Convert rtc-mt6397.txt and add it into parent's mt6397 PMIC DT schema.
>> - regulators:
>> - Align generic names "regulators" instead of origin names.
>> - mt6323-regulator: Replace "txt" reference with mt6323-regulaotr.yaml
>> - mt6358-regulator: Replace "txt" reference with mt6358-regulator.yaml
>> - mt6397-regulator: Replace "txt" reference with mt6397-reuglator.yaml
>> - audio-codec:
>> - Align generic name "audio-codec" for codec and sound subdevices.
>> - Add "mediatek,dmic-mode" and "Avdd-supply".
>> - clocks:
>> - Align generic name "clocks" for clockbuffer subdevices.
>> - leds:
>> - Convert leds-mt6323.txt and add it into parent's mt6397 PMIC DT schema.
>> - keys:
>> - Add more specific descriptions for power and home keys.
>> - Add compatible: mediatek,mt6358-keys
>> - power-controller:
>> - Add property #power-domain-cells for fixing dt-binding check error.
>> - Add "Baseband power up" as the explaination of abbrevitation "BBPU".
>> - pinctrl:
>> - Align generic name "pinctrl" instead of "pin-controller".
>>
>> Signed-off-by: Sen Chu <sen.chu@mediatek.com>
>> Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
>> ---
>> .../bindings/mfd/mediatek,mt6397.yaml | 1026 +++++++++++++++++
>> .../devicetree/bindings/mfd/mt6397.txt | 110 --
>> 2 files changed, 1026 insertions(+), 110 deletions(-)
>> create mode 100644 Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml
>> delete mode 100644 Documentation/devicetree/bindings/mfd/mt6397.txt
>>
>> Changes for v1:
>> - This patch depends on conversion of mediatek,mt6397-regulator.yaml
>> [1] https://lore.kernel.org/lkml/20240807091738.18387-1-macpaul.lin@mediatek.com/T/
>>
>> Changes for v2:
>> - This patch has been made base on linux-next/master git repo.
>> - Keep the parent and child relationship with mediatek,pwrap in description.
>> [2] https://lore.kernel.org/all/20240826-slurp-earphone-0d5173923ae8@spud/
>> - Keep the $ref for regulators since dt_binding_check didn't report any issue
>> based on linux-next/master repo.
>> - Fix description of mt6397/mt6323 devices, use "power management chip"
>> instead of "multifunction device"
>> - Drop unnecessary comments or description according to the review.
>> - Convert sub-modules to DT Schema:
>> - RTC, LEDs, power-controllers, regulators
>> - Drop duplicate sub node name and description for sub-modules
>> - RTC, Keys
>> - examples:
>> - drop parent pwrap node
>> - Add examples from mediatek,mt6323-regulator.yaml
>> - Add examples from mediatek,mt6358-regulator.yaml
>> - Add examples from mediatek,mt6397-regulator.yaml
>> - Complete the examples as could as possible.
>>
>> diff --git a/Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml b/Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml
>> new file mode 100644
>> index 0000000..f5bea33
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml
>> @@ -0,0 +1,1026 @@
>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/mfd/mediatek,mt6397.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: MediaTek MT6397/MT6323 Multifunction Device (PMIC)
>> +
>> +maintainers:
>> + - Sen Chu <sen.chu@mediatek.com>
>> + - Macpaul Lin <macpaul.lin@mediatek.com>
>> +
>> +description: |
>> + MT6397/MT6323 is a power management system chip.
>> + Please see the sub-modules below for supported features.
>> +
>> + MT6397/MT6323 is a multifunction device with the following sub modules:
>> + - Regulators
>> + - RTC
>> + - Audio codec
>> + - GPIO
>> + - Clock
>> + - LED
>> + - Keys
>> + - Power controller
>> +
>> + It is interfaced to host controller using SPI interface by a proprietary hardware
>> + called PMIC wrapper or pwrap. MT6397/MT6323 PMIC is a child device of pwrap.
>> + See the following for pwrap node definitions:
>> + Documentation/devicetree/bindings/soc/mediatek/mediatek,pwrap.yaml
[snip]
>> + rtc:
>> + type: object
>> + $ref: /schemas/rtc/rtc.yaml#
>> + unevaluatedProperties: false
>> + description:
>> + MT6397 Real Time Clock.
>
> Blank line
Will fix this in v3 version.
>
>> + properties:
>> + compatible:
>> + oneOf:
>> + - enum:
>> + - mediatek,mt6323-rtc
>> + - mediatek,mt6331-rtc
>> + - mediatek,mt6358-rtc
>> + - mediatek,mt6397-rtc
>> + - items:
>> + - enum:
>> + - mediatek,mt6366-rtc
>> + - const: mediatek,mt6358-rtc
>
> Blank line between DT properties
Will fix this in v3 version.
>> + start-year: true
>> + required:
>> + - compatible
>> +
>> + regulators:
>> + type: object
>> + oneOf:
>> + - $ref: /schemas/regulator/mediatek,mt6323-regulator.yaml
>> + - $ref: /schemas/regulator/mediatek,mt6358-regulator.yaml
>> + - $ref: /schemas/regulator/mediatek,mt6397-regulator.yaml
>> + unevaluatedProperties: false
>> + description:
>> + List of child nodes that specify the regulators.
>> + properties:
>> + compatible:
>> + oneOf:
>> + - enum:
>> + - mediatek,mt6323-regulator
>> + - mediatek,mt6358-regulator
>> + - mediatek,mt6397-regulator
>> + - items:
>> + - enum:
>> + - mediatek,mt6366-regulator
>> + - const: mediatek,mt6358-regulator
>
> You need the references or compatible, but not both. It's more efficient
> if you list the compatibles along with a 'additionalProperties: true'.
> Otherwise, the referenced schemas have to all be applied and the
> matching one will be applied twice.
>
> Also, for compatible here, just use 'contains' and list all possible
> compatibles. The exact combinations are enforced in the regulator
> schemas.
Both 'addtionalProperties: true' and 'contains' will be added to
v3 version. Since there are different regulator nodes in these
DT Schema but seems no other common nodes, $ref will be added
to if..then.. match rulesfor each compatible.
[snip]
>> +
>> + leds:
>> + type: object
>> + additionalProperties: false
>> + description:
>
> You need '|' or '>' to preserve line breaks.
Will be fixed in v3 version.
>> +
>> + properties:
>> + compatible:
>> + oneOf:
>
> Only 1 entry, don't need oneOf.
>
Will be fixed in v3 version.
>> + - enum:
>> + - mediatek,mt6323-led
>> + - mediatek,mt6331-led
>> + - mediatek,mt6332-led
>> + "#address-cells":
>> + const: 1
>
> blank line
Will be fixed in v3 version.
>> + "#size-cells":
>> + const: 0
>
> blank line. And so on...
Will be fixed in v3 version.
>> + reg:
>> + description:
>> + LED channel number (0..3)
>> + minimum: 0
>> + maximum: 3
>
> Doesn't use the led binding?
Will be fixed in v3 version: using led bindings.
[snip]
>> +
>> +
>> +examples:
>> + - |
>> + #include <dt-bindings/interrupt-controller/arm-gic.h>
>> +
>> + mt6323_pmic: pmic {
>
> Drop unused labels.
Will be fixed in v3 version.
>> + compatible = "mediatek,mt6323";
>> + interrupt-parent = <&pio>;
>> + interrupts = <150 IRQ_TYPE_LEVEL_HIGH>;
>> + interrupt-controller;
>> + #interrupt-cells = <2>;
>> +
>> + mt6323_leds: leds {
>> + compatible = "mediatek,mt6323-led";
>> + #address-cells = <1>;
>> + status = "disabled";
>
> Examples shouldn't be disabled.
Will be fixed in v3 version.
[snip]
Thanks for the review.
Regards,
Macpaul Lin
next prev parent reply other threads:[~2024-09-13 18:16 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-30 11:07 [PATCH v2 1/7] regulator: dt-bindings: mt6323: Convert to DT schema Macpaul Lin
2024-08-30 11:07 ` [PATCH v2 2/7] dt-bindings: mfd: mediatek: mt6397: Convert to DT schema format Macpaul Lin
2024-08-30 12:29 ` Rob Herring (Arm)
2024-08-30 15:33 ` Rob Herring
2024-09-13 18:15 ` Macpaul Lin [this message]
2024-08-31 7:04 ` kernel test robot
2024-08-30 11:07 ` [PATCH v2 3/7] dt-bindings: rtc: mt6397: merge to MFD mediatek,mt6397 DT schema Macpaul Lin
2024-08-30 15:34 ` Rob Herring
2024-09-13 16:29 ` Macpaul Lin
2024-08-30 11:07 ` [PATCH v2 4/7] regulator: dt-bindings: mt6397: move examples to parent PMIC mt6397 Macpaul Lin
2024-08-30 11:07 ` [PATCH v2 5/7] dt-bindings: leds: mt6323: merge to MFD mediatek,mt6397 DT schema Macpaul Lin
2024-08-31 8:06 ` kernel test robot
2024-08-30 11:07 ` [PATCH v2 6/7] dt-bindings: power: reset: " Macpaul Lin
2024-09-03 21:42 ` Sebastian Reichel
2024-09-13 16:33 ` Macpaul Lin
2024-08-30 11:07 ` [PATCH v2 7/7] dt-bindings: sound: mt6358: " Macpaul Lin
2024-08-30 12:29 ` [PATCH v2 1/7] regulator: dt-bindings: mt6323: Convert to " Rob Herring (Arm)
2024-08-30 14:50 ` Rob Herring
2024-09-13 17:47 ` Macpaul Lin
2024-08-31 5:51 ` kernel test robot
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=963d092c-9288-2d38-f677-6d99d3d0bcce@mediatek.com \
--to=macpaul.lin@mediatek.com \
--cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
--cc=amergnat@baylibre.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=bear.wang@mediatek.com \
--cc=broonie@kernel.org \
--cc=chris-qj.chen@mediatek.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=flora.fu@mediatek.com \
--cc=krzk+dt@kernel.org \
--cc=lee@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=macpaul@gmail.com \
--cc=matthias.bgg@gmail.com \
--cc=pablo.sun@mediatek.com \
--cc=pavel@ucw.cz \
--cc=robh@kernel.org \
--cc=sean.wang@mediatek.com \
--cc=sen.chu@mediatek.com \
--cc=sre@kernel.org \
--cc=wenst@chromium.org \
/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