diff mbox series

[1/9] dt-bindings: phy: mediatek: tphy: support type switch by pericfg

Message ID 1627459111-2907-1-git-send-email-chunfeng.yun@mediatek.com
State Not Applicable, archived
Headers show
Series [1/9] dt-bindings: phy: mediatek: tphy: support type switch by pericfg | expand

Checks

Context Check Description
robh/checkpatch success
robh/dt-meta-schema success
robh/dtbs-check success

Commit Message

Chunfeng Yun (云春峰) July 28, 2021, 7:58 a.m. UTC
Add support type switch by pericfg register between USB3, PCIe,
SATA, SGMII, this is used to replace the way through efuse or
jumper.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
 .../devicetree/bindings/phy/mediatek,tphy.yaml   | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

Comments

Chun-Kuang Hu July 30, 2021, 4:23 p.m. UTC | #1
Hi, Chunfeng:

Chunfeng Yun <chunfeng.yun@mediatek.com> 於 2021年7月28日 週三 下午3:59寫道:
>
> Use devm_platform_ioremap_resource to simplify code

Acked-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>

>
> Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
> ---
>  drivers/phy/mediatek/phy-mtk-hdmi.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/phy/mediatek/phy-mtk-hdmi.c b/drivers/phy/mediatek/phy-mtk-hdmi.c
> index 8ad8f717ef43..5fb4217fb8e0 100644
> --- a/drivers/phy/mediatek/phy-mtk-hdmi.c
> +++ b/drivers/phy/mediatek/phy-mtk-hdmi.c
> @@ -100,7 +100,6 @@ static int mtk_hdmi_phy_probe(struct platform_device *pdev)
>  {
>         struct device *dev = &pdev->dev;
>         struct mtk_hdmi_phy *hdmi_phy;
> -       struct resource *mem;
>         struct clk *ref_clk;
>         const char *ref_clk_name;
>         struct clk_init_data clk_init = {
> @@ -116,11 +115,9 @@ static int mtk_hdmi_phy_probe(struct platform_device *pdev)
>         if (!hdmi_phy)
>                 return -ENOMEM;
>
> -       mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -       hdmi_phy->regs = devm_ioremap_resource(dev, mem);
> -       if (IS_ERR(hdmi_phy->regs)) {
> +       hdmi_phy->regs = devm_platform_ioremap_resource(pdev, 0);
> +       if (IS_ERR(hdmi_phy->regs))
>                 return PTR_ERR(hdmi_phy->regs);
> -       }
>
>         ref_clk = devm_clk_get(dev, "pll_ref");
>         if (IS_ERR(ref_clk)) {
> --
> 2.18.0
>
Chun-Kuang Hu July 30, 2021, 4:24 p.m. UTC | #2
Hi, Chunfeng:

Chunfeng Yun <chunfeng.yun@mediatek.com> 於 2021年7月28日 週三 下午3:59寫道:
>
> Return the error number directly without assignment

Acked-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>

>
> Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
> ---
>  drivers/phy/mediatek/phy-mtk-mipi-dsi.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> index 01cf31633019..61c942fbf4a1 100644
> --- a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> +++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> @@ -203,10 +203,8 @@ static int mtk_mipi_tx_probe(struct platform_device *pdev)
>         phy_set_drvdata(phy, mipi_tx);
>
>         phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);
> -       if (IS_ERR(phy_provider)) {
> -               ret = PTR_ERR(phy_provider);
> -               return ret;
> -       }
> +       if (IS_ERR(phy_provider))
> +               return PTR_ERR(phy_provider);
>
>         mipi_tx->dev = dev;
>
> --
> 2.18.0
>
Chun-Kuang Hu July 30, 2021, 4:25 p.m. UTC | #3
Hi, Chunfeng:

Chunfeng Yun <chunfeng.yun@mediatek.com> 於 2021年7月28日 週三 下午3:59寫道:
>
> Use devm_platform_ioremap_resource to simplify code

Acked-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>

>
> Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
> ---
>  drivers/phy/mediatek/phy-mtk-mipi-dsi.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> index 61c942fbf4a1..28ad9403c441 100644
> --- a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> +++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c
> @@ -130,7 +130,6 @@ static int mtk_mipi_tx_probe(struct platform_device *pdev)
>  {
>         struct device *dev = &pdev->dev;
>         struct mtk_mipi_tx *mipi_tx;
> -       struct resource *mem;
>         const char *ref_clk_name;
>         struct clk *ref_clk;
>         struct clk_init_data clk_init = {
> @@ -148,11 +147,9 @@ static int mtk_mipi_tx_probe(struct platform_device *pdev)
>
>         mipi_tx->driver_data = of_device_get_match_data(dev);
>
> -       mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -       mipi_tx->regs = devm_ioremap_resource(dev, mem);
> -       if (IS_ERR(mipi_tx->regs)) {
> +       mipi_tx->regs = devm_platform_ioremap_resource(pdev, 0);
> +       if (IS_ERR(mipi_tx->regs))
>                 return PTR_ERR(mipi_tx->regs);
> -       }
>
>         ref_clk = devm_clk_get(dev, NULL);
>         if (IS_ERR(ref_clk)) {
> --
> 2.18.0
>
Rob Herring (Arm) Aug. 2, 2021, 9:33 p.m. UTC | #4
On Wed, 28 Jul 2021 15:58:23 +0800, Chunfeng Yun wrote:
> Add support type switch by pericfg register between USB3, PCIe,
> SATA, SGMII, this is used to replace the way through efuse or
> jumper.
> 
> Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
> ---
>  .../devicetree/bindings/phy/mediatek,tphy.yaml   | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 

Reviewed-by: Rob Herring <robh@kernel.org>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/phy/mediatek,tphy.yaml b/Documentation/devicetree/bindings/phy/mediatek,tphy.yaml
index 838852cb8527..9e6c0f43f1c6 100644
--- a/Documentation/devicetree/bindings/phy/mediatek,tphy.yaml
+++ b/Documentation/devicetree/bindings/phy/mediatek,tphy.yaml
@@ -201,6 +201,22 @@  patternProperties:
           Specify the flag to enable BC1.2 if support it
         type: boolean
 
+      mediatek,syscon-type:
+        $ref: /schemas/types.yaml#/definitions/phandle-array
+        maxItems: 1
+        description:
+          A phandle to syscon used to access the register of type switch,
+          the field should always be 3 cells long.
+        items:
+          items:
+            - description:
+                The first cell represents a phandle to syscon
+            - description:
+                The second cell represents the register offset
+            - description:
+                The third cell represents the index of config segment
+              enum: [0, 1, 2, 3]
+
     required:
       - reg
       - "#phy-cells"