2023-01-02 17:12:21

by Alexandre Mergnat

[permalink] [raw]
Subject: [PATCH v8 0/6] Add MediaTek MT6357 PMIC support

Hi,
This patch series adds MFD, PMIC keys, and regulator support for MT6357.
MT6357 is a MediaTek PMIC very similar to MT6358.

Currently, MTK bindings related to the PMICs are not converted yet (still .txt):

soc/mediatek/pwrap.txt (all PMIC parent)
|
V
mfd/mt6397.txt (support lot of mt63XX PMIC)
+---------------+----------------+---...
V V V
regulator/... rtc/... codec/...

1) Convert pwrap to yaml is ok.

2) For the PMIC bindings, there are two option:
- Convert mt6397.txt to mediatek,mt6397.yaml and continue to support multiple
PMIC with only one file. IMO, the file will be hard to read because
the supported features aren't the same for each PMIC.

- Make a binding file for each PMIC ref:
- mfd/mediatek,mt6357.yaml
- mfd/mediatek,mt6358.yaml
- ...

3) All PMIC daughter bindings (regulator, rtc, codec, led, ...) aren't fully
converted yet. Refering to the two PMIC convertion options above:
- To be clean, all daughter bindings should be converted. This is hard because
a good understanding of each device is requiered to write efficient bindings.
- Only daughter bindings supported by the added PMIC should be converted, that
allows to do the task conversion step by step.

In the V4 of this serie, I chose the second option.

Regards,
Alex

Changes in v8:
- Remove the 2 applied patches (v6.2-rc1) from the serie.
- regulator: dt-bindings: Add binding schema for mt6357 regulators
- regulator: add mt6357 regulator
- Rebase from v6.2-tmp/soc branch, got from kernel/git/matthias.bgg/linux.git
- Link to v7: https://lore.kernel.org/r/[email protected]

Changes in v7:
- Drop mt6397 RTC schema conversion.
- Integrate mt6357 RTC schema directly in mediatek,mt6357.yaml.
- Fix unit address in mediatek,pwrap.yaml.
- Link to v6: https://lore.kernel.org/r/[email protected]

Changes in v6:
- Fix typo in documentations.
- Remove mediatek,mt6397-rtc.yaml example.
- Align pwrap convertion with the original .txt file.
- Remove unecessary include in the mt6357-regulator driver.
- Link to v5: https://lore.kernel.org/r/[email protected]

Changes in v5:
- Add missing maintainers
- Improve RTC binding by adding rtc.yaml ref and start-year property
- Split the txt->yaml conversion in one commit and the addition of the
new mt6357-rtc compatible in another commit.
- Improve PWRAP binding:
- clocks and clock-name have been refactored.
- reset-names is now properly dependent to resets.
- additionalProperties change from true to false.
- change example for a most recent and popular SoC.
- "allOf" part has been simplified.
- Pass binding tests with the updated tools. Here the command:
"make DT_CHECKER_FLAGS=-m dt_binding_check"
- Link to v4: https://lore.kernel.org/r/[email protected]

Changes in v4:
- "dt-bindings: mfd: mt6397: add binding for MT6357" has been applied
by Lee Jones
- All fixed regulator are now refering to fixed-regulator.yaml
- vfe28 and vcamio18 regulators have been added
- pwrap binding has been converted and mt8365 support has been added
- mt6357 PMIC binding has been created
- mt6397 RTC binding has been converted and mt6357 support has been added
- Link to v3: https://lore.kernel.org/r/[email protected]

Changes in v3:
- To be consistent with regulator/driver.h and helper.c, shift
variables have been removed and the mask values have been directly shifted.
- Remove index tables and rework volt tables to use set/get helper functions.
- Add comment to structure and function.
- Fix Fabien Parent mail address.
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- Rebase
- Fix typo
- Remove dependencies with https://lore.kernel.org/all/[email protected]/
which is no longer relevant.

Previous versions:
v1 - https://lore.kernel.org/all/[email protected]/

To: Lee Jones <[email protected]>
To: Rob Herring <[email protected]>
To: Krzysztof Kozlowski <[email protected]>
To: Matthias Brugger <[email protected]>
To: Dmitry Torokhov <[email protected]>
To: Chen Zhong <[email protected]>
To: Liam Girdwood <[email protected]>
To: Mark Brown <[email protected]>
To: Fabien Parent <[email protected]>
To: Alessandro Zummo <[email protected]>
To: Alexandre Belloni <[email protected]>
To: Sean Wang <[email protected]>
To: Pavel Machek <[email protected]>
To: Tianping Fang <[email protected]>
To: Flora Fu <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: Fabien Parent <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: AngeloGioacchino Del Regno <[email protected]>
Cc: Mattijs Korpershoek <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Signed-off-by: Alexandre Mergnat <[email protected]>

---
Alexandre Mergnat (4):
dt-bindings: soc: mediatek: convert pwrap documentation
dt-bindings: mfd: mediatek: Add bindings for MT6357 PMIC
arm64: dts: mt6358: change node names
arm64: dts: mt8173: change node name

Fabien Parent (2):
dt-bindings: input: mtk-pmic-keys: add binding for MT6357 PMIC
Input: mtk-pmic-keys: add MT6357 support

.../bindings/input/mediatek,pmic-keys.yaml | 1 +
.../devicetree/bindings/leds/leds-mt6323.txt | 2 +-
.../devicetree/bindings/mfd/mediatek,mt6357.yaml | 111 ++++++++++++++++
Documentation/devicetree/bindings/mfd/mt6397.txt | 2 +-
.../bindings/soc/mediatek/mediatek,pwrap.yaml | 147 +++++++++++++++++++++
.../devicetree/bindings/soc/mediatek/pwrap.txt | 75 -----------
arch/arm64/boot/dts/mediatek/mt6358.dtsi | 6 +-
arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi | 2 +-
arch/arm64/boot/dts/mediatek/mt8173-evb.dts | 2 +-
drivers/input/keyboard/mtk-pmic-keys.c | 17 +++
10 files changed, 283 insertions(+), 82 deletions(-)
---
base-commit: e32caddfc737a96f6593754c2a08be6b8c1e0cec
change-id: 20221005-mt6357-support-55308b82e33f

Best regards,
--
Alexandre Mergnat <[email protected]>


2023-01-02 17:13:53

by Alexandre Mergnat

[permalink] [raw]
Subject: [PATCH v8 1/6] dt-bindings: input: mtk-pmic-keys: add binding for MT6357 PMIC

From: Fabien Parent <[email protected]>

Add binding documentation for the PMIC keys on MT6357.

Signed-off-by: Fabien Parent <[email protected]>
Acked-by: Rob Herring <[email protected]>
Acked-by: Dmitry Torokhov <[email protected]>
Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
Signed-off-by: Alexandre Mergnat <[email protected]>
---
Documentation/devicetree/bindings/input/mediatek,pmic-keys.yaml | 1 +
1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/input/mediatek,pmic-keys.yaml b/Documentation/devicetree/bindings/input/mediatek,pmic-keys.yaml
index 2f72ec418415..037c3ae9f1c3 100644
--- a/Documentation/devicetree/bindings/input/mediatek,pmic-keys.yaml
+++ b/Documentation/devicetree/bindings/input/mediatek,pmic-keys.yaml
@@ -26,6 +26,7 @@ properties:
enum:
- mediatek,mt6323-keys
- mediatek,mt6331-keys
+ - mediatek,mt6357-keys
- mediatek,mt6358-keys
- mediatek,mt6397-keys


--
b4 0.10.1

2023-01-19 17:30:58

by Matthias Brugger

[permalink] [raw]
Subject: Re: [PATCH v8 0/6] Add MediaTek MT6357 PMIC support

Given the ACK in the series I took the bindings and driver through v6.2-next/soc
and the DTS changes through v6.2-next/dts64

Thanks!

On 02/01/2023 17:06, Alexandre Mergnat wrote:
> Hi,
> This patch series adds MFD, PMIC keys, and regulator support for MT6357.
> MT6357 is a MediaTek PMIC very similar to MT6358.
>
> Currently, MTK bindings related to the PMICs are not converted yet (still .txt):
>
> soc/mediatek/pwrap.txt (all PMIC parent)
> |
> V
> mfd/mt6397.txt (support lot of mt63XX PMIC)
> +---------------+----------------+---...
> V V V
> regulator/... rtc/... codec/...
>
> 1) Convert pwrap to yaml is ok.
>
> 2) For the PMIC bindings, there are two option:
> - Convert mt6397.txt to mediatek,mt6397.yaml and continue to support multiple
> PMIC with only one file. IMO, the file will be hard to read because
> the supported features aren't the same for each PMIC.
>
> - Make a binding file for each PMIC ref:
> - mfd/mediatek,mt6357.yaml
> - mfd/mediatek,mt6358.yaml
> - ...
>
> 3) All PMIC daughter bindings (regulator, rtc, codec, led, ...) aren't fully
> converted yet. Refering to the two PMIC convertion options above:
> - To be clean, all daughter bindings should be converted. This is hard because
> a good understanding of each device is requiered to write efficient bindings.
> - Only daughter bindings supported by the added PMIC should be converted, that
> allows to do the task conversion step by step.
>
> In the V4 of this serie, I chose the second option.
>
> Regards,
> Alex
>
> Changes in v8:
> - Remove the 2 applied patches (v6.2-rc1) from the serie.
> - regulator: dt-bindings: Add binding schema for mt6357 regulators
> - regulator: add mt6357 regulator
> - Rebase from v6.2-tmp/soc branch, got from kernel/git/matthias.bgg/linux.git
> - Link to v7: https://lore.kernel.org/r/[email protected]
>
> Changes in v7:
> - Drop mt6397 RTC schema conversion.
> - Integrate mt6357 RTC schema directly in mediatek,mt6357.yaml.
> - Fix unit address in mediatek,pwrap.yaml.
> - Link to v6: https://lore.kernel.org/r/[email protected]
>
> Changes in v6:
> - Fix typo in documentations.
> - Remove mediatek,mt6397-rtc.yaml example.
> - Align pwrap convertion with the original .txt file.
> - Remove unecessary include in the mt6357-regulator driver.
> - Link to v5: https://lore.kernel.org/r/[email protected]
>
> Changes in v5:
> - Add missing maintainers
> - Improve RTC binding by adding rtc.yaml ref and start-year property
> - Split the txt->yaml conversion in one commit and the addition of the
> new mt6357-rtc compatible in another commit.
> - Improve PWRAP binding:
> - clocks and clock-name have been refactored.
> - reset-names is now properly dependent to resets.
> - additionalProperties change from true to false.
> - change example for a most recent and popular SoC.
> - "allOf" part has been simplified.
> - Pass binding tests with the updated tools. Here the command:
> "make DT_CHECKER_FLAGS=-m dt_binding_check"
> - Link to v4: https://lore.kernel.org/r/[email protected]
>
> Changes in v4:
> - "dt-bindings: mfd: mt6397: add binding for MT6357" has been applied
> by Lee Jones
> - All fixed regulator are now refering to fixed-regulator.yaml
> - vfe28 and vcamio18 regulators have been added
> - pwrap binding has been converted and mt8365 support has been added
> - mt6357 PMIC binding has been created
> - mt6397 RTC binding has been converted and mt6357 support has been added
> - Link to v3: https://lore.kernel.org/r/[email protected]
>
> Changes in v3:
> - To be consistent with regulator/driver.h and helper.c, shift
> variables have been removed and the mask values have been directly shifted.
> - Remove index tables and rework volt tables to use set/get helper functions.
> - Add comment to structure and function.
> - Fix Fabien Parent mail address.
> - Link to v2: https://lore.kernel.org/r/[email protected]
>
> Changes in v2:
> - Rebase
> - Fix typo
> - Remove dependencies with https://lore.kernel.org/all/[email protected]/
> which is no longer relevant.
>
> Previous versions:
> v1 - https://lore.kernel.org/all/[email protected]/
>
> To: Lee Jones <[email protected]>
> To: Rob Herring <[email protected]>
> To: Krzysztof Kozlowski <[email protected]>
> To: Matthias Brugger <[email protected]>
> To: Dmitry Torokhov <[email protected]>
> To: Chen Zhong <[email protected]>
> To: Liam Girdwood <[email protected]>
> To: Mark Brown <[email protected]>
> To: Fabien Parent <[email protected]>
> To: Alessandro Zummo <[email protected]>
> To: Alexandre Belloni <[email protected]>
> To: Sean Wang <[email protected]>
> To: Pavel Machek <[email protected]>
> To: Tianping Fang <[email protected]>
> To: Flora Fu <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Cc: Fabien Parent <[email protected]>
> Cc: Rob Herring <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Cc: AngeloGioacchino Del Regno <[email protected]>
> Cc: Mattijs Korpershoek <[email protected]>
> Cc: Krzysztof Kozlowski <[email protected]>
> Signed-off-by: Alexandre Mergnat <[email protected]>
>
> ---
> Alexandre Mergnat (4):
> dt-bindings: soc: mediatek: convert pwrap documentation
> dt-bindings: mfd: mediatek: Add bindings for MT6357 PMIC
> arm64: dts: mt6358: change node names
> arm64: dts: mt8173: change node name
>
> Fabien Parent (2):
> dt-bindings: input: mtk-pmic-keys: add binding for MT6357 PMIC
> Input: mtk-pmic-keys: add MT6357 support
>
> .../bindings/input/mediatek,pmic-keys.yaml | 1 +
> .../devicetree/bindings/leds/leds-mt6323.txt | 2 +-
> .../devicetree/bindings/mfd/mediatek,mt6357.yaml | 111 ++++++++++++++++
> Documentation/devicetree/bindings/mfd/mt6397.txt | 2 +-
> .../bindings/soc/mediatek/mediatek,pwrap.yaml | 147 +++++++++++++++++++++
> .../devicetree/bindings/soc/mediatek/pwrap.txt | 75 -----------
> arch/arm64/boot/dts/mediatek/mt6358.dtsi | 6 +-
> arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi | 2 +-
> arch/arm64/boot/dts/mediatek/mt8173-evb.dts | 2 +-
> drivers/input/keyboard/mtk-pmic-keys.c | 17 +++
> 10 files changed, 283 insertions(+), 82 deletions(-)
> ---
> base-commit: e32caddfc737a96f6593754c2a08be6b8c1e0cec
> change-id: 20221005-mt6357-support-55308b82e33f
>
> Best regards,