Mediatek MT8192 clock support
Subsystems (3)
v6 cover Mediatek MT8192 clock support
This series is based on v5.10-rc1.
change since v5:
- remove unused clocks by rolling Tinghan's patches[1][2] into series
[1] https://patchwork.kernel.org/project/linux-mediatek/list/?series=398781
[2] https://patchwork.kernel.org/project/linux-mediatek/list/?series=405143
- remove dts related patches from series
change since v4:
- merge some subsystem into same driver
- add a generic probe function to reduce duplicated code
changes since v3:
- add critical clocks
- split large patches into small ones
changes since v2:
- update and split dt-binding documents by functionalities
- add error checking in probe() function
- fix incorrect clock relation and add critical clocks
- update license identifier and minor fix of coding style
changes since v1:
- fix asymmetrical control of PLL
- have en_mask used as divider enable mask on all MediaTek SoC
Weiyi Lu (22):
dt-bindings: ARM: Mediatek: Add new document bindings of imp i2c
wrapper controller
dt-bindings: ARM: Mediatek: Add new document bindings of mdpsys
controller
dt-bindings: ARM: Mediatek: Add new document bindings of msdc
controller
dt-bindings: ARM: Mediatek: Add new document bindings of scp adsp
controller
dt-bindings: ARM: Mediatek: Document bindings of MT8192 clock
controllers
clk: mediatek: Add dt-bindings of MT8192 clocks
clk: mediatek: Fix asymmetrical PLL enable and disable control
clk: mediatek: Add configurable enable control to mtk_pll_data
clk: mediatek: Add mtk_clk_simple_probe() to simplify clock providers
clk: mediatek: Add MT8192 basic clocks support
clk: mediatek: Add MT8192 audio clock support
clk: mediatek: Add MT8192 camsys clock support
clk: mediatek: Add MT8192 imgsys clock support
clk: mediatek: Add MT8192 imp i2c wrapper clock support
clk: mediatek: Add MT8192 ipesys clock support
clk: mediatek: Add MT8192 mdpsys clock support
clk: mediatek: Add MT8192 mfgcfg clock support
clk: mediatek: Add MT8192 mmsys clock support
clk: mediatek: Add MT8192 msdc clock support
clk: mediatek: Add MT8192 scp adsp clock support
clk: mediatek: Add MT8192 vdecsys clock support
clk: mediatek: Add MT8192 vencsys clock support
.../arm/mediatek/mediatek,apmixedsys.txt | 1 + .../bindings/arm/mediatek/mediatek,audsys.txt | 1 + .../bindings/arm/mediatek/mediatek,camsys.txt | 22 + .../bindings/arm/mediatek/mediatek,imgsys.txt | 2 + .../arm/mediatek/mediatek,imp_iic_wrap.yaml | 78 + .../arm/mediatek/mediatek,infracfg.txt | 1 + .../bindings/arm/mediatek/mediatek,ipesys.txt | 1 + .../arm/mediatek/mediatek,mdpsys.yaml | 38 + .../bindings/arm/mediatek/mediatek,mfgcfg.txt | 1 + .../bindings/arm/mediatek/mediatek,mmsys.txt | 1 + .../bindings/arm/mediatek/mediatek,msdc.yaml | 46 + .../arm/mediatek/mediatek,pericfg.yaml | 1 + .../arm/mediatek/mediatek,scp-adsp.yaml | 38 + .../arm/mediatek/mediatek,topckgen.txt | 1 + .../arm/mediatek/mediatek,vdecsys.txt | 8 + .../arm/mediatek/mediatek,vencsys.txt | 1 + drivers/clk/mediatek/Kconfig | 80 + drivers/clk/mediatek/Makefile | 13 + drivers/clk/mediatek/clk-mt8192-aud.c | 118 ++ drivers/clk/mediatek/clk-mt8192-cam.c | 107 ++ drivers/clk/mediatek/clk-mt8192-img.c | 70 + .../clk/mediatek/clk-mt8192-imp_iic_wrap.c | 119 ++ drivers/clk/mediatek/clk-mt8192-ipe.c | 57 + drivers/clk/mediatek/clk-mt8192-mdp.c | 82 + drivers/clk/mediatek/clk-mt8192-mfg.c | 50 + drivers/clk/mediatek/clk-mt8192-mm.c | 108 ++ drivers/clk/mediatek/clk-mt8192-msdc.c | 85 ++ drivers/clk/mediatek/clk-mt8192-scp_adsp.c | 50 + drivers/clk/mediatek/clk-mt8192-vdec.c | 94 ++ drivers/clk/mediatek/clk-mt8192-venc.c | 53 + drivers/clk/mediatek/clk-mt8192.c | 1326 +++++++++++++++++ drivers/clk/mediatek/clk-mtk.c | 23 + drivers/clk/mediatek/clk-mtk.h | 10 + drivers/clk/mediatek/clk-mux.h | 15 + drivers/clk/mediatek/clk-pll.c | 31 +- include/dt-bindings/clock/mt8192-clk.h | 585 ++++++++ 36 files changed, 3310 insertions(+), 7 deletions(-) create mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,imp_iic_wrap.yaml create mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,mdpsys.yaml create mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,msdc.yaml create mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,scp-adsp.yaml create mode 100644 drivers/clk/mediatek/clk-mt8192-aud.c create mode 100644 drivers/clk/mediatek/clk-mt8192-cam.c create mode 100644 drivers/clk/mediatek/clk-mt8192-img.c create mode 100644 drivers/clk/mediatek/clk-mt8192-imp_iic_wrap.c create mode 100644 drivers/clk/mediatek/clk-mt8192-ipe.c create mode 100644 drivers/clk/mediatek/clk-mt8192-mdp.c create mode 100644 drivers/clk/mediatek/clk-mt8192-mfg.c create mode 100644 drivers/clk/mediatek/clk-mt8192-mm.c create mode 100644 drivers/clk/mediatek/clk-mt8192-msdc.c create mode 100644 drivers/clk/mediatek/clk-mt8192-scp_adsp.c create mode 100644 drivers/clk/mediatek/clk-mt8192-vdec.c create mode 100644 drivers/clk/mediatek/clk-mt8192-venc.c create mode 100644 drivers/clk/mediatek/clk-mt8192.c create mode 100644 include/dt-bindings/clock/mt8192-clk.h
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
PATCH v6 1/22 dt-bindings: ARM: Mediatek: Add new document bindings of imp i2c wrapper controller
This patch adds the new binding documentation of imp i2c wrapper controller for Mediatek MT8192.
--- .../arm/mediatek/mediatek,imp_iic_wrap.yaml | 78 ++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,imp_iic_wrap.yaml
Documentation/devicetree/bindings/arm/mediatek/mediatek,imp_iic_wrap.yaml new file +78 -0
@@ -0,0 +1,78 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/arm/mediatek/mediatek,imp_iic_wrap.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: MediaTek IMP I2C Wrapper Controller + +maintainers: + - Weiyi Lu <[email protected]> + +description: + The Mediatek imp i2c wrapper controller provides functional configurations and clocks to the system. + +properties: + compatible: + items: + - enum: + - mediatek,mt8192-imp_iic_wrap_c + - mediatek,mt8192-imp_iic_wrap_e + - mediatek,mt8192-imp_iic_wrap_s + - mediatek,mt8192-imp_iic_wrap_ws + - mediatek,mt8192-imp_iic_wrap_w + - mediatek,mt8192-imp_iic_wrap_n + - const: syscon + + reg: + maxItems: 1 + + '#clock-cells': + const: 1 + +required: + - compatible + - reg + +examples: + - | + imp_iic_wrap_c: syscon@11007000 { + compatible = "mediatek,mt8192-imp_iic_wrap_c", "syscon"; + reg = <0 0x11007000 0 0x1000>; + #clock-cells = <1>; + }; + + - | + imp_iic_wrap_e: syscon@11cb1000 { + compatible = "mediatek,mt8192-imp_iic_wrap_e", "syscon"; + reg = <0 0x11cb1000 0 0x1000>; + #clock-cells = <1>; + }; + + - | + imp_iic_wrap_s: syscon@11d03000 { + compatible = "mediatek,mt8192-imp_iic_wrap_s", "syscon"; + reg = <0 0x11d03000 0 0x1000>; + #clock-cells = <1>; + }; + + - | + imp_iic_wrap_ws: syscon@11d23000 { + compatible = "mediatek,mt8192-imp_iic_wrap_ws", "syscon"; + reg = <0 0x11d23000 0 0x1000>; + #clock-cells = <1>; + }; + + - | + imp_iic_wrap_w: syscon@11e01000 { + compatible = "mediatek,mt8192-imp_iic_wrap_w", "syscon"; + reg = <0 0x11e01000 0 0x1000>; + #clock-cells = <1>; + }; + + - | + imp_iic_wrap_n: syscon@11f02000 { + compatible = "mediatek,mt8192-imp_iic_wrap_n", "syscon"; + reg = <0 0x11f02000 0 0x1000>; + #clock-cells = <1>; + };
Signature · 1 line
1.8.1.1.dirty
Matthias Brugger
maintainerRe: [PATCH v6 01/22] dt-bindings: ARM: Mediatek: Add new document bindings of imp i2c wrapper controller
Quoted 2 lines · Weiyi Lu
This patch adds the new binding documentation of imp i2c wrapper controller for Mediatek MT8192.
The wrapper controller has only clock parts, or are the clock register mapped into the i2c wrapper block. In that case we might want to probe the clock driver through the i2c wrapper driver.
Regards,
Matthias
Quoted 82 lines
Signed-off-by Weiyi Lu <[email protected]>--- .../arm/mediatek/mediatek,imp_iic_wrap.yaml | 78 ++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,imp_iic_wrap.yamlDocumentation/devicetree/bindings/arm/mediatek/mediatek,imp_iic_wrap.yaml new file +68
-0@@ -0,0 +1,78 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/arm/mediatek/mediatek,imp_iic_wrap.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: MediaTek IMP I2C Wrapper Controller + +maintainers: + - Weiyi Lu <[email protected]> + +description: + The Mediatek imp i2c wrapper controller provides functional configurations and clocks to the system. + +properties: + compatible: + items: + - enum: + - mediatek,mt8192-imp_iic_wrap_c + - mediatek,mt8192-imp_iic_wrap_e + - mediatek,mt8192-imp_iic_wrap_s + - mediatek,mt8192-imp_iic_wrap_ws + - mediatek,mt8192-imp_iic_wrap_w + - mediatek,mt8192-imp_iic_wrap_n + - const: syscon + + reg: + maxItems: 1 + + '#clock-cells': + const: 1 + +required: + - compatible + - reg + +examples: + - | + imp_iic_wrap_c: syscon@11007000 { + compatible = "mediatek,mt8192-imp_iic_wrap_c", "syscon"; + reg = <0 0x11007000 0 0x1000>; + #clock-cells = <1>; + }; + + - | + imp_iic_wrap_e: syscon@11cb1000 { + compatible = "mediatek,mt8192-imp_iic_wrap_e", "syscon"; + reg = <0 0x11cb1000 0 0x1000>; + #clock-cells = <1>; + }; + + - | + imp_iic_wrap_s: syscon@11d03000 { + compatible = "mediatek,mt8192-imp_iic_wrap_s", "syscon"; + reg = <0 0x11d03000 0 0x1000>; + #clock-cells = <1>; + }; + + - | + imp_iic_wrap_ws: syscon@11d23000 { + compatible = "mediatek,mt8192-imp_iic_wrap_ws", "syscon"; + reg = <0 0x11d23000 0 0x1000>; + #clock-cells = <1>; + }; + + - | + imp_iic_wrap_w: syscon@11e01000 { + compatible = "mediatek,mt8192-imp_iic_wrap_w", "syscon";
Documentation/devicetree/bindings/arm/mediatek/mediatek,imp_iic_wrap.yaml line 78
Quoted 10 lines
Documentation/devicetree/bindings/arm/mediatek/mediatek,imp_iic_wrap.yaml new file +10
-0+ reg = <0 0x11e01000 0 0x1000>; + #clock-cells = <1>; + }; + + - | + imp_iic_wrap_n: syscon@11f02000 { + compatible = "mediatek,mt8192-imp_iic_wrap_n", "syscon"; + reg = <0 0x11f02000 0 0x1000>; + #clock-cells = <1>; + };
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
Re: [PATCH v6 01/22] dt-bindings: ARM: Mediatek: Add new document bindings of imp i2c wrapper controller
Quoted 5 lines · Matthias Brugger
Quoted 2 lines · Weiyi Lu
This patch adds the new binding documentation of imp i2c wrapper controller for Mediatek MT8192.
Quoted 7 lines
The wrapper controller has only clock parts, or are the clock register mapped into the i2c wrapper block. In that case we might want to probe the clock driver through the i2c wrapper driver.
Regards,
Matthias
Yes, the clock registers are mapped into partial of the i2c wrapper block.
AFAIK, the i2c wrapper works with the i2c driver(i2c/busses/i2c-mt65xx.c) but not a new driver.
So do you still suggest us to probe the clock driver through the i2c driver(i2c/busses/i2c-mt65xx.c) just like the mtk-mm driver?
Quoted 97 lines
Quoted 82 lines
Signed-off-by Weiyi Lu <[email protected]>--- .../arm/mediatek/mediatek,imp_iic_wrap.yaml | 78 ++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,imp_iic_wrap.yamlDocumentation/devicetree/bindings/arm/mediatek/mediatek,imp_iic_wrap.yaml new file +68
-0@@ -0,0 +1,78 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/arm/mediatek/mediatek,imp_iic_wrap.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: MediaTek IMP I2C Wrapper Controller + +maintainers: + - Weiyi Lu <[email protected]> + +description: + The Mediatek imp i2c wrapper controller provides functional configurations and clocks to the system. + +properties: + compatible: + items: + - enum: + - mediatek,mt8192-imp_iic_wrap_c + - mediatek,mt8192-imp_iic_wrap_e + - mediatek,mt8192-imp_iic_wrap_s + - mediatek,mt8192-imp_iic_wrap_ws + - mediatek,mt8192-imp_iic_wrap_w + - mediatek,mt8192-imp_iic_wrap_n + - const: syscon + + reg: + maxItems: 1 + + '#clock-cells': + const: 1 + +required: + - compatible + - reg + +examples: + - | + imp_iic_wrap_c: syscon@11007000 { + compatible = "mediatek,mt8192-imp_iic_wrap_c", "syscon"; + reg = <0 0x11007000 0 0x1000>; + #clock-cells = <1>; + }; + + - | + imp_iic_wrap_e: syscon@11cb1000 { + compatible = "mediatek,mt8192-imp_iic_wrap_e", "syscon"; + reg = <0 0x11cb1000 0 0x1000>; + #clock-cells = <1>; + }; + + - | + imp_iic_wrap_s: syscon@11d03000 { + compatible = "mediatek,mt8192-imp_iic_wrap_s", "syscon"; + reg = <0 0x11d03000 0 0x1000>; + #clock-cells = <1>; + }; + + - | + imp_iic_wrap_ws: syscon@11d23000 { + compatible = "mediatek,mt8192-imp_iic_wrap_ws", "syscon"; + reg = <0 0x11d23000 0 0x1000>; + #clock-cells = <1>; + }; + + - | + imp_iic_wrap_w: syscon@11e01000 { + compatible = "mediatek,mt8192-imp_iic_wrap_w", "syscon";Documentation/devicetree/bindings/arm/mediatek/mediatek,imp_iic_wrap.yaml line 78
Quoted 10 lines
Documentation/devicetree/bindings/arm/mediatek/mediatek,imp_iic_wrap.yaml new file +10
-0+ reg = <0 0x11e01000 0 0x1000>; + #clock-cells = <1>; + }; + + - | + imp_iic_wrap_n: syscon@11f02000 { + compatible = "mediatek,mt8192-imp_iic_wrap_n", "syscon"; + reg = <0 0x11f02000 0 0x1000>; + #clock-cells = <1>; + };_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
PATCH v6 2/22 dt-bindings: ARM: Mediatek: Add new document bindings of mdpsys controller
In reply to Weiyi LuThis patch adds the new binding documentation of mdpsys controller for Mediatek MT8192.
--- .../bindings/arm/mediatek/mediatek,mdpsys.yaml | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,mdpsys.yaml
Documentation/devicetree/bindings/arm/mediatek/mediatek,mdpsys.yaml new file +38 -0
@@ -0,0 +1,38 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/arm/mediatek/mediatek,mdpsys.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: MediaTek MDPSYS Controller + +maintainers: + - Weiyi Lu <[email protected]> + +description: + The Mediatek mdpsys controller provides functional configurations and clocks to the system. + +properties: + compatible: + items: + - enum: + - mediatek,mt8192-mdpsys + - const: syscon + + reg: + maxItems: 1 + + '#clock-cells': + const: 1 + +required: + - compatible + - reg + +examples: + - | + mdpsys: syscon@1f000000 { + compatible = "mediatek,mt8192-mdpsys", "syscon"; + reg = <0 0x1f000000 0 0x1000>; + #clock-cells = <1>; + };
Signature · 5 lines
1.8.1.1.dirty _______________________________________________ Linux-mediatek mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-mediatek
PATCH v6 3/22 dt-bindings: ARM: Mediatek: Add new document bindings of msdc controller
In reply to Weiyi LuThis patch adds the new binding documentation of msdc controller for Mediatek MT8192.
--- .../bindings/arm/mediatek/mediatek,msdc.yaml | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,msdc.yaml
Documentation/devicetree/bindings/arm/mediatek/mediatek,msdc.yaml new file +46 -0
@@ -0,0 +1,46 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/arm/mediatek/mediatek,msdc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: MediaTek MSDC Controller + +maintainers: + - Weiyi Lu <[email protected]> + +description: + The Mediatek msdc controller provides functional configurations and clocks to the system. + +properties: + compatible: + items: + - enum: + - mediatek,mt8192-msdc + - mediatek,mt8192-msdc_top + - const: syscon + + reg: + maxItems: 1 + + '#clock-cells': + const: 1 + +required: + - compatible + - reg + +examples: + - | + msdc: syscon@11f60000 { + compatible = "mediatek,mt8192-msdc", "syscon"; + reg = <0 0x11f60000 0 0x1000>; + #clock-cells = <1>; + }; + + - | + msdc_top: syscon@11f10000 { + compatible = "mediatek,mt8192-msdc_top", "syscon"; + reg = <0 0x11f10000 0 0x1000>; + #clock-cells = <1>; + };
Signature · 5 lines
1.8.1.1.dirty _______________________________________________ Linux-mediatek mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-mediatek
PATCH v6 4/22 dt-bindings: ARM: Mediatek: Add new document bindings of scp adsp controller
In reply to Weiyi LuThis patch adds the new binding documentation of scp adsp controller for Mediatek MT8192.
--- .../bindings/arm/mediatek/mediatek,scp-adsp.yaml | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,scp-adsp.yaml
Documentation/devicetree/bindings/arm/mediatek/mediatek,scp-adsp.yaml new file +38 -0
@@ -0,0 +1,38 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/arm/mediatek/mediatek,scp-adsp.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: MediaTek SCP ADSP Controller + +maintainers: + - Weiyi Lu <[email protected]> + +description: + The Mediatek scp adsp controller provides functional configurations and clocks to the system. + +properties: + compatible: + items: + - enum: + - mediatek,mt8192-scp_adsp + - const: syscon + + reg: + maxItems: 1 + + '#clock-cells': + const: 1 + +required: + - compatible + - reg + +examples: + - | + scp_adsp: syscon@10720000 { + compatible = "mediatek,mt8192-scp_adsp", "syscon"; + reg = <0x10720000 0x1000>; + #clock-cells = <1>; + };
Signature · 5 lines
1.8.1.1.dirty _______________________________________________ Linux-mediatek mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-mediatek
PATCH v6 5/22 dt-bindings: ARM: Mediatek: Document bindings of MT8192 clock controllers
In reply to Weiyi LuThis patch adds the binding documentation of topckgen, apmixedsys, infracfg, pericfg and subsystem clocks for Mediatek MT8192.
--- .../bindings/arm/mediatek/mediatek,apmixedsys.txt | 1 + .../bindings/arm/mediatek/mediatek,audsys.txt | 1 + .../bindings/arm/mediatek/mediatek,camsys.txt | 22 ++++++++++++++++++++++ .../bindings/arm/mediatek/mediatek,imgsys.txt | 2 ++ .../bindings/arm/mediatek/mediatek,infracfg.txt | 1 + .../bindings/arm/mediatek/mediatek,ipesys.txt | 1 + .../bindings/arm/mediatek/mediatek,mfgcfg.txt | 1 + .../bindings/arm/mediatek/mediatek,mmsys.txt | 1 + .../bindings/arm/mediatek/mediatek,pericfg.yaml | 1 + .../bindings/arm/mediatek/mediatek,topckgen.txt | 1 + .../bindings/arm/mediatek/mediatek,vdecsys.txt | 8 ++++++++ .../bindings/arm/mediatek/mediatek,vencsys.txt | 1 + 12 files changed, 41 insertions(+)
Documentation/devicetree/bindings/arm/mediatek/mediatek,apmixedsys.txt +1 -0
@@ -18,6 +18,7 @@ Required Properties: - "mediatek,mt8167-apmixedsys", "syscon" - "mediatek,mt8173-apmixedsys" - "mediatek,mt8183-apmixedsys", "syscon" + - "mediatek,mt8192-apmixedsys", "syscon" - "mediatek,mt8516-apmixedsys" - #clock-cells: Must be 1
Documentation/devicetree/bindings/arm/mediatek/mediatek,audsys.txt +1 -0
@@ -13,6 +13,7 @@ Required Properties: - "mediatek,mt7623-audsys", "mediatek,mt2701-audsys", "syscon" - "mediatek,mt8167-audiosys", "syscon" - "mediatek,mt8183-audiosys", "syscon" + - "mediatek,mt8192-audsys", "syscon" - "mediatek,mt8516-audsys", "syscon" - #clock-cells: Must be 1
Documentation/devicetree/bindings/arm/mediatek/mediatek,camsys.txt +22 -0
@@ -9,6 +9,10 @@ Required Properties: - "mediatek,mt6765-camsys", "syscon" - "mediatek,mt6779-camsys", "syscon" - "mediatek,mt8183-camsys", "syscon" + - "mediatek,mt8192-camsys", "syscon" + - "mediatek,mt8192-camsys_rawa", "syscon" + - "mediatek,mt8192-camsys_rawb", "syscon" + - "mediatek,mt8192-camsys_rawc", "syscon" - #clock-cells: Must be 1 The camsys controller uses the common clk binding from
@@ -22,3 +26,21 @@ camsys: camsys@1a000000 { reg = <0 0x1a000000 0 0x1000>; #clock-cells = <1>; }; + +camsys_rawa: syscon@1a04f000 { + compatible = "mediatek,mt8192-camsys_rawa", "syscon"; + reg = <0 0x1a04f000 0 0x1000>; + #clock-cells = <1>; +}; + +camsys_rawb: syscon@1a06f000 { + compatible = "mediatek,mt8192-camsys_rawb", "syscon"; + reg = <0 0x1a06f000 0 0x1000>; + #clock-cells = <1>; +}; + +camsys_rawc: syscon@1a08f000 { + compatible = "mediatek,mt8192-camsys_rawc", "syscon"; + reg = <0 0x1a08f000 0 0x1000>; + #clock-cells = <1>; +};
Documentation/devicetree/bindings/arm/mediatek/mediatek,imgsys.txt +2 -0
@@ -15,6 +15,8 @@ Required Properties: - "mediatek,mt8167-imgsys", "syscon" - "mediatek,mt8173-imgsys", "syscon" - "mediatek,mt8183-imgsys", "syscon" + - "mediatek,mt8192-imgsys", "syscon" + - "mediatek,mt8192-imgsys2", "syscon" - #clock-cells: Must be 1 The imgsys controller uses the common clk binding from
Documentation/devicetree/bindings/arm/mediatek/mediatek,infracfg.txt +1 -0
@@ -19,6 +19,7 @@ Required Properties: - "mediatek,mt8167-infracfg", "syscon" - "mediatek,mt8173-infracfg", "syscon" - "mediatek,mt8183-infracfg", "syscon" + - "mediatek,mt8192-infracfg", "syscon" - "mediatek,mt8516-infracfg", "syscon" - #clock-cells: Must be 1 - #reset-cells: Must be 1
Documentation/devicetree/bindings/arm/mediatek/mediatek,ipesys.txt +1 -0
@@ -7,6 +7,7 @@ Required Properties: - compatible: Should be one of: - "mediatek,mt6779-ipesys", "syscon" + - "mediatek,mt8192-ipesys", "syscon" - #clock-cells: Must be 1 The ipesys controller uses the common clk binding from
Documentation/devicetree/bindings/arm/mediatek/mediatek,mfgcfg.txt +1 -0
@@ -10,6 +10,7 @@ Required Properties: - "mediatek,mt6779-mfgcfg", "syscon" - "mediatek,mt8167-mfgcfg", "syscon" - "mediatek,mt8183-mfgcfg", "syscon" + - "mediatek,mt8192-mfgcfg", "syscon" - #clock-cells: Must be 1 The mfgcfg controller uses the common clk binding from
Documentation/devicetree/bindings/arm/mediatek/mediatek,mmsys.txt +1 -0
@@ -15,6 +15,7 @@ Required Properties: - "mediatek,mt7623-mmsys", "mediatek,mt2701-mmsys", "syscon" - "mediatek,mt8173-mmsys", "syscon" - "mediatek,mt8183-mmsys", "syscon" + - "mediatek,mt8192-mmsys", "syscon" - #clock-cells: Must be 1 For the clock control, the mmsys controller uses the common clk binding from
Documentation/devicetree/bindings/arm/mediatek/mediatek,pericfg.yaml +1 -0
@@ -26,6 +26,7 @@ properties: - mediatek,mt8135-pericfg - mediatek,mt8173-pericfg - mediatek,mt8183-pericfg + - mediatek,mt8192-pericfg - mediatek,mt8516-pericfg - const: syscon - items:
Documentation/devicetree/bindings/arm/mediatek/mediatek,topckgen.txt +1 -0
@@ -18,6 +18,7 @@ Required Properties: - "mediatek,mt8167-topckgen", "syscon" - "mediatek,mt8173-topckgen" - "mediatek,mt8183-topckgen", "syscon" + - "mediatek,mt8192-topckgen", "syscon" - "mediatek,mt8516-topckgen" - #clock-cells: Must be 1
Documentation/devicetree/bindings/arm/mediatek/mediatek,vdecsys.txt +8 -0
@@ -14,6 +14,8 @@ Required Properties: - "mediatek,mt8167-vdecsys", "syscon" - "mediatek,mt8173-vdecsys", "syscon" - "mediatek,mt8183-vdecsys", "syscon" + - "mediatek,mt8192-vdecsys", "syscon" + - "mediatek,mt8192-vdecsys_soc", "syscon" - #clock-cells: Must be 1 The vdecsys controller uses the common clk binding from
@@ -27,3 +29,9 @@ vdecsys: clock-controller@16000000 { reg = <0 0x16000000 0 0x1000>; #clock-cells = <1>; }; + +vdecsys_soc: syscon@1600f000 { + compatible = "mediatek,mt8192-vdecsys_soc", "syscon"; + reg = <0 0x1600f000 0 0x1000>; + #clock-cells = <1>; +};
Documentation/devicetree/bindings/arm/mediatek/mediatek,vencsys.txt +1 -0
@@ -11,6 +11,7 @@ Required Properties: - "mediatek,mt6797-vencsys", "syscon" - "mediatek,mt8173-vencsys", "syscon" - "mediatek,mt8183-vencsys", "syscon" + - "mediatek,mt8192-vencsys", "syscon" - #clock-cells: Must be 1 The vencsys controller uses the common clk binding from
Signature · 1 line
1.8.1.1.dirty
PATCH v6 6/22 clk: mediatek: Add dt-bindings of MT8192 clocks
In reply to Weiyi LuAdd MT8192 clock dt-bindings, include topckgen, apmixedsys, infracfg, pericfg and subsystem clocks.
--- include/dt-bindings/clock/mt8192-clk.h | 585 +++++++++++++++++++++++++++++++++ 1 file changed, 585 insertions(+) create mode 100644 include/dt-bindings/clock/mt8192-clk.h
include/dt-bindings/clock/mt8192-clk.h new file +585 -0
@@ -0,0 +1,585 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* +* Copyright (c) 2020 MediaTek Inc. +* Author: Weiyi Lu <[email protected]> +*/ + +#ifndef _DT_BINDINGS_CLK_MT8192_H +#define _DT_BINDINGS_CLK_MT8192_H + +/* TOPCKGEN */ + +#define CLK_TOP_AXI_SEL 0 +#define CLK_TOP_SPM_SEL 1 +#define CLK_TOP_SCP_SEL 2 +#define CLK_TOP_BUS_AXIMEM_SEL 3 +#define CLK_TOP_DISP_SEL 4 +#define CLK_TOP_MDP_SEL 5 +#define CLK_TOP_IMG1_SEL 6 +#define CLK_TOP_IMG2_SEL 7 +#define CLK_TOP_IPE_SEL 8 +#define CLK_TOP_DPE_SEL 9 +#define CLK_TOP_CAM_SEL 10 +#define CLK_TOP_CCU_SEL 11 +#define CLK_TOP_DSP7_SEL 12 +#define CLK_TOP_MFG_REF_SEL 13 +#define CLK_TOP_MFG_PLL_SEL 14 +#define CLK_TOP_CAMTG_SEL 15 +#define CLK_TOP_CAMTG2_SEL 16 +#define CLK_TOP_CAMTG3_SEL 17 +#define CLK_TOP_CAMTG4_SEL 18 +#define CLK_TOP_CAMTG5_SEL 19 +#define CLK_TOP_CAMTG6_SEL 20 +#define CLK_TOP_UART_SEL 21 +#define CLK_TOP_SPI_SEL 22 +#define CLK_TOP_MSDC50_0_H_SEL 23 +#define CLK_TOP_MSDC50_0_SEL 24 +#define CLK_TOP_MSDC30_1_SEL 25 +#define CLK_TOP_MSDC30_2_SEL 26 +#define CLK_TOP_AUDIO_SEL 27 +#define CLK_TOP_AUD_INTBUS_SEL 28 +#define CLK_TOP_PWRAP_ULPOSC_SEL 29 +#define CLK_TOP_ATB_SEL 30 +#define CLK_TOP_DPI_SEL 31 +#define CLK_TOP_SCAM_SEL 32 +#define CLK_TOP_DISP_PWM_SEL 33 +#define CLK_TOP_USB_TOP_SEL 34 +#define CLK_TOP_SSUSB_XHCI_SEL 35 +#define CLK_TOP_I2C_SEL 36 +#define CLK_TOP_SENINF_SEL 37 +#define CLK_TOP_SENINF1_SEL 38 +#define CLK_TOP_SENINF2_SEL 39 +#define CLK_TOP_SENINF3_SEL 40 +#define CLK_TOP_TL_SEL 41 +#define CLK_TOP_DXCC_SEL 42 +#define CLK_TOP_AUD_ENGEN1_SEL 43 +#define CLK_TOP_AUD_ENGEN2_SEL 44 +#define CLK_TOP_AES_UFSFDE_SEL 45 +#define CLK_TOP_UFS_SEL 46 +#define CLK_TOP_AUD_1_SEL 47 +#define CLK_TOP_AUD_2_SEL 48 +#define CLK_TOP_ADSP_SEL 49 +#define CLK_TOP_DPMAIF_MAIN_SEL 50 +#define CLK_TOP_VENC_SEL 51 +#define CLK_TOP_VDEC_SEL 52 +#define CLK_TOP_CAMTM_SEL 53 +#define CLK_TOP_PWM_SEL 54 +#define CLK_TOP_AUDIO_H_SEL 55 +#define CLK_TOP_SPMI_MST_SEL 56 +#define CLK_TOP_AES_MSDCFDE_SEL 57 +#define CLK_TOP_SFLASH_SEL 58 +#define CLK_TOP_APLL_I2S0_M_SEL 59 +#define CLK_TOP_APLL_I2S1_M_SEL 60 +#define CLK_TOP_APLL_I2S2_M_SEL 61 +#define CLK_TOP_APLL_I2S3_M_SEL 62 +#define CLK_TOP_APLL_I2S4_M_SEL 63 +#define CLK_TOP_APLL_I2S5_M_SEL 64 +#define CLK_TOP_APLL_I2S6_M_SEL 65 +#define CLK_TOP_APLL_I2S7_M_SEL 66 +#define CLK_TOP_APLL_I2S8_M_SEL 67 +#define CLK_TOP_APLL_I2S9_M_SEL 68 +#define CLK_TOP_MAINPLL_D3 69 +#define CLK_TOP_MAINPLL_D4 70 +#define CLK_TOP_MAINPLL_D4_D2 71 +#define CLK_TOP_MAINPLL_D4_D4 72 +#define CLK_TOP_MAINPLL_D4_D8 73 +#define CLK_TOP_MAINPLL_D4_D16 74 +#define CLK_TOP_MAINPLL_D5 75 +#define CLK_TOP_MAINPLL_D5_D2 76 +#define CLK_TOP_MAINPLL_D5_D4 77 +#define CLK_TOP_MAINPLL_D5_D8 78 +#define CLK_TOP_MAINPLL_D6 79 +#define CLK_TOP_MAINPLL_D6_D2 80 +#define CLK_TOP_MAINPLL_D6_D4 81 +#define CLK_TOP_MAINPLL_D7 82 +#define CLK_TOP_MAINPLL_D7_D2 83 +#define CLK_TOP_MAINPLL_D7_D4 84 +#define CLK_TOP_MAINPLL_D7_D8 85 +#define CLK_TOP_UNIVPLL_D3 86 +#define CLK_TOP_UNIVPLL_D4 87 +#define CLK_TOP_UNIVPLL_D4_D2 88 +#define CLK_TOP_UNIVPLL_D4_D4 89 +#define CLK_TOP_UNIVPLL_D4_D8 90 +#define CLK_TOP_UNIVPLL_D5 91 +#define CLK_TOP_UNIVPLL_D5_D2 92 +#define CLK_TOP_UNIVPLL_D5_D4 93 +#define CLK_TOP_UNIVPLL_D5_D8 94 +#define CLK_TOP_UNIVPLL_D6 95 +#define CLK_TOP_UNIVPLL_D6_D2 96 +#define CLK_TOP_UNIVPLL_D6_D4 97 +#define CLK_TOP_UNIVPLL_D6_D8 98 +#define CLK_TOP_UNIVPLL_D6_D16 99 +#define CLK_TOP_UNIVPLL_D7 100 +#define CLK_TOP_APLL1 101 +#define CLK_TOP_APLL1_D2 102 +#define CLK_TOP_APLL1_D4 103 +#define CLK_TOP_APLL1_D8 104 +#define CLK_TOP_APLL2 105 +#define CLK_TOP_APLL2_D2 106 +#define CLK_TOP_APLL2_D4 107 +#define CLK_TOP_APLL2_D8 108 +#define CLK_TOP_MMPLL_D4 109 +#define CLK_TOP_MMPLL_D4_D2 110 +#define CLK_TOP_MMPLL_D5 111 +#define CLK_TOP_MMPLL_D5_D2 112 +#define CLK_TOP_MMPLL_D6 113 +#define CLK_TOP_MMPLL_D6_D2 114 +#define CLK_TOP_MMPLL_D7 115 +#define CLK_TOP_MMPLL_D9 116 +#define CLK_TOP_APUPLL 117 +#define CLK_TOP_NPUPLL 118 +#define CLK_TOP_TVDPLL 119 +#define CLK_TOP_TVDPLL_D2 120 +#define CLK_TOP_TVDPLL_D4 121 +#define CLK_TOP_TVDPLL_D8 122 +#define CLK_TOP_TVDPLL_D16 123 +#define CLK_TOP_MSDCPLL 124 +#define CLK_TOP_MSDCPLL_D2 125 +#define CLK_TOP_MSDCPLL_D4 126 +#define CLK_TOP_ULPOSC 127 +#define CLK_TOP_OSC_D2 128 +#define CLK_TOP_OSC_D4 129 +#define CLK_TOP_OSC_D8 130 +#define CLK_TOP_OSC_D10 131 +#define CLK_TOP_OSC_D16 132 +#define CLK_TOP_OSC_D20 133 +#define CLK_TOP_CSW_F26M_D2 134 +#define CLK_TOP_ADSPPLL 135 +#define CLK_TOP_UNIVPLL_192M 136 +#define CLK_TOP_UNIVPLL_192M_D2 137 +#define CLK_TOP_UNIVPLL_192M_D4 138 +#define CLK_TOP_UNIVPLL_192M_D8 139 +#define CLK_TOP_UNIVPLL_192M_D16 140 +#define CLK_TOP_UNIVPLL_192M_D32 141 +#define CLK_TOP_APLL12_DIV0 142 +#define CLK_TOP_APLL12_DIV1 143 +#define CLK_TOP_APLL12_DIV2 144 +#define CLK_TOP_APLL12_DIV3 145 +#define CLK_TOP_APLL12_DIV4 146 +#define CLK_TOP_APLL12_DIVB 147 +#define CLK_TOP_APLL12_DIV5 148 +#define CLK_TOP_APLL12_DIV6 149 +#define CLK_TOP_APLL12_DIV7 150 +#define CLK_TOP_APLL12_DIV8 151 +#define CLK_TOP_APLL12_DIV9 152 +#define CLK_TOP_SSUSB_TOP_REF 153 +#define CLK_TOP_SSUSB_PHY_REF 154 +#define CLK_TOP_NR_CLK 155 + +/* INFRACFG */ + +#define CLK_INFRA_PMIC_TMR 0 +#define CLK_INFRA_PMIC_AP 1 +#define CLK_INFRA_PMIC_MD 2 +#define CLK_INFRA_PMIC_CONN 3 +#define CLK_INFRA_SCPSYS 4 +#define CLK_INFRA_SEJ 5 +#define CLK_INFRA_APXGPT 6 +#define CLK_INFRA_GCE 7 +#define CLK_INFRA_GCE2 8 +#define CLK_INFRA_THERM 9 +#define CLK_INFRA_I2C0 10 +#define CLK_INFRA_AP_DMA_PSEUDO 11 +#define CLK_INFRA_I2C2 12 +#define CLK_INFRA_I2C3 13 +#define CLK_INFRA_PWM_H 14 +#define CLK_INFRA_PWM1 15 +#define CLK_INFRA_PWM2 16 +#define CLK_INFRA_PWM3 17 +#define CLK_INFRA_PWM4 18 +#define CLK_INFRA_PWM 19 +#define CLK_INFRA_UART0 20 +#define CLK_INFRA_UART1 21 +#define CLK_INFRA_UART2 22 +#define CLK_INFRA_UART3 23 +#define CLK_INFRA_GCE_26M 24 +#define CLK_INFRA_CQ_DMA_FPC 25 +#define CLK_INFRA_BTIF 26 +#define CLK_INFRA_SPI0 27 +#define CLK_INFRA_MSDC0 28 +#define CLK_INFRA_MSDC1 29 +#define CLK_INFRA_MSDC2 30 +#define CLK_INFRA_MSDC0_SRC 31 +#define CLK_INFRA_GCPU 32 +#define CLK_INFRA_TRNG 33 +#define CLK_INFRA_AUXADC 34 +#define CLK_INFRA_CPUM 35 +#define CLK_INFRA_CCIF1_AP 36 +#define CLK_INFRA_CCIF1_MD 37 +#define CLK_INFRA_AUXADC_MD 38 +#define CLK_INFRA_PCIE_TL_26M 39 +#define CLK_INFRA_MSDC1_SRC 40 +#define CLK_INFRA_MSDC2_SRC 41 +#define CLK_INFRA_PCIE_TL_96M 42 +#define CLK_INFRA_PCIE_PL_P_250M 43 +#define CLK_INFRA_DEVICE_APC 44 +#define CLK_INFRA_CCIF_AP 45 +#define CLK_INFRA_DEBUGSYS 46 +#define CLK_INFRA_AUDIO 47 +#define CLK_INFRA_CCIF_MD 48 +#define CLK_INFRA_DXCC_SEC_CORE 49 +#define CLK_INFRA_DXCC_AO 50 +#define CLK_INFRA_DBG_TRACE 51 +#define CLK_INFRA_DEVMPU_B 52 +#define CLK_INFRA_DRAMC_F26M 53 +#define CLK_INFRA_IRTX 54 +#define CLK_INFRA_SSUSB 55 +#define CLK_INFRA_DISP_PWM 56 +#define CLK_INFRA_CLDMA_B 57 +#define CLK_INFRA_AUDIO_26M_B 58 +#define CLK_INFRA_MODEM_TEMP_SHARE 59 +#define CLK_INFRA_SPI1 60 +#define CLK_INFRA_I2C4 61 +#define CLK_INFRA_SPI2 62 +#define CLK_INFRA_SPI3 63 +#define CLK_INFRA_UNIPRO_SYS 64 +#define CLK_INFRA_UNIPRO_TICK 65 +#define CLK_INFRA_UFS_MP_SAP_B 66 +#define CLK_INFRA_MD32_B 67 +#define CLK_INFRA_UNIPRO_MBIST 68 +#define CLK_INFRA_I2C5 69 +#define CLK_INFRA_I2C5_ARBITER 70 +#define CLK_INFRA_I2C5_IMM 71 +#define CLK_INFRA_I2C1_ARBITER 72 +#define CLK_INFRA_I2C1_IMM 73 +#define CLK_INFRA_I2C2_ARBITER 74 +#define CLK_INFRA_I2C2_IMM 75 +#define CLK_INFRA_SPI4 76 +#define CLK_INFRA_SPI5 77 +#define CLK_INFRA_CQ_DMA 78 +#define CLK_INFRA_UFS 79 +#define CLK_INFRA_AES_UFSFDE 80 +#define CLK_INFRA_UFS_TICK 81 +#define CLK_INFRA_SSUSB_XHCI 82 +#define CLK_INFRA_MSDC0_SELF 83 +#define CLK_INFRA_MSDC1_SELF 84 +#define CLK_INFRA_MSDC2_SELF 85 +#define CLK_INFRA_UFS_AXI 86 +#define CLK_INFRA_I2C6 87 +#define CLK_INFRA_AP_MSDC0 88 +#define CLK_INFRA_MD_MSDC0 89 +#define CLK_INFRA_CCIF5_AP 90 +#define CLK_INFRA_CCIF5_MD 91 +#define CLK_INFRA_PCIE_TOP_H_133M 92 +#define CLK_INFRA_FLASHIF_TOP_H_133M 93 +#define CLK_INFRA_PCIE_PERI_26M 94 +#define CLK_INFRA_CCIF2_AP 95 +#define CLK_INFRA_CCIF2_MD 96 +#define CLK_INFRA_CCIF3_AP 97 +#define CLK_INFRA_CCIF3_MD 98 +#define CLK_INFRA_SEJ_F13M 99 +#define CLK_INFRA_AES 100 +#define CLK_INFRA_I2C7 101 +#define CLK_INFRA_I2C8 102 +#define CLK_INFRA_FBIST2FPC 103 +#define CLK_INFRA_DEVICE_APC_SYNC 104 +#define CLK_INFRA_DPMAIF_MAIN 105 +#define CLK_INFRA_PCIE_TL_32K 106 +#define CLK_INFRA_CCIF4_AP 107 +#define CLK_INFRA_CCIF4_MD 108 +#define CLK_INFRA_SPI6 109 +#define CLK_INFRA_SPI7 110 +#define CLK_INFRA_133M 111 +#define CLK_INFRA_66M 112 +#define CLK_INFRA_66M_PERI_BUS 113 +#define CLK_INFRA_FREE_DCM_133M 114 +#define CLK_INFRA_FREE_DCM_66M 115 +#define CLK_INFRA_PERI_BUS_DCM_133M 116 +#define CLK_INFRA_PERI_BUS_DCM_66M 117 +#define CLK_INFRA_FLASHIF_PERI_26M 118 +#define CLK_INFRA_FLASHIF_SFLASH 119 +#define CLK_INFRA_AP_DMA 120 +#define CLK_INFRA_NR_CLK 121 + +/* PERICFG */ + +#define CLK_PERI_PERIAXI 0 +#define CLK_PERI_NR_CLK 1 + +/* APMIXEDSYS */ + +#define CLK_APMIXED_MAINPLL 0 +#define CLK_APMIXED_UNIVPLL 1 +#define CLK_APMIXED_USBPLL 2 +#define CLK_APMIXED_MSDCPLL 3 +#define CLK_APMIXED_MMPLL 4 +#define CLK_APMIXED_ADSPPLL 5 +#define CLK_APMIXED_MFGPLL 6 +#define CLK_APMIXED_TVDPLL 7 +#define CLK_APMIXED_APLL1 8 +#define CLK_APMIXED_APLL2 9 +#define CLK_APMIXED_MIPID26M 10 +#define CLK_APMIXED_NR_CLK 11 + +/* SCP_ADSP */ + +#define CLK_SCP_ADSP_AUDIODSP 0 +#define CLK_SCP_ADSP_NR_CLK 1 + +/* IMP_IIC_WRAP_C */ + +#define CLK_IMP_IIC_WRAP_C_I2C10 0 +#define CLK_IMP_IIC_WRAP_C_I2C11 1 +#define CLK_IMP_IIC_WRAP_C_I2C12 2 +#define CLK_IMP_IIC_WRAP_C_I2C13 3 +#define CLK_IMP_IIC_WRAP_C_NR_CLK 4 + +/* AUDSYS */ + +#define CLK_AUD_AFE 0 +#define CLK_AUD_22M 1 +#define CLK_AUD_24M 2 +#define CLK_AUD_APLL2_TUNER 3 +#define CLK_AUD_APLL_TUNER 4 +#define CLK_AUD_TDM 5 +#define CLK_AUD_ADC 6 +#define CLK_AUD_DAC 7 +#define CLK_AUD_DAC_PREDIS 8 +#define CLK_AUD_TML 9 +#define CLK_AUD_NLE 10 +#define CLK_AUD_I2S1_B 11 +#define CLK_AUD_I2S2_B 12 +#define CLK_AUD_I2S3_B 13 +#define CLK_AUD_I2S4_B 14 +#define CLK_AUD_CONNSYS_I2S_ASRC 15 +#define CLK_AUD_GENERAL1_ASRC 16 +#define CLK_AUD_GENERAL2_ASRC 17 +#define CLK_AUD_DAC_HIRES 18 +#define CLK_AUD_ADC_HIRES 19 +#define CLK_AUD_ADC_HIRES_TML 20 +#define CLK_AUD_ADDA6_ADC 21 +#define CLK_AUD_ADDA6_ADC_HIRES 22 +#define CLK_AUD_3RD_DAC 23 +#define CLK_AUD_3RD_DAC_PREDIS 24 +#define CLK_AUD_3RD_DAC_TML 25 +#define CLK_AUD_3RD_DAC_HIRES 26 +#define CLK_AUD_I2S5_B 27 +#define CLK_AUD_I2S6_B 28 +#define CLK_AUD_I2S7_B 29 +#define CLK_AUD_I2S8_B 30 +#define CLK_AUD_I2S9_B 31 +#define CLK_AUD_NR_CLK 32 + +/* IMP_IIC_WRAP_E */ + +#define CLK_IMP_IIC_WRAP_E_I2C3 0 +#define CLK_IMP_IIC_WRAP_E_NR_CLK 1 + +/* IMP_IIC_WRAP_S */ + +#define CLK_IMP_IIC_WRAP_S_I2C7 0 +#define CLK_IMP_IIC_WRAP_S_I2C8 1 +#define CLK_IMP_IIC_WRAP_S_I2C9 2 +#define CLK_IMP_IIC_WRAP_S_NR_CLK 3 + +/* IMP_IIC_WRAP_WS */ + +#define CLK_IMP_IIC_WRAP_WS_I2C1 0 +#define CLK_IMP_IIC_WRAP_WS_I2C2 1 +#define CLK_IMP_IIC_WRAP_WS_I2C4 2 +#define CLK_IMP_IIC_WRAP_WS_NR_CLK 3 + +/* IMP_IIC_WRAP_W */ + +#define CLK_IMP_IIC_WRAP_W_I2C5 0 +#define CLK_IMP_IIC_WRAP_W_NR_CLK 1 + +/* IMP_IIC_WRAP_N */ + +#define CLK_IMP_IIC_WRAP_N_I2C0 0 +#define CLK_IMP_IIC_WRAP_N_I2C6 1 +#define CLK_IMP_IIC_WRAP_N_NR_CLK 2 + +/* MSDC_TOP */ + +#define CLK_MSDC_TOP_AES_0P 0 +#define CLK_MSDC_TOP_SRC_0P 1 +#define CLK_MSDC_TOP_SRC_1P 2 +#define CLK_MSDC_TOP_SRC_2P 3 +#define CLK_MSDC_TOP_P_MSDC0 4 +#define CLK_MSDC_TOP_P_MSDC1 5 +#define CLK_MSDC_TOP_P_MSDC2 6 +#define CLK_MSDC_TOP_P_CFG 7 +#define CLK_MSDC_TOP_AXI 8 +#define CLK_MSDC_TOP_H_MST_0P 9 +#define CLK_MSDC_TOP_H_MST_1P 10 +#define CLK_MSDC_TOP_H_MST_2P 11 +#define CLK_MSDC_TOP_MEM_OFF_DLY_26M 12 +#define CLK_MSDC_TOP_32K 13 +#define CLK_MSDC_TOP_AHB2AXI_BRG_AXI 14 +#define CLK_MSDC_TOP_NR_CLK 15 + +/* MSDC */ + +#define CLK_MSDC_AXI_WRAP 0 +#define CLK_MSDC_NR_CLK 1 + +/* MFGCFG */ + +#define CLK_MFG_BG3D 0 +#define CLK_MFG_NR_CLK 1 + +/* MMSYS */ + +#define CLK_MM_DISP_MUTEX0 0 +#define CLK_MM_DISP_CONFIG 1 +#define CLK_MM_DISP_OVL0 2 +#define CLK_MM_DISP_RDMA0 3 +#define CLK_MM_DISP_OVL0_2L 4 +#define CLK_MM_DISP_WDMA0 5 +#define CLK_MM_DISP_UFBC_WDMA0 6 +#define CLK_MM_DISP_RSZ0 7 +#define CLK_MM_DISP_AAL0 8 +#define CLK_MM_DISP_CCORR0 9 +#define CLK_MM_DISP_DITHER0 10 +#define CLK_MM_SMI_INFRA 11 +#define CLK_MM_DISP_GAMMA0 12 +#define CLK_MM_DISP_POSTMASK0 13 +#define CLK_MM_DISP_DSC_WRAP0 14 +#define CLK_MM_DSI0 15 +#define CLK_MM_DISP_COLOR0 16 +#define CLK_MM_SMI_COMMON 17 +#define CLK_MM_DISP_FAKE_ENG0 18 +#define CLK_MM_DISP_FAKE_ENG1 19 +#define CLK_MM_MDP_TDSHP4 20 +#define CLK_MM_MDP_RSZ4 21 +#define CLK_MM_MDP_AAL4 22 +#define CLK_MM_MDP_HDR4 23 +#define CLK_MM_MDP_RDMA4 24 +#define CLK_MM_MDP_COLOR4 25 +#define CLK_MM_DISP_Y2R0 26 +#define CLK_MM_SMI_GALS 27 +#define CLK_MM_DISP_OVL2_2L 28 +#define CLK_MM_DISP_RDMA4 29 +#define CLK_MM_DISP_DPI0 30 +#define CLK_MM_SMI_IOMMU 31 +#define CLK_MM_DSI_DSI0 32 +#define CLK_MM_DPI_DPI0 33 +#define CLK_MM_26MHZ 34 +#define CLK_MM_32KHZ 35 +#define CLK_MM_NR_CLK 36 + +/* IMGSYS */ + +#define CLK_IMG_LARB9 0 +#define CLK_IMG_LARB10 1 +#define CLK_IMG_DIP 2 +#define CLK_IMG_GALS 3 +#define CLK_IMG_NR_CLK 4 + +/* IMGSYS2 */ + +#define CLK_IMG2_LARB11 0 +#define CLK_IMG2_LARB12 1 +#define CLK_IMG2_MFB 2 +#define CLK_IMG2_WPE 3 +#define CLK_IMG2_MSS 4 +#define CLK_IMG2_GALS 5 +#define CLK_IMG2_NR_CLK 6 + +/* VDECSYS_SOC */ + +#define CLK_VDEC_SOC_LARB1 0 +#define CLK_VDEC_SOC_LAT 1 +#define CLK_VDEC_SOC_LAT_ACTIVE 2 +#define CLK_VDEC_SOC_VDEC 3 +#define CLK_VDEC_SOC_VDEC_ACTIVE 4 +#define CLK_VDEC_SOC_NR_CLK 5 + +/* VDECSYS */ + +#define CLK_VDEC_LARB1 0 +#define CLK_VDEC_LAT 1 +#define CLK_VDEC_LAT_ACTIVE 2 +#define CLK_VDEC_VDEC 3 +#define CLK_VDEC_ACTIVE 4 +#define CLK_VDEC_NR_CLK 5 + +/* VENCSYS */ + +#define CLK_VENC_SET0_LARB 0 +#define CLK_VENC_SET1_VENC 1 +#define CLK_VENC_SET2_JPGENC 2 +#define CLK_VENC_SET5_GALS 3 +#define CLK_VENC_NR_CLK 4 + +/* CAMSYS */ + +#define CLK_CAM_LARB13 0 +#define CLK_CAM_DFP_VAD 1 +#define CLK_CAM_LARB14 2 +#define CLK_CAM_CAM 3 +#define CLK_CAM_CAMTG 4 +#define CLK_CAM_SENINF 5 +#define CLK_CAM_CAMSV0 6 +#define CLK_CAM_CAMSV1 7 +#define CLK_CAM_CAMSV2 8 +#define CLK_CAM_CAMSV3 9 +#define CLK_CAM_CCU0 10 +#define CLK_CAM_CCU1 11 +#define CLK_CAM_MRAW0 12 +#define CLK_CAM_FAKE_ENG 13 +#define CLK_CAM_CCU_GALS 14 +#define CLK_CAM_CAM2MM_GALS 15 +#define CLK_CAM_NR_CLK 16 + +/* CAMSYS_RAWA */ + +#define CLK_CAM_RAWA_LARBX 0 +#define CLK_CAM_RAWA_CAM 1 +#define CLK_CAM_RAWA_CAMTG 2 +#define CLK_CAM_RAWA_NR_CLK 3 + +/* CAMSYS_RAWB */ + +#define CLK_CAM_RAWB_LARBX 0 +#define CLK_CAM_RAWB_CAM 1 +#define CLK_CAM_RAWB_CAMTG 2 +#define CLK_CAM_RAWB_NR_CLK 3 + +/* CAMSYS_RAWC */ + +#define CLK_CAM_RAWC_LARBX 0 +#define CLK_CAM_RAWC_CAM 1 +#define CLK_CAM_RAWC_CAMTG 2 +#define CLK_CAM_RAWC_NR_CLK 3 + +/* IPESYS */ + +#define CLK_IPE_LARB19 0 +#define CLK_IPE_LARB20 1 +#define CLK_IPE_SMI_SUBCOM 2 +#define CLK_IPE_FD 3 +#define CLK_IPE_FE 4 +#define CLK_IPE_RSC 5 +#define CLK_IPE_DPE 6 +#define CLK_IPE_GALS 7 +#define CLK_IPE_NR_CLK 8 + +/* MDPSYS */ + +#define CLK_MDP_RDMA0 0 +#define CLK_MDP_TDSHP0 1 +#define CLK_MDP_IMG_DL_ASYNC0 2 +#define CLK_MDP_IMG_DL_ASYNC1 3 +#define CLK_MDP_RDMA1 4 +#define CLK_MDP_TDSHP1 5 +#define CLK_MDP_SMI0 6 +#define CLK_MDP_APB_BUS 7 +#define CLK_MDP_WROT0 8 +#define CLK_MDP_RSZ0 9 +#define CLK_MDP_HDR0 10 +#define CLK_MDP_MUTEX0 11 +#define CLK_MDP_WROT1 12 +#define CLK_MDP_RSZ1 13 +#define CLK_MDP_HDR1 14 +#define CLK_MDP_FAKE_ENG0 15 +#define CLK_MDP_AAL0 16 +#define CLK_MDP_AAL1 17 +#define CLK_MDP_COLOR0 18 +#define CLK_MDP_COLOR1 19 +#define CLK_MDP_IMG_DL_RELAY0_ASYNC0 20 +#define CLK_MDP_IMG_DL_RELAY1_ASYNC1 21 +#define CLK_MDP_NR_CLK 22 + +#endif /* _DT_BINDINGS_CLK_MT8192_H */
Signature · 1 line
1.8.1.1.dirty
PATCH v6 7/22 clk: mediatek: Fix asymmetrical PLL enable and disable control
In reply to Weiyi LuIn fact, the en_mask is a combination of divider enable mask and pll enable bit(bit0).
Before this patch, we enabled both divider mask and bit0 in prepare(), but only cleared the bit0 in unprepare().
In the future, we hope en_mask will only be used as divider enable mask. The enable register(CON0) will be set in 2 steps:
first is divider mask, and then bit0 during prepare(), and vice versa. But considering backward compatibility, at this stage we allow en_mask to be a combination or a pure divider enable mask.
And then we will make en_mask a pure divider enable mask in another following patch series.
--- drivers/clk/mediatek/clk-pll.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-)
drivers/clk/mediatek/clk-pll.c +16 -4
@@ -238,6 +238,7 @@ static int mtk_pll_prepare(struct clk_hw *hw) {struct mtk_clk_pll *pll =to_mtk_clk_pll (hw);u32 r; +u32 div_en_mask; r =readl (pll->pwr_addr) |CON0_PWR_ON ;writel (r, pll->pwr_addr);
@@ -247,10 +248,15 @@ static int mtk_pll_prepare(struct clk_hw *hw)writel (r, pll->pwr_addr);udelay (1 ); - r =readl (pll->base_addr +REG_CON0 ); - r |= pll->data->en_mask; + r =readl (pll->base_addr +REG_CON0 ) |CON0_BASE_EN ;writel (r, pll->base_addr +REG_CON0 ); + div_en_mask = pll->data->en_mask & ~CON0_BASE_EN ; +if (div_en_mask) { + r =readl (pll->base_addr +REG_CON0 ) | div_en_mask; +writel (r, pll->base_addr +REG_CON0 ); + } +__mtk_pll_tuner_enable (pll);udelay (20 );
@@ -268,6 +274,7 @@ static void mtk_pll_unprepare(struct clk_hw *hw) {struct mtk_clk_pll *pll =to_mtk_clk_pll (hw);u32 r; +u32 div_en_mask;if (pll->data->flags &HAVE_RST_BAR ) { r =readl (pll->base_addr +REG_CON0 );
@@ -277,8 +284,13 @@ static void mtk_pll_unprepare(struct clk_hw *hw)__mtk_pll_tuner_disable (pll); - r =readl (pll->base_addr +REG_CON0 ); - r &= ~CON0_BASE_EN ; + div_en_mask = pll->data->en_mask & ~CON0_BASE_EN ; +if (div_en_mask) { + r =readl (pll->base_addr +REG_CON0 ) & ~div_en_mask; +writel (r, pll->base_addr +REG_CON0 ); + } + + r =readl (pll->base_addr +REG_CON0 ) & ~CON0_BASE_EN ;writel (r, pll->base_addr +REG_CON0 ); r =readl (pll->pwr_addr) |CON0_ISO_EN ;
Signature · 1 line
1.8.1.1.dirty
Re: [PATCH v6 07/22] clk: mediatek: Fix asymmetrical PLL enable and disable control
Quoted 13 lines · Weiyi Lu
In fact, the
en_maskis a combination of divider enable mask and pll enable bit(bit0).
Before this patch, we enabled both divider mask and bit0 inprepare(), but only cleared the bit0 inunprepare().
In the future, we hopeen_maskwill only be used as divider enable mask. The enable register(CON0) will be set in 2 steps:
first is divider mask, and then bit0 duringprepare(), and vice versa. But considering backward compatibility, at this stage we allowen_maskto be a combination or a pure divider enable mask.
And then we will makeen_maska pure divider enable mask in another following patch series.
Quoted 1 line
Signed-off-by Weiyi Lu <[email protected]>
Quoted 59 lines
--- drivers/clk/mediatek/clk-pll.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-)drivers/clk/mediatek/clk-pll.c +16
-5@@ -238,6 +238,7 @@ static int mtk_pll_prepare(struct clk_hw *hw) {struct mtk_clk_pll *pll =to_mtk_clk_pll (hw);u32 r; +u32 div_en_mask; r =readl (pll->pwr_addr) |CON0_PWR_ON ;writel (r, pll->pwr_addr);@@ -247,10 +248,15 @@ static int mtk_pll_prepare(struct clk_hw *hw)writel (r, pll->pwr_addr);udelay (1 ); - r =readl (pll->base_addr +REG_CON0 ); - r |= pll->data->en_mask; + r =readl (pll->base_addr +REG_CON0 ) |CON0_BASE_EN ;writel (r, pll->base_addr +REG_CON0 ); + div_en_mask = pll->data->en_mask & ~CON0_BASE_EN ; +if (div_en_mask) { + r =readl (pll->base_addr +REG_CON0 ) | div_en_mask; +writel (r, pll->base_addr +REG_CON0 ); + } +__mtk_pll_tuner_enable (pll);udelay (20 );@@ -268,6 +274,7 @@ static void mtk_pll_unprepare(struct clk_hw *hw) {struct mtk_clk_pll *pll =to_mtk_clk_pll (hw);u32 r; +u32 div_en_mask;if (pll->data->flags &HAVE_RST_BAR ) { r =readl (pll->base_addr +REG_CON0 );@@ -277,8 +284,13 @@ static void mtk_pll_unprepare(struct clk_hw *hw)__mtk_pll_tuner_disable (pll); - r =readl (pll->base_addr +REG_CON0 ); - r &= ~CON0_BASE_EN ; + div_en_mask = pll->data->en_mask & ~CON0_BASE_EN ; +if (div_en_mask) { + r =readl (pll->base_addr +REG_CON0 ) & ~div_en_mask; +writel (r, pll->base_addr +REG_CON0 ); + } + + r =readl (pll->base_addr +REG_CON0 ) & ~CON0_BASE_EN ;writel (r, pll->base_addr +REG_CON0 ); r =readl (pll->pwr_addr) |CON0_ISO_EN ; --
Quoted 5 lines
1.8.1.1.dirty
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
PATCH v6 8/22 clk: mediatek: Add configurable enable control to mtk_pll_data
In reply to Weiyi LuIn all MediaTek PLL design, bit0 of CON0 register is always the enable bit.
However, there's a special case of usbpll on MT8192. The enable bit of usbpll is moved to bit2 of other register. Add configurable en_reg and pll_en_bit for enable control or default 0 where pll data are static variables. Hence, CON0_BASE_EN could also be removed.
And there might have another special case on other chips, the enable bit is still on CON0 register but not at bit0.
--- drivers/clk/mediatek/clk-mtk.h | 2 ++ drivers/clk/mediatek/clk-pll.c | 15 ++++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-)
drivers/clk/mediatek/clk-mtk.h +2 -0
@@ -233,6 +233,8 @@ struct mtk_pll_data {uint32_t pcw_chg_reg;const struct mtk_pll_div_table *div_table;const char *parent_name; +uint32_t en_reg; +uint8_t pll_en_bit;/* Assume 0, indicates BIT(0) by default */ }; void mtk_clk_register_plls(struct device_node *node,
drivers/clk/mediatek/clk-pll.c +10 -5
@@ -44,6 +44,7 @@ struct mtk_clk_pll {void __iomem *tuner_en_addr;void __iomem *pcw_addr;void __iomem *pcw_chg_addr; +void __iomem *en_addr;const struct mtk_pll_data *data; };
@@ -56,7 +57,7 @@ static int mtk_pll_is_prepared(struct clk_hw *hw) {struct mtk_clk_pll *pll =to_mtk_clk_pll (hw); -return (readl (pll->base_addr +REG_CON0 ) &CON0_BASE_EN ) !=0 ; +return (readl (pll->en_addr) &BIT (pll->data->pll_en_bit)) !=0 ; } static unsigned long __mtk_pll_recalc_rate(struct mtk_clk_pll *pll, u32 fin,
@@ -248,8 +249,8 @@ static int mtk_pll_prepare(struct clk_hw *hw)writel (r, pll->pwr_addr);udelay (1 ); - r =readl (pll->base_addr +REG_CON0 ) |CON0_BASE_EN ; -writel (r, pll->base_addr +REG_CON0 ); + r =readl (pll->en_addr) |BIT (pll->data->pll_en_bit); +writel (r, pll->en_addr); div_en_mask = pll->data->en_mask & ~CON0_BASE_EN ;if (div_en_mask) {
@@ -290,8 +291,8 @@ static void mtk_pll_unprepare(struct clk_hw *hw)writel (r, pll->base_addr +REG_CON0 ); } - r =readl (pll->base_addr +REG_CON0 ) & ~CON0_BASE_EN ; -writel (r, pll->base_addr +REG_CON0 ); + r =readl (pll->en_addr) & ~BIT (pll->data->pll_en_bit); +writel (r, pll->en_addr); r =readl (pll->pwr_addr) |CON0_ISO_EN ;writel (r, pll->pwr_addr);
@@ -333,6 +334,10 @@ static struct clk *mtk_clk_register_pll(const struct mtk_pll_data *data, pll->tuner_addr = base + data->tuner_reg;if (data->tuner_en_reg) pll->tuner_en_addr = base + data->tuner_en_reg; +if (data->en_reg) + pll->en_addr = base + data->en_reg; +else + pll->en_addr = pll->base_addr +REG_CON0 ; pll->hw.init = &init; pll->data = data;
Signature · 5 lines
1.8.1.1.dirty _______________________________________________ Linux-mediatek mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-mediatek
Re: [PATCH v6 08/22] clk: mediatek: Add configurable enable control to mtk_pll_data
Quoted 11 lines · Weiyi Lu
In all MediaTek PLL design, bit0 of CON0 register is always the enable bit.
However, there's a special case of usbpll on MT8192. The enable bit of usbpll is moved to bit2 of other register. Add configurableen_regandpll_en_bitfor enable control or default 0 where pll data are static variables. Hence,CON0_BASE_ENcould also be removed.
And there might have another special case on other chips, the enable bit is still on CON0 register but not at bit0.
Quoted 1 line
Signed-off-by Weiyi Lu <[email protected]>
Quoted 73 lines
--- drivers/clk/mediatek/clk-mtk.h | 2 ++ drivers/clk/mediatek/clk-pll.c | 15 ++++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-)drivers/clk/mediatek/clk-mtk.h +2
-0@@ -233,6 +233,8 @@ struct mtk_pll_data {uint32_t pcw_chg_reg;const struct mtk_pll_div_table *div_table;const char *parent_name; +uint32_t en_reg; +uint8_t pll_en_bit;/* Assume 0, indicates BIT(0) by default */ }; void mtk_clk_register_plls(struct device_node *node,drivers/clk/mediatek/clk-pll.c +10
-6@@ -44,6 +44,7 @@ struct mtk_clk_pll {void __iomem *tuner_en_addr;void __iomem *pcw_addr;void __iomem *pcw_chg_addr; +void __iomem *en_addr;const struct mtk_pll_data *data; };@@ -56,7 +57,7 @@ static int mtk_pll_is_prepared(struct clk_hw *hw) {struct mtk_clk_pll *pll =to_mtk_clk_pll (hw); -return (readl (pll->base_addr +REG_CON0 ) &CON0_BASE_EN ) !=0 ; +return (readl (pll->en_addr) &BIT (pll->data->pll_en_bit)) !=0 ; } static unsigned long __mtk_pll_recalc_rate(struct mtk_clk_pll *pll, u32 fin,@@ -248,8 +249,8 @@ static int mtk_pll_prepare(struct clk_hw *hw)writel (r, pll->pwr_addr);udelay (1 ); - r =readl (pll->base_addr +REG_CON0 ) |CON0_BASE_EN ; -writel (r, pll->base_addr +REG_CON0 ); + r =readl (pll->en_addr) |BIT (pll->data->pll_en_bit); +writel (r, pll->en_addr); div_en_mask = pll->data->en_mask & ~CON0_BASE_EN ;if (div_en_mask) {@@ -290,8 +291,8 @@ static void mtk_pll_unprepare(struct clk_hw *hw)writel (r, pll->base_addr +REG_CON0 ); } - r =readl (pll->base_addr +REG_CON0 ) & ~CON0_BASE_EN ; -writel (r, pll->base_addr +REG_CON0 ); + r =readl (pll->en_addr) & ~BIT (pll->data->pll_en_bit); +writel (r, pll->en_addr); r =readl (pll->pwr_addr) |CON0_ISO_EN ;writel (r, pll->pwr_addr);@@ -333,6 +334,10 @@ static struct clk *mtk_clk_register_pll(const struct mtk_pll_data *data, pll->tuner_addr = base + data->tuner_reg;if (data->tuner_en_reg) pll->tuner_en_addr = base + data->tuner_en_reg; +if (data->en_reg) + pll->en_addr = base + data->en_reg; +else + pll->en_addr = pll->base_addr +REG_CON0 ; pll->hw.init = &init; pll->data = data; --
Quoted 5 lines
1.8.1.1.dirty
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
PATCH v6 9/22 clk: mediatek: Add mtk_clk_simple_probe() to simplify clock providers
In reply to Weiyi LuMost of subsystem clock providers only need to register clock gates in their probe() function.
To reduce the duplicated code by add a generic function.
--- drivers/clk/mediatek/clk-mtk.c | 23 +++++++++++++++++++++++ drivers/clk/mediatek/clk-mtk.h | 8 ++++++++ 2 files changed, 31 insertions(+)
drivers/clk/mediatek/clk-mtk.c +23 -0
@@ -13,6 +13,7 @@#include <linux/clkdev.h> #include <linux/mfd/syscon.h> #include <linux/device.h> +#include <linux/of_device.h> #include "clk-mtk.h" #include "clk-gate.h"
@@ -286,3 +287,25 @@ void mtk_clk_register_dividers(const struct mtk_clk_divider *mcds, clk_data->clks[mcd->id] = clk; } } + +int mtk_clk_simple_probe (struct platform_device *pdev) +{ +const struct mtk_clk_desc *mcd; +struct clk_onecell_data *clk_data; +struct device_node *node = pdev->dev.of_node; +int r; + + mcd =of_device_get_match_data (&pdev->dev); +if (!mcd) +return -EINVAL ; + + clk_data =mtk_alloc_clk_data (mcd->num_clks); +if (!clk_data) +return -ENOMEM ; + + r =mtk_clk_register_gates (node, mcd->clks, mcd->num_clks, clk_data); +if (r) +return r; + +return of_clk_add_provider (node, of_clk_src_onecell_get, clk_data); +}
drivers/clk/mediatek/clk-mtk.h +8 -0
@@ -10,6 +10,7 @@#include <linux/regmap.h> #include <linux/bitops.h> #include <linux/clk-provider.h> +#include <linux/platform_device.h> struct clk ;struct clk_onecell_data ;
@@ -250,4 +251,11 @@ void mtk_register_reset_controller(struct device_node *np,void mtk_register_reset_controller_set_clr (struct device_node *np,unsigned int num_regs,int regofs); +struct mtk_clk_desc { +const struct mtk_gate *clks; +size_t num_clks; +}; + +int mtk_clk_simple_probe (struct platform_device *pdev); +#endif /* __DRV_CLK_MTK_H */
Signature · 5 lines
1.8.1.1.dirty _______________________________________________ Linux-mediatek mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-mediatek
PATCH v6 10/22 clk: mediatek: Add MT8192 basic clocks support
In reply to Weiyi LuAdd MT8192 basic clock providers, include topckgen, apmixedsys, infracfg and pericfg.
--- drivers/clk/mediatek/Kconfig | 8 + drivers/clk/mediatek/Makefile | 1 + drivers/clk/mediatek/clk-mt8192.c | 1326 +++++++++++++++++++++++++++++++++++++ drivers/clk/mediatek/clk-mux.h | 15 + 4 files changed, 1350 insertions(+) create mode 100644 drivers/clk/mediatek/clk-mt8192.c
drivers/clk/mediatek/Kconfig +8 -0
@@ -489,6 +489,14 @@ config COMMON_CLK_MT8183_VENCSYS help This driver supports MediaTek MT8183 vencsys clocks. +config COMMON_CLK_MT8192 + bool "Clock driver for MediaTek MT8192" + depends on ARM64 || COMPILE_TEST + select COMMON_CLK_MEDIATEK + default ARM64 + help + This driver supports MediaTek MT8192 basic clocks. + config COMMON_CLK_MT8516 bool "Clock driver for MediaTek MT8516" depends on ARCH_MEDIATEK || COMPILE_TEST
drivers/clk/mediatek/Makefile +1 -0
@@ -67,5 +67,6 @@ obj-$(CONFIG_COMMON_CLK_MT8183_MFGCFG) += clk-mt8183-mfgcfg.o obj-$(CONFIG_COMMON_CLK_MT8183_MMSYS) += clk-mt8183-mm.o obj-$(CONFIG_COMMON_CLK_MT8183_VDECSYS) += clk-mt8183-vdec.o obj-$(CONFIG_COMMON_CLK_MT8183_VENCSYS) += clk-mt8183-venc.o +obj-$(CONFIG_COMMON_CLK_MT8192) += clk-mt8192.o obj-$(CONFIG_COMMON_CLK_MT8516) += clk-mt8516.o obj-$(CONFIG_COMMON_CLK_MT8516_AUDSYS) += clk-mt8516-aud.o
drivers/clk/mediatek/clk-mt8192.c new file +1326 -0
1,326 lines not on this page · raw message
drivers/clk/mediatek/clk-mux.h +15 -0
@@ -77,6 +77,21 @@ struct mtk_mux { _width, _gate, _upd_ofs, _upd, \ CLK_SET_RATE_PARENT) +#define MUX_CLR_SET_UPD_FLAGS (_id, _name, _parents, _mux_ofs, \ + _mux_set_ofs, _mux_clr_ofs, _shift, _width, \ + _upd_ofs, _upd, _flags) \ + GATE_CLR_SET_UPD_FLAGS(_id, _name, _parents, _mux_ofs, \ + _mux_set_ofs, _mux_clr_ofs, _shift, _width, \ + 0, _upd_ofs, _upd, _flags, \ + mtk_mux_clr_set_upd_ops) + +#define MUX_CLR_SET_UPD (_id, _name, _parents, _mux_ofs, \ + _mux_set_ofs, _mux_clr_ofs, _shift, _width, \ + _upd_ofs, _upd) \ + MUX_CLR_SET_UPD_FLAGS(_id, _name, _parents, \ + _mux_ofs, _mux_set_ofs, _mux_clr_ofs, _shift, \ + _width, _upd_ofs, _upd, CLK_SET_RATE_PARENT) +struct clk *mtk_clk_register_mux (const struct mtk_mux *mux,struct regmap *regmap,spinlock_t *lock);
Signature · 1 line
1.8.1.1.dirty
Re: [PATCH v6 10/22] clk: mediatek: Add MT8192 basic clocks support
Quoted 13 lines · Weiyi Lu
Add MT8192 basic clock providers, include topckgen, apmixedsys, infracfg and pericfg.
Signed-off-by Weiyi Lu <[email protected]>--- drivers/clk/mediatek/Kconfig | 8 + drivers/clk/mediatek/Makefile | 1 + drivers/clk/mediatek/clk-mt8192.c | 1326 +++++++++++++++++++++++++++++++++++++ drivers/clk/mediatek/clk-mux.h | 15 + 4 files changed, 1350 insertions(+) create mode 100644 drivers/clk/mediatek/clk-mt8192.c
<snip>
Quoted 13 lines
drivers/clk/mediatek/clk-mux.h +5
-0@@ -77,6 +77,21 @@ struct mtk_mux { _width, _gate, _upd_ofs, _upd, \ CLK_SET_RATE_PARENT) +#define MUX_CLR_SET_UPD_FLAGS (_id, _name, _parents, _mux_ofs, \ + _mux_set_ofs, _mux_clr_ofs, _shift, _width, \ + _upd_ofs, _upd, _flags) \ + GATE_CLR_SET_UPD_FLAGS(_id, _name, _parents, _mux_ofs, \ + _mux_set_ofs, _mux_clr_ofs, _shift, _width, \
drivers/clk/mediatek/clk-mux.h struct mtk_mux { · line 94
Quoted 10 lines
drivers/clk/mediatek/clk-mux.h +10
-0+ 0, _upd_ofs, _upd, _flags, \ + mtk_mux_clr_set_upd_ops) + +#define MUX_CLR_SET_UPD (_id, _name, _parents, _mux_ofs, \ + _mux_set_ofs, _mux_clr_ofs, _shift, _width, \ + _upd_ofs, _upd) \ + MUX_CLR_SET_UPD_FLAGS(_id, _name, _parents, \ + _mux_ofs, _mux_set_ofs, _mux_clr_ofs, _shift, \ + _width, _upd_ofs, _upd, CLK_SET_RATE_PARENT) +
conflicts, these macros are already existed in upstream.
Quoted 9 lines
drivers/clk/mediatek/clk-mux.h +0
-1struct clk *mtk_clk_register_mux (const struct mtk_mux *mux,struct regmap *regmap,spinlock_t *lock); --1.8.1.1.dirty
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
Re: [PATCH v6 10/22] clk: mediatek: Add MT8192 basic clocks support
Quoted 34 lines · Ikjoon Jang
Quoted 13 lines · Weiyi Lu
Add MT8192 basic clock providers, include topckgen, apmixedsys, infracfg and pericfg.
Signed-off-by Weiyi Lu <[email protected]>--- drivers/clk/mediatek/Kconfig | 8 + drivers/clk/mediatek/Makefile | 1 + drivers/clk/mediatek/clk-mt8192.c | 1326 +++++++++++++++++++++++++++++++++++++ drivers/clk/mediatek/clk-mux.h | 15 + 4 files changed, 1350 insertions(+) create mode 100644 drivers/clk/mediatek/clk-mt8192.c<snip>
Quoted 17 lines
drivers/clk/mediatek/clk-mux.h +9
-0@@ -77,6 +77,21 @@ struct mtk_mux { _width, _gate, _upd_ofs, _upd, \ CLK_SET_RATE_PARENT) +#define MUX_CLR_SET_UPD_FLAGS (_id, _name, _parents, _mux_ofs, \ + _mux_set_ofs, _mux_clr_ofs, _shift, _width, \ + _upd_ofs, _upd, _flags) \ + GATE_CLR_SET_UPD_FLAGS(_id, _name, _parents, _mux_ofs, \ + _mux_set_ofs, _mux_clr_ofs, _shift, _width, \ + 0, _upd_ofs, _upd, _flags, \ + mtk_mux_clr_set_upd_ops) + +#define MUX_CLR_SET_UPD(_id, _name, _parents, _mux_ofs, \
Quoted 8 lines
drivers/clk/mediatek/clk-mux.h struct mtk_mux { · line 94
Quoted 6 lines
drivers/clk/mediatek/clk-mux.h +6
-0+ _mux_set_ofs, _mux_clr_ofs, _shift, _width, \ + _upd_ofs, _upd) \ +MUX_CLR_SET_UPD_FLAGS (_id, _name, _parents, \ + _mux_ofs, _mux_set_ofs, _mux_clr_ofs, _shift, \ + _width, _upd_ofs, _upd,CLK_SET_RATE_PARENT ) +conflicts, these macros are already existed in upstream.
really? These two macros don't show up in 5.11-rc1 yet.
Quoted 9 lines
Quoted 9 lines
drivers/clk/mediatek/clk-mux.h +0
-1struct clk *mtk_clk_register_mux (const struct mtk_mux *mux,struct regmap *regmap,spinlock_t *lock); --1.8.1.1.dirty
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
Re: [PATCH v6 10/22] clk: mediatek: Add MT8192 basic clocks support
Quoted 45 lines · Weiyi Lu
Quoted 34 lines · Ikjoon Jang
Quoted 13 lines · Weiyi Lu
Add MT8192 basic clock providers, include topckgen, apmixedsys, infracfg and pericfg.
Signed-off-by Weiyi Lu <[email protected]>--- drivers/clk/mediatek/Kconfig | 8 + drivers/clk/mediatek/Makefile | 1 + drivers/clk/mediatek/clk-mt8192.c | 1326 +++++++++++++++++++++++++++++++++++++ drivers/clk/mediatek/clk-mux.h | 15 + 4 files changed, 1350 insertions(+) create mode 100644 drivers/clk/mediatek/clk-mt8192.c<snip>
Quoted 17 lines
drivers/clk/mediatek/clk-mux.h +9
-0@@ -77,6 +77,21 @@ struct mtk_mux { _width, _gate, _upd_ofs, _upd, \ CLK_SET_RATE_PARENT) +#define MUX_CLR_SET_UPD_FLAGS (_id, _name, _parents, _mux_ofs, \ + _mux_set_ofs, _mux_clr_ofs, _shift, _width, \ + _upd_ofs, _upd, _flags) \ + GATE_CLR_SET_UPD_FLAGS(_id, _name, _parents, _mux_ofs, \ + _mux_set_ofs, _mux_clr_ofs, _shift, _width, \ + 0, _upd_ofs, _upd, _flags, \ + mtk_mux_clr_set_upd_ops) + +#define MUX_CLR_SET_UPD(_id, _name, _parents, _mux_ofs, \Quoted 8 lines
drivers/clk/mediatek/clk-mux.h struct mtk_mux { · line 94
Quoted 6 lines
drivers/clk/mediatek/clk-mux.h +6
-0+ _mux_set_ofs, _mux_clr_ofs, _shift, _width, \ + _upd_ofs, _upd) \ +MUX_CLR_SET_UPD_FLAGS (_id, _name, _parents, \ + _mux_ofs, _mux_set_ofs, _mux_clr_ofs, _shift, \ + _width, _upd_ofs, _upd,CLK_SET_RATE_PARENT ) +conflicts, these macros are already existed in upstream.
Quoted 1 line
really? These two macros don't show up in 5.11-rc1 yet.
yep, maybe this one: a3ae549917f1 "clk: mediatek: Add new clkmux register API"
Quoted 11 lines
Quoted 10 lines
Quoted 10 lines
drivers/clk/mediatek/clk-mux.h +0
-1struct clk *mtk_clk_register_mux (const struct mtk_mux *mux,struct regmap *regmap,spinlock_t *lock); --1.8.1.1.dirty
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
Quoted 4 lines
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
Re: [PATCH v6 10/22] clk: mediatek: Add MT8192 basic clocks support
Quoted 46 lines · Ikjoon Jang
Quoted 45 lines · Weiyi Lu
Quoted 42 lines · Ikjoon Jang
Quoted 13 lines · Weiyi Lu
Add MT8192 basic clock providers, include topckgen, apmixedsys, infracfg and pericfg.
Signed-off-by Weiyi Lu <[email protected]>--- drivers/clk/mediatek/Kconfig | 8 + drivers/clk/mediatek/Makefile | 1 + drivers/clk/mediatek/clk-mt8192.c | 1326 +++++++++++++++++++++++++++++++++++++ drivers/clk/mediatek/clk-mux.h | 15 + 4 files changed, 1350 insertions(+) create mode 100644 drivers/clk/mediatek/clk-mt8192.c<snip>
Quoted 13 lines
drivers/clk/mediatek/clk-mux.h +5
-0@@ -77,6 +77,21 @@ struct mtk_mux { _width, _gate, _upd_ofs, _upd, \ CLK_SET_RATE_PARENT) +#define MUX_CLR_SET_UPD_FLAGS (_id, _name, _parents, _mux_ofs, \ + _mux_set_ofs, _mux_clr_ofs, _shift, _width, \ + _upd_ofs, _upd, _flags) \ + GATE_CLR_SET_UPD_FLAGS(_id, _name, _parents, _mux_ofs, \ + _mux_set_ofs, _mux_clr_ofs, _shift, _width, \drivers/clk/mediatek/clk-mux.h struct mtk_mux { · line 94
Quoted 10 lines
drivers/clk/mediatek/clk-mux.h +10
-0+ 0, _upd_ofs, _upd, _flags, \ + mtk_mux_clr_set_upd_ops) + +#define MUX_CLR_SET_UPD (_id, _name, _parents, _mux_ofs, \ + _mux_set_ofs, _mux_clr_ofs, _shift, _width, \ + _upd_ofs, _upd) \ + MUX_CLR_SET_UPD_FLAGS(_id, _name, _parents, \ + _mux_ofs, _mux_set_ofs, _mux_clr_ofs, _shift, \ + _width, _upd_ofs, _upd, CLK_SET_RATE_PARENT) +conflicts, these macros are already existed in upstream.
Quoted 4 lines
Quoted 1 line
really? These two macros don't show up in 5.11-rc1 yet.
yep, maybe this one:
a3ae549917f1"clk: mediatek: Add new clkmux register API"
The new macros in this patch are for the clock MUX without gate control. It's a little different from those mux macros with gate control in a3ae549917f1 "clk: mediatek: Add new clkmux register API"
Quoted 15 lines
Quoted 15 lines
Quoted 10 lines
Quoted 10 lines
drivers/clk/mediatek/clk-mux.h +0
-1struct clk *mtk_clk_register_mux (const struct mtk_mux *mux,struct regmap *regmap,spinlock_t *lock); --1.8.1.1.dirty
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
Re: [PATCH v6 10/22] clk: mediatek: Add MT8192 basic clocks support
Quoted 48 lines · Weiyi Lu
Quoted 46 lines · Ikjoon Jang
Quoted 45 lines · Weiyi Lu
Quoted 42 lines · Ikjoon Jang
Quoted 13 lines · Weiyi Lu
Add MT8192 basic clock providers, include topckgen, apmixedsys, infracfg and pericfg.
Signed-off-by Weiyi Lu <[email protected]>--- drivers/clk/mediatek/Kconfig | 8 + drivers/clk/mediatek/Makefile | 1 + drivers/clk/mediatek/clk-mt8192.c | 1326 +++++++++++++++++++++++++++++++++++++ drivers/clk/mediatek/clk-mux.h | 15 + 4 files changed, 1350 insertions(+) create mode 100644 drivers/clk/mediatek/clk-mt8192.c<snip>
Quoted 13 lines
drivers/clk/mediatek/clk-mux.h +5
-0@@ -77,6 +77,21 @@ struct mtk_mux { _width, _gate, _upd_ofs, _upd, \ CLK_SET_RATE_PARENT) +#define MUX_CLR_SET_UPD_FLAGS (_id, _name, _parents, _mux_ofs, \ + _mux_set_ofs, _mux_clr_ofs, _shift, _width, \ + _upd_ofs, _upd, _flags) \ + GATE_CLR_SET_UPD_FLAGS(_id, _name, _parents, _mux_ofs, \ + _mux_set_ofs, _mux_clr_ofs, _shift, _width, \drivers/clk/mediatek/clk-mux.h struct mtk_mux { · line 94
Quoted 10 lines
drivers/clk/mediatek/clk-mux.h +10
-0+ 0, _upd_ofs, _upd, _flags, \ + mtk_mux_clr_set_upd_ops) + +#define MUX_CLR_SET_UPD (_id, _name, _parents, _mux_ofs, \ + _mux_set_ofs, _mux_clr_ofs, _shift, _width, \ + _upd_ofs, _upd) \ + MUX_CLR_SET_UPD_FLAGS(_id, _name, _parents, \ + _mux_ofs, _mux_set_ofs, _mux_clr_ofs, _shift, \ + _width, _upd_ofs, _upd, CLK_SET_RATE_PARENT) +conflicts, these macros are already existed in upstream.
Quoted 9 lines
Quoted 4 lines
Quoted 1 line
really? These two macros don't show up in 5.11-rc1 yet.
yep, maybe this one:
a3ae549917f1"clk: mediatek: Add new clkmux register API"The new macros in this patch are for the clock MUX without gate control. It's a little different from those mux macros with gate control in
a3ae549917f1"clk: mediatek: Add new clkmux register API"
sorry, my bad. it's just a simple context conflict from
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
drivers/clk/mediatek/clk-mux.h struct mtk_mux {
Quoted 5 lines
drivers/clk/mediatek/clk-mux.h +0
-1struct clk *mtk_clk_register_mux (const struct mtk_mux *mux,struct regmap *regmap,spinlock_t *lock); --
your another patch,2aeff9d8c8e "clk: mediatek: Make mtk_clk_register_mux() a static function" was applied before this series.
Quoted 11 lines
Quoted 10 lines
Quoted 10 lines
Quoted 5 lines
Quoted 5 lines
1.8.1.1.dirty
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
Matthias Brugger
maintainerRe: [PATCH v6 10/22] clk: mediatek: Add MT8192 basic clocks support
In reply to Weiyi LuQuoted 12 lines · Weiyi Lu
Add MT8192 basic clock providers, include topckgen, apmixedsys, infracfg and pericfg.
Signed-off-by Weiyi Lu <[email protected]>--- drivers/clk/mediatek/Kconfig | 8 + drivers/clk/mediatek/Makefile | 1 + drivers/clk/mediatek/clk-mt8192.c | 1326 +++++++++++++++++++++++++++++++++++++ drivers/clk/mediatek/clk-mux.h | 15 + 4 files changed, 1350 insertions(+) create mode 100644 drivers/clk/mediatek/clk-mt8192.c
[...]
Quoted 56 lines
drivers/clk/mediatek/clk-mt8192.c new file +56
-0+static int clk_mt8192_apmixed_probe (struct platform_device *pdev) +{ +struct clk_onecell_data *clk_data; +struct device_node *node = pdev->dev.of_node; +int r; + + clk_data =mtk_alloc_clk_data (CLK_APMIXED_NR_CLK ); +if (!clk_data) +return -ENOMEM ; + +mtk_clk_register_plls (node, plls,ARRAY_SIZE (plls), clk_data); + r =mtk_clk_register_gates (node, apmixed_clks,ARRAY_SIZE (apmixed_clks), clk_data); +if (r) +return r; + +return of_clk_add_provider (node, of_clk_src_onecell_get, clk_data); +} + +static const struct of_device_id of_match_clk_mt8192[] = { + { + .compatible ="mediatek,mt8192-apmixedsys" , + .data = clk_mt8192_apmixed_probe, + }, { + .compatible ="mediatek,mt8192-topckgen" , + .data = clk_mt8192_top_probe, + }, { + .compatible ="mediatek,mt8192-infracfg" , + .data = clk_mt8192_infra_probe, + }, { + .compatible ="mediatek,mt8192-pericfg" , + .data = clk_mt8192_peri_probe, + }, { +/* sentinel */ + } +}; + +static int clk_mt8192_probe (struct platform_device *pdev) +{ +int (*clk_probe)(struct platform_device *pdev); +int r; + + clk_probe =of_device_get_match_data (&pdev->dev); +if (!clk_probe) +return -EINVAL ; + + r =clk_probe (pdev); +if (r) +dev_err (&pdev->dev,"could not register clock provider: %s: %d\n" , pdev->name, r); + +return r; +} + +static struct platform_driver clk_mt8192_drv = { + .probe = clk_mt8192_probe, + .driver = { + .name ="clk-mt8192" ,
drivers/clk/mediatek/clk-mt8192.c line 1326
Quoted 10 lines
drivers/clk/mediatek/clk-mt8192.c new file +10
-0+ .of_match_table = of_match_clk_mt8192, + }, +}; + +static int __init clk_mt8192_init (void ) +{ +return platform_driver_register (&clk_mt8192_drv); +} + +arch_initcall (clk_mt8192_init);
Do we really need all these clocks that early?
Why don't we use CLK_OF_DECLARE_DRIVER() then and why do we initialize some clocks CLK_OF_DECLARE_DRIVER and other with arch_initcall?
I know that this is in other drivers for MediaTek SoCs, but that does not mean it's the right approach.
Quoted 13 lines
drivers/clk/mediatek/clk-mux.h +5
-0@@ -77,6 +77,21 @@ struct mtk_mux { _width, _gate, _upd_ofs, _upd, \ CLK_SET_RATE_PARENT) +#define MUX_CLR_SET_UPD_FLAGS (_id, _name, _parents, _mux_ofs, \ + _mux_set_ofs, _mux_clr_ofs, _shift, _width, \ + _upd_ofs, _upd, _flags) \ + GATE_CLR_SET_UPD_FLAGS(_id, _name, _parents, _mux_ofs, \ + _mux_set_ofs, _mux_clr_ofs, _shift, _width, \
drivers/clk/mediatek/clk-mux.h struct mtk_mux { · line 94
Quoted 10 lines
drivers/clk/mediatek/clk-mux.h +10
-0+ 0, _upd_ofs, _upd, _flags, \ + mtk_mux_clr_set_upd_ops) + +#define MUX_CLR_SET_UPD (_id, _name, _parents, _mux_ofs, \ + _mux_set_ofs, _mux_clr_ofs, _shift, _width, \ + _upd_ofs, _upd) \ + MUX_CLR_SET_UPD_FLAGS(_id, _name, _parents, \ + _mux_ofs, _mux_set_ofs, _mux_clr_ofs, _shift, \ + _width, _upd_ofs, _upd, CLK_SET_RATE_PARENT) +
Why can't we do something like:
#define MUX_CLR_SET_UPD(_id, _name, _parents, _mux_ofs, \ _mux_set_ofs, _mux_clr_ofs, _shift, _width, \ _upd_ofs, _upd) \ GATE_CLR_SET_UPD_FLAGS(_id, _name, _parents, _mux_ofs, \ _mux_set_ofs, _mux_clr_ofs, _shift, _width, \ 0, _upd_ofs, _upd, CLK_SET_RATE_PARENT, \ mtk_mux_clr_set_upd_ops)
drivers/clk/mediatek/clk-mux.h struct mtk_mux { · line 97
Quoted 4 lines
drivers/clk/mediatek/clk-mux.h +0
-0struct clk *mtk_clk_register_mux (const struct mtk_mux *mux,struct regmap *regmap,spinlock_t *lock);
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
Re: [PATCH v6 10/22] clk: mediatek: Add MT8192 basic clocks support
Quoted 88 lines · Matthias Brugger
Quoted 12 lines · Weiyi Lu
Add MT8192 basic clock providers, include topckgen, apmixedsys, infracfg and pericfg.
Signed-off-by Weiyi Lu <[email protected]>--- drivers/clk/mediatek/Kconfig | 8 + drivers/clk/mediatek/Makefile | 1 + drivers/clk/mediatek/clk-mt8192.c | 1326 +++++++++++++++++++++++++++++++++++++ drivers/clk/mediatek/clk-mux.h | 15 + 4 files changed, 1350 insertions(+) create mode 100644 drivers/clk/mediatek/clk-mt8192.c[...]
Quoted 56 lines
drivers/clk/mediatek/clk-mt8192.c new file +56
-0+static int clk_mt8192_apmixed_probe (struct platform_device *pdev) +{ +struct clk_onecell_data *clk_data; +struct device_node *node = pdev->dev.of_node; +int r; + + clk_data =mtk_alloc_clk_data (CLK_APMIXED_NR_CLK ); +if (!clk_data) +return -ENOMEM ; + +mtk_clk_register_plls (node, plls,ARRAY_SIZE (plls), clk_data); + r =mtk_clk_register_gates (node, apmixed_clks,ARRAY_SIZE (apmixed_clks), clk_data); +if (r) +return r; + +return of_clk_add_provider (node, of_clk_src_onecell_get, clk_data); +} + +static const struct of_device_id of_match_clk_mt8192[] = { + { + .compatible ="mediatek,mt8192-apmixedsys" , + .data = clk_mt8192_apmixed_probe, + }, { + .compatible ="mediatek,mt8192-topckgen" , + .data = clk_mt8192_top_probe, + }, { + .compatible ="mediatek,mt8192-infracfg" , + .data = clk_mt8192_infra_probe, + }, { + .compatible ="mediatek,mt8192-pericfg" , + .data = clk_mt8192_peri_probe, + }, { +/* sentinel */ + } +}; + +static int clk_mt8192_probe (struct platform_device *pdev) +{ +int (*clk_probe)(struct platform_device *pdev); +int r; + + clk_probe =of_device_get_match_data (&pdev->dev); +if (!clk_probe) +return -EINVAL ; + + r =clk_probe (pdev); +if (r) +dev_err (&pdev->dev,"could not register clock provider: %s: %d\n" , pdev->name, r); + +return r; +} + +static struct platform_driver clk_mt8192_drv = { + .probe = clk_mt8192_probe, + .driver = { + .name ="clk-mt8192" ,drivers/clk/mediatek/clk-mt8192.c line 1326
Quoted 10 lines
drivers/clk/mediatek/clk-mt8192.c new file +10
-0+ .of_match_table = of_match_clk_mt8192, + }, +}; + +static int __init clk_mt8192_init (void ) +{ +return platform_driver_register (&clk_mt8192_drv); +} + +arch_initcall (clk_mt8192_init);Do we really need all these clocks that early?
Why don't we useCLK_OF_DECLARE_DRIVER()then and why do we initialize some clocksCLK_OF_DECLARE_DRIVERand other witharch_initcall?
Quoted 3 lines
I know that this is in other drivers for MediaTek SoCs, but that does not mean it's the right approach.
I guess you mean CLK_OF_DECLARE() but not CLK_OF_DECLARE_DRIVER(), am I correct?
I saw there had some discussion[1][2] about initializing these basic clocks by CLK_OF_DECLARE() or the current implementation by arch_init(). Could I have more of your opinion on this discussion?
[1]
https://patchwork.kernel.org/project/linux-mediatek/patch/[email protected]/
[2]
https://patchwork.kernel.org/project/linux-mediatek/patch/[email protected]/
As to CLK_OF_DECLARE_DRIVER(), we have to initialize the clocks earlier for timer(clocksource) driver by this way.
Quoted 27 lines
Quoted 14 lines
drivers/clk/mediatek/clk-mux.h +5
-0@@ -77,6 +77,21 @@ struct mtk_mux { _width, _gate, _upd_ofs, _upd, \ CLK_SET_RATE_PARENT) +#define MUX_CLR_SET_UPD_FLAGS (_id, _name, _parents, _mux_ofs, \ + _mux_set_ofs, _mux_clr_ofs, _shift, _width, \ + _upd_ofs, _upd, _flags) \ + GATE_CLR_SET_UPD_FLAGS(_id, _name, _parents, _mux_ofs, \ + _mux_set_ofs, _mux_clr_ofs, _shift, _width, \drivers/clk/mediatek/clk-mux.h struct mtk_mux { · line 94
Quoted 10 lines
drivers/clk/mediatek/clk-mux.h +10
-0+ 0, _upd_ofs, _upd, _flags, \ + mtk_mux_clr_set_upd_ops) + +#define MUX_CLR_SET_UPD (_id, _name, _parents, _mux_ofs, \ + _mux_set_ofs, _mux_clr_ofs, _shift, _width, \ + _upd_ofs, _upd) \ + MUX_CLR_SET_UPD_FLAGS(_id, _name, _parents, \ + _mux_ofs, _mux_set_ofs, _mux_clr_ofs, _shift, \ + _width, _upd_ofs, _upd, CLK_SET_RATE_PARENT) +Why can't we do something like:
Quoted 12 lines
#define MUX_CLR_SET_UPD(_id, _name, _parents, _mux_ofs, \ _mux_set_ofs, _mux_clr_ofs, _shift, _width, \ _upd_ofs, _upd) \ GATE_CLR_SET_UPD_FLAGS(_id, _name, _parents, _mux_ofs, \ _mux_set_ofs, _mux_clr_ofs, _shift, _width, \ 0, _upd_ofs, _upd, CLK_SET_RATE_PARENT, \ mtk_mux_clr_set_upd_ops)Quoted 4 lines
drivers/clk/mediatek/clk-mux.h +0
-0struct clk *mtk_clk_register_mux (const struct mtk_mux *mux,struct regmap *regmap,spinlock_t *lock);
It could be, so I'll fix in next patch.
Quoted 5 lines
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
PATCH v6 11/22 clk: mediatek: Add MT8192 audio clock support
In reply to Weiyi LuAdd MT8192 audio clock provider
--- drivers/clk/mediatek/Kconfig | 6 ++ drivers/clk/mediatek/Makefile | 1 + drivers/clk/mediatek/clk-mt8192-aud.c | 118 ++++++++++++++++++++++++++++++++++ 3 files changed, 125 insertions(+) create mode 100644 drivers/clk/mediatek/clk-mt8192-aud.c
drivers/clk/mediatek/Kconfig +6 -0
@@ -497,6 +497,12 @@ config COMMON_CLK_MT8192 help This driver supports MediaTek MT8192 basic clocks. +config COMMON_CLK_MT8192_AUDSYS + bool "Clock driver for MediaTek MT8192 audsys" + depends on COMMON_CLK_MT8192 + help + This driver supports MediaTek MT8192 audsys clocks. + config COMMON_CLK_MT8516 bool "Clock driver for MediaTek MT8516" depends on ARCH_MEDIATEK || COMPILE_TEST
drivers/clk/mediatek/Makefile +1 -0
@@ -68,5 +68,6 @@ obj-$(CONFIG_COMMON_CLK_MT8183_MMSYS) += clk-mt8183-mm.o obj-$(CONFIG_COMMON_CLK_MT8183_VDECSYS) += clk-mt8183-vdec.o obj-$(CONFIG_COMMON_CLK_MT8183_VENCSYS) += clk-mt8183-venc.o obj-$(CONFIG_COMMON_CLK_MT8192) += clk-mt8192.o +obj-$(CONFIG_COMMON_CLK_MT8192_AUDSYS) += clk-mt8192-aud.o obj-$(CONFIG_COMMON_CLK_MT8516) += clk-mt8516.o obj-$(CONFIG_COMMON_CLK_MT8516_AUDSYS) += clk-mt8516-aud.o
drivers/clk/mediatek/clk-mt8192-aud.c new file +118 -0
118 lines not on this page · raw message
Signature · 1 line
1.8.1.1.dirty
PATCH v6 12/22 clk: mediatek: Add MT8192 camsys clock support
In reply to Weiyi LuAdd MT8192 camsys and camsys raw clock providers
--- drivers/clk/mediatek/Kconfig | 6 ++ drivers/clk/mediatek/Makefile | 1 + drivers/clk/mediatek/clk-mt8192-cam.c | 107 ++++++++++++++++++++++++++++++++++ 3 files changed, 114 insertions(+) create mode 100644 drivers/clk/mediatek/clk-mt8192-cam.c
drivers/clk/mediatek/Kconfig +6 -0
@@ -503,6 +503,12 @@ config COMMON_CLK_MT8192_AUDSYS help This driver supports MediaTek MT8192 audsys clocks. +config COMMON_CLK_MT8192_CAMSYS + bool "Clock driver for MediaTek MT8192 camsys" + depends on COMMON_CLK_MT8192 + help + This driver supports MediaTek MT8192 camsys and camsys_raw clocks. + config COMMON_CLK_MT8516 bool "Clock driver for MediaTek MT8516" depends on ARCH_MEDIATEK || COMPILE_TEST
drivers/clk/mediatek/Makefile +1 -0
@@ -69,5 +69,6 @@ obj-$(CONFIG_COMMON_CLK_MT8183_VDECSYS) += clk-mt8183-vdec.o obj-$(CONFIG_COMMON_CLK_MT8183_VENCSYS) += clk-mt8183-venc.o obj-$(CONFIG_COMMON_CLK_MT8192) += clk-mt8192.o obj-$(CONFIG_COMMON_CLK_MT8192_AUDSYS) += clk-mt8192-aud.o +obj-$(CONFIG_COMMON_CLK_MT8192_CAMSYS) += clk-mt8192-cam.o obj-$(CONFIG_COMMON_CLK_MT8516) += clk-mt8516.o obj-$(CONFIG_COMMON_CLK_MT8516_AUDSYS) += clk-mt8516-aud.o
drivers/clk/mediatek/clk-mt8192-cam.c new file +107 -0
107 lines not on this page · raw message
Signature · 1 line
1.8.1.1.dirty
PATCH v6 13/22 clk: mediatek: Add MT8192 imgsys clock support
In reply to Weiyi LuAdd MT8192 imgsys and imgsys2 clock providers
--- drivers/clk/mediatek/Kconfig | 6 +++ drivers/clk/mediatek/Makefile | 1 + drivers/clk/mediatek/clk-mt8192-img.c | 70 +++++++++++++++++++++++++++++++++++ 3 files changed, 77 insertions(+) create mode 100644 drivers/clk/mediatek/clk-mt8192-img.c
drivers/clk/mediatek/Kconfig +6 -0
@@ -509,6 +509,12 @@ config COMMON_CLK_MT8192_CAMSYS help This driver supports MediaTek MT8192 camsys and camsys_raw clocks. +config COMMON_CLK_MT8192_IMGSYS + bool "Clock driver for MediaTek MT8192 imgsys" + depends on COMMON_CLK_MT8192 + help + This driver supports MediaTek MT8192 imgsys and imgsys2 clocks. + config COMMON_CLK_MT8516 bool "Clock driver for MediaTek MT8516" depends on ARCH_MEDIATEK || COMPILE_TEST
drivers/clk/mediatek/Makefile +1 -0
@@ -70,5 +70,6 @@ obj-$(CONFIG_COMMON_CLK_MT8183_VENCSYS) += clk-mt8183-venc.o obj-$(CONFIG_COMMON_CLK_MT8192) += clk-mt8192.o obj-$(CONFIG_COMMON_CLK_MT8192_AUDSYS) += clk-mt8192-aud.o obj-$(CONFIG_COMMON_CLK_MT8192_CAMSYS) += clk-mt8192-cam.o +obj-$(CONFIG_COMMON_CLK_MT8192_IMGSYS) += clk-mt8192-img.o obj-$(CONFIG_COMMON_CLK_MT8516) += clk-mt8516.o obj-$(CONFIG_COMMON_CLK_MT8516_AUDSYS) += clk-mt8516-aud.o
drivers/clk/mediatek/clk-mt8192-img.c new file +70 -0
70 lines not on this page · raw message
Signature · 1 line
1.8.1.1.dirty
PATCH v6 14/22 clk: mediatek: Add MT8192 imp i2c wrapper clock support
In reply to Weiyi LuAdd MT8192 imp i2c wrapper clock provider
--- drivers/clk/mediatek/Kconfig | 6 ++ drivers/clk/mediatek/Makefile | 1 + drivers/clk/mediatek/clk-mt8192-imp_iic_wrap.c | 119 +++++++++++++++++++++++++ 3 files changed, 126 insertions(+) create mode 100644 drivers/clk/mediatek/clk-mt8192-imp_iic_wrap.c
drivers/clk/mediatek/Kconfig +6 -0
@@ -515,6 +515,12 @@ config COMMON_CLK_MT8192_IMGSYS help This driver supports MediaTek MT8192 imgsys and imgsys2 clocks. +config COMMON_CLK_MT8192_IMP_IIC_WRAP + bool "Clock driver for MediaTek MT8192 imp_iic_wrap" + depends on COMMON_CLK_MT8192 + help + This driver supports MediaTek MT8192 imp_iic_wrap clocks. + config COMMON_CLK_MT8516 bool "Clock driver for MediaTek MT8516" depends on ARCH_MEDIATEK || COMPILE_TEST
drivers/clk/mediatek/Makefile +1 -0
@@ -71,5 +71,6 @@ obj-$(CONFIG_COMMON_CLK_MT8192) += clk-mt8192.o obj-$(CONFIG_COMMON_CLK_MT8192_AUDSYS) += clk-mt8192-aud.o obj-$(CONFIG_COMMON_CLK_MT8192_CAMSYS) += clk-mt8192-cam.o obj-$(CONFIG_COMMON_CLK_MT8192_IMGSYS) += clk-mt8192-img.o +obj-$(CONFIG_COMMON_CLK_MT8192_IMP_IIC_WRAP) += clk-mt8192-imp_iic_wrap.o obj-$(CONFIG_COMMON_CLK_MT8516) += clk-mt8516.o obj-$(CONFIG_COMMON_CLK_MT8516_AUDSYS) += clk-mt8516-aud.o
drivers/clk/mediatek/clk-mt8192-imp_iic_wrap.c new file +119 -0
119 lines not on this page · raw message
Signature · 5 lines
1.8.1.1.dirty _______________________________________________ Linux-mediatek mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-mediatek
PATCH v6 15/22 clk: mediatek: Add MT8192 ipesys clock support
In reply to Weiyi LuAdd MT8192 ipesys clock provider
--- drivers/clk/mediatek/Kconfig | 6 ++++ drivers/clk/mediatek/Makefile | 1 + drivers/clk/mediatek/clk-mt8192-ipe.c | 57 +++++++++++++++++++++++++++++++++++ 3 files changed, 64 insertions(+) create mode 100644 drivers/clk/mediatek/clk-mt8192-ipe.c
drivers/clk/mediatek/Kconfig +6 -0
@@ -521,6 +521,12 @@ config COMMON_CLK_MT8192_IMP_IIC_WRAP help This driver supports MediaTek MT8192 imp_iic_wrap clocks. +config COMMON_CLK_MT8192_IPESYS + bool "Clock driver for MediaTek MT8192 ipesys" + depends on COMMON_CLK_MT8192 + help + This driver supports MediaTek MT8192 ipesys clocks. + config COMMON_CLK_MT8516 bool "Clock driver for MediaTek MT8516" depends on ARCH_MEDIATEK || COMPILE_TEST
drivers/clk/mediatek/Makefile +1 -0
@@ -72,5 +72,6 @@ obj-$(CONFIG_COMMON_CLK_MT8192_AUDSYS) += clk-mt8192-aud.o obj-$(CONFIG_COMMON_CLK_MT8192_CAMSYS) += clk-mt8192-cam.o obj-$(CONFIG_COMMON_CLK_MT8192_IMGSYS) += clk-mt8192-img.o obj-$(CONFIG_COMMON_CLK_MT8192_IMP_IIC_WRAP) += clk-mt8192-imp_iic_wrap.o +obj-$(CONFIG_COMMON_CLK_MT8192_IPESYS) += clk-mt8192-ipe.o obj-$(CONFIG_COMMON_CLK_MT8516) += clk-mt8516.o obj-$(CONFIG_COMMON_CLK_MT8516_AUDSYS) += clk-mt8516-aud.o
drivers/clk/mediatek/clk-mt8192-ipe.c new file +57 -0
57 lines not on this page · raw message
Signature · 1 line
1.8.1.1.dirty
PATCH v6 16/22 clk: mediatek: Add MT8192 mdpsys clock support
In reply to Weiyi LuAdd MT8192 mdpsys clock provider
--- drivers/clk/mediatek/Kconfig | 6 +++ drivers/clk/mediatek/Makefile | 1 + drivers/clk/mediatek/clk-mt8192-mdp.c | 82 +++++++++++++++++++++++++++++++++++ 3 files changed, 89 insertions(+) create mode 100644 drivers/clk/mediatek/clk-mt8192-mdp.c
drivers/clk/mediatek/Kconfig +6 -0
@@ -527,6 +527,12 @@ config COMMON_CLK_MT8192_IPESYS help This driver supports MediaTek MT8192 ipesys clocks. +config COMMON_CLK_MT8192_MDPSYS + bool "Clock driver for MediaTek MT8192 mdpsys" + depends on COMMON_CLK_MT8192 + help + This driver supports MediaTek MT8192 mdpsys clocks. + config COMMON_CLK_MT8516 bool "Clock driver for MediaTek MT8516" depends on ARCH_MEDIATEK || COMPILE_TEST
drivers/clk/mediatek/Makefile +1 -0
@@ -73,5 +73,6 @@ obj-$(CONFIG_COMMON_CLK_MT8192_CAMSYS) += clk-mt8192-cam.o obj-$(CONFIG_COMMON_CLK_MT8192_IMGSYS) += clk-mt8192-img.o obj-$(CONFIG_COMMON_CLK_MT8192_IMP_IIC_WRAP) += clk-mt8192-imp_iic_wrap.o obj-$(CONFIG_COMMON_CLK_MT8192_IPESYS) += clk-mt8192-ipe.o +obj-$(CONFIG_COMMON_CLK_MT8192_MDPSYS) += clk-mt8192-mdp.o obj-$(CONFIG_COMMON_CLK_MT8516) += clk-mt8516.o obj-$(CONFIG_COMMON_CLK_MT8516_AUDSYS) += clk-mt8516-aud.o
drivers/clk/mediatek/clk-mt8192-mdp.c new file +82 -0
82 lines not on this page · raw message
Signature · 1 line
1.8.1.1.dirty
PATCH v6 17/22 clk: mediatek: Add MT8192 mfgcfg clock support
In reply to Weiyi LuAdd MT8192 mfgcfg clock provider
--- drivers/clk/mediatek/Kconfig | 6 +++++ drivers/clk/mediatek/Makefile | 1 + drivers/clk/mediatek/clk-mt8192-mfg.c | 50 +++++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 drivers/clk/mediatek/clk-mt8192-mfg.c
drivers/clk/mediatek/Kconfig +6 -0
@@ -533,6 +533,12 @@ config COMMON_CLK_MT8192_MDPSYS help This driver supports MediaTek MT8192 mdpsys clocks. +config COMMON_CLK_MT8192_MFGCFG + bool "Clock driver for MediaTek MT8192 mfgcfg" + depends on COMMON_CLK_MT8192 + help + This driver supports MediaTek MT8192 mfgcfg clocks. + config COMMON_CLK_MT8516 bool "Clock driver for MediaTek MT8516" depends on ARCH_MEDIATEK || COMPILE_TEST
drivers/clk/mediatek/Makefile +1 -0
@@ -74,5 +74,6 @@ obj-$(CONFIG_COMMON_CLK_MT8192_IMGSYS) += clk-mt8192-img.o obj-$(CONFIG_COMMON_CLK_MT8192_IMP_IIC_WRAP) += clk-mt8192-imp_iic_wrap.o obj-$(CONFIG_COMMON_CLK_MT8192_IPESYS) += clk-mt8192-ipe.o obj-$(CONFIG_COMMON_CLK_MT8192_MDPSYS) += clk-mt8192-mdp.o +obj-$(CONFIG_COMMON_CLK_MT8192_MFGCFG) += clk-mt8192-mfg.o obj-$(CONFIG_COMMON_CLK_MT8516) += clk-mt8516.o obj-$(CONFIG_COMMON_CLK_MT8516_AUDSYS) += clk-mt8516-aud.o
drivers/clk/mediatek/clk-mt8192-mfg.c new file +50 -0
50 lines not on this page · raw message
Signature · 1 line
1.8.1.1.dirty
PATCH v6 18/22 clk: mediatek: Add MT8192 mmsys clock support
In reply to Weiyi LuAdd MT8192 mmsys clock provider
--- drivers/clk/mediatek/Kconfig | 6 ++ drivers/clk/mediatek/Makefile | 1 + drivers/clk/mediatek/clk-mt8192-mm.c | 108 +++++++++++++++++++++++++++++++++++ 3 files changed, 115 insertions(+) create mode 100644 drivers/clk/mediatek/clk-mt8192-mm.c
drivers/clk/mediatek/Kconfig +6 -0
@@ -539,6 +539,12 @@ config COMMON_CLK_MT8192_MFGCFG help This driver supports MediaTek MT8192 mfgcfg clocks. +config COMMON_CLK_MT8192_MMSYS + bool "Clock driver for MediaTek MT8192 mmsys" + depends on COMMON_CLK_MT8192 + help + This driver supports MediaTek MT8192 mmsys clocks. + config COMMON_CLK_MT8516 bool "Clock driver for MediaTek MT8516" depends on ARCH_MEDIATEK || COMPILE_TEST
drivers/clk/mediatek/Makefile +1 -0
@@ -75,5 +75,6 @@ obj-$(CONFIG_COMMON_CLK_MT8192_IMP_IIC_WRAP) += clk-mt8192-imp_iic_wrap.o obj-$(CONFIG_COMMON_CLK_MT8192_IPESYS) += clk-mt8192-ipe.o obj-$(CONFIG_COMMON_CLK_MT8192_MDPSYS) += clk-mt8192-mdp.o obj-$(CONFIG_COMMON_CLK_MT8192_MFGCFG) += clk-mt8192-mfg.o +obj-$(CONFIG_COMMON_CLK_MT8192_MMSYS) += clk-mt8192-mm.o obj-$(CONFIG_COMMON_CLK_MT8516) += clk-mt8516.o obj-$(CONFIG_COMMON_CLK_MT8516_AUDSYS) += clk-mt8516-aud.o
drivers/clk/mediatek/clk-mt8192-mm.c new file +108 -0
108 lines not on this page · raw message
Signature · 1 line
1.8.1.1.dirty
PATCH v6 19/22 clk: mediatek: Add MT8192 msdc clock support
In reply to Weiyi LuAdd MT8192 msdc and msdc top clock providers
--- drivers/clk/mediatek/Kconfig | 6 +++ drivers/clk/mediatek/Makefile | 1 + drivers/clk/mediatek/clk-mt8192-msdc.c | 85 ++++++++++++++++++++++++++++++++++ 3 files changed, 92 insertions(+) create mode 100644 drivers/clk/mediatek/clk-mt8192-msdc.c
drivers/clk/mediatek/Kconfig +6 -0
@@ -545,6 +545,12 @@ config COMMON_CLK_MT8192_MMSYS help This driver supports MediaTek MT8192 mmsys clocks. +config COMMON_CLK_MT8192_MSDC + bool "Clock driver for MediaTek MT8192 msdc" + depends on COMMON_CLK_MT8192 + help + This driver supports MediaTek MT8192 msdc and msdc_top clocks. + config COMMON_CLK_MT8516 bool "Clock driver for MediaTek MT8516" depends on ARCH_MEDIATEK || COMPILE_TEST
drivers/clk/mediatek/Makefile +1 -0
@@ -76,5 +76,6 @@ obj-$(CONFIG_COMMON_CLK_MT8192_IPESYS) += clk-mt8192-ipe.o obj-$(CONFIG_COMMON_CLK_MT8192_MDPSYS) += clk-mt8192-mdp.o obj-$(CONFIG_COMMON_CLK_MT8192_MFGCFG) += clk-mt8192-mfg.o obj-$(CONFIG_COMMON_CLK_MT8192_MMSYS) += clk-mt8192-mm.o +obj-$(CONFIG_COMMON_CLK_MT8192_MSDC) += clk-mt8192-msdc.o obj-$(CONFIG_COMMON_CLK_MT8516) += clk-mt8516.o obj-$(CONFIG_COMMON_CLK_MT8516_AUDSYS) += clk-mt8516-aud.o
drivers/clk/mediatek/clk-mt8192-msdc.c new file +85 -0
85 lines not on this page · raw message
Signature · 1 line
1.8.1.1.dirty
PATCH v6 20/22 clk: mediatek: Add MT8192 scp adsp clock support
In reply to Weiyi LuAdd MT8192 scp adsp clock provider
--- drivers/clk/mediatek/Kconfig | 6 ++++ drivers/clk/mediatek/Makefile | 1 + drivers/clk/mediatek/clk-mt8192-scp_adsp.c | 50 ++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 drivers/clk/mediatek/clk-mt8192-scp_adsp.c
drivers/clk/mediatek/Kconfig +6 -0
@@ -551,6 +551,12 @@ config COMMON_CLK_MT8192_MSDC help This driver supports MediaTek MT8192 msdc and msdc_top clocks. +config COMMON_CLK_MT8192_SCP_ADSP + bool "Clock driver for MediaTek MT8192 scp_adsp" + depends on COMMON_CLK_MT8192 + help + This driver supports MediaTek MT8192 scp_adsp clocks. + config COMMON_CLK_MT8516 bool "Clock driver for MediaTek MT8516" depends on ARCH_MEDIATEK || COMPILE_TEST
drivers/clk/mediatek/Makefile +1 -0
@@ -77,5 +77,6 @@ obj-$(CONFIG_COMMON_CLK_MT8192_MDPSYS) += clk-mt8192-mdp.o obj-$(CONFIG_COMMON_CLK_MT8192_MFGCFG) += clk-mt8192-mfg.o obj-$(CONFIG_COMMON_CLK_MT8192_MMSYS) += clk-mt8192-mm.o obj-$(CONFIG_COMMON_CLK_MT8192_MSDC) += clk-mt8192-msdc.o +obj-$(CONFIG_COMMON_CLK_MT8192_SCP_ADSP) += clk-mt8192-scp_adsp.o obj-$(CONFIG_COMMON_CLK_MT8516) += clk-mt8516.o obj-$(CONFIG_COMMON_CLK_MT8516_AUDSYS) += clk-mt8516-aud.o
drivers/clk/mediatek/clk-mt8192-scp_adsp.c new file +50 -0
50 lines not on this page · raw message
Signature · 1 line
1.8.1.1.dirty
PATCH v6 21/22 clk: mediatek: Add MT8192 vdecsys clock support
In reply to Weiyi LuAdd MT8192 vdecsys and vdecsys soc clock providers
--- drivers/clk/mediatek/Kconfig | 6 +++ drivers/clk/mediatek/Makefile | 1 + drivers/clk/mediatek/clk-mt8192-vdec.c | 94 ++++++++++++++++++++++++++++++++++ 3 files changed, 101 insertions(+) create mode 100644 drivers/clk/mediatek/clk-mt8192-vdec.c
drivers/clk/mediatek/Kconfig +6 -0
@@ -557,6 +557,12 @@ config COMMON_CLK_MT8192_SCP_ADSP help This driver supports MediaTek MT8192 scp_adsp clocks. +config COMMON_CLK_MT8192_VDECSYS + bool "Clock driver for MediaTek MT8192 vdecsys" + depends on COMMON_CLK_MT8192 + help + This driver supports MediaTek MT8192 vdecsys and vdecsys_soc clocks. + config COMMON_CLK_MT8516 bool "Clock driver for MediaTek MT8516" depends on ARCH_MEDIATEK || COMPILE_TEST
drivers/clk/mediatek/Makefile +1 -0
@@ -78,5 +78,6 @@ obj-$(CONFIG_COMMON_CLK_MT8192_MFGCFG) += clk-mt8192-mfg.o obj-$(CONFIG_COMMON_CLK_MT8192_MMSYS) += clk-mt8192-mm.o obj-$(CONFIG_COMMON_CLK_MT8192_MSDC) += clk-mt8192-msdc.o obj-$(CONFIG_COMMON_CLK_MT8192_SCP_ADSP) += clk-mt8192-scp_adsp.o +obj-$(CONFIG_COMMON_CLK_MT8192_VDECSYS) += clk-mt8192-vdec.o obj-$(CONFIG_COMMON_CLK_MT8516) += clk-mt8516.o obj-$(CONFIG_COMMON_CLK_MT8516_AUDSYS) += clk-mt8516-aud.o
drivers/clk/mediatek/clk-mt8192-vdec.c new file +94 -0
94 lines not on this page · raw message
Signature · 1 line
1.8.1.1.dirty
PATCH v6 22/22 clk: mediatek: Add MT8192 vencsys clock support
In reply to Weiyi LuAdd MT8192 vencsys clock provider
--- drivers/clk/mediatek/Kconfig | 6 ++++ drivers/clk/mediatek/Makefile | 1 + drivers/clk/mediatek/clk-mt8192-venc.c | 53 ++++++++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 drivers/clk/mediatek/clk-mt8192-venc.c
drivers/clk/mediatek/Kconfig +6 -0
@@ -563,6 +563,12 @@ config COMMON_CLK_MT8192_VDECSYS help This driver supports MediaTek MT8192 vdecsys and vdecsys_soc clocks. +config COMMON_CLK_MT8192_VENCSYS + bool "Clock driver for MediaTek MT8192 vencsys" + depends on COMMON_CLK_MT8192 + help + This driver supports MediaTek MT8192 vencsys clocks. + config COMMON_CLK_MT8516 bool "Clock driver for MediaTek MT8516" depends on ARCH_MEDIATEK || COMPILE_TEST
drivers/clk/mediatek/Makefile +1 -0
@@ -79,5 +79,6 @@ obj-$(CONFIG_COMMON_CLK_MT8192_MMSYS) += clk-mt8192-mm.o obj-$(CONFIG_COMMON_CLK_MT8192_MSDC) += clk-mt8192-msdc.o obj-$(CONFIG_COMMON_CLK_MT8192_SCP_ADSP) += clk-mt8192-scp_adsp.o obj-$(CONFIG_COMMON_CLK_MT8192_VDECSYS) += clk-mt8192-vdec.o +obj-$(CONFIG_COMMON_CLK_MT8192_VENCSYS) += clk-mt8192-venc.o obj-$(CONFIG_COMMON_CLK_MT8516) += clk-mt8516.o obj-$(CONFIG_COMMON_CLK_MT8516_AUDSYS) += clk-mt8516-aud.o
drivers/clk/mediatek/clk-mt8192-venc.c new file +53 -0
53 lines not on this page · raw message
Signature · 1 line
1.8.1.1.dirty
Quoted 110 lines · Weiyi Lu
This series is based on v5.10-rc1.
change since v5:
- remove unused clocks by rolling Tinghan's patches[1][2] into series
[1] https://patchwork.kernel.org/project/linux-mediatek/list/?series=398781
[2] https://patchwork.kernel.org/project/linux-mediatek/list/?series=405143
- remove dts related patches from serieschange since v4:
- merge some subsystem into same driver
- add a generic probe function to reduce duplicated codechanges since v3:
- add critical clocks
- split large patches into small oneschanges since v2:
- update and split dt-binding documents by functionalities
- add error checking inprobe()function
- fix incorrect clock relation and add critical clocks
- update license identifier and minor fix of coding stylechanges since v1:
- fix asymmetrical control of PLL
- haveen_maskused as divider enable mask on all MediaTek SoCWeiyi Lu (22):
dt-bindings: ARM: Mediatek: Add new document bindings of imp i2c
wrapper controller
dt-bindings: ARM: Mediatek: Add new document bindings of mdpsys
controller
dt-bindings: ARM: Mediatek: Add new document bindings of msdc
controller
dt-bindings: ARM: Mediatek: Add new document bindings of scp adsp
controller
dt-bindings: ARM: Mediatek: Document bindings of MT8192 clock
controllers
clk: mediatek: Add dt-bindings of MT8192 clocks
clk: mediatek: Fix asymmetrical PLL enable and disable control
clk: mediatek: Add configurable enable control tomtk_pll_data
clk: mediatek: Addmtk_clk_simple_probe()to simplify clock providers
clk: mediatek: Add MT8192 basic clocks support
clk: mediatek: Add MT8192 audio clock support
clk: mediatek: Add MT8192 camsys clock support
clk: mediatek: Add MT8192 imgsys clock support
clk: mediatek: Add MT8192 imp i2c wrapper clock support
clk: mediatek: Add MT8192 ipesys clock support
clk: mediatek: Add MT8192 mdpsys clock support
clk: mediatek: Add MT8192 mfgcfg clock support
clk: mediatek: Add MT8192 mmsys clock support
clk: mediatek: Add MT8192 msdc clock support
clk: mediatek: Add MT8192 scp adsp clock support
clk: mediatek: Add MT8192 vdecsys clock support
clk: mediatek: Add MT8192 vencsys clock support.../arm/mediatek/mediatek,apmixedsys.txt | 1 + .../bindings/arm/mediatek/mediatek,audsys.txt | 1 + .../bindings/arm/mediatek/mediatek,camsys.txt | 22 + .../bindings/arm/mediatek/mediatek,imgsys.txt | 2 + .../arm/mediatek/mediatek,imp_iic_wrap.yaml | 78 + .../arm/mediatek/mediatek,infracfg.txt | 1 + .../bindings/arm/mediatek/mediatek,ipesys.txt | 1 + .../arm/mediatek/mediatek,mdpsys.yaml | 38 + .../bindings/arm/mediatek/mediatek,mfgcfg.txt | 1 + .../bindings/arm/mediatek/mediatek,mmsys.txt | 1 + .../bindings/arm/mediatek/mediatek,msdc.yaml | 46 + .../arm/mediatek/mediatek,pericfg.yaml | 1 + .../arm/mediatek/mediatek,scp-adsp.yaml | 38 + .../arm/mediatek/mediatek,topckgen.txt | 1 + .../arm/mediatek/mediatek,vdecsys.txt | 8 + .../arm/mediatek/mediatek,vencsys.txt | 1 + drivers/clk/mediatek/Kconfig | 80 + drivers/clk/mediatek/Makefile | 13 + drivers/clk/mediatek/clk-mt8192-aud.c | 118 ++ drivers/clk/mediatek/clk-mt8192-cam.c | 107 ++ drivers/clk/mediatek/clk-mt8192-img.c | 70 + .../clk/mediatek/clk-mt8192-imp_iic_wrap.c | 119 ++ drivers/clk/mediatek/clk-mt8192-ipe.c | 57 + drivers/clk/mediatek/clk-mt8192-mdp.c | 82 + drivers/clk/mediatek/clk-mt8192-mfg.c | 50 + drivers/clk/mediatek/clk-mt8192-mm.c | 108 ++ drivers/clk/mediatek/clk-mt8192-msdc.c | 85 ++ drivers/clk/mediatek/clk-mt8192-scp_adsp.c | 50 + drivers/clk/mediatek/clk-mt8192-vdec.c | 94 ++ drivers/clk/mediatek/clk-mt8192-venc.c | 53 + drivers/clk/mediatek/clk-mt8192.c | 1326 +++++++++++++++++ drivers/clk/mediatek/clk-mtk.c | 23 + drivers/clk/mediatek/clk-mtk.h | 10 + drivers/clk/mediatek/clk-mux.h | 15 + drivers/clk/mediatek/clk-pll.c | 31 +- include/dt-bindings/clock/mt8192-clk.h | 585 ++++++++ 36 files changed, 3310 insertions(+), 7 deletions(-) create mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,imp_iic_wrap.yaml create mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,mdpsys.yaml create mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,msdc.yaml create mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,scp-adsp.yaml create mode 100644 drivers/clk/mediatek/clk-mt8192-aud.c create mode 100644 drivers/clk/mediatek/clk-mt8192-cam.c create mode 100644 drivers/clk/mediatek/clk-mt8192-img.c create mode 100644 drivers/clk/mediatek/clk-mt8192-imp_iic_wrap.c create mode 100644 drivers/clk/mediatek/clk-mt8192-ipe.c create mode 100644 drivers/clk/mediatek/clk-mt8192-mdp.c create mode 100644 drivers/clk/mediatek/clk-mt8192-mfg.c create mode 100644 drivers/clk/mediatek/clk-mt8192-mm.c create mode 100644 drivers/clk/mediatek/clk-mt8192-msdc.c create mode 100644 drivers/clk/mediatek/clk-mt8192-scp_adsp.c create mode 100644 drivers/clk/mediatek/clk-mt8192-vdec.c create mode 100644 drivers/clk/mediatek/clk-mt8192-venc.c create mode 100644 drivers/clk/mediatek/clk-mt8192.c create mode 100644 include/dt-bindings/clock/mt8192-clk.h
Quoted 4 lines
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
All patches in this series:
Stephen Boyd
maintainerQuoting Weiyi Lu (2020-12-22 05:09:25)
Quoted 2 lines
This series is based on v5.10-rc1.
The DT bindings fail, can you fix and resend?
Documentation/devicetree/bindings/arm/mediatek/mediatek,msdc.yaml: 'additionalProperties' is a required property Documentation/devicetree/bindings/arm/mediatek/mediatek,imp_iic_wrap.yaml: 'additionalProperties' is a required property Documentation/devicetree/bindings/arm/mediatek/mediatek,mdpsys.yaml: 'additionalProperties' is a required property Documentation/devicetree/bindings/arm/mediatek/mediatek,scp-adsp.yaml: 'additionalProperties' is a required property Documentation/devicetree/bindings/arm/mediatek/mediatek,msdc.yaml: ignoring, error in schema:
warning: no schema found in file: Documentation/devicetree/bindings/arm/mediatek/mediatek,msdc.yaml Documentation/devicetree/bindings/arm/mediatek/mediatek,imp_iic_wrap.yaml: ignoring, error in schema:
warning: no schema found in file: Documentation/devicetree/bindings/arm/mediatek/mediatek,imp_iic_wrap.yaml Documentation/devicetree/bindings/arm/mediatek/mediatek,mdpsys.yaml: ignoring, error in schema:
warning: no schema found in file: Documentation/devicetree/bindings/arm/mediatek/mediatek,mdpsys.yaml Documentation/devicetree/bindings/arm/mediatek/mediatek,scp-adsp.yaml: ignoring, error in schema:
warning: no schema found in file: Documentation/devicetree/bindings/arm/mediatek/mediatek,scp-adsp.yaml Documentation/devicetree/bindings/arm/mediatek/mediatek,msdc.example.dt.yaml: example-0: syscon@11f60000:reg:0: [0, 301334528, 0, 4096] is too long
From schema: ~/.local/lib/python3.8/site-packages/dtschema/schemas/reg.yamlDocumentation/devicetree/bindings/arm/mediatek/mediatek,msdc.example.dt.yaml: example-1: syscon@11f10000:reg:0: [0, 301006848, 0, 4096] is too long
From schema: ~/.local/lib/python3.8/site-packages/dtschema/schemas/reg.yamlDocumentation/devicetree/bindings/arm/mediatek/mediatek,mdpsys.example.dt.yaml: example-0: syscon@1f000000:reg:0: [0, 520093696, 0, 4096] is too long
From schema: ~/.local/lib/python3.8/site-packages/dtschema/schemas/reg.yamlDocumentation/devicetree/bindings/arm/mediatek/mediatek,imp_iic_wrap.example.dt.yaml: example-0: syscon@11007000:reg:0: [0, 285241344, 0, 4096] is too long
From schema: ~/.local/lib/python3.8/site-packages/dtschema/schemas/reg.yamlDocumentation/devicetree/bindings/arm/mediatek/mediatek,imp_iic_wrap.example.dt.yaml: example-1: syscon@11cb1000:reg:0: [0, 298520576, 0, 4096] is too long
From schema: ~/.local/lib/python3.8/site-packages/dtschema/schemas/reg.yamlDocumentation/devicetree/bindings/arm/mediatek/mediatek,imp_iic_wrap.example.dt.yaml: example-2: syscon@11d03000:reg:0: [0, 298856448, 0, 4096] is too long
From schema: ~/.local/lib/python3.8/site-packages/dtschema/schemas/reg.yamlDocumentation/devicetree/bindings/arm/mediatek/mediatek,imp_iic_wrap.example.dt.yaml: example-3: syscon@11d23000:reg:0: [0, 298987520, 0, 4096] is too long
From schema: ~/.local/lib/python3.8/site-packages/dtschema/schemas/reg.yamlDocumentation/devicetree/bindings/arm/mediatek/mediatek,imp_iic_wrap.example.dt.yaml: example-4: syscon@11e01000:reg:0: [0, 299896832, 0, 4096] is too long
From schema: ~/.local/lib/python3.8/site-packages/dtschema/schemas/reg.yamlDocumentation/devicetree/bindings/arm/mediatek/mediatek,imp_iic_wrap.example.dt.yaml: example-5: syscon@11f02000:reg:0: [0, 300949504, 0, 4096] is too long
From schema: ~/.local/lib/python3.8/site-packages/dtschema/schemas/reg.yaml
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
Quoted 6 lines · Stephen Boyd
Quoting Weiyi Lu (2020-12-22 05:09:25)
Quoted 2 lines
This series is based on v5.10-rc1.
The DT bindings fail, can you fix and resend?
OK, I'll fix and resend. Thank you for reviewing.
Quoted 31 lines
Documentation/devicetree/bindings/arm/mediatek/mediatek,msdc.yaml: 'additionalProperties' is a required propertyDocumentation/devicetree/bindings/arm/mediatek/mediatek,imp_iic_wrap.yaml: 'additionalProperties' is a required propertyDocumentation/devicetree/bindings/arm/mediatek/mediatek,mdpsys.yaml: 'additionalProperties' is a required propertyDocumentation/devicetree/bindings/arm/mediatek/mediatek,scp-adsp.yaml: 'additionalProperties' is a required propertyDocumentation/devicetree/bindings/arm/mediatek/mediatek,msdc.yaml: ignoring, error in schema:
warning: no schema found in file:Documentation/devicetree/bindings/arm/mediatek/mediatek,msdc.yamlDocumentation/devicetree/bindings/arm/mediatek/mediatek,imp_iic_wrap.yaml: ignoring, error in schema:
warning: no schema found in file:Documentation/devicetree/bindings/arm/mediatek/mediatek,imp_iic_wrap.yamlDocumentation/devicetree/bindings/arm/mediatek/mediatek,mdpsys.yaml: ignoring, error in schema:
warning: no schema found in file:Documentation/devicetree/bindings/arm/mediatek/mediatek,mdpsys.yamlDocumentation/devicetree/bindings/arm/mediatek/mediatek,scp-adsp.yaml: ignoring, error in schema:
warning: no schema found in file:Documentation/devicetree/bindings/arm/mediatek/mediatek,scp-adsp.yamlDocumentation/devicetree/bindings/arm/mediatek/mediatek,msdc.example.dt.yaml: example-0: syscon@11f60000:reg:0: [0, 301334528, 0, 4096] is too long
From schema:~/.local/lib/python3.8/site-packages/dtschema/schemas/reg.yamlDocumentation/devicetree/bindings/arm/mediatek/mediatek,msdc.example.dt.yaml: example-1: syscon@11f10000:reg:0: [0, 301006848, 0, 4096] is too long
From schema:~/.local/lib/python3.8/site-packages/dtschema/schemas/reg.yamlDocumentation/devicetree/bindings/arm/mediatek/mediatek,mdpsys.example.dt.yaml: example-0: syscon@1f000000:reg:0: [0, 520093696, 0, 4096] is too long
From schema:~/.local/lib/python3.8/site-packages/dtschema/schemas/reg.yamlDocumentation/devicetree/bindings/arm/mediatek/mediatek,imp_iic_wrap.example.dt.yaml: example-0: syscon@11007000:reg:0: [0, 285241344, 0, 4096] is too long
From schema:~/.local/lib/python3.8/site-packages/dtschema/schemas/reg.yamlDocumentation/devicetree/bindings/arm/mediatek/mediatek,imp_iic_wrap.example.dt.yaml: example-1: syscon@11cb1000:reg:0: [0, 298520576, 0, 4096] is too long
From schema:~/.local/lib/python3.8/site-packages/dtschema/schemas/reg.yamlDocumentation/devicetree/bindings/arm/mediatek/mediatek,imp_iic_wrap.example.dt.yaml: example-2: syscon@11d03000:reg:0: [0, 298856448, 0, 4096] is too long
From schema:~/.local/lib/python3.8/site-packages/dtschema/schemas/reg.yamlDocumentation/devicetree/bindings/arm/mediatek/mediatek,imp_iic_wrap.example.dt.yaml: example-3: syscon@11d23000:reg:0: [0, 298987520, 0, 4096] is too long
From schema:~/.local/lib/python3.8/site-packages/dtschema/schemas/reg.yamlDocumentation/devicetree/bindings/arm/mediatek/mediatek,imp_iic_wrap.example.dt.yaml: example-4: syscon@11e01000:reg:0: [0, 299896832, 0, 4096] is too long
From schema:~/.local/lib/python3.8/site-packages/dtschema/schemas/reg.yamlDocumentation/devicetree/bindings/arm/mediatek/mediatek,imp_iic_wrap.example.dt.yaml: example-5: syscon@11f02000:reg:0: [0, 300949504, 0, 4096] is too long
From schema:~/.local/lib/python3.8/site-packages/dtschema/schemas/reg.yaml
Quoted 4 lines
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek