Skip to contentSkip to conversation

MIPI DSI Controller support for SAM9X75 series

PATCH Superseded Manikandan Muralidharan 3 participants 9 messages Sep 18, 2024 – Sep 24, 2024

Subsystems (6)

v4 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

v4 cover MIPI DSI Controller support for SAM9X75 series

This patch series adds support for the Microchip's MIPI DSI Controller wrapper driver that uses the Synopsys DesignWare MIPI DSI host controller bridge for SAM9X75 SoC series.

Changelogs are available in respective patches.

Manikandan Muralidharan (4):
dt-bindings: display: bridge: add sam9x75-mipi-dsi binding drm/bridge: add Microchip DSI controller support for sam9x7 SoC series
MAINTAINERS: add SAM9X7 SoC's Microchip's MIPI DSI host wrapper driver
ARM: configs: at91: Enable Microchip's MIPI DSI Host Controller
support

 .../bridge/microchip,sam9x75-mipi-dsi.yaml    | 109 ++++
 MAINTAINERS                                   |   7 +
 arch/arm/configs/at91_dt_defconfig            |   1 +
 drivers/gpu/drm/bridge/Kconfig                |   8 +
 drivers/gpu/drm/bridge/Makefile               |   1 +
 drivers/gpu/drm/bridge/dw-mipi-dsi-mchp.c     | 545 ++++++++++++++++++
 6 files changed, 671 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/bridge/microchip,sam9x75-mipi-dsi.yaml
 create mode 100644 drivers/gpu/drm/bridge/dw-mipi-dsi-mchp.c
Signature · 1 line
2.25.1
#1 lore raw

PATCH v4 1/4 dt-bindings: display: bridge: add sam9x75-mipi-dsi binding

Add the 'sam9x75-mipi-dsi' compatible binding, which describes the Microchip's specific wrapper for the Synopsys DesignWare MIPI DSI HOST Controller for the sam9x75 series System-on-Chip (SoC) devices.

---
changes in v4:
- Removed 'microchip,sfr' phandle property since regmap to SFR node can be obtained using its compatible string

changes in v3:
- Describe the clocks used

changes in v2:
- List the clocks with description
- remove describing 'remove-endpoint' properties
- remove unused label, node and fix example DT indentation
- cosmetic fixes

---
 .../bridge/microchip,sam9x75-mipi-dsi.yaml    | 109 ++++++++++++++++++
 1 file changed, 109 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/bridge/microchip,sam9x75-mipi-dsi.yaml
Documentation/devicetree/bindings/display/bridge/microchip,sam9x75-mipi-dsi.yaml new file +109 -0
new file mode 100644
index 000000000000..d2ae6250e1f1
@@ -0,0 +1,109 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/bridge/microchip,sam9x75-mipi-dsi.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Microchip SAM9X75 MIPI DSI Controller
+
+maintainers:
+  - Manikandan Muralidharan <[email protected]>
+
+description:
+  Microchip specific extensions or wrapper to the Synopsys Designware MIPI DSI.
+  The MIPI Display Serial Interface (DSI) Host Controller implements all
+  protocol functions defined in the MIPI DSI Specification.The DSI Host
+  provides an interface between the LCD Controller (LCDC) and the MIPI D-PHY,
+  allowing communication with a DSI-compliant display.
+
+allOf:
+  - $ref: /schemas/display/dsi-controller.yaml#
+
+properties:
+  compatible:
+    const: microchip,sam9x75-mipi-dsi
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    items:
+      - description:
+          Peripheral Bus Clock between LCDC and MIPI DPHY
+      - description:
+          MIPI DPHY Interface reference clock for PLL block
+
+  clock-names:
+    items:
+      - const: pclk
+      - const: refclk
+
+  ports:
+    $ref: /schemas/graph.yaml#/properties/ports
+
+    properties:
+      port@0:
+        $ref: /schemas/graph.yaml#/$defs/port-base
+        unevaluatedProperties: false
+        description:
+          DSI Input port node, connected to the LCDC RGB output port.
+
+        properties:
+          endpoint:
+            $ref: /schemas/media/video-interfaces.yaml#
+            unevaluatedProperties: false
+
+      port@1:
+        $ref: /schemas/graph.yaml#/$defs/port-base
+        unevaluatedProperties: false
+        description:
+          DSI Output port node, connected to a panel or a bridge input port.
+
+        properties:
+          endpoint:
+            $ref: /schemas/media/video-interfaces.yaml#
+            unevaluatedProperties: false
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+  - ports
+
+unevaluatedProperties: false
+
+examples:
+  - |
+     #include <dt-bindings/clock/at91.h>
+     #include <dt-bindings/gpio/gpio.h>
+
+     dsi@f8054000 {
+       compatible = "microchip,sam9x75-mipi-dsi";
+       reg = <0xf8054000 0x200>;
+       clocks = <&pmc PMC_TYPE_PERIPHERAL 54>, <&pmc PMC_TYPE_GCK 55>;
+       clock-names = "pclk", "refclk";
+
+       #address-cells = <1>;
+       #size-cells = <0>;
+
+       ports {
+         #address-cells = <1>;
+         #size-cells = <0>;
+
+         port@0 {
+           reg = <0>;
+           dsi_in: endpoint {
+             remote-endpoint = <&hlcdc_panel_output>;
+           };
+         };
+
+         port@1 {
+           reg = <1>;
+           dsi_out: endpoint {
+             remote-endpoint = <&mipi_in_panel>;
+           };
+         };
+       };
+     };
+...
Signature · 1 line
2.25.1
Reviewed-by on v4 1/4
#2 lore raw

Re: [PATCH v4 1/4] dt-bindings: display: bridge: add sam9x75-mipi-dsi binding

Quoted 5 lines · Manikandan Muralidharan

Add the 'sam9x75-mipi-dsi' compatible binding, which describes the Microchip's specific wrapper for the Synopsys DesignWare MIPI DSI HOST Controller for the sam9x75 series System-on-Chip (SoC) devices.

#3 lore raw

PATCH v4 2/4 drm/bridge: add Microchip DSI controller support for sam9x7 SoC series

In reply to Manikandan Muralidharan

Add the Microchip's DSI controller wrapper driver that uses the Synopsys DesignWare MIPI DSI host controller bridge.

---
changes in v4:
- Fixed issues reported by kernel test robot
- replaced syscon_regmap_lookup_by_phandle with
syscon_regmap_lookup_by_compatible

changes in v3:
- make remove callback return void

changes in v2:
- use static const with global variables
- replace dev_err with dev_err_probe
- move clk_prepare_enable to simplify the error path
- use FIELD_PREP calls
- remove unused macros and unused functions
- rename function name with mchp_ suffix
- add suspend and resume pm calls to handle pllref_clk

---
 drivers/gpu/drm/bridge/Kconfig            |   8 +
 drivers/gpu/drm/bridge/Makefile           |   1 +
 drivers/gpu/drm/bridge/dw-mipi-dsi-mchp.c | 545 ++++++++++++++++++++++
 3 files changed, 554 insertions(+)
 create mode 100644 drivers/gpu/drm/bridge/dw-mipi-dsi-mchp.c
drivers/gpu/drm/bridge/Kconfig +8 -0
index 683cb33805b2..317246509601 100644
@@ -196,6 +196,14 @@ config DRM_MICROCHIP_LVDS_SERIALIZER
 	help
 	  Support for Microchip's LVDS serializer.
 
+config DRM_MICROCHIP_DW_MIPI_DSI
+	tristate "Microchip specific extensions for Synopsys DW MIPI DSI"
+	depends on DRM_ATMEL_HLCDC
+	select DRM_DW_MIPI_DSI
+	help
+	  This selects support for Microchip's SoC specific extensions
+	  for the Synopsys DesignWare dsi driver.
+
 config DRM_NWL_MIPI_DSI
 	tristate "Northwest Logic MIPI DSI Host controller"
 	depends on DRM
drivers/gpu/drm/bridge/Makefile +1 -0
index 3daf803ce80b..32e4233e6b5e 100644
@@ -14,6 +14,7 @@ obj-$(CONFIG_DRM_LONTIUM_LT9611UXC) += lontium-lt9611uxc.o
 obj-$(CONFIG_DRM_LVDS_CODEC) += lvds-codec.o
 obj-$(CONFIG_DRM_MEGACHIPS_STDPXXXX_GE_B850V3_FW) += megachips-stdpxxxx-ge-b850v3-fw.o
 obj-$(CONFIG_DRM_MICROCHIP_LVDS_SERIALIZER) += microchip-lvds.o
+obj-$(CONFIG_DRM_MICROCHIP_DW_MIPI_DSI) += dw-mipi-dsi-mchp.o
 obj-$(CONFIG_DRM_NXP_PTN3460) += nxp-ptn3460.o
 obj-$(CONFIG_DRM_PARADE_PS8622) += parade-ps8622.o
 obj-$(CONFIG_DRM_PARADE_PS8640) += parade-ps8640.o
drivers/gpu/drm/bridge/dw-mipi-dsi-mchp.c new file +545 -0

545 lines not on this page · raw message

Signature · 1 line
2.25.1
#4 lore raw

Re: [PATCH v4 2/4] drm/bridge: add Microchip DSI controller support for sam9x7 SoC series

Quoted 73 lines · Manikandan Muralidharan

Add the Microchip's DSI controller wrapper driver that uses the Synopsys DesignWare MIPI DSI host controller bridge.

---
changes in v4:
- Fixed issues reported by kernel test robot
- replaced syscon_regmap_lookup_by_phandle with
syscon_regmap_lookup_by_compatible

changes in v3:
- make remove callback return void

changes in v2:
- use static const with global variables
- replace dev_err with dev_err_probe
- move clk_prepare_enable to simplify the error path
- use FIELD_PREP calls
- remove unused macros and unused functions
- rename function name with mchp_ suffix
- add suspend and resume pm calls to handle pllref_clk

---
 drivers/gpu/drm/bridge/Kconfig            |   8 +
 drivers/gpu/drm/bridge/Makefile           |   1 +
 drivers/gpu/drm/bridge/dw-mipi-dsi-mchp.c | 545 ++++++++++++++++++++++
 3 files changed, 554 insertions(+)
 create mode 100644 drivers/gpu/drm/bridge/dw-mipi-dsi-mchp.c
drivers/gpu/drm/bridge/Kconfig +8 -0
index 683cb33805b2..317246509601 100644
@@ -196,6 +196,14 @@ config DRM_MICROCHIP_LVDS_SERIALIZER
 	help
 	  Support for Microchip's LVDS serializer.
 
+config DRM_MICROCHIP_DW_MIPI_DSI
+	tristate "Microchip specific extensions for Synopsys DW MIPI DSI"
+	depends on DRM_ATMEL_HLCDC
+	select DRM_DW_MIPI_DSI
+	help
+	  This selects support for Microchip's SoC specific extensions
+	  for the Synopsys DesignWare dsi driver.
+
 config DRM_NWL_MIPI_DSI
 	tristate "Northwest Logic MIPI DSI Host controller"
 	depends on DRM
drivers/gpu/drm/bridge/Makefile +1 -0
index 3daf803ce80b..32e4233e6b5e 100644
@@ -14,6 +14,7 @@ obj-$(CONFIG_DRM_LONTIUM_LT9611UXC) += lontium-lt9611uxc.o
 obj-$(CONFIG_DRM_LVDS_CODEC) += lvds-codec.o
 obj-$(CONFIG_DRM_MEGACHIPS_STDPXXXX_GE_B850V3_FW) += megachips-stdpxxxx-ge-b850v3-fw.o
 obj-$(CONFIG_DRM_MICROCHIP_LVDS_SERIALIZER) += microchip-lvds.o
+obj-$(CONFIG_DRM_MICROCHIP_DW_MIPI_DSI) += dw-mipi-dsi-mchp.o
 obj-$(CONFIG_DRM_NXP_PTN3460) += nxp-ptn3460.o
 obj-$(CONFIG_DRM_PARADE_PS8622) += parade-ps8622.o
 obj-$(CONFIG_DRM_PARADE_PS8640) += parade-ps8640.o
drivers/gpu/drm/bridge/dw-mipi-dsi-mchp.c new file +8 -0
new file mode 100644
index 000000000000..35cfca1ff000
@@ -0,0 +1,545 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (C) 2024 Microchip Technology Inc. and its subsidiaries
+ *
+ * Author: Manikandan Muralidharan <[email protected]>
+ *
+ */
+

[...]

Quoted 5 lines
drivers/gpu/drm/bridge/dw-mipi-dsi-mchp.c new file +5 -0
+
+static int dw_mipi_dsi_mchp_get_lane_mbps(void *priv_data,
+					  const struct drm_display_mode *mode,
+					  unsigned long mode_flags, u32 lanes,
+					  u32 format, unsigned int *lane_mbps)

drivers/gpu/drm/bridge/dw-mipi-dsi-mchp.c line 290

Quoted 10 lines
drivers/gpu/drm/bridge/dw-mipi-dsi-mchp.c new file +10 -0
+{
+	struct dw_mipi_dsi_mchp *dsi = priv_data;
+	unsigned long best_freq, fvco_min, fvco_max, fin, fout;
+	unsigned long min_delta = ULONG_MAX, delta;
+	unsigned int target_mbps = 0, mpclk, desired_mbps;
+	unsigned int max_mbps = dppa_map[ARRAY_SIZE(dppa_map) - 1].max_mbps;
+	unsigned int min_prediv, max_prediv;
+	unsigned int _fbdiv, best_fbdiv, _prediv, best_prediv;
+	int bpp;
+	u64 freq_factor;

This function is significantly overlapping with dw_mipi_dsi_get_lane_mbps(). Please extract a common helper and add it to dw-mipi-dsi.c. Other than that, LGTM.

Quoted 10 lines
drivers/gpu/drm/bridge/dw-mipi-dsi-mchp.c new file +10 -0
+
+	dsi->format = format;
+	bpp = mipi_dsi_pixel_format_to_bpp(dsi->format);
+	if (bpp < 0) {
+		dev_err(dsi->dev,
+			"failed to get bpp for pixel format %d\n",
+			dsi->format);
+		return bpp;
+	}
+
Signature · 2 lines
With best wishes
Dmitry
#5 lore raw

Re: [PATCH v4 2/4] drm/bridge: add Microchip DSI controller support for sam9x7 SoC series

Hi Dmitry,

Quoted 90 lines · Dmitry Baryshkov

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

Quoted 73 lines · Manikandan Muralidharan

Add the Microchip's DSI controller wrapper driver that uses the Synopsys DesignWare MIPI DSI host controller bridge.

---
changes in v4:
- Fixed issues reported by kernel test robot
- replaced syscon_regmap_lookup_by_phandle with
syscon_regmap_lookup_by_compatible

changes in v3:
- make remove callback return void

changes in v2:
- use static const with global variables
- replace dev_err with dev_err_probe
- move clk_prepare_enable to simplify the error path
- use FIELD_PREP calls
- remove unused macros and unused functions
- rename function name with mchp_ suffix
- add suspend and resume pm calls to handle pllref_clk

---
  drivers/gpu/drm/bridge/Kconfig            |   8 +
  drivers/gpu/drm/bridge/Makefile           |   1 +
  drivers/gpu/drm/bridge/dw-mipi-dsi-mchp.c | 545 ++++++++++++++++++++++
  3 files changed, 554 insertions(+)

create mode 100644 drivers/gpu/drm/bridge/dw-mipi-dsi-mchp.c

drivers/gpu/drm/bridge/Kconfig +8 -0
index 683cb33805b2..317246509601 100644
@@ -196,6 +196,14 @@ config DRM_MICROCHIP_LVDS_SERIALIZER
       help
         Support for Microchip's LVDS serializer.
 
+config DRM_MICROCHIP_DW_MIPI_DSI
+     tristate "Microchip specific extensions for Synopsys DW MIPI DSI"
+     depends on DRM_ATMEL_HLCDC
+     select DRM_DW_MIPI_DSI
+     help
+       This selects support for Microchip's SoC specific extensions
+       for the Synopsys DesignWare dsi driver.
+
  config DRM_NWL_MIPI_DSI
       tristate "Northwest Logic MIPI DSI Host controller"
       depends on DRM
drivers/gpu/drm/bridge/Makefile +1 -0
index 3daf803ce80b..32e4233e6b5e 100644
@@ -14,6 +14,7 @@ obj-$(CONFIG_DRM_LONTIUM_LT9611UXC) += lontium-lt9611uxc.o
  obj-$(CONFIG_DRM_LVDS_CODEC) += lvds-codec.o
  obj-$(CONFIG_DRM_MEGACHIPS_STDPXXXX_GE_B850V3_FW) += megachips-stdpxxxx-ge-b850v3-fw.o
  obj-$(CONFIG_DRM_MICROCHIP_LVDS_SERIALIZER) += microchip-lvds.o
+obj-$(CONFIG_DRM_MICROCHIP_DW_MIPI_DSI) += dw-mipi-dsi-mchp.o
  obj-$(CONFIG_DRM_NXP_PTN3460) += nxp-ptn3460.o
  obj-$(CONFIG_DRM_PARADE_PS8622) += parade-ps8622.o
  obj-$(CONFIG_DRM_PARADE_PS8640) += parade-ps8640.o
drivers/gpu/drm/bridge/dw-mipi-dsi-mchp.c new file +8 -0
new file mode 100644
index 000000000000..35cfca1ff000
@@ -0,0 +1,545 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (C) 2024 Microchip Technology Inc. and its subsidiaries
+ *
+ * Author: Manikandan Muralidharan <[email protected]>
+ *
+ */
+

[...]

Quoted 11 lines
drivers/gpu/drm/bridge/dw-mipi-dsi-mchp.c new file +11 -0
+
+static int dw_mipi_dsi_mchp_get_lane_mbps(void *priv_data,
+                                       const struct drm_display_mode *mode,
+                                       unsigned long mode_flags, u32 lanes,
+                                       u32 format, unsigned int *lane_mbps)
+{
+     struct dw_mipi_dsi_mchp *dsi = priv_data;
+     unsigned long best_freq, fvco_min, fvco_max, fin, fout;
+     unsigned long min_delta = ULONG_MAX, delta;
+     unsigned int target_mbps = 0, mpclk, desired_mbps;
+     unsigned int max_mbps = dppa_map[ARRAY_SIZE(dppa_map) - 1].max_mbps;
Quoted 9 lines

drivers/gpu/drm/bridge/dw-mipi-dsi-mchp.c line 290

Quoted 4 lines
drivers/gpu/drm/bridge/dw-mipi-dsi-mchp.c new file +4 -0
+     unsigned int min_prediv, max_prediv;
+     unsigned int _fbdiv, best_fbdiv, _prediv, best_prediv;
+     int bpp;
+     u64 freq_factor;

This function is significantly overlapping with dw_mipi_dsi_get_lane_mbps(). Please extract a common helper and add it to dw-mipi-dsi.c. Other than that, LGTM.

I find it difficult to understand your concern.
The dw_mipi_dsi_mchp_get_lane_mbps() is the .get_lane_mbps phy_op specific to Microchip DSI wrapper. The dw_mipi_dsi_get_lane_mbps functionalities across different SoC wrapper is not the same to extract a common helper.

Quoted 13 lines

drivers/gpu/drm/bridge/dw-mipi-dsi-mchp.c line 300

Quoted 10 lines
drivers/gpu/drm/bridge/dw-mipi-dsi-mchp.c new file +10 -0
+
+     dsi->format = format;
+     bpp = mipi_dsi_pixel_format_to_bpp(dsi->format);
+     if (bpp < 0) {
+             dev_err(dsi->dev,
+                     "failed to get bpp for pixel format %d\n",
+                     dsi->format);
+             return bpp;
+     }
+

--
With best wishes
Dmitry

Signature · 2 lines
Thanks and Regards,
Manikandan M.
#6 lore raw

Re: [PATCH v4 2/4] drm/bridge: add Microchip DSI controller support for sam9x7 SoC series

Quoted 103 lines · On Tue, 24 Sept 2024 at 12:17, <[email protected]> wrote:

Hi Dmitry,

Quoted 90 lines · Dmitry Baryshkov

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

Quoted 73 lines · Manikandan Muralidharan

Add the Microchip's DSI controller wrapper driver that uses the Synopsys DesignWare MIPI DSI host controller bridge.

---
changes in v4:
- Fixed issues reported by kernel test robot
- replaced syscon_regmap_lookup_by_phandle with
syscon_regmap_lookup_by_compatible

changes in v3:
- make remove callback return void

changes in v2:
- use static const with global variables
- replace dev_err with dev_err_probe
- move clk_prepare_enable to simplify the error path
- use FIELD_PREP calls
- remove unused macros and unused functions
- rename function name with mchp_ suffix
- add suspend and resume pm calls to handle pllref_clk

---
  drivers/gpu/drm/bridge/Kconfig            |   8 +
  drivers/gpu/drm/bridge/Makefile           |   1 +
  drivers/gpu/drm/bridge/dw-mipi-dsi-mchp.c | 545 ++++++++++++++++++++++
  3 files changed, 554 insertions(+)

create mode 100644 drivers/gpu/drm/bridge/dw-mipi-dsi-mchp.c

drivers/gpu/drm/bridge/Kconfig +8 -0
index 683cb33805b2..317246509601 100644
@@ -196,6 +196,14 @@ config DRM_MICROCHIP_LVDS_SERIALIZER
       help
         Support for Microchip's LVDS serializer.
 
+config DRM_MICROCHIP_DW_MIPI_DSI
+     tristate "Microchip specific extensions for Synopsys DW MIPI DSI"
+     depends on DRM_ATMEL_HLCDC
+     select DRM_DW_MIPI_DSI
+     help
+       This selects support for Microchip's SoC specific extensions
+       for the Synopsys DesignWare dsi driver.
+
  config DRM_NWL_MIPI_DSI
       tristate "Northwest Logic MIPI DSI Host controller"
       depends on DRM
drivers/gpu/drm/bridge/Makefile +1 -0
index 3daf803ce80b..32e4233e6b5e 100644
@@ -14,6 +14,7 @@ obj-$(CONFIG_DRM_LONTIUM_LT9611UXC) += lontium-lt9611uxc.o
  obj-$(CONFIG_DRM_LVDS_CODEC) += lvds-codec.o
  obj-$(CONFIG_DRM_MEGACHIPS_STDPXXXX_GE_B850V3_FW) += megachips-stdpxxxx-ge-b850v3-fw.o
  obj-$(CONFIG_DRM_MICROCHIP_LVDS_SERIALIZER) += microchip-lvds.o
+obj-$(CONFIG_DRM_MICROCHIP_DW_MIPI_DSI) += dw-mipi-dsi-mchp.o
  obj-$(CONFIG_DRM_NXP_PTN3460) += nxp-ptn3460.o
  obj-$(CONFIG_DRM_PARADE_PS8622) += parade-ps8622.o
  obj-$(CONFIG_DRM_PARADE_PS8640) += parade-ps8640.o
drivers/gpu/drm/bridge/dw-mipi-dsi-mchp.c new file +8 -0
new file mode 100644
index 000000000000..35cfca1ff000
@@ -0,0 +1,545 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (C) 2024 Microchip Technology Inc. and its subsidiaries
+ *
+ * Author: Manikandan Muralidharan <[email protected]>
+ *
+ */
+

[...]

Quoted 11 lines
drivers/gpu/drm/bridge/dw-mipi-dsi-mchp.c new file +11 -0
+
+static int dw_mipi_dsi_mchp_get_lane_mbps(void *priv_data,
+                                       const struct drm_display_mode *mode,
+                                       unsigned long mode_flags, u32 lanes,
+                                       u32 format, unsigned int *lane_mbps)
+{
+     struct dw_mipi_dsi_mchp *dsi = priv_data;
+     unsigned long best_freq, fvco_min, fvco_max, fin, fout;
+     unsigned long min_delta = ULONG_MAX, delta;
+     unsigned int target_mbps = 0, mpclk, desired_mbps;
+     unsigned int max_mbps = dppa_map[ARRAY_SIZE(dppa_map) - 1].max_mbps;
Quoted 9 lines

drivers/gpu/drm/bridge/dw-mipi-dsi-mchp.c line 290

Quoted 4 lines
drivers/gpu/drm/bridge/dw-mipi-dsi-mchp.c new file +4 -0
+     unsigned int min_prediv, max_prediv;
+     unsigned int _fbdiv, best_fbdiv, _prediv, best_prediv;
+     int bpp;
+     u64 freq_factor;

This function is significantly overlapping with dw_mipi_dsi_get_lane_mbps(). Please extract a common helper and add it to dw-mipi-dsi.c. Other than that, LGTM.

Quoted 5 lines

I find it difficult to understand your concern.
The dw_mipi_dsi_mchp_get_lane_mbps() is the .get_lane_mbps phy_op specific to Microchip DSI wrapper. The dw_mipi_dsi_get_lane_mbps functionalities across different SoC wrapper is not the same to extract a common helper.

Ok, somebody didn't do a proper prefix naming. I was looking at dw_mipi_dsi_get_lane_mbps() from dw-mipi-dsi-rockchip.c. It looks pretty close to your code.

Quoted 18 lines
Quoted 5 lines
Quoted 5 lines
drivers/gpu/drm/bridge/dw-mipi-dsi-mchp.c new file +5 -0
+
+     dsi->format = format;
+     bpp = mipi_dsi_pixel_format_to_bpp(dsi->format);
+     if (bpp < 0) {
+             dev_err(dsi->dev,
Quoted 8 lines

drivers/gpu/drm/bridge/dw-mipi-dsi-mchp.c line 300

Quoted 5 lines
drivers/gpu/drm/bridge/dw-mipi-dsi-mchp.c new file +5 -0
+                     "failed to get bpp for pixel format %d\n",
+                     dsi->format);
+             return bpp;
+     }
+

--
With best wishes
Dmitry

--
Thanks and Regards,
Manikandan M.

Signature · 2 lines
With best wishes
Dmitry
#7 lore raw

PATCH v4 3/4 MAINTAINERS: add SAM9X7 SoC's Microchip's MIPI DSI host wrapper driver

In reply to Manikandan Muralidharan

Add the Microchip's DSI controller wrapper driver that uses the Synopsys DesignWare MIPI DSI host controller bridge for the SAM9X7 SoC series to the MAINTAINERS entry.

---
changes in v3:
- Drop T: section

---
 MAINTAINERS | 7 +++++++
 1 file changed, 7 insertions(+)
MAINTAINERS +7 -0
index 333ed0718175..10b3a2b99717 100644
@@ -15103,6 +15103,13 @@ S:	Supported
 F:	Documentation/devicetree/bindings/display/bridge/microchip,sam9x75-lvds.yaml
 F:	drivers/gpu/drm/bridge/microchip-lvds.c
 
+DRM DRIVER FOR MICROCHIP SAM9X7-COMPATIBLE MIPI DSI HOST CONTROLLER
+M:	Manikandan Muralidharan <[email protected]>
+L:	[email protected]
+S:	Supported
+F:	Documentation/devicetree/bindings/display/bridge/microchip,sam9x75-mipi-dsi.yaml
+F:	drivers/gpu/drm/bridge/dw-mipi-dsi-mchp.c
+
 MICROCHIP SAMA5D2-COMPATIBLE ADC DRIVER
 M:	Eugen Hristev <[email protected]>
 L:	[email protected]
Signature · 1 line
2.25.1
#8 lore raw

PATCH v4 4/4 ARM: configs: at91: Enable Microchip's MIPI DSI Host Controller support

In reply to Manikandan Muralidharan

Enable the Microchip's DSI controller wrapper driver that uses the Synopsys DesignWare MIPI DSI host controller bridge.

---
 arch/arm/configs/at91_dt_defconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/configs/at91_dt_defconfig +1 -0
index 6eabe2313c9a..beb29c4832ce 100644
@@ -144,6 +144,7 @@ CONFIG_VIDEO_OV7740=m
 CONFIG_DRM=y
 CONFIG_DRM_ATMEL_HLCDC=y
 CONFIG_DRM_MICROCHIP_LVDS_SERIALIZER=y
+CONFIG_DRM_MICROCHIP_DW_MIPI_DSI=y
 CONFIG_DRM_PANEL_SIMPLE=y
 CONFIG_DRM_PANEL_EDP=y
 CONFIG_FB_ATMEL=y
Signature · 1 line
2.25.1