MIPI DSI phy for rk3588
Subsystems (3)
Heiko Stuebner
maintainerv2 cover MIPI DSI phy for rk3588
This adds the phy driver need for DSI output on rk3588.
The phy itself is used for both DSI output and CSI input, though the CSI part for the whole chain needs a lot more work, so is left out for now and only the DSI part implemented.
This allows the rk3588 with its current VOP support to drive a DSI display using the DSI2 controller driver I'll submit in a next step.
Only generic phy interfaces are used, so the DSI part is pretty straight forward.
changes in v2:
- fix error in dt-binding example
- drop unused frequency table
- pull in some more recent improvements from the vendor-kernel which includes a lot less magic values
- already include the support for rk3576
- use dev_err_probe
Heiko Stuebner (2):
dt-bindings: phy: Add Rockchip MIPI CSI/DSI PHY schema
phy: rockchip: Add Samsung CSI/DSI Combo DCPHY driver
.../phy/rockchip,rk3588-mipi-dcphy.yaml | 82 + drivers/phy/rockchip/Kconfig | 12 + drivers/phy/rockchip/Makefile | 1 + .../phy/rockchip/phy-rockchip-samsung-dcphy.c | 1654 +++++++++++++++++ 4 files changed, 1749 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/rockchip,rk3588-mipi-dcphy.yaml create mode 100644 drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c
Signature · 7 lines
2.45.2 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Heiko Stuebner
maintainerPATCH v2 1/2 dt-bindings: phy: Add Rockchip MIPI CSI/DSI PHY schema
From: Heiko Stuebner <[email protected]>
Add dt-binding schema for the MIPI CSI/DSI PHY found on Rockchip RK3588 SoCs.
--- .../phy/rockchip,rk3588-mipi-dcphy.yaml | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/rockchip,rk3588-mipi-dcphy.yaml
Documentation/devicetree/bindings/phy/rockchip,rk3588-mipi-dcphy.yaml new file +82 -0
@@ -0,0 +1,82 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/phy/rockchip,rk3588-mipi-dcphy.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Rockchip MIPI CSI/DSI PHY with Samsung IP block + +maintainers: + - Guochun Huang <[email protected]> + - Heiko Stuebner <[email protected]> + +properties: + compatible: + enum: + - rockchip,rk3576-mipi-dcphy + - rockchip,rk3588-mipi-dcphy + + reg: + maxItems: 1 + + "#phy-cells": + const: 0 + + clocks: + maxItems: 2 + + clock-names: + items: + - const: pclk + - const: ref + + resets: + maxItems: 4 + + reset-names: + items: + - const: m_phy + - const: apb + - const: grf + - const: s_phy + + rockchip,grf: + $ref: /schemas/types.yaml#/definitions/phandle + description: + Phandle to the syscon managing the 'mipi dcphy general register files'. + +required: + - compatible + - reg + - clocks + - clock-names + - resets + - reset-names + - "#phy-cells" + +additionalProperties: false + +examples: + - | + #include <dt-bindings/clock/rockchip,rk3588-cru.h> + #include <dt-bindings/reset/rockchip,rk3588-cru.h> + + soc { + #address-cells = <2>; + #size-cells = <2>; + + phy@feda0000 { + compatible = "rockchip,rk3588-mipi-dcphy"; + reg = <0x0 0xfeda0000 0x0 0x10000>; + clocks = <&cru PCLK_MIPI_DCPHY0>, + <&cru CLK_USBDPPHY_MIPIDCPPHY_REF>; + clock-names = "pclk", "ref"; + resets = <&cru SRST_M_MIPI_DCPHY0>, + <&cru SRST_P_MIPI_DCPHY0>, + <&cru SRST_P_MIPI_DCPHY0_GRF>, + <&cru SRST_S_MIPI_DCPHY0>; + reset-names = "m_phy", "apb", "grf", "s_phy"; + rockchip,grf = <&mipidcphy0_grf>; + #phy-cells = <0>; + }; + };
Signature · 7 lines
2.45.2 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH v2 1/2] dt-bindings: phy: Add Rockchip MIPI CSI/DSI PHY schema
Quoted 10 lines · Heiko Stuebner
From: Heiko Stuebner <[email protected]>
Add dt-binding schema for the MIPI CSI/DSI PHY found on Rockchip RK3588 SoCs.
Signed-off-by Heiko Stuebner <[email protected]>--- .../phy/rockchip,rk3588-mipi-dcphy.yaml | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/rockchip,rk3588-mipi-dcphy.yaml
Best regards,
Krzysztof
Re: [PATCH v2 1/2] dt-bindings: phy: Add Rockchip MIPI CSI/DSI PHY schema
In reply to Heiko StuebnerHi,
Quoted 53 lines · Heiko Stuebner
From: Heiko Stuebner <[email protected]>
Add dt-binding schema for the MIPI CSI/DSI PHY found on Rockchip RK3588 SoCs.
Signed-off-by Heiko Stuebner <[email protected]>--- .../phy/rockchip,rk3588-mipi-dcphy.yaml | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/rockchip,rk3588-mipi-dcphy.yamlDocumentation/devicetree/bindings/phy/rockchip,rk3588-mipi-dcphy.yaml new file +36
-0@@ -0,0 +1,82 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/phy/rockchip,rk3588-mipi-dcphy.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Rockchip MIPI CSI/DSI PHY with Samsung IP block + +maintainers: + - Guochun Huang <[email protected]> + - Heiko Stuebner <[email protected]> + +properties: + compatible: + enum: + - rockchip,rk3576-mipi-dcphy + - rockchip,rk3588-mipi-dcphy + + reg: + maxItems: 1 + + "#phy-cells": + const: 0 + + clocks: + maxItems: 2 + + clock-names: + items: + - const: pclk + - const: ref + + resets: + maxItems: 4 + + reset-names:
Documentation/devicetree/bindings/phy/rockchip,rk3588-mipi-dcphy.yaml line 46
Quoted 10 lines
Documentation/devicetree/bindings/phy/rockchip,rk3588-mipi-dcphy.yaml new file +10
-0+ items: + - const: m_phy + - const: apb + - const: grf + - const: s_phy + + rockchip,grf: + $ref: /schemas/types.yaml#/definitions/phandle + description: + Phandle to the syscon managing the 'mipi dcphy general register files'.
Should this dt-binding have a power-domains property? RK3588 TRM v1.0 part 1 page 1097 has ALIVE(PD_BUS) for MIPI_DC_PHY0~MIPI_DC_PHY1
FTR: I made a similar remark on another patch sent by Heiko today. While that was incorrect, I do think it's appropriate for this binding after which it could also be added to the respective phy nodes in the dts(i) file(s).
Cheers,
Diederik
Quoted 36 lines
Documentation/devicetree/bindings/phy/rockchip,rk3588-mipi-dcphy.yaml new file +36
-0+ +required: + - compatible + - reg + - clocks + - clock-names + - resets + - reset-names + - "#phy-cells" + +additionalProperties: false + +examples: + - | + #include <dt-bindings/clock/rockchip,rk3588-cru.h> + #include <dt-bindings/reset/rockchip,rk3588-cru.h> + + soc { + #address-cells = <2>; + #size-cells = <2>; + + phy@feda0000 { + compatible = "rockchip,rk3588-mipi-dcphy"; + reg = <0x0 0xfeda0000 0x0 0x10000>; + clocks = <&cru PCLK_MIPI_DCPHY0>, + <&cru CLK_USBDPPHY_MIPIDCPPHY_REF>; + clock-names = "pclk", "ref"; + resets = <&cru SRST_M_MIPI_DCPHY0>, + <&cru SRST_P_MIPI_DCPHY0>, + <&cru SRST_P_MIPI_DCPHY0_GRF>, + <&cru SRST_S_MIPI_DCPHY0>; + reset-names = "m_phy", "apb", "grf", "s_phy"; + rockchip,grf = <&mipidcphy0_grf>; + #phy-cells = <0>; + }; + };
Heiko Stübner
maintainerRe: [PATCH v2 1/2] dt-bindings: phy: Add Rockchip MIPI CSI/DSI PHY schema
Hi,
Am Mittwoch, 6. November 2024, 15:17:02 CET schrieb Diederik de Haas:
Quoted 60 lines · Heiko Stuebner
Quoted 59 lines
From: Heiko Stuebner <[email protected]>
Add dt-binding schema for the MIPI CSI/DSI PHY found on Rockchip RK3588 SoCs.
Signed-off-by Heiko Stuebner <[email protected]>--- .../phy/rockchip,rk3588-mipi-dcphy.yaml | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/rockchip,rk3588-mipi-dcphy.yamlDocumentation/devicetree/bindings/phy/rockchip,rk3588-mipi-dcphy.yaml new file +42
-0@@ -0,0 +1,82 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/phy/rockchip,rk3588-mipi-dcphy.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Rockchip MIPI CSI/DSI PHY with Samsung IP block + +maintainers: + - Guochun Huang <[email protected]> + - Heiko Stuebner <[email protected]> + +properties: + compatible: + enum: + - rockchip,rk3576-mipi-dcphy + - rockchip,rk3588-mipi-dcphy + + reg: + maxItems: 1 + + "#phy-cells": + const: 0 + + clocks: + maxItems: 2 + + clock-names: + items: + - const: pclk + - const: ref + + resets: + maxItems: 4 + + reset-names: + items: + - const: m_phy + - const: apb + - const: grf + - const: s_phy +
Quoted 8 lines
Documentation/devicetree/bindings/phy/rockchip,rk3588-mipi-dcphy.yaml line 46
Quoted 4 lines
Documentation/devicetree/bindings/phy/rockchip,rk3588-mipi-dcphy.yaml new file +4
-0+ rockchip,grf: + $ref: /schemas/types.yaml#/definitions/phandle + description: + Phandle to the syscon managing the 'mipi dcphy general register files'.Should this dt-binding have a power-domains property? RK3588 TRM v1.0 part 1 page 1097 has
ALIVE(PD_BUS)for MIPI_DC_PHY0~MIPI_DC_PHY1
I don't think so. As you write, the dcphy is part of the PD_BUS(ALIVE) power-domain on at least rk3588 and the new rk3576.
This power-domain is actually non-controllable and also contains things like the main GIC - so will be always on.
And for that reason probably, that domain also is not even exposed in the rk3588 devicetree (nor the driver implementation).
Similarly the hdptx phy binding (in a similar situation) also does not handle a power-domain. So my thinking is, we'll stay like this for now.
Heiko
Quoted 46 lines
FTR: I made a similar remark on another patch sent by Heiko today. While that was incorrect, I do think it's appropriate for this binding after which it could also be added to the respective phy nodes in the dts(i) file(s).
Cheers,
DiederikQuoted 36 lines
Documentation/devicetree/bindings/phy/rockchip,rk3588-mipi-dcphy.yaml new file +36
-0+ +required: + - compatible + - reg + - clocks + - clock-names + - resets + - reset-names + - "#phy-cells" + +additionalProperties: false + +examples: + - | + #include <dt-bindings/clock/rockchip,rk3588-cru.h> + #include <dt-bindings/reset/rockchip,rk3588-cru.h> + + soc { + #address-cells = <2>; + #size-cells = <2>; + + phy@feda0000 { + compatible = "rockchip,rk3588-mipi-dcphy"; + reg = <0x0 0xfeda0000 0x0 0x10000>; + clocks = <&cru PCLK_MIPI_DCPHY0>, + <&cru CLK_USBDPPHY_MIPIDCPPHY_REF>; + clock-names = "pclk", "ref"; + resets = <&cru SRST_M_MIPI_DCPHY0>, + <&cru SRST_P_MIPI_DCPHY0>, + <&cru SRST_P_MIPI_DCPHY0_GRF>, + <&cru SRST_S_MIPI_DCPHY0>; + reset-names = "m_phy", "apb", "grf", "s_phy"; + rockchip,grf = <&mipidcphy0_grf>; + #phy-cells = <0>; + }; + };
Heiko Stuebner
maintainerPATCH v2 2/2 phy: rockchip: Add Samsung CSI/DSI Combo DCPHY driver
In reply to Heiko StuebnerFrom: Heiko Stuebner <[email protected]>
Add phy driver needed to drive either a MIPI DSI output to a DSI display or MIPI CSI input from a camera on rk3588.
Right now only the DSI portion is implemented as the whole camera part needs more work in general.
--- drivers/phy/rockchip/Kconfig | 12 + drivers/phy/rockchip/Makefile | 1 + .../phy/rockchip/phy-rockchip-samsung-dcphy.c | 1654 +++++++++++++++++ 3 files changed, 1667 insertions(+) create mode 100644 drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c
drivers/phy/rockchip/Kconfig +12 -0
@@ -83,6 +83,18 @@ config PHY_ROCKCHIP_PCIE help Enable this to support the Rockchip PCIe PHY. +config PHY_ROCKCHIP_SAMSUNG_DCPHY + tristate "Rockchip Samsung MIPI DCPHY driver" + depends on (ARCH_ROCKCHIP || COMPILE_TEST) + select GENERIC_PHY + select GENERIC_PHY_MIPI_DPHY + help + Enable this to support the Rockchip MIPI DCPHY with + Samsung IP block. + + To compile this driver as a module, choose M here: the module + will be called phy-rockchip-samsung-dcphy + config PHY_ROCKCHIP_SAMSUNG_HDPTX tristate "Rockchip Samsung HDMI/eDP Combo PHY driver" depends on (ARCH_ROCKCHIP || COMPILE_TEST) && OF
drivers/phy/rockchip/Makefile +1 -0
@@ -8,6 +8,7 @@ obj-$(CONFIG_PHY_ROCKCHIP_INNO_HDMI) += phy-rockchip-inno-hdmi.o obj-$(CONFIG_PHY_ROCKCHIP_INNO_USB2) += phy-rockchip-inno-usb2.o obj-$(CONFIG_PHY_ROCKCHIP_NANENG_COMBO_PHY) += phy-rockchip-naneng-combphy.o obj-$(CONFIG_PHY_ROCKCHIP_PCIE) += phy-rockchip-pcie.o +obj-$(CONFIG_PHY_ROCKCHIP_SAMSUNG_DCPHY) += phy-rockchip-samsung-dcphy.o obj-$(CONFIG_PHY_ROCKCHIP_SAMSUNG_HDPTX) += phy-rockchip-samsung-hdptx.o obj-$(CONFIG_PHY_ROCKCHIP_SNPS_PCIE3) += phy-rockchip-snps-pcie3.o obj-$(CONFIG_PHY_ROCKCHIP_TYPEC) += phy-rockchip-typec.o
drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c new file +1654 -0
1,654 lines not on this page · raw message
Signature · 7 lines
2.45.2 -- linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
Re: [PATCH v2 2/2] phy: rockchip: Add Samsung CSI/DSI Combo DCPHY driver
Hi,
Quoted 10 lines · Heiko Stuebner
From: Heiko Stuebner <[email protected]>
Add phy driver needed to drive either a MIPI DSI output to a DSI display or MIPI CSI input from a camera on rk3588.
Right now only the DSI portion is implemented as the whole camera part needs more work in general.
Signed-off-by Heiko Stuebner <[email protected]>---
Do you have a git branch with the DSI controller driver, so that this can actually be tested? :)
Quoted 50 lines
drivers/phy/rockchip/Kconfig | 12 + drivers/phy/rockchip/Makefile | 1 + .../phy/rockchip/phy-rockchip-samsung-dcphy.c | 1654 +++++++++++++++++ 3 files changed, 1667 insertions(+) create mode 100644 drivers/phy/rockchip/phy-rockchip-samsung-dcphy.cdrivers/phy/rockchip/Kconfig +12
-0@@ -83,6 +83,18 @@ config PHY_ROCKCHIP_PCIE help Enable this to support the Rockchip PCIe PHY. +config PHY_ROCKCHIP_SAMSUNG_DCPHY + tristate "Rockchip Samsung MIPI DCPHY driver" + depends on (ARCH_ROCKCHIP || COMPILE_TEST) + select GENERIC_PHY + select GENERIC_PHY_MIPI_DPHY + help + Enable this to support the Rockchip MIPI DCPHY with + Samsung IP block. + + To compile this driver as a module, choose M here: the module + will be called phy-rockchip-samsung-dcphy + config PHY_ROCKCHIP_SAMSUNG_HDPTX tristate "Rockchip Samsung HDMI/eDP Combo PHY driver" depends on (ARCH_ROCKCHIP || COMPILE_TEST) && OFdrivers/phy/rockchip/Makefile +1
-0@@ -8,6 +8,7 @@ obj-$(CONFIG_PHY_ROCKCHIP_INNO_HDMI) += phy-rockchip-inno-hdmi.o obj-$(CONFIG_PHY_ROCKCHIP_INNO_USB2) += phy-rockchip-inno-usb2.o obj-$(CONFIG_PHY_ROCKCHIP_NANENG_COMBO_PHY) += phy-rockchip-naneng-combphy.o obj-$(CONFIG_PHY_ROCKCHIP_PCIE) += phy-rockchip-pcie.o +obj-$(CONFIG_PHY_ROCKCHIP_SAMSUNG_DCPHY) += phy-rockchip-samsung-dcphy.o obj-$(CONFIG_PHY_ROCKCHIP_SAMSUNG_HDPTX) += phy-rockchip-samsung-hdptx.o obj-$(CONFIG_PHY_ROCKCHIP_SNPS_PCIE3) += phy-rockchip-snps-pcie3.o obj-$(CONFIG_PHY_ROCKCHIP_TYPEC) += phy-rockchip-typec.odrivers/phy/rockchip/phy-rockchip-samsung-dcphy.c new file +3
-0@@ -0,0 +1,1654 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* Copyright (C) Rockchip Electronics Co.Ltd
drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c line 13
Quoted 10 lines
drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c new file +10
-0+* Author: +* Guochun Huang <[email protected]> +*/ + +#include <linux/clk.h> +#include <linux/init.h> +#include <linux/kernel.h> +#include <linux/mfd/syscon.h> +#include <linux/module.h> +#include <linux/of_device.h>
I think this should be
#include <linux/mod_devicetable.h>
Quoted 6 lines
drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c new file +6
-0+#include <linux/phy/phy.h> +#include <linux/platform_device.h> +#include <linux/pm_runtime.h> +#include <linux/regmap.h> +#include <linux/reset.h> +
[...]
Quoted 9 lines
drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c new file +9
-0+static void samsung_mipi_dcphy_bias_block_enable (struct samsung_mipi_dcphy *samsung) +{ +u32 bias_con2 =0x3223 ; + +regmap_write (samsung->regmap,BIAS_CON0 ,0x0010 ); +regmap_write (samsung->regmap,BIAS_CON1 ,0x0110 ); +regmap_write (samsung->regmap,BIAS_CON2 , bias_con2); + +/* default output voltage select:
drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c line 954
Quoted 10 lines
drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c new file +10
-0+* dphy: 400mv +* cphy: 530mv +*/ +regmap_update_bits (samsung->regmap,BIAS_CON4 , +I_MUX_SEL_MASK ,I_MUX_SEL_400MV ); +} + +static void samsung_mipi_dcphy_bias_block_disable (struct samsung_mipi_dcphy *samsung) +{ +}
uhm? :)
[...]
Quoted 7 lines
drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c new file +7
-0+static const struct samsung_mipi_dphy_timing * +samsung_mipi_dphy_get_timing (struct samsung_mipi_dcphy *samsung) +{ +const struct samsung_mipi_dphy_timing *timings; +unsigned int num_timings; +unsigned int lane_mbps =div64_ul (samsung->pll.rate,USEC_PER_SEC ); +unsigned int i;
drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c line 1067
Quoted 10 lines
drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c new file +10
-0+ + timings = samsung_mipi_dphy_timing_table; + num_timings =ARRAY_SIZE (samsung_mipi_dphy_timing_table); + +for (i = num_timings; i >0 ; i--) +if (lane_mbps <= timings[i -1 ].max_lane_mbps) +break ; + +if (i ==0 ) + ++i;
I guess you can just do 'for (i = max; i > 1; i--)' instead of counting to 0 and then go back to 1?
Quoted 3 lines
drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c new file +3
-0+ +return &timings[i -1 ]; +}
[...]
Quoted 24 lines
drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c new file +24
-0+static int samsung_mipi_dphy_power_on (struct samsung_mipi_dcphy *samsung) +{ +int ret; + +reset_control_assert (samsung->m_phy_rst); + +samsung_mipi_dcphy_bias_block_enable (samsung); +samsung_mipi_dcphy_pll_configure (samsung); +samsung_mipi_dphy_clk_lane_timing_init (samsung); +samsung_mipi_dphy_data_lane_timing_init (samsung); + ret =samsung_mipi_dcphy_pll_enable (samsung); +if (ret <0 ) { +samsung_mipi_dcphy_bias_block_disable (samsung); +return ret; + } + +samsung_mipi_dphy_lane_enable (samsung); + +reset_control_deassert (samsung->m_phy_rst); + +/* The TSKEWCAL maximum is 100 µsec +* at initial calibration. +*/ +usleep_range (100 ,110 );
drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c line 1319
Quoted 10 lines
drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c new file +10
-0+ +return 0 ; +} + +static int samsung_mipi_dcphy_power_on (struct phy *phy) +{ +struct samsung_mipi_dcphy *samsung =phy_get_drvdata (phy); +enum phy_mode mode =phy_get_mode (phy); + +pm_runtime_get_sync (samsung->dev);
This already happened in samsung_mipi_dcphy_init?
Quoted 32 lines
drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c new file +32
-0+reset_control_assert (samsung->apb_rst); +udelay (1 ); +reset_control_deassert (samsung->apb_rst); + +switch (mode) { +case PHY_MODE_MIPI_DPHY : +return samsung_mipi_dphy_power_on (samsung); +default : +/* CSI cphy part to be implemented later */ +return -EOPNOTSUPP ; + } + +return 0 ; +} + +static int samsung_mipi_dcphy_power_off (struct phy *phy) +{ +struct samsung_mipi_dcphy *samsung =phy_get_drvdata (phy); +enum phy_mode mode =phy_get_mode (phy); + +switch (mode) { +case PHY_MODE_MIPI_DPHY : +samsung_mipi_dphy_lane_disable (samsung); +break ; +default : +/* CSI cphy part to be implemented later */ +return -EOPNOTSUPP ; + } + +samsung_mipi_dcphy_pll_disable (samsung); +samsung_mipi_dcphy_bias_block_disable (samsung); +
drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c line 1361
Quoted 10 lines
drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c new file +10
-0+pm_runtime_put (samsung->dev); + +return 0 ; +} + +static int samsung_mipi_dcphy_set_mode (struct phy *phy,enum phy_mode mode, +int submode) +{ +return 0 ; +}
You can just remove this. phy_set_mode_ext() will return 0 byself if the callback is NULL.
[...]
drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c line 1468
Quoted 5 lines
drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c new file +5
-0+static int samsung_mipi_dcphy_init (struct phy *phy) +{ +struct samsung_mipi_dcphy *samsung =phy_get_drvdata (phy); + +pm_runtime_get_sync (samsung->dev);
return pm_runtime_resume_and_get(samsung->dev);
drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c line 1477
Quoted 8 lines
drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c new file +8
-0+return 0 ; +} + +static int samsung_mipi_dcphy_exit (struct phy *phy) +{ +struct samsung_mipi_dcphy *samsung =phy_get_drvdata (phy); + +pm_runtime_put (samsung->dev);
return pm_runtime_put(samsung->dev);
Quoted 3 lines
drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c new file +3
-0+ +return 0 ; +}
[...]
Quoted 9 lines
drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c new file +9
-0+static __maybe_unused int samsung_mipi_dcphy_runtime_suspend (struct device *dev) +{ +struct samsung_mipi_dcphy *samsung =dev_get_drvdata (dev); + +clk_disable_unprepare (samsung->pclk); +clk_disable_unprepare (samsung->ref_clk); + +return 0 ; +}
drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c line 1599
Quoted 10 lines
drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c new file +10
-0+ +static __maybe_unused int samsung_mipi_dcphy_runtime_resume (struct device *dev) +{ +struct samsung_mipi_dcphy *samsung =dev_get_drvdata (dev); + +clk_prepare_enable (samsung->pclk); +clk_prepare_enable (samsung->ref_clk); + +return 0 ; +}
No error checking for managing the clocks?
[...]
Quoted 6 lines
drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c new file +6
-0+static const struct of_device_id samsung_mipi_dcphy_of_match[] = { + { + .compatible ="rockchip,rk3576-mipi-dcphy" , + .data = &rk3576_samsung_mipi_dcphy_plat_data, + }, { + .compatible ="rockchip,rk3588-mipi-dcphy" ,
drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c line 1645
Quoted 10 lines
drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c new file +10
-0+ .data = &rk3588_samsung_mipi_dcphy_plat_data, + }, + {/* sentinel */ } +}; +MODULE_DEVICE_TABLE (of, samsung_mipi_dcphy_of_match); + +static struct platform_driver samsung_mipi_dcphy_driver = { + .driver = { + .name ="samsung-mipi-dcphy" , + .of_match_table =of_match_ptr (samsung_mipi_dcphy_of_match),
drop of_match_ptr(). The way it is used right now just brings a compiler warning for CONFIG_OF=n.
drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c line 1652
Quoted 7 lines
drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c new file +7
-0+ .pm = &samsung_mipi_dcphy_pm_ops, + }, + .probe = samsung_mipi_dcphy_probe, +}; +module_platform_driver (samsung_mipi_dcphy_driver); + +MODULE_AUTHOR ("Guochun Huang<[email protected]>" );
space before <
drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c line 1654
Quoted 2 lines
drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c new file +2
-0+MODULE_DESCRIPTION ("Samsung MIPI DCPHY Driver" ); +MODULE_LICENSE ("GPL" );
Greetings,
-- Sebastian
Heiko Stübner
maintainerRe: [PATCH v2 2/2] phy: rockchip: Add Samsung CSI/DSI Combo DCPHY driver
Hi,
Quoted 13 lines
Quoted 13 lines
drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c new file +13
-0+static void samsung_mipi_dcphy_bias_block_enable (struct samsung_mipi_dcphy *samsung) +{ +u32 bias_con2 =0x3223 ; + +regmap_write (samsung->regmap,BIAS_CON0 ,0x0010 ); +regmap_write (samsung->regmap,BIAS_CON1 ,0x0110 ); +regmap_write (samsung->regmap,BIAS_CON2 , bias_con2); + +/* default output voltage select: +* dphy: 400mv +* cphy: 530mv +*/ + regmap_update_bits(samsung->regmap, BIAS_CON4,
Quoted 8 lines
drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c line 954
Quoted 6 lines
drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c new file +6
-0+ I_MUX_SEL_MASK, I_MUX_SEL_400MV); +} + +static void samsung_mipi_dcphy_bias_block_disable (struct samsung_mipi_dcphy *samsung) +{ +}uhm? :)
When there was still the CSI stuff in here, that function still had content ;-) .
But yeah, if and when that comes back, we can re-add things.
Quoted 8 lines
drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c line 1361
Quoted 5 lines
drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c new file +5
-0+static int samsung_mipi_dcphy_set_mode (struct phy *phy,enum phy_mode mode, +int submode) +{ +return 0 ; +}You can just remove this.
phy_set_mode_ext()will return 0 byself if the callback is NULL.
But it will not set the mode then.
See the part of
ret = phy->ops->set_mode(phy, mode, submode); if (!ret) phy->attrs.mode = mode;
Without the set_mode callback phy->attrs.mode will not be set. And while we don't have anything to do for set_mode itself, we do need the mipi_dphy mode to be set.
Heiko
Signature · 3 lines
linux-phy mailing list [email protected] https://lists.infradead.org/mailman/listinfo/linux-phy
kernel test robot
build botRe: [PATCH v2 2/2] phy: rockchip: Add Samsung CSI/DSI Combo DCPHY driver
In reply to Heiko Stuebnerkernel test robot noticed the following build warnings:
Hi Heiko,
kernel test robot noticed the following build warnings:
[auto build test WARNING on rockchip/for-next]
[also build test WARNING on robh/for-next linus/master v6.12-rc6 next-20241105] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Heiko-Stuebner/dt-bindings-phy-Add-Rockchip-MIPI-CSI-DSI-PHY-schema/20241104-193646 base: https://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git for-next patch link: https://lore.kernel.org/r/20241104111121.99274-3-heiko%40sntech.de patch subject: [PATCH v2 2/2] phy: rockchip: Add Samsung CSI/DSI Combo DCPHY driver config: m68k-randconfig-r113-20241105 (https://download.01.org/0day-ci/archive/20241106/[email protected]/config) compiler: m68k-linux-gcc (GCC) 14.1.0 reproduce: (https://download.01.org/0day-ci/archive/20241106/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All warnings (new ones prefixed by >>):
>> drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c:1630:34: warning: 'samsung_mipi_dcphy_of_match' defined but not used [-Wunused-const-variable=]
1630 | static const struct of_device_id samsung_mipi_dcphy_of_match[] = {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for GET_FREE_REGION Depends on [n]: SPARSEMEM [=n]
Selected by [y]:
- RESOURCE_KUNIT_TEST [=y] && RUNTIME_TESTING_MENU [=y] && KUNIT [=y]
vim +/samsung_mipi_dcphy_of_match +1630 drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c
1629
> 1630 static const struct of_device_id samsung_mipi_dcphy_of_match[] = { 1631 {
1632 .compatible = "rockchip,rk3576-mipi-dcphy",
1633 .data = &rk3576_samsung_mipi_dcphy_plat_data,
1634 }, {
1635 .compatible = "rockchip,rk3588-mipi-dcphy",
1636 .data = &rk3588_samsung_mipi_dcphy_plat_data,
1637 },
1638 { /* sentinel */ }
1639 };
1640 MODULE_DEVICE_TABLE(of, samsung_mipi_dcphy_of_match);
1641
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki