[v4] arm64: dts: sc7180: add nodes for idp display

2020-06-30 Thread Harigovindan P
Add nodes for IDP display. The display is Visionox RM69299.

Signed-off-by: Harigovindan P 
---
Changes in v2:
- Adding dependency patchwork series
- Removing suspend configuration
- Adding blank before space curly brace
Changes in v3:
- Updating status for mdp and mdss node to get the
display working
- Change in commit text
Changes in v4:
- Added pinconf subnode
- Using macros for function and drive-strength

 arch/arm64/boot/dts/qcom/sc7180-idp.dts | 65 +
 1 file changed, 65 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sc7180-idp.dts 
b/arch/arm64/boot/dts/qcom/sc7180-idp.dts
index 39dbfc89689e..5e0b7e4b2545 100644
--- a/arch/arm64/boot/dts/qcom/sc7180-idp.dts
+++ b/arch/arm64/boot/dts/qcom/sc7180-idp.dts
@@ -9,6 +9,7 @@
 
 #include 
 #include 
+#include 
 #include "sc7180.dtsi"
 #include "pm6150.dtsi"
 #include "pm6150l.dtsi"
@@ -287,6 +288,57 @@ vreg_bob: bob {
};
 };
 
+ {
+   status = "okay";
+
+   vdda-supply = <_l3c_1p2>;
+
+   panel@0 {
+   compatible = "visionox,rm69299-1080p-display";
+   reg = <0>;
+
+   vdda-supply = <_l8c_1p8>;
+   vdd3p3-supply = <_l18a_2p8>;
+
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins>;
+
+   reset-gpios = <_gpio 3 GPIO_ACTIVE_HIGH>;
+
+   ports {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   port@0 {
+   reg = <0>;
+   panel0_in: endpoint {
+   remote-endpoint = <_out>;
+   };
+   };
+   };
+   };
+
+   ports {
+   port@1 {
+   endpoint {
+   remote-endpoint = <_in>;
+   data-lanes = <0 1 2 3>;
+   };
+   };
+   };
+};
+
+_phy {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+};
+
  {
status = "okay";
pinctrl-names = "default";
@@ -402,6 +454,19 @@ wifi-firmware {
 
 /* PINCTRL - additions to nodes defined in sc7180.dtsi */
 
+_gpio {
+   disp_pins: disp-pins {
+   pinconf {
+   pins = "gpio3";
+   function = PMIC_GPIO_FUNC_FUNC1;
+   qcom,drive-strength = ;
+   power-source = <0>;
+   bias-disable;
+   output-low;
+   };
+   };
+};
+
 _clk {
pinconf {
pins = "gpio63";
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[v3] drm/bridge: ti-sn65dsi86: ensure bridge suspend happens during PM sleep

2020-06-10 Thread Harigovindan P
ti-sn65dsi86 bridge is enumerated as a runtime device. When
suspend is triggered, PM core adds a refcount on all the
devices and calls device suspend, since usage count is
already incremented, runtime suspend will not be called
and it kept the bridge regulators and gpios ON which resulted
in platform not entering into XO shutdown.

Add changes to force suspend on the runtime device during pm sleep.

Signed-off-by: Harigovindan P 
---

Changes in v2:
- Include bridge name in the commit message and 
remove dependent patchwork link from the commit
text as bridge is independent of OEM(Stephen Boyd)

Changes in v3:
- Updating changelog to explain the need for patch

 drivers/gpu/drm/bridge/ti-sn65dsi86.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c 
b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
index 6ad688b320ae..2eef755b2917 100644
--- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c
+++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
@@ -159,6 +159,8 @@ static int __maybe_unused ti_sn_bridge_suspend(struct 
device *dev)
 
 static const struct dev_pm_ops ti_sn_bridge_pm_ops = {
SET_RUNTIME_PM_OPS(ti_sn_bridge_suspend, ti_sn_bridge_resume, NULL)
+   SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
+   pm_runtime_force_resume)
 };
 
 static int status_show(struct seq_file *s, void *data)
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[v2] drm/bridge: ti-sn65dsi86: ensure bridge suspend happens during PM sleep

2020-06-05 Thread Harigovindan P
ti-sn65dsi86 bridge is enumerated as a runtime device.

Adding sleep ops to force runtime_suspend when PM suspend is
requested on the device.

Signed-off-by: Harigovindan P 
---
Changes in v2:
- Include bridge name in the commit message and 
remove dependent patchwork link from the commit
text as bridge is independent of OEM(Stephen Boyd)

 drivers/gpu/drm/bridge/ti-sn65dsi86.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c 
b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
index 6ad688b320ae..2eef755b2917 100644
--- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c
+++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
@@ -159,6 +159,8 @@ static int __maybe_unused ti_sn_bridge_suspend(struct 
device *dev)
 
 static const struct dev_pm_ops ti_sn_bridge_pm_ops = {
SET_RUNTIME_PM_OPS(ti_sn_bridge_suspend, ti_sn_bridge_resume, NULL)
+   SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
+   pm_runtime_force_resume)
 };
 
 static int status_show(struct seq_file *s, void *data)
-- 
2.27.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v12 0/2] Add support for rm69299 Visionox panel driver and add devicetree bindings for visionox panel

2020-04-29 Thread Harigovindan P
Adding support for visionox rm69299 panel driver and adding bindings for the 
same panel.
https://patchwork.kernel.org/patch/11461943/ has already been added to 
drm-misc-next.

Harigovindan P (2):
  drm/panel: add support for rm69299 visionox panel driver
  dt-bindings: documenting compatible string vendor "visionox"

 .../devicetree/bindings/vendor-prefixes.yaml  |   2 +
 drivers/gpu/drm/panel/Kconfig |   8 +
 drivers/gpu/drm/panel/Makefile|   1 +
 .../gpu/drm/panel/panel-visionox-rm69299.c| 304 ++
 4 files changed, 315 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-visionox-rm69299.c

-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v12 2/2] dt-bindings: documenting compatible string vendor "visionox"

2020-04-29 Thread Harigovindan P
Documenting compatible string vendor "visionox" in vendor-prefix yaml file.

Signed-off-by: Harigovindan P 
---
Changes in v11:
- Added compatible string in vendor-prefix yaml file

Changes in v12:
- Fixed the string to clear dt_binding_check errors.

 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml 
b/Documentation/devicetree/bindings/vendor-prefixes.yaml
index 66a7382add95..1c86ebbeae20 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.yaml
+++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml
@@ -1047,6 +1047,8 @@ patternProperties:
 description: Tronsmart
   "^truly,.*":
 description: Truly Semiconductors Limited
+  "^visionox,.*":
+description: Visionox
   "^tsd,.*":
 description: Theobroma Systems Design und Consulting GmbH
   "^tyan,.*":
-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[v1] drm/bridge: ensure bridge suspend happens during PM sleep

2020-04-23 Thread Harigovindan P
ti-sn65dsi86 bridge is enumerated as a runtime device.

Adding sleep ops to force runtime_suspend when PM suspend is
requested on the device.

This change needs to be taken along with the series:
https://patchwork.kernel.org/patch/11494309/

Signed-off-by: Harigovindan P 
---
 drivers/gpu/drm/bridge/ti-sn65dsi86.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c 
b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
index 6ad688b320ae..2eef755b2917 100644
--- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c
+++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
@@ -159,6 +159,8 @@ static int __maybe_unused ti_sn_bridge_suspend(struct 
device *dev)
 
 static const struct dev_pm_ops ti_sn_bridge_pm_ops = {
SET_RUNTIME_PM_OPS(ti_sn_bridge_suspend, ti_sn_bridge_resume, NULL)
+   SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
+   pm_runtime_force_resume)
 };
 
 static int status_show(struct seq_file *s, void *data)
-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v11 0/2] Add support for rm69299 Visionox panel driver and add devicetree bindings for visionox panel

2020-04-21 Thread Harigovindan P
Adding support for visionox rm69299 panel driver and adding bindings for the 
same panel.
https://patchwork.kernel.org/patch/11461943/ has already been added to 
drm-misc-next.

Harigovindan P (2):
  drm/panel: add support for rm69299 visionox panel driver
  dt-bindings: documenting compatible string vendor "visionox"

 .../devicetree/bindings/vendor-prefixes.yaml  |   2 +
 drivers/gpu/drm/panel/Kconfig |   8 +
 drivers/gpu/drm/panel/Makefile|   1 +
 .../gpu/drm/panel/panel-visionox-rm69299.c| 304 ++
 4 files changed, 315 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-visionox-rm69299.c

-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v11 0/2] Add support for rm69299 Visionox panel driver and add devicetree bindings for visionox panel

2020-04-21 Thread Harigovindan P
Adding support for visionox rm69299 panel driver and adding bindings for the 
same panel.
https://patchwork.kernel.org/patch/11461943/ has already been added to 
drm-misc-next.

Harigovindan P (2):
  drm/panel: add support for rm69299 visionox panel driver
  dt-bindings: documenting compatible string vendor "visionox"

 .../devicetree/bindings/vendor-prefixes.yaml  |   2 +
 drivers/gpu/drm/panel/Kconfig |   8 +
 drivers/gpu/drm/panel/Makefile|   1 +
 .../gpu/drm/panel/panel-visionox-rm69299.c| 304 ++
 4 files changed, 315 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-visionox-rm69299.c

-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v11 1/2] drm/panel: add support for rm69299 visionox panel driver

2020-04-21 Thread Harigovindan P
Add support for Visionox panel driver.

Signed-off-by: Harigovindan P 
---

Changes in v2:
- Dropping redundant space in Kconfig(Sam Ravnborg).
- Changing structure for include files(Sam Ravnborg).
- Removing backlight related code and functions(Sam Ravnborg).
- Removing repeated printing of error message(Sam Ravnborg).
- Adding drm_connector as an argument for get_modes function.
Changes in v3:
- Adding arguments for drm_panel_init to support against mainline.
Changes in v4:
- Removing error messages from regulator_set_load.
- Removing dev struct entry.
- Removing checks.
- Dropping empty comment lines.
Changes in v5:
- Removing unused struct member variables.
- Removing blank lines.
- Fixed indentation.
- Invoking dsi_detach and panel_remove while early exiting from probe.
Changes in v6:
- Changed "35597" to "rm69299" for power_on function.
- Removing rm69299_config since it supports single type of panel for 
now.
- Fixed alignment.
- Using goto statements when regulator_set_load fails.
Changes in v7:
- Added new goto statement when regulator_set_load fails.
Changes in v8,v9,v10:
- Had changes in first patch, did not make any change in panel driver.
Changes in v11:
- Fixing checkpatch script errors.
- Updated assignment of panel.dev property in  probe.

 drivers/gpu/drm/panel/Kconfig |   8 +
 drivers/gpu/drm/panel/Makefile|   1 +
 .../gpu/drm/panel/panel-visionox-rm69299.c| 304 ++
 3 files changed, 313 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-visionox-rm69299.c

diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index d56258b9fcaf..4b6131f5893d 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -444,6 +444,14 @@ config DRM_PANEL_TRULY_NT35597_WQXGA
  Say Y here if you want to enable support for Truly NT35597 WQXGA Dual 
DSI
  Video Mode panel
 
+config DRM_PANEL_VISIONOX_RM69299
+   tristate "Visionox RM69299"
+   depends on OF
+   depends on DRM_MIPI_DSI
+   help
+ Say Y here if you want to enable support for Visionox
+ RM69299  DSI Video Mode panel.
+
 config DRM_PANEL_XINPENG_XPP055C272
tristate "Xinpeng XPP055C272 panel driver"
depends on OF
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index 2335a1e32ae0..8eac3e6fa82c 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -47,4 +47,5 @@ obj-$(CONFIG_DRM_PANEL_TPO_TD028TTEC1) += 
panel-tpo-td028ttec1.o
 obj-$(CONFIG_DRM_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o
 obj-$(CONFIG_DRM_PANEL_TPO_TPG110) += panel-tpo-tpg110.o
 obj-$(CONFIG_DRM_PANEL_TRULY_NT35597_WQXGA) += panel-truly-nt35597.o
+obj-$(CONFIG_DRM_PANEL_VISIONOX_RM69299) += panel-visionox-rm69299.o
 obj-$(CONFIG_DRM_PANEL_XINPENG_XPP055C272) += panel-xinpeng-xpp055c272.o
diff --git a/drivers/gpu/drm/panel/panel-visionox-rm69299.c 
b/drivers/gpu/drm/panel/panel-visionox-rm69299.c
new file mode 100644
index ..3ef4cc80044a
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-visionox-rm69299.c
@@ -0,0 +1,304 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2019, The Linux Foundation. All rights reserved.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+struct visionox_rm69299 {
+   struct drm_panel panel;
+   struct regulator_bulk_data supplies[2];
+   struct gpio_desc *reset_gpio;
+   struct mipi_dsi_device *dsi;
+   bool prepared;
+   bool enabled;
+};
+
+static inline struct visionox_rm69299 *panel_to_ctx(struct drm_panel *panel)
+{
+   return container_of(panel, struct visionox_rm69299, panel);
+}
+
+static int visionox_rm69299_power_on(struct visionox_rm69299 *ctx)
+{
+   int ret;
+
+   ret = regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
+   if (ret < 0)
+   return ret;
+
+   /*
+* Reset sequence of visionox panel requires the panel to be
+* out of reset for 10ms, followed by being held in reset
+* for 10ms and then out again
+*/
+   gpiod_set_value(ctx->reset_gpio, 1);
+   usleep_range(1, 2);
+   gpiod_set_value(ctx->reset_gpio, 0);
+   usleep_range(1, 2);
+   gpiod_set_value(ctx->reset_gpio, 1);
+   usleep_range(1, 2);
+
+   return 0;
+}
+
+static int visionox_rm69299_power_off(struct visionox_rm69299 *ctx)
+{
+   gpiod_set_value(ctx->reset_gpio, 0);
+
+   return regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
+}
+
+static int visionox_rm69299_unprepare(struct drm_panel *panel)
+{
+   struct visionox_rm69299 *ctx = p

[PATCH v11 2/2] dt-bindings: documenting compatible string vendor "visionox"

2020-04-21 Thread Harigovindan P
Documenting compatible string vendor "visionox" in vendor-prefix yaml file.

Signed-off-by: Harigovindan P 
---
Changes in v11:
- Added visionox compatible string in vendor-prefixes.yaml
- Added as a part of checkpatch script error for panel driver.

 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml 
b/Documentation/devicetree/bindings/vendor-prefixes.yaml
index 66a7382add95..b2b8de90b87a 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.yaml
+++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml
@@ -1047,6 +1047,8 @@ patternProperties:
 description: Tronsmart
   "^truly,.*":
 description: Truly Semiconductors Limited
+  "visionox,.*":
+description: Visionox
   "^tsd,.*":
 description: Theobroma Systems Design und Consulting GmbH
   "^tyan,.*":
-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v11 0/2] Add support for rm69299 Visionox panel driver and add devicetree bindings for visionox panel

2020-04-21 Thread Harigovindan P
Adding support for visionox rm69299 panel driver and adding bindings for the 
same panel.
https://patchwork.kernel.org/patch/11461943/ has already been added to 
drm-misc-next.

Harigovindan P (2):
  drm/panel: add support for rm69299 visionox panel driver
  dt-bindings: documenting compatible string vendor "visionox"

 .../devicetree/bindings/vendor-prefixes.yaml  |   2 +
 drivers/gpu/drm/panel/Kconfig |   8 +
 drivers/gpu/drm/panel/Makefile|   1 +
 .../gpu/drm/panel/panel-visionox-rm69299.c| 304 ++
 4 files changed, 315 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-visionox-rm69299.c

-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v11 1/2] drm/panel: add support for rm69299 visionox panel driver

2020-04-21 Thread Harigovindan P
Add support for Visionox panel driver.

Signed-off-by: Harigovindan P 
---

Changes in v2:
- Dropping redundant space in Kconfig(Sam Ravnborg).
- Changing structure for include files(Sam Ravnborg).
- Removing backlight related code and functions(Sam Ravnborg).
- Removing repeated printing of error message(Sam Ravnborg).
- Adding drm_connector as an argument for get_modes function.
Changes in v3:
- Adding arguments for drm_panel_init to support against mainline.
Changes in v4:
- Removing error messages from regulator_set_load.
- Removing dev struct entry.
- Removing checks.
- Dropping empty comment lines.
Changes in v5:
- Removing unused struct member variables.
- Removing blank lines.
- Fixed indentation.
- Invoking dsi_detach and panel_remove while early exiting from probe.
Changes in v6:
- Changed "35597" to "rm69299" for power_on function.
- Removing rm69299_config since it supports single type of panel for 
now.
- Fixed alignment.
- Using goto statements when regulator_set_load fails.
Changes in v7:
- Added new goto statement when regulator_set_load fails.
Changes in v8,v9,v10:
- Had changes in first patch, did not make any change in panel driver.
Changes in v11:
- Fixing checkpatch script errors.
- Updated assignment of panel.dev property in  probe.

 drivers/gpu/drm/panel/Kconfig |   8 +
 drivers/gpu/drm/panel/Makefile|   1 +
 .../gpu/drm/panel/panel-visionox-rm69299.c| 304 ++
 3 files changed, 313 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-visionox-rm69299.c

diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index d56258b9fcaf..4b6131f5893d 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -444,6 +444,14 @@ config DRM_PANEL_TRULY_NT35597_WQXGA
  Say Y here if you want to enable support for Truly NT35597 WQXGA Dual 
DSI
  Video Mode panel
 
+config DRM_PANEL_VISIONOX_RM69299
+   tristate "Visionox RM69299"
+   depends on OF
+   depends on DRM_MIPI_DSI
+   help
+ Say Y here if you want to enable support for Visionox
+ RM69299  DSI Video Mode panel.
+
 config DRM_PANEL_XINPENG_XPP055C272
tristate "Xinpeng XPP055C272 panel driver"
depends on OF
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index 2335a1e32ae0..8eac3e6fa82c 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -47,4 +47,5 @@ obj-$(CONFIG_DRM_PANEL_TPO_TD028TTEC1) += 
panel-tpo-td028ttec1.o
 obj-$(CONFIG_DRM_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o
 obj-$(CONFIG_DRM_PANEL_TPO_TPG110) += panel-tpo-tpg110.o
 obj-$(CONFIG_DRM_PANEL_TRULY_NT35597_WQXGA) += panel-truly-nt35597.o
+obj-$(CONFIG_DRM_PANEL_VISIONOX_RM69299) += panel-visionox-rm69299.o
 obj-$(CONFIG_DRM_PANEL_XINPENG_XPP055C272) += panel-xinpeng-xpp055c272.o
diff --git a/drivers/gpu/drm/panel/panel-visionox-rm69299.c 
b/drivers/gpu/drm/panel/panel-visionox-rm69299.c
new file mode 100644
index ..3ef4cc80044a
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-visionox-rm69299.c
@@ -0,0 +1,304 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2019, The Linux Foundation. All rights reserved.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+struct visionox_rm69299 {
+   struct drm_panel panel;
+   struct regulator_bulk_data supplies[2];
+   struct gpio_desc *reset_gpio;
+   struct mipi_dsi_device *dsi;
+   bool prepared;
+   bool enabled;
+};
+
+static inline struct visionox_rm69299 *panel_to_ctx(struct drm_panel *panel)
+{
+   return container_of(panel, struct visionox_rm69299, panel);
+}
+
+static int visionox_rm69299_power_on(struct visionox_rm69299 *ctx)
+{
+   int ret;
+
+   ret = regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
+   if (ret < 0)
+   return ret;
+
+   /*
+* Reset sequence of visionox panel requires the panel to be
+* out of reset for 10ms, followed by being held in reset
+* for 10ms and then out again
+*/
+   gpiod_set_value(ctx->reset_gpio, 1);
+   usleep_range(1, 2);
+   gpiod_set_value(ctx->reset_gpio, 0);
+   usleep_range(1, 2);
+   gpiod_set_value(ctx->reset_gpio, 1);
+   usleep_range(1, 2);
+
+   return 0;
+}
+
+static int visionox_rm69299_power_off(struct visionox_rm69299 *ctx)
+{
+   gpiod_set_value(ctx->reset_gpio, 0);
+
+   return regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
+}
+
+static int visionox_rm69299_unprepare(struct drm_panel *panel)
+{
+   struct visionox_rm69299 *ctx = p

[PATCH v11 2/2] dt-bindings: documenting compatible string vendor "visionox"

2020-04-21 Thread Harigovindan P
Documenting compatible string vendor "visionox" in vendor-prefix yaml file.

Signed-off-by: Harigovindan P 
---
Changes in v11:
- Added visionox compatible string in vendor-prefixes.yaml
- Added as a part of checkpatch script error for panel driver.

 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml 
b/Documentation/devicetree/bindings/vendor-prefixes.yaml
index 66a7382add95..b2b8de90b87a 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.yaml
+++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml
@@ -1047,6 +1047,8 @@ patternProperties:
 description: Tronsmart
   "^truly,.*":
 description: Truly Semiconductors Limited
+  "visionox,.*":
+description: Visionox
   "^tsd,.*":
 description: Theobroma Systems Design und Consulting GmbH
   "^tyan,.*":
-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v10 0/2] Add support for rm69299 Visionox panel driver and add devicetree bindings for visionox panel

2020-03-27 Thread Harigovindan P
Adding support for visionox rm69299 panel driver and adding bindings for the 
same panel.

Harigovindan P (2):
  dt-bindings: display: add visionox rm69299 panel variant
  drm/panel: add support for rm69299 visionox panel driver

 .../display/panel/visionox,rm69299.yaml   |  58 
 drivers/gpu/drm/panel/Kconfig |   8 +
 drivers/gpu/drm/panel/Makefile|   1 +
 .../gpu/drm/panel/panel-visionox-rm69299.c| 295 ++
 4 files changed, 362 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/panel/visionox,rm69299.yaml
 create mode 100644 drivers/gpu/drm/panel/panel-visionox-rm69299.c

-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v10 1/2] dt-bindings: display: add visionox rm69299 panel variant

2020-03-27 Thread Harigovindan P
Add bindings for visionox rm69299 panel.

Signed-off-by: Harigovindan P 
---

Changes in v2:
- Removed unwanted properties from description.
- Creating source files without execute permissions(Rob Herring).
Changes in v3:
- Changing txt file into yaml
Changes in v4:
- Updating license identifier.
- Moving yaml file inside panel directory.
- Removing pinctrl entries.
- Adding documentation for reset-gpios.
Changes in v5:
- No changes. Updated 2/2 Patch.
Changes in v6:
- Removing patternProperties.
- Added " |" after description.
- Setting port and reset-gpios to true.
- Removing @ae94000 for dsi node.
Changes in v7:
- Added reg property.
Changes in v8:
- Rearranged additionalProperties.
- Dropping improper reg property.
Changes in v9:
- Adding additionalProperties at the same level as
  'properties'
- Adding properties for "ports" which includes:
  -> #address-cells
  -> #size-cells
  -> port@0
Changes in v10:
   - Changed file mode
   - Making port as required
   - Fixing example by removing ports and unit address in port
   - Removing indentation for 'additionalProperties'

 .../display/panel/visionox,rm69299.yaml   | 58 +++
 1 file changed, 58 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/panel/visionox,rm69299.yaml

diff --git 
a/Documentation/devicetree/bindings/display/panel/visionox,rm69299.yaml 
b/Documentation/devicetree/bindings/display/panel/visionox,rm69299.yaml
new file mode 100644
index ..1a44caae5f9b
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/panel/visionox,rm69299.yaml
@@ -0,0 +1,58 @@
+# SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/panel/visionox,rm69299.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Visionox model RM69299 Panels Device Tree Bindings.
+
+maintainers:
+ - Harigovindan P 
+
+description: |
+ This binding is for display panels using a Visionox RM692999 panel.
+
+allOf:
+ - $ref: panel-common.yaml#
+
+properties:
+  compatible:
+const: visionox,rm69299-1080p-display
+
+  vdda-supply:
+description: |
+  Phandle of the regulator that provides the vdda supply voltage.
+
+  vdd3p3-supply:
+description: |
+  Phandle of the regulator that provides the vdd3p3 supply voltage.
+
+  port: true
+
+  reset-gpios: true
+
+additionalProperties: false
+
+required:
+  - compatible
+  - vdda-supply
+  - vdd3p3-supply
+  - reset-gpios
+  - port
+
+examples:
+  - |
+panel {
+compatible = "visionox,rm69299-1080p-display";
+
+vdda-supply = <_pp1800_l8c>;
+vdd3p3-supply = <_pp2800_l18a>;
+
+reset-gpios = <_gpio 3 0>;
+port {
+panel0_in: endpoint {
+remote-endpoint = <_out>;
+};
+};
+};
+...
-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v9 0/2] Add support for rm69299 Visionox panel driver and add devicetree bindings for visionox panel

2020-03-23 Thread Harigovindan P
Adding support for visionox rm69299 panel driver and adding bindings for the 
same panel.

Harigovindan P (2):
  dt-bindings: display: add visionox rm69299 panel variant
  drm/panel: add support for rm69299 visionox panel driver

 .../display/panel/visionox,rm69299.yaml   |  82 +
 drivers/gpu/drm/panel/Kconfig |   8 +
 drivers/gpu/drm/panel/Makefile|   1 +
 .../gpu/drm/panel/panel-visionox-rm69299.c| 295 ++
 4 files changed, 386 insertions(+)
 create mode 100755 
Documentation/devicetree/bindings/display/panel/visionox,rm69299.yaml
 create mode 100644 drivers/gpu/drm/panel/panel-visionox-rm69299.c

-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v9 1/2] dt-bindings: display: add visionox rm69299 panel variant

2020-03-23 Thread Harigovindan P
Add bindings for visionox rm69299 panel.

Signed-off-by: Harigovindan P 
---

Changes in v2:
- Removed unwanted properties from description.
- Creating source files without execute permissions(Rob Herring).
Changes in v3:
- Changing txt file into yaml
Changes in v4:
- Updating license identifier.
- Moving yaml file inside panel directory.
- Removing pinctrl entries.
- Adding documentation for reset-gpios.
Changes in v5:
- No changes. Updated 2/2 Patch.
Changes in v6:
- Removing patternProperties.
- Added " |" after description.
- Setting port and reset-gpios to true.
- Removing @ae94000 for dsi node.
Changes in v7:
- Added reg property.
Changes in v8:
- Rearranged additionalProperties.
- Dropping improper reg property.
Changes in v9:
- Adding additionalProperties at the same level as
  'properties'
- Adding properties for "ports" which includes:
  -> #address-cells
  -> #size-cells
  -> port@0

 .../display/panel/visionox,rm69299.yaml   | 82 +++
 1 file changed, 82 insertions(+)
 create mode 100755 
Documentation/devicetree/bindings/display/panel/visionox,rm69299.yaml

diff --git 
a/Documentation/devicetree/bindings/display/panel/visionox,rm69299.yaml 
b/Documentation/devicetree/bindings/display/panel/visionox,rm69299.yaml
new file mode 100755
index ..2dd4d9471fa8
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/panel/visionox,rm69299.yaml
@@ -0,0 +1,82 @@
+# SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/panel/visionox,rm69299.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Visionox model RM69299 Panels Device Tree Bindings.
+
+maintainers:
+ - Harigovindan P 
+
+description: |
+ This binding is for display panels using a Visionox RM692999 panel.
+
+allOf:
+ - $ref: panel-common.yaml#
+
+properties:
+  compatible:
+const: visionox,rm69299-1080p-display
+
+  reg:
+maxItems: 1
+
+  vdda-supply:
+description: |
+  Phandle of the regulator that provides the vdda supply voltage.
+
+  vdd3p3-supply:
+description: |
+  Phandle of the regulator that provides the vdd3p3 supply voltage.
+
+  ports:
+type: object
+description: |
+  A ports node with endpoint definitions as defined in
+  Documentation/devicetree/bindings/media/video-interfaces.txt.
+
+properties:
+  "#address-cells":
+const: 1
+
+  "#size-cells":
+const: 0
+
+  port@0:
+type: object
+description: |
+  Input endpoints of the controller.
+
+  reset-gpios: true
+
+  additionalProperties: false
+
+required:
+  - compatible
+  - vdda-supply
+  - vdd3p3-supply
+  - reset-gpios
+
+examples:
+  - |
+panel {
+compatible = "visionox,rm69299-1080p-display";
+
+vdda-supply = <_pp1800_l8c>;
+vdd3p3-supply = <_pp2800_l18a>;
+
+reset-gpios = <_gpio 3 0>;
+ports {
+#address-cells = <1>;
+#size-cells = <0>;
+port@0 {
+reg = <0>;
+panel0_in: endpoint {
+remote-endpoint = <_out>;
+};
+};
+};
+};
+...
+
-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v8 1/2] dt-bindings: display: add visionox rm69299 panel variant

2020-03-20 Thread Harigovindan P
Add bindings for visionox rm69299 panel.

Signed-off-by: Harigovindan P 
---

Changes in v2:
- Removed unwanted properties from description.
- Creating source files without execute permissions(Rob Herring).
Changes in v3:
- Changing txt file into yaml
Changes in v4:
- Updating license identifier.
- Moving yaml file inside panel directory.
- Removing pinctrl entries.
- Adding documentation for reset-gpios.
Changes in v5:
- No changes. Updated 2/2 Patch.
Changes in v6:
- Removing patternProperties.
- Added " |" after description.
- Setting port and reset-gpios to true.
- Removing @ae94000 for dsi node.
Changes in v7:
- Added reg property.
Changes in v8:
- Rearranged additionalProperties.
- Dropping improper reg property.

 .../display/panel/visionox,rm69299.yaml   | 73 +++
 1 file changed, 73 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/panel/visionox,rm69299.yaml

diff --git 
a/Documentation/devicetree/bindings/display/panel/visionox,rm69299.yaml 
b/Documentation/devicetree/bindings/display/panel/visionox,rm69299.yaml
new file mode 100644
index ..5fd277602a66
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/panel/visionox,rm69299.yaml
@@ -0,0 +1,73 @@
+# SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/panel/visionox,rm69299.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Visionox model RM69299 Panels Device Tree Bindings.
+
+maintainers:
+ - Harigovindan P 
+
+description: |
+ This binding is for display panels using a Visionox RM692999 panel.
+
+allOf:
+ - $ref: panel-common.yaml#
+
+properties:
+  compatible:
+const: visionox,rm69299-1080p-display
+
+  reg:
+maxItems: 1
+
+  vdda-supply:
+description: |
+  Phandle of the regulator that provides the vdda supply voltage.
+
+  vdd3p3-supply:
+description: |
+  Phandle of the regulator that provides the vdd3p3 supply voltage.
+
+  ports:
+type: object
+description: |
+  A node containing DSI input & output port nodes with endpoint
+  definitions as documented in
+  Documentation/devicetree/bindings/media/video-interfaces.txt
+  Documentation/devicetree/bindings/graph.txt
+  properties:
+port: true
+
+  reset-gpios: true
+
+additionalProperties: false
+
+required:
+  - compatible
+  - vdda-supply
+  - vdd3p3-supply
+  - reset-gpios
+
+examples:
+  - |
+panel {
+compatible = "visionox,rm69299-1080p-display";
+
+vdda-supply = <_pp1800_l8c>;
+vdd3p3-supply = <_pp2800_l18a>;
+
+reset-gpios = <_gpio 3 0>;
+ports {
+#address-cells = <1>;
+#size-cells = <0>;
+port@0 {
+reg = <0>;
+panel0_in: endpoint {
+remote-endpoint = <_out>;
+};
+};
+};
+};
+...
-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v8 0/2] Add support for rm69299 Visionox panel driver and add devicetree bindings for visionox panel

2020-03-20 Thread Harigovindan P
Adding support for visionox rm69299 panel driver and adding bindings for the 
same panel.

Harigovindan P (2):
  dt-bindings: display: add visionox rm69299 panel variant
  drm/panel: add support for rm69299 visionox panel driver

 .../display/panel/visionox,rm69299.yaml   |  73 +
 drivers/gpu/drm/panel/Kconfig |   8 +
 drivers/gpu/drm/panel/Makefile|   1 +
 .../gpu/drm/panel/panel-visionox-rm69299.c| 295 ++
 4 files changed, 377 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/panel/visionox,rm69299.yaml
 create mode 100644 drivers/gpu/drm/panel/panel-visionox-rm69299.c

-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v7 2/2] drm/panel: add support for rm69299 visionox panel driver

2020-03-16 Thread Harigovindan P
Add support for Visionox panel driver.

Signed-off-by: Harigovindan P 
---

Changes in v2:
- Dropping redundant space in Kconfig(Sam Ravnborg).
- Changing structure for include files(Sam Ravnborg).
- Removing backlight related code and functions(Sam Ravnborg).
- Removing repeated printing of error message(Sam Ravnborg).
- Adding drm_connector as an argument for get_modes function.
Changes in v3:
- Adding arguments for drm_panel_init to support against mainline.
Changes in v4:
- Removing error messages from regulator_set_load.
- Removing dev struct entry.
- Removing checks.
- Dropping empty comment lines.
Changes in v5:
- Removing unused struct member variables.
- Removing blank lines.
- Fixed indentation.
- Invoking dsi_detach and panel_remove while early exiting from probe.
Changes in v6:
- Changed "35597" to "rm69299" for power_on function.
- Removing rm69299_config since it supports single type of panel for 
now.
- Fixed alignment.
- Using goto statements when regulator_set_load fails.
Changes in v7:
- Added new goto statement when regulator_set_load fails.

 drivers/gpu/drm/panel/Kconfig |   8 +
 drivers/gpu/drm/panel/Makefile|   1 +
 .../gpu/drm/panel/panel-visionox-rm69299.c| 295 ++
 3 files changed, 304 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-visionox-rm69299.c

diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index ae44ac2ec106..7b696f304a99 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -389,6 +389,14 @@ config DRM_PANEL_TRULY_NT35597_WQXGA
  Say Y here if you want to enable support for Truly NT35597 WQXGA Dual 
DSI
  Video Mode panel
 
+config DRM_PANEL_VISIONOX_RM69299
+   tristate "Visionox RM69299"
+   depends on OF
+   depends on DRM_MIPI_DSI
+   help
+ Say Y here if you want to enable support for Visionox
+ RM69299  DSI Video Mode panel.
+
 config DRM_PANEL_XINPENG_XPP055C272
tristate "Xinpeng XPP055C272 panel driver"
depends on OF
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index 7c4d3c581fd4..9f11d067a6b2 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -41,4 +41,5 @@ obj-$(CONFIG_DRM_PANEL_TPO_TD028TTEC1) += 
panel-tpo-td028ttec1.o
 obj-$(CONFIG_DRM_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o
 obj-$(CONFIG_DRM_PANEL_TPO_TPG110) += panel-tpo-tpg110.o
 obj-$(CONFIG_DRM_PANEL_TRULY_NT35597_WQXGA) += panel-truly-nt35597.o
+obj-$(CONFIG_DRM_PANEL_VISIONOX_RM69299) += panel-visionox-rm69299.o
 obj-$(CONFIG_DRM_PANEL_XINPENG_XPP055C272) += panel-xinpeng-xpp055c272.o
diff --git a/drivers/gpu/drm/panel/panel-visionox-rm69299.c 
b/drivers/gpu/drm/panel/panel-visionox-rm69299.c
new file mode 100644
index ..0f877d21fdf2
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-visionox-rm69299.c
@@ -0,0 +1,295 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2019, The Linux Foundation. All rights reserved.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+struct visionox_rm69299 {
+   struct drm_panel panel;
+   struct regulator_bulk_data supplies[2];
+   struct gpio_desc *reset_gpio;
+   struct mipi_dsi_device *dsi;
+   bool prepared;
+   bool enabled;
+};
+
+static inline struct visionox_rm69299 *panel_to_ctx(struct drm_panel *panel)
+{
+   return container_of(panel, struct visionox_rm69299, panel);
+}
+
+static int visionox_rm69299_power_on(struct visionox_rm69299 *ctx)
+{
+   int ret;
+
+   ret = regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
+   if (ret < 0)
+   return ret;
+
+   /*
+* Reset sequence of visionox panel requires the panel to be
+* out of reset for 10ms, followed by being held in reset
+* for 10ms and then out again
+*/
+   gpiod_set_value(ctx->reset_gpio, 1);
+   usleep_range(1, 2);
+   gpiod_set_value(ctx->reset_gpio, 0);
+   usleep_range(1, 2);
+   gpiod_set_value(ctx->reset_gpio, 1);
+   usleep_range(1, 2);
+
+   return 0;
+}
+
+static int visionox_rm69299_power_off(struct visionox_rm69299 *ctx)
+{
+   gpiod_set_value(ctx->reset_gpio, 0);
+
+   return regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
+}
+
+static int visionox_rm69299_unprepare(struct drm_panel *panel)
+{
+   struct visionox_rm69299 *ctx = panel_to_ctx(panel);
+   int ret;
+
+   ctx->dsi->mode_flags = 0;
+
+   ret = mipi_dsi_dcs_write(ctx->dsi, MIPI_DCS_SET_DISPLAY_OFF, NULL, 0);
+   if (ret < 0)
+   DRM_DEV_ERROR(ctx-&

[PATCH v7 0/2] Add support for rm69299 Visionox panel driver and add devicetree bindings for visionox panel

2020-03-16 Thread Harigovindan P
Adding support for visionox rm69299 panel driver and adding bindings for the 
same panel.

Harigovindan P (2):
  dt-bindings: display: add visionox rm69299 panel variant
  drm/panel: add support for rm69299 visionox panel driver

 .../display/panel/visionox,rm69299.yaml   |  81 +
 drivers/gpu/drm/panel/Kconfig |   8 +
 drivers/gpu/drm/panel/Makefile|   1 +
 .../gpu/drm/panel/panel-visionox-rm69299.c| 295 ++
 4 files changed, 385 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/panel/visionox,rm69299.yaml
 create mode 100644 drivers/gpu/drm/panel/panel-visionox-rm69299.c

-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v7 0/2] Add support for rm69299 Visionox panel driver and add devicetree bindings for visionox panel

2020-03-16 Thread Harigovindan P
Adding support for visionox rm69299 panel driver and adding bindings for the 
same panel.

Harigovindan P (2):
  dt-bindings: display: add visionox rm69299 panel variant
  drm/panel: add support for rm69299 visionox panel driver

 .../display/panel/visionox,rm69299.yaml   |  81 +
 drivers/gpu/drm/panel/Kconfig |   8 +
 drivers/gpu/drm/panel/Makefile|   1 +
 .../gpu/drm/panel/panel-visionox-rm69299.c| 295 ++
 4 files changed, 385 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/panel/visionox,rm69299.yaml
 create mode 100644 drivers/gpu/drm/panel/panel-visionox-rm69299.c

-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v7 1/2] dt-bindings: display: add visionox rm69299 panel variant

2020-03-16 Thread Harigovindan P
Add bindings for visionox rm69299 panel.

Signed-off-by: Harigovindan P 
---

Changes in v2:
- Removed unwanted properties from description.
- Creating source files without execute permissions(Rob Herring).
Changes in v3:
- Changing txt file into yaml
Changes in v4:
- Updating license identifier.
- Moving yaml file inside panel directory.
- Removing pinctrl entries.
- Adding documentation for reset-gpios.
Changes in v5:
- No changes. Updated 2/2 Patch.
Changes in v6:
- Removing patternProperties.
- Added " |" after description.
- Setting port and reset-gpios to true.
- Removing @ae94000 for dsi node.
Changes in v7:
- Added reg property.

 .../display/panel/visionox,rm69299.yaml   | 81 +++
 1 file changed, 81 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/panel/visionox,rm69299.yaml

diff --git 
a/Documentation/devicetree/bindings/display/panel/visionox,rm69299.yaml 
b/Documentation/devicetree/bindings/display/panel/visionox,rm69299.yaml
new file mode 100644
index ..6ea1a7be3787
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/panel/visionox,rm69299.yaml
@@ -0,0 +1,81 @@
+# SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/panel/visionox,rm69299.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Visionox model RM69299 Panels Device Tree Bindings.
+
+maintainers:
+ - Harigovindan P 
+
+description: |
+ This binding is for display panels using a Visionox RM692999 panel.
+
+allOf:
+ - $ref: panel-common.yaml#
+
+properties:
+  compatible:
+const: visionox,rm69299-1080p-display
+
+  reg:
+maxItems: 1
+
+  vdda-supply:
+description: |
+  Phandle of the regulator that provides the vdda supply voltage.
+
+  vdd3p3-supply:
+description: |
+  Phandle of the regulator that provides the vdd3p3 supply voltage.
+
+  ports:
+type: object
+description: |
+  A node containing DSI input & output port nodes with endpoint
+  definitions as documented in
+  Documentation/devicetree/bindings/media/video-interfaces.txt
+  Documentation/devicetree/bindings/graph.txt
+  properties:
+port: true
+
+  reset-gpios: true
+
+required:
+  - compatible
+  - reg
+  - vdda-supply
+  - vdd3p3-supply
+  - reset-gpios
+
+additionalProperties: false
+
+examples:
+  - |
+dsi {
+reg = <0x0ae94000 0x400>;
+#address-cells = <1>;
+#size-cells = <0>;
+panel@0 {
+compatible = "visionox,rm69299-1080p-display";
+reg = <0x0ae94000 0x400>;
+
+vdda-supply = <_pp1800_l8c>;
+vdd3p3-supply = <_pp2800_l18a>;
+
+reset-gpios = <_gpio 3 0>;
+ports {
+#address-cells = <1>;
+#size-cells = <0>;
+port@0 {
+reg = <0>;
+panel0_in: endpoint {
+remote-endpoint = <_out>;
+};
+};
+};
+};
+};
+
+...
-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v7 1/2] dt-bindings: display: add visionox rm69299 panel variant

2020-03-16 Thread Harigovindan P
Add bindings for visionox rm69299 panel.

Signed-off-by: Harigovindan P 
---
 .../display/panel/visionox,rm69299.yaml   | 81 +++
 1 file changed, 81 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/panel/visionox,rm69299.yaml

diff --git 
a/Documentation/devicetree/bindings/display/panel/visionox,rm69299.yaml 
b/Documentation/devicetree/bindings/display/panel/visionox,rm69299.yaml
new file mode 100644
index ..6ea1a7be3787
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/panel/visionox,rm69299.yaml
@@ -0,0 +1,81 @@
+# SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/panel/visionox,rm69299.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Visionox model RM69299 Panels Device Tree Bindings.
+
+maintainers:
+ - Harigovindan P 
+
+description: |
+ This binding is for display panels using a Visionox RM692999 panel.
+
+allOf:
+ - $ref: panel-common.yaml#
+
+properties:
+  compatible:
+const: visionox,rm69299-1080p-display
+
+  reg:
+maxItems: 1
+
+  vdda-supply:
+description: |
+  Phandle of the regulator that provides the vdda supply voltage.
+
+  vdd3p3-supply:
+description: |
+  Phandle of the regulator that provides the vdd3p3 supply voltage.
+
+  ports:
+type: object
+description: |
+  A node containing DSI input & output port nodes with endpoint
+  definitions as documented in
+  Documentation/devicetree/bindings/media/video-interfaces.txt
+  Documentation/devicetree/bindings/graph.txt
+  properties:
+port: true
+
+  reset-gpios: true
+
+required:
+  - compatible
+  - reg
+  - vdda-supply
+  - vdd3p3-supply
+  - reset-gpios
+
+additionalProperties: false
+
+examples:
+  - |
+dsi {
+reg = <0x0ae94000 0x400>;
+#address-cells = <1>;
+#size-cells = <0>;
+panel@0 {
+compatible = "visionox,rm69299-1080p-display";
+reg = <0x0ae94000 0x400>;
+
+vdda-supply = <_pp1800_l8c>;
+vdd3p3-supply = <_pp2800_l18a>;
+
+reset-gpios = <_gpio 3 0>;
+ports {
+#address-cells = <1>;
+#size-cells = <0>;
+port@0 {
+reg = <0>;
+panel0_in: endpoint {
+remote-endpoint = <_out>;
+};
+};
+};
+};
+};
+
+...
-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v7 2/2] drm/panel: add support for rm69299 visionox panel driver

2020-03-16 Thread Harigovindan P
Add support for Visionox panel driver.

Signed-off-by: Harigovindan P 
---
 drivers/gpu/drm/panel/Kconfig |   8 +
 drivers/gpu/drm/panel/Makefile|   1 +
 .../gpu/drm/panel/panel-visionox-rm69299.c| 295 ++
 3 files changed, 304 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-visionox-rm69299.c

diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index ae44ac2ec106..7b696f304a99 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -389,6 +389,14 @@ config DRM_PANEL_TRULY_NT35597_WQXGA
  Say Y here if you want to enable support for Truly NT35597 WQXGA Dual 
DSI
  Video Mode panel
 
+config DRM_PANEL_VISIONOX_RM69299
+   tristate "Visionox RM69299"
+   depends on OF
+   depends on DRM_MIPI_DSI
+   help
+ Say Y here if you want to enable support for Visionox
+ RM69299  DSI Video Mode panel.
+
 config DRM_PANEL_XINPENG_XPP055C272
tristate "Xinpeng XPP055C272 panel driver"
depends on OF
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index 7c4d3c581fd4..9f11d067a6b2 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -41,4 +41,5 @@ obj-$(CONFIG_DRM_PANEL_TPO_TD028TTEC1) += 
panel-tpo-td028ttec1.o
 obj-$(CONFIG_DRM_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o
 obj-$(CONFIG_DRM_PANEL_TPO_TPG110) += panel-tpo-tpg110.o
 obj-$(CONFIG_DRM_PANEL_TRULY_NT35597_WQXGA) += panel-truly-nt35597.o
+obj-$(CONFIG_DRM_PANEL_VISIONOX_RM69299) += panel-visionox-rm69299.o
 obj-$(CONFIG_DRM_PANEL_XINPENG_XPP055C272) += panel-xinpeng-xpp055c272.o
diff --git a/drivers/gpu/drm/panel/panel-visionox-rm69299.c 
b/drivers/gpu/drm/panel/panel-visionox-rm69299.c
new file mode 100644
index ..0f877d21fdf2
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-visionox-rm69299.c
@@ -0,0 +1,295 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2019, The Linux Foundation. All rights reserved.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+struct visionox_rm69299 {
+   struct drm_panel panel;
+   struct regulator_bulk_data supplies[2];
+   struct gpio_desc *reset_gpio;
+   struct mipi_dsi_device *dsi;
+   bool prepared;
+   bool enabled;
+};
+
+static inline struct visionox_rm69299 *panel_to_ctx(struct drm_panel *panel)
+{
+   return container_of(panel, struct visionox_rm69299, panel);
+}
+
+static int visionox_rm69299_power_on(struct visionox_rm69299 *ctx)
+{
+   int ret;
+
+   ret = regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
+   if (ret < 0)
+   return ret;
+
+   /*
+* Reset sequence of visionox panel requires the panel to be
+* out of reset for 10ms, followed by being held in reset
+* for 10ms and then out again
+*/
+   gpiod_set_value(ctx->reset_gpio, 1);
+   usleep_range(1, 2);
+   gpiod_set_value(ctx->reset_gpio, 0);
+   usleep_range(1, 2);
+   gpiod_set_value(ctx->reset_gpio, 1);
+   usleep_range(1, 2);
+
+   return 0;
+}
+
+static int visionox_rm69299_power_off(struct visionox_rm69299 *ctx)
+{
+   gpiod_set_value(ctx->reset_gpio, 0);
+
+   return regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
+}
+
+static int visionox_rm69299_unprepare(struct drm_panel *panel)
+{
+   struct visionox_rm69299 *ctx = panel_to_ctx(panel);
+   int ret;
+
+   ctx->dsi->mode_flags = 0;
+
+   ret = mipi_dsi_dcs_write(ctx->dsi, MIPI_DCS_SET_DISPLAY_OFF, NULL, 0);
+   if (ret < 0)
+   DRM_DEV_ERROR(ctx->panel.dev,
+   "set_display_off cmd failed ret = %d\n", ret);
+
+   /* 120ms delay required here as per DCS spec */
+   msleep(120);
+
+   ret = mipi_dsi_dcs_write(ctx->dsi, MIPI_DCS_ENTER_SLEEP_MODE, NULL, 0);
+   if (ret < 0) {
+   DRM_DEV_ERROR(ctx->panel.dev,
+   "enter_sleep cmd failed ret = %d\n", ret);
+   }
+
+   ret = visionox_rm69299_power_off(ctx);
+
+   ctx->prepared = false;
+   return ret;
+}
+
+static int visionox_rm69299_prepare(struct drm_panel *panel)
+{
+   struct visionox_rm69299 *ctx = panel_to_ctx(panel);
+   int ret;
+
+   if (ctx->prepared)
+   return 0;
+
+   ret = visionox_rm69299_power_on(ctx);
+   if (ret < 0)
+   return ret;
+
+   ctx->dsi->mode_flags |= MIPI_DSI_MODE_LPM;
+
+   ret = mipi_dsi_dcs_write_buffer(ctx->dsi, (u8[]){ 0xfe, 0x00 }, 2);
+   if (ret < 0) {
+   DRM_DEV_ERROR(ctx->panel.dev,
+   "cmd set tx 0 failed, ret = %d\n", ret);
+   goto power_off;
+   }
+
+  

[PATCH v6 0/2] Add support for rm69299 Visionox panel driver and add devicetree bindings for visionox panel

2020-03-12 Thread Harigovindan P
Adding support for visionox rm69299 panel driver and adding bindings for the 
same panel.

Harigovindan P (2):
  dt-bindings: display: add visionox rm69299 panel variant
  drm/panel: add support for rm69299 visionox panel driver

 .../display/panel/visionox,rm69299.yaml   |  77 +
 drivers/gpu/drm/panel/Kconfig |   8 +
 drivers/gpu/drm/panel/Makefile|   1 +
 .../gpu/drm/panel/panel-visionox-rm69299.c| 295 ++
 4 files changed, 381 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/panel/visionox,rm69299.yaml
 create mode 100644 drivers/gpu/drm/panel/panel-visionox-rm69299.c

-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v6 2/2] drm/panel: add support for rm69299 visionox panel driver

2020-03-12 Thread Harigovindan P
Add support for Visionox panel driver.

Signed-off-by: Harigovindan P 
---

Changes in v2:
- Dropping redundant space in Kconfig(Sam Ravnborg).
- Changing structure for include files(Sam Ravnborg).
- Removing backlight related code and functions(Sam Ravnborg).
- Removing repeated printing of error message(Sam Ravnborg).
- Adding drm_connector as an argument for get_modes function.
Changes in v3:
- Adding arguments for drm_panel_init to support against mainline.
Changes in v4:
- Removing error messages from regulator_set_load.
- Removing dev struct entry.
- Removing checks.
- Dropping empty comment lines.
Changes in v5:
- Removing unused struct member variables.
- Removing blank lines.
- Fixed indentation.
- Invoking dsi_detach and panel_remove while early exiting from probe.
Changes in v6:
- Changed "35597" to "rm69299" for power_on function.
- Removing rm69299_config since it supports single type of panel for 
now.
- Fixed alignment.
- Using goto statements when regulator_set_load fails.

 drivers/gpu/drm/panel/Kconfig |   8 +
 drivers/gpu/drm/panel/Makefile|   1 +
 .../gpu/drm/panel/panel-visionox-rm69299.c| 295 ++
 3 files changed, 304 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-visionox-rm69299.c

diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index ae44ac2ec106..7b696f304a99 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -389,6 +389,14 @@ config DRM_PANEL_TRULY_NT35597_WQXGA
  Say Y here if you want to enable support for Truly NT35597 WQXGA Dual 
DSI
  Video Mode panel
 
+config DRM_PANEL_VISIONOX_RM69299
+   tristate "Visionox RM69299"
+   depends on OF
+   depends on DRM_MIPI_DSI
+   help
+ Say Y here if you want to enable support for Visionox
+ RM69299  DSI Video Mode panel.
+
 config DRM_PANEL_XINPENG_XPP055C272
tristate "Xinpeng XPP055C272 panel driver"
depends on OF
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index 7c4d3c581fd4..9f11d067a6b2 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -41,4 +41,5 @@ obj-$(CONFIG_DRM_PANEL_TPO_TD028TTEC1) += 
panel-tpo-td028ttec1.o
 obj-$(CONFIG_DRM_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o
 obj-$(CONFIG_DRM_PANEL_TPO_TPG110) += panel-tpo-tpg110.o
 obj-$(CONFIG_DRM_PANEL_TRULY_NT35597_WQXGA) += panel-truly-nt35597.o
+obj-$(CONFIG_DRM_PANEL_VISIONOX_RM69299) += panel-visionox-rm69299.o
 obj-$(CONFIG_DRM_PANEL_XINPENG_XPP055C272) += panel-xinpeng-xpp055c272.o
diff --git a/drivers/gpu/drm/panel/panel-visionox-rm69299.c 
b/drivers/gpu/drm/panel/panel-visionox-rm69299.c
new file mode 100644
index ..b226723a7543
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-visionox-rm69299.c
@@ -0,0 +1,295 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2019, The Linux Foundation. All rights reserved.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+struct visionox_rm69299 {
+   struct drm_panel panel;
+   struct regulator_bulk_data supplies[2];
+   struct gpio_desc *reset_gpio;
+   struct mipi_dsi_device *dsi;
+   bool prepared;
+   bool enabled;
+};
+
+static inline struct visionox_rm69299 *panel_to_ctx(struct drm_panel *panel)
+{
+   return container_of(panel, struct visionox_rm69299, panel);
+}
+
+static int visionox_rm69299_power_on(struct visionox_rm69299 *ctx)
+{
+   int ret;
+
+   ret = regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
+   if (ret < 0)
+   return ret;
+
+   /*
+* Reset sequence of visionox panel requires the panel to be
+* out of reset for 10ms, followed by being held in reset
+* for 10ms and then out again
+*/
+   gpiod_set_value(ctx->reset_gpio, 1);
+   usleep_range(1, 2);
+   gpiod_set_value(ctx->reset_gpio, 0);
+   usleep_range(1, 2);
+   gpiod_set_value(ctx->reset_gpio, 1);
+   usleep_range(1, 2);
+
+   return 0;
+}
+
+static int visionox_rm69299_power_off(struct visionox_rm69299 *ctx)
+{
+   gpiod_set_value(ctx->reset_gpio, 0);
+
+   return regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
+}
+
+static int visionox_rm69299_unprepare(struct drm_panel *panel)
+{
+   struct visionox_rm69299 *ctx = panel_to_ctx(panel);
+   int ret;
+
+   ctx->dsi->mode_flags = 0;
+
+   ret = mipi_dsi_dcs_write(ctx->dsi, MIPI_DCS_SET_DISPLAY_OFF, NULL, 0);
+   if (ret < 0)
+   DRM_DEV_ERROR(ctx->panel.dev,
+   "set_display_off cmd failed ret = %d

[PATCH v6 1/2] dt-bindings: display: add visionox rm69299 panel variant

2020-03-12 Thread Harigovindan P
Add bindings for visionox rm69299 panel.

Signed-off-by: Harigovindan P 
---

Changes in v2:
- Removed unwanted properties from description.
- Creating source files without execute permissions(Rob Herring).
Changes in v3:
- Changing txt file into yaml
Changes in v4:
- Updating license identifier.
- Moving yaml file inside panel directory.
- Removing pinctrl entries.
- Adding documentation for reset-gpios.
Changes in v5:
- No changes. Updated 2/2 Patch.
Changes in v6:
- Removing patternProperties.
- Added " |" after description.
- Setting port and reset-gpios to true.
- Removing @ae94000 for dsi node.

 .../display/panel/visionox,rm69299.yaml   | 77 +++
 1 file changed, 77 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/panel/visionox,rm69299.yaml

diff --git 
a/Documentation/devicetree/bindings/display/panel/visionox,rm69299.yaml 
b/Documentation/devicetree/bindings/display/panel/visionox,rm69299.yaml
new file mode 100644
index ..18854cc7d99e
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/panel/visionox,rm69299.yaml
@@ -0,0 +1,77 @@
+# SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/panel/visionox,rm69299.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Visionox model RM69299 Panels Device Tree Bindings.
+
+maintainers:
+ - Harigovindan P 
+
+description: |
+ This binding is for display panels using a Visionox RM692999 panel.
+
+allOf:
+ - $ref: panel-common.yaml#
+
+properties:
+  compatible:
+const: visionox,rm69299-1080p-display
+
+  reg:
+maxItems: 1
+
+  vdda-supply:
+description: |
+  Phandle of the regulator that provides the vdda supply voltage.
+
+  vdd3p3-supply:
+description: |
+  Phandle of the regulator that provides the vdd3p3 supply voltage.
+
+  ports:
+type: object
+description: |
+  A node containing DSI input & output port nodes with endpoint
+  definitions as documented in
+  Documentation/devicetree/bindings/media/video-interfaces.txt
+  Documentation/devicetree/bindings/graph.txt
+  properties:
+port: true
+
+  reset-gpios: true
+
+required:
+  - compatible
+  - reg
+  - vdda-supply
+  - vdd3p3-supply
+  - reset-gpios
+
+additionalProperties: false
+
+examples:
+- |
+dsi {
+panel@0 {
+compatible = "visionox,rm69299-1080p-display";
+
+vdda-supply = <_pp1800_l8c>;
+vdd3p3-supply = <_pp2800_l18a>;
+
+reset-gpios = <_gpio 3 0>;
+ports {
+#address-cells = <1>;
+#size-cells = <0>;
+port@0 {
+reg = <0>;
+panel0_in: endpoint {
+remote-endpoint = <_out>;
+};
+};
+};
+};
+};
+...
+
-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v5 0/2] Add support for rm69299 Visionox panel driver and add devicetree bindings for visionox panel

2020-03-09 Thread Harigovindan P
Adding support for visionox rm69299 panel driver and adding bindings for the 
same panel.

Harigovindan P (2):
  dt-bindings: display: add visionox rm69299 panel variant
  drm/panel: add support for rm69299 visionox panel driver

 .../display/panel/visionox,rm69299.yaml   |  85 +
 drivers/gpu/drm/panel/Kconfig |   8 +
 drivers/gpu/drm/panel/Makefile|   1 +
 .../gpu/drm/panel/panel-visionox-rm69299.c| 315 ++
 4 files changed, 409 insertions(+)
 create mode 100755 
Documentation/devicetree/bindings/display/panel/visionox,rm69299.yaml
 create mode 100644 drivers/gpu/drm/panel/panel-visionox-rm69299.c

-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v5 1/2] dt-bindings: display: add visionox rm69299 panel variant

2020-03-09 Thread Harigovindan P
Add bindings for visionox rm69299 panel.

Signed-off-by: Harigovindan P 
---

Changes in v2:
- Removed unwanted properties from description.
- Creating source files without execute permissions(Rob Herring).
Changes in v3:
- Changing txt file into yaml
Changes in v4:
- Updating license identifier.
- Moving yaml file inside panel directory.
- Removing pinctrl entries.
- Adding documentation for reset-gpios.
Changes in v5:
- No changes. Updated 2/2 Patch.

 .../display/panel/visionox,rm69299.yaml   | 85 +++
 1 file changed, 85 insertions(+)
 create mode 100755 
Documentation/devicetree/bindings/display/panel/visionox,rm69299.yaml

diff --git 
a/Documentation/devicetree/bindings/display/panel/visionox,rm69299.yaml 
b/Documentation/devicetree/bindings/display/panel/visionox,rm69299.yaml
new file mode 100755
index ..052d87f8fadd
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/panel/visionox,rm69299.yaml
@@ -0,0 +1,85 @@
+# SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/panel/visionox,rm69299.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Visionox model RM69299 Panels Device Tree Bindings.
+
+maintainers:
+ - Harigovindan P 
+
+description: |
+ This binding is for display panels using a Visionox RM692999 panel.
+
+allOf:
+ - $ref: panel-common.yaml#
+
+patternProperties:
+  "^(panel|panel-dsi)@[0-9]$":
+type: object
+properties:
+  compatible:
+const: visionox,rm69299-1080p-display
+
+  reg:
+maxItems: 1
+
+  vdda-supply:
+description:
+  Phandle of the regulator that provides the vdda supply voltage.
+
+  vdd3p3-supply:
+description:
+  Phandle of the regulator that provides the vdd3p3 supply voltage.
+
+  ports:
+type: object
+description:
+  A node containing DSI input & output port nodes with endpoint
+  definitions as documented in
+  Documentation/devicetree/bindings/media/video-interfaces.txt
+  Documentation/devicetree/bindings/graph.txt
+properties:
+  port@0:
+type: object
+description:
+  DSI input port node.
+
+  reset-gpios:
+description:
+  a GPIO spec for the reset pin.
+
+required:
+  - compatible
+  - reg
+  - vdda-supply
+  - vdd3p3-supply
+  - reset-gpios
+
+additionalProperties: false
+
+examples:
+- |
+dsi@ae94000 {
+panel@0 {
+compatible = "visionox,rm69299-1080p-display";
+
+vdda-supply = <_pp1800_l8c>;
+vdd3p3-supply = <_pp2800_l18a>;
+
+reset-gpios = <_gpio 3 0>;
+ports {
+#address-cells = <1>;
+#size-cells = <0>;
+port@0 {
+reg = <0>;
+panel0_in: endpoint {
+remote-endpoint = <_out>;
+};
+};
+};
+};
+};
+...
+
-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v5 2/2] drm/panel: add support for rm69299 visionox panel driver

2020-03-09 Thread Harigovindan P
Add support for Visionox panel driver.

Signed-off-by: Harigovindan P 
---

Changes in v2:
- Dropping redundant space in Kconfig(Sam Ravnborg).
- Changing structure for include files(Sam Ravnborg).
- Removing backlight related code and functions(Sam Ravnborg).
- Removing repeated printing of error message(Sam Ravnborg).
- Adding drm_connector as an argument for get_modes function.
Changes in v3:
- Adding arguments for drm_panel_init to support against mainline.
Changes in v4:
- Removing error messages from regulator_set_load.
- Removing dev struct entry.
- Removing checks.
- Dropping empty comment lines.
Changes in v5:
- Removing unused struct member variables.
- Removing blank lines.
- Fixed indentation.
- Invoking dsi_detach and panel_remove while early exiting from probe.

 drivers/gpu/drm/panel/Kconfig |   8 +
 drivers/gpu/drm/panel/Makefile|   1 +
 .../gpu/drm/panel/panel-visionox-rm69299.c| 315 ++
 3 files changed, 324 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-visionox-rm69299.c

diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index ae44ac2ec106..7b696f304a99 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -389,6 +389,14 @@ config DRM_PANEL_TRULY_NT35597_WQXGA
  Say Y here if you want to enable support for Truly NT35597 WQXGA Dual 
DSI
  Video Mode panel
 
+config DRM_PANEL_VISIONOX_RM69299
+   tristate "Visionox RM69299"
+   depends on OF
+   depends on DRM_MIPI_DSI
+   help
+ Say Y here if you want to enable support for Visionox
+ RM69299  DSI Video Mode panel.
+
 config DRM_PANEL_XINPENG_XPP055C272
tristate "Xinpeng XPP055C272 panel driver"
depends on OF
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index 7c4d3c581fd4..9f11d067a6b2 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -41,4 +41,5 @@ obj-$(CONFIG_DRM_PANEL_TPO_TD028TTEC1) += 
panel-tpo-td028ttec1.o
 obj-$(CONFIG_DRM_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o
 obj-$(CONFIG_DRM_PANEL_TPO_TPG110) += panel-tpo-tpg110.o
 obj-$(CONFIG_DRM_PANEL_TRULY_NT35597_WQXGA) += panel-truly-nt35597.o
+obj-$(CONFIG_DRM_PANEL_VISIONOX_RM69299) += panel-visionox-rm69299.o
 obj-$(CONFIG_DRM_PANEL_XINPENG_XPP055C272) += panel-xinpeng-xpp055c272.o
diff --git a/drivers/gpu/drm/panel/panel-visionox-rm69299.c 
b/drivers/gpu/drm/panel/panel-visionox-rm69299.c
new file mode 100644
index ..2bd3af46d933
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-visionox-rm69299.c
@@ -0,0 +1,315 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2019, The Linux Foundation. All rights reserved.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+struct rm69299_config {
+   unsigned long width_mm;
+   unsigned long height_mm;
+   const struct drm_display_mode *dm;
+};
+
+struct visionox_rm69299 {
+   struct drm_panel panel;
+   struct regulator_bulk_data supplies[2];
+   struct gpio_desc *reset_gpio;
+   struct mipi_dsi_device *dsi;
+   const struct rm69299_config *config;
+   bool prepared;
+   bool enabled;
+};
+
+static inline struct visionox_rm69299 *panel_to_ctx(struct drm_panel *panel)
+{
+   return container_of(panel, struct visionox_rm69299, panel);
+}
+
+static int visionox_35597_power_on(struct visionox_rm69299 *ctx)
+{
+   int ret;
+
+   ret = regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
+   if (ret < 0)
+   return ret;
+
+   /*
+* Reset sequence of visionox panel requires the panel to be
+* out of reset for 10ms, followed by being held in reset
+* for 10ms and then out again
+*/
+   gpiod_set_value(ctx->reset_gpio, 1);
+   usleep_range(1, 2);
+   gpiod_set_value(ctx->reset_gpio, 0);
+   usleep_range(1, 2);
+   gpiod_set_value(ctx->reset_gpio, 1);
+   usleep_range(1, 2);
+
+   return 0;
+}
+
+static int visionox_rm69299_power_off(struct visionox_rm69299 *ctx)
+{
+   gpiod_set_value(ctx->reset_gpio, 0);
+
+   return regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
+}
+
+static int visionox_rm69299_unprepare(struct drm_panel *panel)
+{
+   struct visionox_rm69299 *ctx = panel_to_ctx(panel);
+   int ret;
+
+   ctx->dsi->mode_flags = 0;
+
+   ret = mipi_dsi_dcs_write(ctx->dsi, MIPI_DCS_SET_DISPLAY_OFF, NULL, 0);
+   if (ret < 0)
+   DRM_DEV_ERROR(ctx->panel.dev,
+   "set_display_off cmd failed ret = %d\n", ret);
+
+   /* 120ms delay required here as per DCS 

[PATCH v4 0/2] Add support for rm69299 Visionox panel driver and add devicetree bindings for visionox panel

2020-03-07 Thread Harigovindan P
Adding support for visionox rm69299 panel driver and adding bindings for the 
same panel.

Harigovindan P (2):
  dt-bindings: display: add visionox rm69299 panel variant
  drm/panel: add support for rm69299 visionox panel driver

 .../display/panel/visionox,rm69299.yaml   |  85 +
 drivers/gpu/drm/panel/Kconfig |   8 +
 drivers/gpu/drm/panel/Makefile|   1 +
 .../gpu/drm/panel/panel-visionox-rm69299.c| 322 ++
 4 files changed, 416 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/panel/visionox,rm69299.yaml
 create mode 100644 drivers/gpu/drm/panel/panel-visionox-rm69299.c

-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v4 1/2] dt-bindings: display: add visionox rm69299 panel variant

2020-03-07 Thread Harigovindan P
Add bindings for visionox rm69299 panel.

Signed-off-by: Harigovindan P 
---

Changes in v2:
- Removed unwanted properties from description.
- Creating source files without execute permissions(Rob Herring).
Changes in v3:
- Changing txt file into yaml
Changes in v4:
- Updating license identifier.
- Moving yaml file inside panel directory.
- Removing pinctrl entries.
- Adding documentation for reset-gpios.

 .../display/panel/visionox,rm69299.yaml   | 85 +++
 1 file changed, 85 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/panel/visionox,rm69299.yaml

diff --git 
a/Documentation/devicetree/bindings/display/panel/visionox,rm69299.yaml 
b/Documentation/devicetree/bindings/display/panel/visionox,rm69299.yaml
new file mode 100644
index ..93cae431207c
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/panel/visionox,rm69299.yaml
@@ -0,0 +1,85 @@
+# SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/panel/visionox,rm69299.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Visionox model RM69299 Panels Device Tree Bindings.
+
+maintainers:
+ - Harigovindan P 
+
+description: |
+ This binding is for display panels using a Visionox RM692999 panel.
+
+allOf:
+ - $ref: panel-common.yaml#
+
+patternProperties:
+  "^(panel|panel-dsi)@[0-9]$":
+type: object
+properties:
+  compatible:
+const: visionox,rm69299-1080p-display
+
+  reg:
+maxItems: 1
+
+  vdda-supply:
+description:
+  Phandle of the regulator that provides the vdda supply voltage.
+
+  vdd3p3-supply:
+description:
+  Phandle of the regulator that provides the vdd3p3 supply voltage.
+
+  ports:
+type: object
+description:
+  A node containing DSI input & output port nodes with endpoint
+  definitions as documented in
+  Documentation/devicetree/bindings/media/video-interfaces.txt
+  Documentation/devicetree/bindings/graph.txt
+properties:
+  port@0:
+type: object
+description:
+  DSI input port node.
+
+  reset-gpios:
+description:
+  a GPIO spec for the reset pin.
+
+required:
+  - compatible
+  - reg
+  - vdda-supply
+  - vdd3p3-supply
+  - reset-gpios
+
+additionalProperties: false
+
+examples:
+- |
+dsi@ae94000 {
+panel@0 {
+compatible = "visionox,rm69299-1080p-display";
+
+vdda-supply = <_pp1800_l8c>;
+vdd3p3-supply = <_pp2800_l18a>;
+
+reset-gpios = <_gpio 3 0>;
+ports {
+#address-cells = <1>;
+#size-cells = <0>;
+port@0 {
+reg = <0>;
+panel0_in: endpoint {
+remote-endpoint = <_out>;
+};
+};
+};
+};
+};
+...
+
-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v4 2/2] drm/panel: add support for rm69299 visionox panel driver

2020-03-07 Thread Harigovindan P
Add support for Visionox panel driver.

Signed-off-by: Harigovindan P 
---

Changes in v2:
- Dropping redundant space in Kconfig(Sam Ravnborg).
- Changing structure for include files(Sam Ravnborg).
- Removing backlight related code and functions(Sam Ravnborg).
- Removing repeated printing of error message(Sam Ravnborg).
- Adding drm_connector as an argument for get_modes function.
Changes in v3:
- Adding arguments for drm_panel_init to support against mainline.
Changes in v4:
- Removing error messages from regulator_set_load.
- Removing dev struct entry.
- Removing checks.
- Dropping empty comment lines.

 drivers/gpu/drm/panel/Kconfig |   8 +
 drivers/gpu/drm/panel/Makefile|   1 +
 .../gpu/drm/panel/panel-visionox-rm69299.c| 322 ++
 3 files changed, 331 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-visionox-rm69299.c

diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index ae44ac2ec106..7b696f304a99 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -389,6 +389,14 @@ config DRM_PANEL_TRULY_NT35597_WQXGA
  Say Y here if you want to enable support for Truly NT35597 WQXGA Dual 
DSI
  Video Mode panel
 
+config DRM_PANEL_VISIONOX_RM69299
+   tristate "Visionox RM69299"
+   depends on OF
+   depends on DRM_MIPI_DSI
+   help
+ Say Y here if you want to enable support for Visionox
+ RM69299  DSI Video Mode panel.
+
 config DRM_PANEL_XINPENG_XPP055C272
tristate "Xinpeng XPP055C272 panel driver"
depends on OF
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index 7c4d3c581fd4..9f11d067a6b2 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -41,4 +41,5 @@ obj-$(CONFIG_DRM_PANEL_TPO_TD028TTEC1) += 
panel-tpo-td028ttec1.o
 obj-$(CONFIG_DRM_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o
 obj-$(CONFIG_DRM_PANEL_TPO_TPG110) += panel-tpo-tpg110.o
 obj-$(CONFIG_DRM_PANEL_TRULY_NT35597_WQXGA) += panel-truly-nt35597.o
+obj-$(CONFIG_DRM_PANEL_VISIONOX_RM69299) += panel-visionox-rm69299.o
 obj-$(CONFIG_DRM_PANEL_XINPENG_XPP055C272) += panel-xinpeng-xpp055c272.o
diff --git a/drivers/gpu/drm/panel/panel-visionox-rm69299.c 
b/drivers/gpu/drm/panel/panel-visionox-rm69299.c
new file mode 100644
index ..eb15dca15398
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-visionox-rm69299.c
@@ -0,0 +1,322 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2019, The Linux Foundation. All rights reserved.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+struct rm69299_config {
+   unsigned long width_mm;
+   unsigned long height_mm;
+   const char *panel_name;
+   u32 num_on_cmds;
+   const struct drm_display_mode *dm;
+};
+
+struct visionox_rm69299 {
+   struct drm_panel panel;
+
+   struct regulator_bulk_data supplies[2];
+
+   struct gpio_desc *reset_gpio;
+
+   struct mipi_dsi_device *dsi;
+   const struct rm69299_config *config;
+   bool prepared;
+   bool enabled;
+};
+
+static inline struct visionox_rm69299 *panel_to_ctx(struct drm_panel *panel)
+{
+   return container_of(panel, struct visionox_rm69299, panel);
+}
+
+static int visionox_35597_power_on(struct visionox_rm69299 *ctx)
+{
+   int ret;
+
+   ret = regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
+   if (ret < 0)
+   return ret;
+
+   /*
+* Reset sequence of visionox panel requires the panel to be
+* out of reset for 10ms, followed by being held in reset
+* for 10ms and then out again
+*/
+   gpiod_set_value(ctx->reset_gpio, 1);
+   usleep_range(1, 2);
+   gpiod_set_value(ctx->reset_gpio, 0);
+   usleep_range(1, 2);
+   gpiod_set_value(ctx->reset_gpio, 1);
+   usleep_range(1, 2);
+
+   return 0;
+}
+
+static int visionox_rm69299_power_off(struct visionox_rm69299 *ctx)
+{
+   gpiod_set_value(ctx->reset_gpio, 0);
+
+   return regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
+}
+
+static int visionox_rm69299_unprepare(struct drm_panel *panel)
+{
+   struct visionox_rm69299 *ctx = panel_to_ctx(panel);
+   int ret;
+
+   ctx->dsi->mode_flags = 0;
+
+   ret = mipi_dsi_dcs_write(ctx->dsi, MIPI_DCS_SET_DISPLAY_OFF, NULL, 0);
+   if (ret < 0)
+   DRM_DEV_ERROR(ctx->panel.dev, "set_display_off cmd failed ret = 
%d\n", ret);
+
+   /* 120ms delay required here as per DCS spec */
+   msleep(120);
+
+   ret = mipi_dsi_dcs_write(ctx->dsi, MIPI_DCS_ENTER_SLEEP_MODE, NULL, 0);
+   if (ret < 0) {
+   DRM_DEV_ERROR(ct

[v3] arm64: dts: sc7180: add nodes for idp display

2020-02-17 Thread Harigovindan P
Add nodes for IDP display. The display is Visionox RM69299.

Signed-off-by: Harigovindan P 
---

Changes in v2:
- Adding dependency patchwork series
- Removing suspend configuration
- Adding blank before space curly brace
Changes in v3:
- Updating status for mdp and mdss node to get the
display working
- Change in commit text

This patch depends on following patchwork series:

https://patchwork.kernel.org/patch/11364687/
https://patchwork.kernel.org/patch/11366303/

 arch/arm64/boot/dts/qcom/sc7180-idp.dts | 63 +
 1 file changed, 63 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sc7180-idp.dts 
b/arch/arm64/boot/dts/qcom/sc7180-idp.dts
index 388f50ad4fde..349db8fe78a5 100644
--- a/arch/arm64/boot/dts/qcom/sc7180-idp.dts
+++ b/arch/arm64/boot/dts/qcom/sc7180-idp.dts
@@ -7,6 +7,7 @@
 
 /dts-v1/;
 
+#include 
 #include 
 #include "sc7180.dtsi"
 #include "pm6150.dtsi"
@@ -232,6 +233,57 @@ vreg_bob: bob {
};
 };
 
+ {
+   status = "okay";
+
+   vdda-supply = <_l3c_1p2>;
+
+   panel@0 {
+   compatible = "visionox,rm69299-1080p-display";
+   reg = <0>;
+
+   vdda-supply = <_l8c_1p8>;
+   vdd3p3-supply = <_l18a_2p8>;
+
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins>;
+
+   reset-gpios = <_gpio 3 GPIO_ACTIVE_HIGH>;
+
+   ports {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   port@0 {
+   reg = <0>;
+   panel0_in: endpoint {
+   remote-endpoint = <_out>;
+   };
+   };
+   };
+   };
+
+   ports {
+   port@1 {
+   endpoint {
+   remote-endpoint = <_in>;
+   data-lanes = <0 1 2 3>;
+   };
+   };
+   };
+};
+
+_phy {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+};
+
  {
status = "okay";
pinctrl-names = "default";
@@ -289,6 +341,17 @@ _1_qmpphy {
 
 /* PINCTRL - additions to nodes defined in sc7180.dtsi */
 
+_gpio {
+   disp_pins: disp-pins {
+   pins = "gpio3";
+   function = "func1";
+   qcom,drive-strength = <2>;
+   power-source = <0>;
+   bias-disable;
+   output-low;
+   };
+};
+
 _clk {
pinconf {
pins = "gpio63";
-- 
2.25.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[v2] arm64: dts: sc7180: add dsi controller and phy entries for idp dts

2020-02-12 Thread Harigovindan P
Adding dsi controller and phy entries for idp dt.

Signed-off-by: Harigovindan P 
---

Changes in v1:
- Added dsi controller and dsi phy entries for idp dts

Changes in v2:
- Adding dependency patchwork series
- Removing suspend configuration
- Adding blank before curly brace

This patch depends on following patchwork series:

https://patchwork.kernel.org/patch/11364687/
https://patchwork.kernel.org/patch/11366303/

 arch/arm64/boot/dts/qcom/sc7180-idp.dts | 55 +
 1 file changed, 55 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sc7180-idp.dts 
b/arch/arm64/boot/dts/qcom/sc7180-idp.dts
index 388f50ad4fde..6ccf8c3603ab 100644
--- a/arch/arm64/boot/dts/qcom/sc7180-idp.dts
+++ b/arch/arm64/boot/dts/qcom/sc7180-idp.dts
@@ -7,6 +7,7 @@
 
 /dts-v1/;
 
+#include 
 #include 
 #include "sc7180.dtsi"
 #include "pm6150.dtsi"
@@ -232,6 +233,49 @@ vreg_bob: bob {
};
 };
 
+ {
+   status = "okay";
+
+   vdda-supply = <_l3c_1p2>;
+
+   panel@0 {
+   compatible = "visionox,rm69299-1080p-display";
+   reg = <0>;
+
+   vdda-supply = <_l8c_1p8>;
+   vdd3p3-supply = <_l18a_2p8>;
+
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins>;
+
+   reset-gpios = <_gpio 3 GPIO_ACTIVE_HIGH>;
+
+   ports {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   port@0 {
+   reg = <0>;
+   panel0_in: endpoint {
+   remote-endpoint = <_out>;
+   };
+   };
+   };
+   };
+
+   ports {
+   port@1 {
+   endpoint {
+   remote-endpoint = <_in>;
+   data-lanes = <0 1 2 3>;
+   };
+   };
+   };
+};
+
+_phy {
+   status = "okay";
+};
+
  {
status = "okay";
pinctrl-names = "default";
@@ -289,6 +333,17 @@ _1_qmpphy {
 
 /* PINCTRL - additions to nodes defined in sc7180.dtsi */
 
+_gpio {
+   disp_pins: disp-pins {
+   pins = "gpio3";
+   function = "func1";
+   qcom,drive-strength = <2>;
+   power-source = <0>;
+   bias-disable;
+   output-low;
+   };
+};
+
 _clk {
pinconf {
pins = "gpio63";
-- 
2.25.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[v1] drm/msm/dsi: save pll state before dsi host is powered off

2020-02-07 Thread Harigovindan P
Save pll state before dsi host is powered off. Without this change
some register values gets resetted.

Signed-off-by: Harigovindan P 
---

Changes in v1:
- Saving pll state before dsi host is powered off.
- Removed calling of save state in post_disable since everything
would be resetted and it would save only resetted values.

 drivers/gpu/drm/msm/dsi/dsi_manager.c | 5 +
 drivers/gpu/drm/msm/dsi/phy/dsi_phy.c | 4 
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c 
b/drivers/gpu/drm/msm/dsi/dsi_manager.c
index 104115d..a987efe 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_manager.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c
@@ -506,6 +506,7 @@ static void dsi_mgr_bridge_post_disable(struct drm_bridge 
*bridge)
struct msm_dsi *msm_dsi1 = dsi_mgr_get_dsi(DSI_1);
struct mipi_dsi_host *host = msm_dsi->host;
struct drm_panel *panel = msm_dsi->panel;
+   struct msm_dsi_pll *src_pll;
bool is_dual_dsi = IS_DUAL_DSI();
int ret;
 
@@ -539,6 +540,10 @@ static void dsi_mgr_bridge_post_disable(struct drm_bridge 
*bridge)
id, ret);
}
 
+   /* Save PLL status if it is a clock source */
+   src_pll = msm_dsi_phy_get_pll(msm_dsi->phy);
+   msm_dsi_pll_save_state(src_pll);
+
ret = msm_dsi_host_power_off(host);
if (ret)
pr_err("%s: host %d power off failed,%d\n", __func__, id, ret);
diff --git a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c 
b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c
index b0cfa67..f509ebd 100644
--- a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c
+++ b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c
@@ -724,10 +724,6 @@ void msm_dsi_phy_disable(struct msm_dsi_phy *phy)
if (!phy || !phy->cfg->ops.disable)
return;
 
-   /* Save PLL status if it is a clock source */
-   if (phy->usecase != MSM_DSI_PHY_SLAVE)
-   msm_dsi_pll_save_state(phy->pll);
-
phy->cfg->ops.disable(phy);
 
dsi_phy_regulator_disable(phy);
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[v1] drm/msm/dsi: save pll state before dsi host is powered off

2020-02-07 Thread Harigovindan P
Save pll state before dsi host is powered off. Without this change
some register values gets resetted.

Signed-off-by: Harigovindan P 
---

Changes in v1:
- Saving pll state before dsi host is powered off.
- Removed calling of save state in msm_dsi_phy_disable since everything
would be resetted and it would save only resetted values.

 drivers/gpu/drm/msm/dsi/dsi_manager.c | 5 +
 drivers/gpu/drm/msm/dsi/phy/dsi_phy.c | 4 
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c 
b/drivers/gpu/drm/msm/dsi/dsi_manager.c
index 104115d..a987efe 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_manager.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c
@@ -506,6 +506,7 @@ static void dsi_mgr_bridge_post_disable(struct drm_bridge 
*bridge)
struct msm_dsi *msm_dsi1 = dsi_mgr_get_dsi(DSI_1);
struct mipi_dsi_host *host = msm_dsi->host;
struct drm_panel *panel = msm_dsi->panel;
+   struct msm_dsi_pll *src_pll;
bool is_dual_dsi = IS_DUAL_DSI();
int ret;
 
@@ -539,6 +540,10 @@ static void dsi_mgr_bridge_post_disable(struct drm_bridge 
*bridge)
id, ret);
}
 
+   /* Save PLL status if it is a clock source */
+   src_pll = msm_dsi_phy_get_pll(msm_dsi->phy);
+   msm_dsi_pll_save_state(src_pll);
+
ret = msm_dsi_host_power_off(host);
if (ret)
pr_err("%s: host %d power off failed,%d\n", __func__, id, ret);
diff --git a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c 
b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c
index b0cfa67..f509ebd 100644
--- a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c
+++ b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c
@@ -724,10 +724,6 @@ void msm_dsi_phy_disable(struct msm_dsi_phy *phy)
if (!phy || !phy->cfg->ops.disable)
return;
 
-   /* Save PLL status if it is a clock source */
-   if (phy->usecase != MSM_DSI_PHY_SLAVE)
-   msm_dsi_pll_save_state(phy->pll);
-
phy->cfg->ops.disable(phy);
 
dsi_phy_regulator_disable(phy);
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[v1] drm/msm/dsi/pll: call vco set rate explicitly

2020-02-07 Thread Harigovindan P
For a given byte clock, if VCO recalc value is exactly same as
vco set rate value, vco_set_rate does not get called assuming
VCO is already set to required value. But Due to GDSC toggle,
VCO values are erased in the HW. To make sure VCO is programmed
correctly, we forcefully call set_rate from vco_prepare.

Signed-off-by: Harigovindan P 
---

Changes in v1:
- Calling set rate from vco_prepare

 drivers/gpu/drm/msm/dsi/pll/dsi_pll_10nm.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/msm/dsi/pll/dsi_pll_10nm.c 
b/drivers/gpu/drm/msm/dsi/pll/dsi_pll_10nm.c
index 1c89454..6ac04fc 100644
--- a/drivers/gpu/drm/msm/dsi/pll/dsi_pll_10nm.c
+++ b/drivers/gpu/drm/msm/dsi/pll/dsi_pll_10nm.c
@@ -411,6 +411,12 @@ static int dsi_pll_10nm_vco_prepare(struct clk_hw *hw)
if (pll_10nm->slave)
dsi_pll_enable_pll_bias(pll_10nm->slave);
 
+   rc = dsi_pll_10nm_vco_set_rate(hw,pll_10nm->vco_current_rate, 0);
+   if (rc) {
+   pr_err("vco_set_rate failed, rc=%d\n", rc);
+   return rc;
+   }
+
/* Start PLL */
pll_write(pll_10nm->phy_cmn_mmio + REG_DSI_10nm_PHY_CMN_PLL_CNTRL,
  0x01);
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCHv3 0/2] Add support for rm69299 Visionox panel driver and add devicetree bindings for visionox panel

2020-02-06 Thread Harigovindan P
Adding support for visionox rm69299 panel driver and adding bindings for the 
same panel.

Harigovindan P (2):
  dt-bindings: display: add visionox rm69299 panel variant
  drm/panel: add support for rm69299 visionox panel driver

 .../bindings/display/visionox,rm69299.yaml | 109 ++
 drivers/gpu/drm/panel/Kconfig  |   8 +
 drivers/gpu/drm/panel/Makefile |   1 +
 drivers/gpu/drm/panel/panel-visionox-rm69299.c | 371 +
 4 files changed, 489 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/visionox,rm69299.yaml
 create mode 100644 drivers/gpu/drm/panel/panel-visionox-rm69299.c

-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCHv3 1/2] dt-bindings: display: add visionox rm69299 panel variant

2020-02-06 Thread Harigovindan P
Add bindings for visionox rm69299 panel.

Signed-off-by: Harigovindan P 
---

Changes in v1:
- Added a compatible string to support sc7180 panel version.
Changes in v2:
- Removed unwanted properties from description.
- Creating source files without execute permissions(Rob Herring).
Changes in v3:
- Changing txt file into yaml

 .../bindings/display/visionox,rm69299.yaml | 109 +
 1 file changed, 109 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/visionox,rm69299.yaml

diff --git a/Documentation/devicetree/bindings/display/visionox,rm69299.yaml 
b/Documentation/devicetree/bindings/display/visionox,rm69299.yaml
new file mode 100644
index 000..bfcd46d
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/visionox,rm69299.yaml
@@ -0,0 +1,109 @@
+# SPDX-License-Identifier: GPL-2.0-only
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/visionox,rm69299.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Visionox model RM69299 Panels Device Tree Bindings
+
+maintainers:
+  - Harigovindan P 
+  - Kalyan Thota 
+  - Vishnuvardhan Prodduturi 
+
+description:
+  This binding is for display panels using a Visionox RM692999 panel.
+
+patternProperties:
+  "^(panel|panel-dsi)@[0-9]$":
+type: object
+description:
+  A node containing the panel or bridge description as documented in
+  Documentation/devicetree/bindings/display/mipi-dsi-bus.txt
+properties:
+  compatible:
+const: visionox,rm69299-1080p-display
+
+  reg:
+maxItems: 1
+
+  vdda-supply:
+description:
+  Phandle of the regulator that provides the vdda supply voltage.
+
+  vdd3p3-supply:
+description:
+  Phandle of the regulator that provides the vdd3p3 supply voltage.
+
+  pinctrl-names:
+items:
+  - const: default
+  - const: suspend
+
+  pinctrl-0:
+items:
+  - const: Display default pin
+  - const: Display default pin
+
+  ports:
+type: object
+description:
+  A node containing DSI input & output port nodes with endpoint
+  definitions as documented in
+  Documentation/devicetree/bindings/media/video-interfaces.txt
+  Documentation/devicetree/bindings/graph.txt
+properties:
+  port@0:
+type: object
+description:
+  DSI input port node.
+
+  "#address-cells":
+const: 1
+
+  "#size-cells":
+const: 0
+
+required:
+  - "#address-cells"
+  - "#size-cells"
+  - compatible
+  - reg
+  - vdda-supply
+  - vdd3p3-supply
+  - pinctrl-names
+  - pinctrl-0
+  - pinctrl-1
+  - reset-gpios
+
+additionalProperties: false
+
+examples:
+  -
+   dsi@ae94000 {
+   panel@0 {
+   compatible = "visionox,rm69299-1080p-display";
+   reg = <0>;
+
+   vdda-supply = <_pp1800_l8c>;
+   vdd3p3-supply = <_pp2800_l18a>;
+
+   pinctrl-names = "default", "suspend";
+   pinctrl-0 = <_pins_default>;
+   pinctrl-1 = <_pins_default>;
+
+   reset-gpios = <_gpios 3 0>;
+   ports {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   port@0 {
+   reg = <0>;
+   panel0_in: endpoint {
+   remote-endpoint = <_out>;
+   };
+   };
+   };
+   };
+   };
+
+...
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCHv3 2/2] drm/panel: add support for rm69299 visionox panel driver

2020-02-06 Thread Harigovindan P
Add support for Visionox panel driver.

Signed-off-by: Harigovindan P 
---

Changes in v1:
- Split out panel driver patch from dsi config changes(Rob Clark).
- Remove unrelated code(Stephen Boyd).
- Remove static arrays to make regulator setup open coded
in probe(Stephen Boyd).
- Remove pre-assigning variables(Stephen Boyd).
- Inline panel_add function into probe(Stephen Boyd).
- Use mipi_dsi_dcs_write directly(Rob Clark).
- Remove qcom_rm69299_1080p_panel_magic_cmds array(Rob Clark).
Changes in v2:
- Dropping redundant space in Kconfig(Sam Ravnborg).
- Changing structure for include files(Sam Ravnborg).
- Removing backlight related code and functions(Sam Ravnborg).
- Removing repeated printing of error message(Sam Ravnborg).
- Adding drm_connector as an argument for get_modes function.
Changes in v3:
- Adding arguments for drm_panel_init to support against mainline.

 drivers/gpu/drm/panel/Kconfig  |   8 +
 drivers/gpu/drm/panel/Makefile |   1 +
 drivers/gpu/drm/panel/panel-visionox-rm69299.c | 371 +
 3 files changed, 380 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-visionox-rm69299.c

diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index 04225a8..354a3a5 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -407,6 +407,14 @@ config DRM_PANEL_TRULY_NT35597_WQXGA
  Say Y here if you want to enable support for Truly NT35597 WQXGA Dual 
DSI
  Video Mode panel
 
+config DRM_PANEL_VISIONOX_RM69299
+   tristate "Visionox RM69299"
+   depends on OF
+   depends on DRM_MIPI_DSI
+   help
+ Say Y here if you want to enable support for Visionox
+ RM69299  DSI Video Mode panel.
+
 config DRM_PANEL_XINPENG_XPP055C272
tristate "Xinpeng XPP055C272 panel driver"
depends on OF
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index 801f9f6..b7ae 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -43,4 +43,5 @@ obj-$(CONFIG_DRM_PANEL_TPO_TD028TTEC1) += 
panel-tpo-td028ttec1.o
 obj-$(CONFIG_DRM_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o
 obj-$(CONFIG_DRM_PANEL_TPO_TPG110) += panel-tpo-tpg110.o
 obj-$(CONFIG_DRM_PANEL_TRULY_NT35597_WQXGA) += panel-truly-nt35597.o
+obj-$(CONFIG_DRM_PANEL_VISIONOX_RM69299) += panel-visionox-rm69299.o
 obj-$(CONFIG_DRM_PANEL_XINPENG_XPP055C272) += panel-xinpeng-xpp055c272.o
diff --git a/drivers/gpu/drm/panel/panel-visionox-rm69299.c 
b/drivers/gpu/drm/panel/panel-visionox-rm69299.c
new file mode 100644
index 000..7195ab0
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-visionox-rm69299.c
@@ -0,0 +1,371 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2019, The Linux Foundation. All rights reserved.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+struct rm69299_config {
+   unsigned long width_mm;
+   unsigned long height_mm;
+   const char *panel_name;
+   u32 num_on_cmds;
+   const struct drm_display_mode *dm;
+};
+
+struct visionox_rm69299 {
+   struct device *dev;
+   struct drm_panel panel;
+
+   struct regulator_bulk_data supplies[2];
+
+   struct gpio_desc *reset_gpio;
+
+   struct mipi_dsi_device *dsi;
+   const struct rm69299_config *config;
+   bool prepared;
+   bool enabled;
+};
+
+static inline struct visionox_rm69299 *panel_to_ctx(struct drm_panel *panel)
+{
+   return container_of(panel, struct visionox_rm69299, panel);
+}
+
+static int visionox_35597_power_on(struct visionox_rm69299 *ctx)
+{
+   int ret;
+
+   ret = regulator_set_load(ctx->supplies[0].consumer, 32000);
+   if (ret)
+   return ret;
+
+   ret = regulator_set_load(ctx->supplies[1].consumer, 13200);
+   if (ret)
+   return ret;
+
+   ret = regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
+   if (ret < 0)
+   return ret;
+
+   /*
+* Reset sequence of visionox panel requires the panel to be
+* out of reset for 10ms, followed by being held in reset
+* for 10ms and then out again
+*/
+   gpiod_set_value(ctx->reset_gpio, 1);
+   usleep_range(1, 2);
+   gpiod_set_value(ctx->reset_gpio, 0);
+   usleep_range(1, 2);
+   gpiod_set_value(ctx->reset_gpio, 1);
+   usleep_range(1, 2);
+
+   return 0;
+}
+
+static int visionox_rm69299_power_off(struct visionox_rm69299 *ctx)
+{
+   int ret;
+
+   gpiod_set_value(ctx->reset_gpio, 0);
+
+   ret = regulator_set_load(ctx->supplies[0].consumer, 80);
+
+   if (ret) {
+   DRM_DEV_ERROR(ctx->dev,
+   "regulat

[v1] dt-bindings: msm:disp: update dsi and dpu bindings

2020-02-05 Thread Harigovindan P
Updating bindings of dsi and dpu by adding and removing certain
properties.

Signed-off-by: Harigovindan P 
---

Changes in v1:
- Adding "ahb" clock as a required property.
- Adding "bus", "rot", "lut" as optional properties for sc7180 device.
- Removing properties from dsi bindings that are unused.
- Removing power-domain property since DSI is the child node of MDSS
  and it will inherit supply from its parent.

 Documentation/devicetree/bindings/display/msm/dpu.txt | 7 +++
 Documentation/devicetree/bindings/display/msm/dsi.txt | 5 -
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/Documentation/devicetree/bindings/display/msm/dpu.txt 
b/Documentation/devicetree/bindings/display/msm/dpu.txt
index 551ae26..dd58472a 100644
--- a/Documentation/devicetree/bindings/display/msm/dpu.txt
+++ b/Documentation/devicetree/bindings/display/msm/dpu.txt
@@ -19,6 +19,7 @@ Required properties:
   The following clocks are required:
   * "iface"
   * "bus"
+  * "ahb"
   * "core"
 - interrupts: interrupt signal from MDSS.
 - interrupt-controller: identifies the node as an interrupt controller.
@@ -50,6 +51,8 @@ Required properties:
 - clock-names: device clock names, must be in same order as clocks property.
   The following clocks are required.
   * "bus"
+  For the device "qcom,sc7180-dpu":
+  * "bus" - is an optional property due to architecture change.
   * "iface"
   * "core"
   * "vsync"
@@ -70,6 +73,10 @@ Optional properties:
 - assigned-clocks: list of clock specifiers for clocks needing rate assignment
 - assigned-clock-rates: list of clock frequencies sorted in the same order as
   the assigned-clocks property.
+- For the device "qcom,sc7180-dpu":
+  clock-names: optional device clocks, needed for accessing LUT blocks.
+  * "rot"
+  * "lut"
 
 Example:
 
diff --git a/Documentation/devicetree/bindings/display/msm/dsi.txt 
b/Documentation/devicetree/bindings/display/msm/dsi.txt
index af95586..61d659a 100644
--- a/Documentation/devicetree/bindings/display/msm/dsi.txt
+++ b/Documentation/devicetree/bindings/display/msm/dsi.txt
@@ -8,13 +8,10 @@ Required properties:
 - reg-names: The names of register regions. The following regions are required:
   * "dsi_ctrl"
 - interrupts: The interrupt signal from the DSI block.
-- power-domains: Should be < MDSS_GDSC>.
 - clocks: Phandles to device clocks.
 - clock-names: the following clocks are required:
-  * "mdp_core"
   * "iface"
   * "bus"
-  * "core_mmss"
   * "byte"
   * "pixel"
   * "core"
@@ -156,7 +153,6 @@ Example:
"core",
"core_mmss",
"iface",
-   "mdp_core",
"pixel";
clocks =
< MDSS_AXI_CLK>,
@@ -164,7 +160,6 @@ Example:
< MDSS_ESC0_CLK>,
< MMSS_MISC_AHB_CLK>,
< MDSS_AHB_CLK>,
-   < MDSS_MDP_CLK>,
< MDSS_PCLK0_CLK>;
 
assigned-clocks =
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[v5] arm64: dts: sc7180: add display dt nodes

2020-02-05 Thread Harigovindan P
Add display, DSI hardware DT nodes for sc7180.

Co-developed-by: Kalyan Thota 
Signed-off-by: Kalyan Thota 
Signed-off-by: Harigovindan P 
---

Changes in v1:
- Added display DT nodes for sc7180
Changes in v2:
- Renamed node names
- Corrected code alignments
- Removed extra new line
- Added DISP AHB clock for register access
  under display_subsystem node for global settings
Changes in v3:
- Modified node names
- Modified hard coded values
- Removed mdss reg entry
Changes in v4:
- Reverting mdp node name
- Setting status to disabled in main SOC dtsi file
- Replacing _ to - for node names
- Adding clock dependency patch link
- Splitting idp dt file to a separate patch
Changes in v5:
- Renaming "gcc_bus" to "bus" as per bindings (Doug Anderson)
- Making status as disabled for mdss and mdss_mdp by default (Doug 
Anderson)
- Removing "disp_cc" register space (Doug Anderson)
- Renaming "dsi_controller" to "dsi" as per bindings (Doug Anderson)
- Providing "ref" clk for dsi_phy (Doug Anderson)
- Sorting mdss node before dispcc (Doug Anderson)

This patch has dependency on the below series
https://lkml.org/lkml/2019/12/27/73

 arch/arm64/boot/dts/qcom/sc7180.dtsi | 136 ++-
 1 file changed, 134 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sc7180.dtsi 
b/arch/arm64/boot/dts/qcom/sc7180.dtsi
index bd2584d..3ac1b87 100644
--- a/arch/arm64/boot/dts/qcom/sc7180.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc7180.dtsi
@@ -1173,13 +1173,145 @@
#power-domain-cells = <1>;
};
 
+   mdss: mdss@ae0 {
+   compatible = "qcom,sc7180-mdss";
+   reg = <0 0x0ae0 0 0x1000>;
+   reg-names = "mdss";
+
+   power-domains = < MDSS_GDSC>;
+
+   clocks = < GCC_DISP_AHB_CLK>,
+< GCC_DISP_HF_AXI_CLK>,
+< DISP_CC_MDSS_AHB_CLK>,
+< DISP_CC_MDSS_MDP_CLK>;
+   clock-names = "iface", "bus", "ahb", "core";
+
+   assigned-clocks = < DISP_CC_MDSS_MDP_CLK>;
+   assigned-clock-rates = <3>;
+
+   interrupts = ;
+   interrupt-controller;
+   #interrupt-cells = <1>;
+
+   iommus = <_smmu 0x800 0x2>;
+
+   #address-cells = <2>;
+   #size-cells = <2>;
+   ranges;
+
+   status = "disabled";
+
+   mdp: mdp@ae01000 {
+   compatible = "qcom,sc7180-dpu";
+   reg = <0 0x0ae01000 0 0x8f000>,
+ <0 0x0aeb 0 0x2008>;
+   reg-names = "mdp", "vbif";
+
+   clocks = < DISP_CC_MDSS_AHB_CLK>,
+< DISP_CC_MDSS_ROT_CLK>,
+< DISP_CC_MDSS_MDP_LUT_CLK>,
+< DISP_CC_MDSS_MDP_CLK>,
+< DISP_CC_MDSS_VSYNC_CLK>;
+   clock-names = "iface", "rot", "lut", "core",
+ "vsync";
+   assigned-clocks = < 
DISP_CC_MDSS_MDP_CLK>,
+ < 
DISP_CC_MDSS_VSYNC_CLK>;
+   assigned-clock-rates = <3>,
+  <1920>;
+
+   interrupt-parent = <>;
+   interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
+
+   status = "disabled";
+
+   ports {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   port@0 {
+   reg = <0>;
+   dpu_intf1_out: endpoint {
+   remote-endpoint = 
<_in>;
+   };
+   };
+   };
+   }

[v1] arm64: dts: sc7180: add dsi controller and phy entries for idp dts

2020-01-29 Thread Harigovindan P
Adding dsi controller and phy entries for idp dt.

Signed-off-by: Harigovindan P 
---
 arch/arm64/boot/dts/qcom/sc7180-idp.dts | 56 +
 1 file changed, 56 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sc7180-idp.dts 
b/arch/arm64/boot/dts/qcom/sc7180-idp.dts
index 388f50a..9f42367 100644
--- a/arch/arm64/boot/dts/qcom/sc7180-idp.dts
+++ b/arch/arm64/boot/dts/qcom/sc7180-idp.dts
@@ -7,6 +7,7 @@
 
 /dts-v1/;
 
+#include 
 #include 
 #include "sc7180.dtsi"
 #include "pm6150.dtsi"
@@ -232,6 +233,50 @@
};
 };
 
+_controller {
+   status = "okay";
+
+   vdda-supply = <_l3c_1p2>;
+
+   panel@0 {
+   compatible = "visionox,rm69299-1080p-display";
+   reg = <0>;
+
+   vdda-supply = <_l8c_1p8>;
+   vdd3p3-supply = <_l18a_2p8>;
+
+   pinctrl-names = "default", "suspend";
+   pinctrl-0 = <_pins_default>;
+   pinctrl-1 = <_pins_default>;
+
+   reset-gpios = <_gpio 3 GPIO_ACTIVE_HIGH>;
+
+   ports {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   port@0 {
+   reg = <0>;
+   panel0_in: endpoint {
+   remote-endpoint = <_out>;
+   };
+   };
+   };
+   };
+
+   ports {
+   port@1 {
+   endpoint {
+   remote-endpoint = <_in>;
+   data-lanes = <0 1 2 3>;
+   };
+   };
+   };
+};
+
+_phy {
+   status = "okay";
+};
+
  {
status = "okay";
pinctrl-names = "default";
@@ -289,6 +334,17 @@
 
 /* PINCTRL - additions to nodes defined in sc7180.dtsi */
 
+_gpio {
+   disp_pins_default: disp-pins-default{
+   pins = "gpio3";
+   function = "func1";
+   qcom,drive-strength = <2>;
+   power-source = <0>;
+   bias-disable;
+   output-low;
+   };
+};
+
 _clk {
pinconf {
pins = "gpio63";
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[v4] arm64: dts: sc7180: add display dt nodes

2020-01-29 Thread Harigovindan P
Add display, DSI hardware DT nodes for sc7180.

Signed-off-by: Harigovindan P 
---

Changes in v1:
-Added display DT nodes for sc7180
Changes in v2:
-Renamed node names
-Corrected code alignments
-Removed extra new line
-Added DISP AHB clock for register access
under display_subsystem node for global settings
Changes in v3:
-Modified node names
-Modified hard coded values
-Removed mdss reg entry
Changes in v4:
-Reverting mdp node name
-Setting status to disabled in main SOC dtsi file
-Replacing _ to - for node names
-Adding clock dependency patch link
-Splitting idp dt file to a separate patch

This patch has dependency on the below series
https://lkml.org/lkml/2019/12/27/73
 arch/arm64/boot/dts/qcom/sc7180.dtsi | 128 +++
 1 file changed, 128 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sc7180.dtsi 
b/arch/arm64/boot/dts/qcom/sc7180.dtsi
index 3bc3f64..c3883af 100644
--- a/arch/arm64/boot/dts/qcom/sc7180.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc7180.dtsi
@@ -1184,6 +1184,134 @@
#power-domain-cells = <1>;
};
 
+   mdss: mdss@ae0 {
+   compatible = "qcom,sc7180-mdss";
+   reg = <0 0x0ae0 0 0x1000>;
+   reg-names = "mdss";
+
+   power-domains = < MDSS_GDSC>;
+
+   clocks = < GCC_DISP_AHB_CLK>,
+< GCC_DISP_HF_AXI_CLK>,
+< DISP_CC_MDSS_AHB_CLK>,
+< DISP_CC_MDSS_MDP_CLK>;
+   clock-names = "iface", "gcc_bus", "ahb", "core";
+
+   assigned-clocks = < DISP_CC_MDSS_MDP_CLK>;
+   assigned-clock-rates = <3>;
+
+   interrupts = ;
+   interrupt-controller;
+   #interrupt-cells = <1>;
+
+   iommus = <_smmu 0x800 0x2>;
+
+   #address-cells = <2>;
+   #size-cells = <2>;
+   ranges;
+
+   mdss_mdp: mdp@ae01000 {
+   compatible = "qcom,sc7180-dpu";
+   reg = <0 0x0ae01000 0 0x8f000>,
+ <0 0x0aeb 0 0x2008>,
+ <0 0x0af03000 0 0x16>;
+   reg-names = "mdp", "vbif", "disp_cc";
+
+   clocks = < DISP_CC_MDSS_AHB_CLK>,
+< DISP_CC_MDSS_ROT_CLK>,
+< DISP_CC_MDSS_MDP_LUT_CLK>,
+< DISP_CC_MDSS_MDP_CLK>,
+< DISP_CC_MDSS_VSYNC_CLK>;
+   clock-names = "iface", "rot", "lut", "core",
+ "vsync";
+   assigned-clocks = < 
DISP_CC_MDSS_MDP_CLK>,
+ < 
DISP_CC_MDSS_VSYNC_CLK>;
+   assigned-clock-rates = <3>,
+  <1920>;
+
+   interrupt-parent = <>;
+   interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
+
+   ports {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   port@0 {
+   reg = <0>;
+   dpu_intf1_out: endpoint {
+   remote-endpoint = 
<_in>;
+   };
+   };
+   };
+   };
+
+   dsi_controller: dsi-controller@ae94000 {
+   compatible = "qcom,mdss-dsi-ctrl";
+   reg = <0 0x0ae94000 0 0x400>;
+   reg-names = "dsi_ctrl";
+
+   interrupt-parent = <>;
+   interrupts = <4 IRQ_TYPE_LEVEL_HIGH>;
+
+   clocks = < DISP_CC_MDSS_BYTE0_CLK>,
+< DISP_CC_MDSS_BYTE0_INTF

[v3] arm64: dts: sc7180: add display dt nodes

2020-01-25 Thread Harigovindan P
Add display, DSI hardware DT nodes for sc7180.

Signed-off-by: Harigovindan P 
---

Changes in v1:
-Added display DT nodes for sc7180
Changes in v2:
-Renamed node names
-Corrected code alignments
-Removed extra new line
-Added DISP AHB clock for register access
under display_subsystem node for global settings
Changes in v3:
-Modified node names
-Modified hard coded values
-Removed mdss reg entry

 arch/arm64/boot/dts/qcom/sc7180-idp.dts |  58 +++
 arch/arm64/boot/dts/qcom/sc7180.dtsi| 124 
 2 files changed, 182 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sc7180-idp.dts 
b/arch/arm64/boot/dts/qcom/sc7180-idp.dts
index 388f50a..c77aab7 100644
--- a/arch/arm64/boot/dts/qcom/sc7180-idp.dts
+++ b/arch/arm64/boot/dts/qcom/sc7180-idp.dts
@@ -7,6 +7,7 @@
 
 /dts-v1/;
 
+#include 
 #include 
 #include "sc7180.dtsi"
 #include "pm6150.dtsi"
@@ -232,6 +233,50 @@
};
 };
 
+_controller {
+   status = "okay";
+
+   vdda-supply = <_l3c_1p2>;
+
+   panel@0 {
+   compatible = "visionox,rm69299-1080p-display";
+   reg = <0>;
+
+   vdda-supply = <_l8c_1p8>;
+   vdd3p3-supply = <_l18a_2p8>;
+
+   pinctrl-names = "default", "suspend";
+   pinctrl-0 = <_pins_default>;
+   pinctrl-1 = <_pins_default>;
+
+   reset-gpios = <_gpio 3 GPIO_ACTIVE_HIGH>;
+
+   ports {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   port@0 {
+   reg = <0>;
+   panel0_in: endpoint {
+   remote-endpoint = <_out>;
+   };
+   };
+   };
+   };
+
+   ports {
+   port@1 {
+   endpoint {
+   remote-endpoint = <_in>;
+   data-lanes = <0 1 2 3>;
+   };
+   };
+   };
+};
+
+_phy {
+   status = "okay";
+};
+
  {
status = "okay";
pinctrl-names = "default";
@@ -289,6 +334,19 @@
 
 /* PINCTRL - additions to nodes defined in sc7180.dtsi */
 
+_gpio {
+   disp_pins {
+   disp_pins_default: disp_pins_default{
+   pins = "gpio3";
+   function = "func1";
+   qcom,drive-strength = <2>;
+   power-source = <0>;
+   bias-disable;
+   output-low;
+   };
+   };
+};
+
 _clk {
pinconf {
pins = "gpio63";
diff --git a/arch/arm64/boot/dts/qcom/sc7180.dtsi 
b/arch/arm64/boot/dts/qcom/sc7180.dtsi
index 3bc3f64..3ebc45b 100644
--- a/arch/arm64/boot/dts/qcom/sc7180.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc7180.dtsi
@@ -1184,6 +1184,130 @@
#power-domain-cells = <1>;
};
 
+   mdss: display_subsystem@ae0 {
+   compatible = "qcom,sc7180-mdss";
+   reg = <0 0x0ae0 0 0x1000>;
+   reg-names = "mdss";
+
+   power-domains = < MDSS_GDSC>;
+
+   clocks = < GCC_DISP_AHB_CLK>,
+< GCC_DISP_HF_AXI_CLK>,
+< DISP_CC_MDSS_AHB_CLK>,
+< DISP_CC_MDSS_MDP_CLK>;
+   clock-names = "iface", "gcc_bus", "ahb", "core";
+
+   assigned-clocks = < DISP_CC_MDSS_MDP_CLK>;
+   assigned-clock-rates = <3>;
+
+   interrupts = ;
+   interrupt-controller;
+   #interrupt-cells = <1>;
+
+   iommus = <_smmu 0x800 0x2>;
+
+   #address-cells = <2>;
+   #size-cells = <2>;
+   ranges;
+
+   mdp: display_controller@ae01000 {
+   compatible = "qcom,sc7180-dpu";
+   reg = <0 0x0ae01000 0 0x8f000>,
+ <0 0x0aeb 0 0x2008>,
+ <0 0x0af03000 0 0x16>;
+   reg-names = "mdp", "vbif", "disp_cc";
+
+   clocks = < DISP_CC_MDSS_AHB_CLK>,
+< DISP_CC_MDSS_ROT_

[v2] arm64: dts: sc7180: add display dt nodes

2020-01-24 Thread Harigovindan P
Add display, DSI hardware DT nodes for sc7180.

Changes in v1:
-Added display DT nodes for sc7180
Changes in v2:
-Renamed node names
-Corrected code alignments
-Removed extra new line

Signed-off-by: Harigovindan P 
---
 arch/arm64/boot/dts/qcom/sc7180-idp.dts |  57 +++
 arch/arm64/boot/dts/qcom/sc7180.dtsi| 125 
 2 files changed, 182 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sc7180-idp.dts 
b/arch/arm64/boot/dts/qcom/sc7180-idp.dts
index 388f50a..f410614 100644
--- a/arch/arm64/boot/dts/qcom/sc7180-idp.dts
+++ b/arch/arm64/boot/dts/qcom/sc7180-idp.dts
@@ -232,6 +232,50 @@
};
 };
 
+_controller {
+   status = "okay";
+
+   vdda-supply = <_l3c_1p2>;
+
+   panel@0 {
+   compatible = "visionox,rm69299-1080p-display";
+   reg = <0>;
+
+   vdda-supply = <_l8c_1p8>;
+   vdd3p3-supply = <_l18a_2p8>;
+
+   pinctrl-names = "default", "suspend";
+   pinctrl-0 = <_pins_default>;
+   pinctrl-1 = <_pins_default>;
+
+   reset-gpios = <_gpio 3 0>;
+
+   ports {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   port@0 {
+   reg = <0>;
+   panel0_in: endpoint {
+   remote-endpoint = <_out>;
+   };
+   };
+   };
+   };
+
+   ports {
+   port@1 {
+   endpoint {
+   remote-endpoint = <_in>;
+   data-lanes = <0 1 2 3>;
+   };
+   };
+   };
+};
+
+_phy {
+   status = "okay";
+};
+
  {
status = "okay";
pinctrl-names = "default";
@@ -289,6 +333,19 @@
 
 /* PINCTRL - additions to nodes defined in sc7180.dtsi */
 
+_gpio {
+   disp_pins {
+   disp_pins_default: disp_pins_default {
+   pins = "gpio3";
+   function = "func1";
+   qcom,drive-strength = <2>;
+   power-source = <0>;
+   bias-disable;
+   output-low;
+   };
+   };
+};
+
 _clk {
pinconf {
pins = "gpio63";
diff --git a/arch/arm64/boot/dts/qcom/sc7180.dtsi 
b/arch/arm64/boot/dts/qcom/sc7180.dtsi
index 3bc3f64..81c3aab 100644
--- a/arch/arm64/boot/dts/qcom/sc7180.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc7180.dtsi
@@ -1184,6 +1184,131 @@
#power-domain-cells = <1>;
};
 
+   display_subsystem: mdss@ae0 {
+   compatible = "qcom,sc7180-mdss";
+   reg = <0 0x0ae0 0 0x1000>;
+   reg-names = "mdss";
+
+   power-domains = < MDSS_GDSC>;
+
+   clocks = < GCC_DISP_AHB_CLK>,
+< GCC_DISP_HF_AXI_CLK>,
+< DISP_CC_MDSS_AHB_CLK>,
+< DISP_CC_MDSS_MDP_CLK>;
+   clock-names = "iface", "gcc_bus", "ahb", "core";
+
+   assigned-clocks = < DISP_CC_MDSS_MDP_CLK>;
+   assigned-clock-rates = <3>;
+
+   interrupts = ;
+   interrupt-controller;
+   #interrupt-cells = <1>;
+
+   iommus = <_smmu 0x800 0x2>;
+
+   #address-cells = <2>;
+   #size-cells = <2>;
+   ranges;
+
+   display_controller: mdp@ae0 {
+   compatible = "qcom,sc7180-dpu";
+   reg = <0 0x0ae0 0 0x1000>,
+ <0 0x0ae01000 0 0x8f000>,
+ <0 0x0aeb 0 0x2008>,
+ <0 0x0af03000 0 0x16>;
+   reg-names = "mdss", "mdp", "vbif", "disp_cc";
+
+   clocks = < DISP_CC_MDSS_AHB_CLK>,
+< DISP_CC_MDSS_ROT_CLK>,
+< DISP_CC_MDSS_MDP_LUT_CLK>,
+< DISP_CC_MDSS_MDP_CLK>,
+< DISP_CC_MDSS_VSYNC_CLK>;
+   

[v2] arm64: dts: sc7180: add display dt nodes

2020-01-24 Thread Harigovindan P
Add display, DSI hardware DT nodes for sc7180.

Changes in v1:
-Added display DT nodes for sc7180
Changes in v2:
-Renamed node names
-Corrected code alignments
-Removed extra new line
-Added DISP AHB clock for register access
under display_subsystem node for global settings

Signed-off-by: Harigovindan P 
---
 arch/arm64/boot/dts/qcom/sc7180-idp.dts |  57 +++
 arch/arm64/boot/dts/qcom/sc7180.dtsi| 125 
 2 files changed, 182 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sc7180-idp.dts 
b/arch/arm64/boot/dts/qcom/sc7180-idp.dts
index 388f50a..f410614 100644
--- a/arch/arm64/boot/dts/qcom/sc7180-idp.dts
+++ b/arch/arm64/boot/dts/qcom/sc7180-idp.dts
@@ -232,6 +232,50 @@
};
 };
 
+_controller {
+   status = "okay";
+
+   vdda-supply = <_l3c_1p2>;
+
+   panel@0 {
+   compatible = "visionox,rm69299-1080p-display";
+   reg = <0>;
+
+   vdda-supply = <_l8c_1p8>;
+   vdd3p3-supply = <_l18a_2p8>;
+
+   pinctrl-names = "default", "suspend";
+   pinctrl-0 = <_pins_default>;
+   pinctrl-1 = <_pins_default>;
+
+   reset-gpios = <_gpio 3 0>;
+
+   ports {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   port@0 {
+   reg = <0>;
+   panel0_in: endpoint {
+   remote-endpoint = <_out>;
+   };
+   };
+   };
+   };
+
+   ports {
+   port@1 {
+   endpoint {
+   remote-endpoint = <_in>;
+   data-lanes = <0 1 2 3>;
+   };
+   };
+   };
+};
+
+_phy {
+   status = "okay";
+};
+
  {
status = "okay";
pinctrl-names = "default";
@@ -289,6 +333,19 @@
 
 /* PINCTRL - additions to nodes defined in sc7180.dtsi */
 
+_gpio {
+   disp_pins {
+   disp_pins_default: disp_pins_default{
+   pins = "gpio3";
+   function = "func1";
+   qcom,drive-strength = <2>;
+   power-source = <0>;
+   bias-disable;
+   output-low;
+   };
+   };
+};
+
 _clk {
pinconf {
pins = "gpio63";
diff --git a/arch/arm64/boot/dts/qcom/sc7180.dtsi 
b/arch/arm64/boot/dts/qcom/sc7180.dtsi
index 3bc3f64..81c3aab 100644
--- a/arch/arm64/boot/dts/qcom/sc7180.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc7180.dtsi
@@ -1184,6 +1184,131 @@
#power-domain-cells = <1>;
};
 
+   display_subsystem: mdss@ae0 {
+   compatible = "qcom,sc7180-mdss";
+   reg = <0 0x0ae0 0 0x1000>;
+   reg-names = "mdss";
+
+   power-domains = < MDSS_GDSC>;
+
+   clocks = < GCC_DISP_AHB_CLK>,
+< GCC_DISP_HF_AXI_CLK>,
+< DISP_CC_MDSS_AHB_CLK>,
+< DISP_CC_MDSS_MDP_CLK>;
+   clock-names = "iface", "gcc_bus", "ahb", "core";
+
+   assigned-clocks = < DISP_CC_MDSS_MDP_CLK>;
+   assigned-clock-rates = <3>;
+
+   interrupts = ;
+   interrupt-controller;
+   #interrupt-cells = <1>;
+
+   iommus = <_smmu 0x800 0x2>;
+
+   #address-cells = <2>;
+   #size-cells = <2>;
+   ranges;
+
+   display_controller: mdp@ae0 {
+   compatible = "qcom,sc7180-dpu";
+   reg = <0 0x0ae0 0 0x1000>,
+ <0 0x0ae01000 0 0x8f000>,
+ <0 0x0aeb 0 0x2008>,
+ <0 0x0af03000 0 0x16>;
+   reg-names = "mdss", "mdp", "vbif", "disp_cc";
+
+   clocks = < DISP_CC_MDSS_AHB_CLK>,
+< DISP_CC_MDSS_ROT_CLK>,
+< DISP_CC_MDSS_MDP_LUT_CLK>,
+< DISP_CC_MDSS_MDP_CL

[v1] arm64: dts: sc7180: add display dt nodes

2020-01-22 Thread Harigovindan P
Add display, DSI hardware DT nodes for sc7180.

Signed-off-by: Harigovindan P 
---
 arch/arm64/boot/dts/qcom/sc7180.dtsi | 125 +++
 1 file changed, 125 insertions(+)
 mode change 100644 => 100755 arch/arm64/boot/dts/qcom/sc7180.dtsi

diff --git a/arch/arm64/boot/dts/qcom/sc7180.dtsi 
b/arch/arm64/boot/dts/qcom/sc7180.dtsi
old mode 100644
new mode 100755
index 8011c5f..963f5c1
--- a/arch/arm64/boot/dts/qcom/sc7180.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc7180.dtsi
@@ -1151,6 +1151,131 @@
};
};
 
+   mdss: mdss@ae0 {
+   compatible = "qcom,sc7180-mdss";
+   reg = <0 0x0ae0 0 0x1000>;
+   reg-names = "mdss";
+
+   power-domains = < MDSS_GDSC>;
+
+   clocks = < GCC_DISP_AHB_CLK>,
+< GCC_DISP_HF_AXI_CLK>,
+< DISP_CC_MDSS_MDP_CLK>;
+   clock-names = "iface", "gcc_bus", "core";
+
+   assigned-clocks = < DISP_CC_MDSS_MDP_CLK>;
+   assigned-clock-rates = <3>;
+
+   interrupts = ;
+   interrupt-controller;
+   #interrupt-cells = <1>;
+
+   iommus = <_smmu 0x800 0x2>;
+
+   #address-cells = <2>;
+   #size-cells = <2>;
+   ranges;
+
+   mdss_mdp: mdp@ae01000 {
+   compatible = "qcom,sc7180-dpu";
+   reg = <0 0x0ae0 0 0x1000>,
+ <0 0x0ae01000 0 0x8f000>,
+ <0 0x0aeb 0 0x2008>,
+ <0 0x0af03000 0 0x16>;
+   reg-names = "mdss","mdp", "vbif", "disp_cc";
+
+   clocks = < DISP_CC_MDSS_AHB_CLK>,
+< DISP_CC_MDSS_ROT_CLK>,
+< DISP_CC_MDSS_MDP_LUT_CLK>,
+< DISP_CC_MDSS_MDP_CLK>,
+< DISP_CC_MDSS_VSYNC_CLK>;
+   clock-names = "iface", "rot", "lut", "core",
+   "vsync";
+   assigned-clocks = < 
DISP_CC_MDSS_MDP_CLK>,
+ < 
DISP_CC_MDSS_VSYNC_CLK>;
+   assigned-clock-rates = <3>,
+  <1920>;
+
+   interrupt-parent = <>;
+   interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
+
+   ports {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   port@0 {
+   reg = <0>;
+   dpu_intf1_out: endpoint {
+   remote-endpoint = 
<_in>;
+   };
+   };
+   };
+   };
+
+   dsi0: qcom,mdss_dsi_ctrl0@ae94000 {
+   compatible = "qcom,mdss-dsi-ctrl";
+   reg = <0 0x0ae94000 0 0x400>;
+   reg-names = "dsi_ctrl";
+
+   interrupt-parent = <>;
+   interrupts = <4 IRQ_TYPE_LEVEL_HIGH>;
+
+   clocks = < DISP_CC_MDSS_BYTE0_CLK>,
+   < DISP_CC_MDSS_BYTE0_INTF_CLK>,
+   < DISP_CC_MDSS_PCLK0_CLK>,
+   < DISP_CC_MDSS_ESC0_CLK>,
+   < DISP_CC_MDSS_AHB_CLK>,
+   < GCC_DISP_HF_AXI_CLK>;
+   clock-names = "byte",
+  "byte_intf",
+  "pixel",
+  "core",
+  "iface",
+  "bus";
+
+  

[PATCH 1/2] dt-bindings: display: add sc7180 panel variant

2020-01-08 Thread Harigovindan P
Add a compatible string to support sc7180 panel version.

Changes in v1:
-Added a compatible string to support sc7180 panel version.
Changes in v2:
-Removed unwanted properties from description.
-Creating source files without execute permissions(Rob Herring).

Signed-off-by: Harigovindan P 
---
 .../bindings/display/visionox,rm69299.txt  | 48 ++
 1 file changed, 48 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/visionox,rm69299.txt

diff --git a/Documentation/devicetree/bindings/display/visionox,rm69299.txt 
b/Documentation/devicetree/bindings/display/visionox,rm69299.txt
new file mode 100644
index 000..d7bbd5f
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/visionox,rm69299.txt
@@ -0,0 +1,48 @@
+Visionox model RM69299 DSI display driver
+
+The Visionox RM69299 is a generic display driver, currently only configured
+for use in the 1080p display on the Qualcomm SC7180 MTP board.
+
+Required properties:
+- compatible: should be "visionox,rm69299-1080p-display"
+- vdda-supply: phandle of the regulator that provides the supply voltage
+  Power IC supply
+- vdd3p3-supply: phandle of the regulator that provides the supply voltage
+  Power IC supply
+- reset-gpios: phandle of gpio for reset line
+  This should be 8mA, gpio can be configured using mux, pinctrl, pinctrl-names
+  (active low)
+- ports: This device has one video port driven by one DSI. Their connections
+  are modeled using the OF graph bindings specified in
+  Documentation/devicetree/bindings/graph.txt.
+  - port@0: DSI input port driven by master DSI
+
+Example:
+
+   dsi@ae94000 {
+   panel@0 {
+   compatible = "visionox,rm69299-1080p-display";
+   reg = <0>;
+
+   vdda-supply = <_pp1800_l8c>;
+   vdd3p3-supply = <_pp2800_l18a>;
+
+   pinctrl-names = "default", "suspend";
+   pinctrl-0 = <_pins_default>;
+   pinctrl-1 = <_pins_default>;
+
+   reset-gpios = <_gpios 3 0>;
+
+   ports {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   port@0 {
+   reg = <0>;
+   panel0_in: endpoint {
+   remote-endpoint = <_out>;
+   };
+   };
+   };
+   };
+   };
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 2/2] drm/panel: add support for rm69299 visionox panel driver

2020-01-08 Thread Harigovindan P
Add support for Visionox panel driver.

Changes in v1:
-Split out panel driver patch from dsi config changes(Rob Clark).
-Remove unrelated code(Stephen Boyd).
-Remove static arrays to make regulator setup open coded
in probe(Stephen Boyd).
-Remove pre-assigning variables(Stephen Boyd).
-Inline panel_add function into probe(Stephen Boyd).
-Use mipi_dsi_dcs_write directly(Rob Clark).
-Remove qcom_rm69299_1080p_panel_magic_cmds array(Rob Clark).
Changes in v2:
-Dropping redundant space in Kconfig(Sam Ravnborg).
-Changing structure for include files(Sam Ravnborg).
-Removing backlight related code and functions(Sam Ravnborg).
-Removing repeated printing of error message(Sam Ravnborg).
-Adding drm_connector as an argument for get_modes function.

Signed-off-by: Harigovindan P 
---
 drivers/gpu/drm/panel/Kconfig  |   8 +
 drivers/gpu/drm/panel/Makefile |   1 +
 drivers/gpu/drm/panel/panel-visionox-rm69299.c | 370 +
 3 files changed, 379 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-visionox-rm69299.c

diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index f152bc4..123481f 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -355,4 +355,12 @@ config DRM_PANEL_TRULY_NT35597_WQXGA
help
  Say Y here if you want to enable support for Truly NT35597 WQXGA Dual 
DSI
  Video Mode panel
+
+config DRM_PANEL_VISIONOX_RM69299
+   tristate "Visionox RM69299"
+   depends on OF
+   depends on DRM_MIPI_DSI
+   help
+ Say Y here if you want to enable support for Visionox
+ RM69299  DSI Video Mode panel.
 endmenu
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index b6cd39f..6f1e4c6 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -38,3 +38,4 @@ obj-$(CONFIG_DRM_PANEL_TPO_TD028TTEC1) += 
panel-tpo-td028ttec1.o
 obj-$(CONFIG_DRM_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o
 obj-$(CONFIG_DRM_PANEL_TPO_TPG110) += panel-tpo-tpg110.o
 obj-$(CONFIG_DRM_PANEL_TRULY_NT35597_WQXGA) += panel-truly-nt35597.o
+obj-$(CONFIG_DRM_PANEL_VISIONOX_RM69299) += panel-visionox-rm69299.o
diff --git a/drivers/gpu/drm/panel/panel-visionox-rm69299.c 
b/drivers/gpu/drm/panel/panel-visionox-rm69299.c
new file mode 100644
index 000..3fa1cb4
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-visionox-rm69299.c
@@ -0,0 +1,370 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2019, The Linux Foundation. All rights reserved.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+struct rm69299_config {
+   unsigned long width_mm;
+   unsigned long height_mm;
+   const char *panel_name;
+   u32 num_on_cmds;
+   const struct drm_display_mode *dm;
+};
+
+struct visionox_rm69299 {
+   struct device *dev;
+   struct drm_panel panel;
+
+   struct regulator_bulk_data supplies[2];
+
+   struct gpio_desc *reset_gpio;
+
+   struct mipi_dsi_device *dsi;
+   const struct rm69299_config *config;
+   bool prepared;
+   bool enabled;
+};
+
+static inline struct visionox_rm69299 *panel_to_ctx(struct drm_panel *panel)
+{
+   return container_of(panel, struct visionox_rm69299, panel);
+}
+
+static int visionox_35597_power_on(struct visionox_rm69299 *ctx)
+{
+   int ret;
+
+   ret = regulator_set_load(ctx->supplies[0].consumer, 32000);
+   if (ret)
+   return ret;
+
+   ret = regulator_set_load(ctx->supplies[1].consumer, 13200);
+   if (ret)
+   return ret;
+
+   ret = regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
+   if (ret < 0)
+   return ret;
+
+   /*
+* Reset sequence of visionox panel requires the panel to be
+* out of reset for 10ms, followed by being held in reset
+* for 10ms and then out again
+*/
+   gpiod_set_value(ctx->reset_gpio, 1);
+   usleep_range(1, 2);
+   gpiod_set_value(ctx->reset_gpio, 0);
+   usleep_range(1, 2);
+   gpiod_set_value(ctx->reset_gpio, 1);
+   usleep_range(1, 2);
+
+   return 0;
+}
+
+static int visionox_rm69299_power_off(struct visionox_rm69299 *ctx)
+{
+   int ret;
+
+   gpiod_set_value(ctx->reset_gpio, 0);
+
+   ret = regulator_set_load(ctx->supplies[0].consumer, 80);
+
+   if (ret) {
+   DRM_DEV_ERROR(ctx->dev,
+   "regulator_set_load failed %d\n", ret);
+   return ret;
+   }
+
+   ret = regulator_set_load(ctx->supplies[1].consumer, 80);
+
+   if (ret) {
+   DRM_DEV_ERROR(ctx->dev,
+   "regulator_set_load failed 

[PATCH v2 0/2] Add support for rm69299 Visionox panel driver and add devicetree bindings for visionox panel

2020-01-08 Thread Harigovindan P
Current patchset adds support for rm69299 visionox panel driver used 
in MSM reference platforms. The visionox panel driver supports a 
resolution of 1080x2248 with 4 lanes and supports only single DSI mode.

Current patchset is tested on actual panel.

Changes in v1:
-add devicetree bindings for visionox panel.
-Split out panel driver patch from dsi config changes(Rob Clark).
-Remove unrelated code(Stephen Boyd).
-Remove static arrays to make regulator setup
 open coded in probe(Stephen Boyd).
-Remove pre-assigning variables(Stephen Boyd).
-Inline panel_add function into probe(Stephen Boyd).
-Use mipi_dsi_dcs_write directly(Rob Clark).
-Remove qcom_rm69299_1080p_panel_magic_cmds array(Rob Clark).
Changes in v2:
-Removed unwanted properties from description.
-Creating source files without execute permissions(Rob Herring).
-Dropping redundant space in Kconfig(Sam Ravnborg).
-Changing structure for include files(Sam Ravnborg).
-Removing backlight related code and functions(Sam Ravnborg).
-Removing repeated printing of error message(Sam Ravnborg).
-Adding drm_connector as an argument for get_modes function.

Harigovindan P (2):
  dt-bindings: display: add sc7180 panel variant
  drm/panel: add support for rm69299 visionox panel driver

 .../bindings/display/visionox,rm69299.txt  |  48 +++
 drivers/gpu/drm/panel/Kconfig  |   8 +
 drivers/gpu/drm/panel/Makefile |   1 +
 drivers/gpu/drm/panel/panel-visionox-rm69299.c | 370 +++
 4 files changed, 427 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/visionox,rm69299.txt
 create mode 100644 drivers/gpu/drm/panel/panel-visionox-rm69299.c

-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 2/2] drm/panel: add support for rm69299 visionox panel driver

2020-01-08 Thread Harigovindan P
Add support for Visionox panel driver.

Changes in v1:
-Split out panel driver patch from dsi config changes(Rob Clark).
-Remove unrelated code(Stephen Boyd).
-Remove static arrays to make regulator setup open coded
in probe(Stephen Boyd).
-Remove pre-assigning variables(Stephen Boyd).
-Inline panel_add function into probe(Stephen Boyd).
-Use mipi_dsi_dcs_write directly(Rob Clark).
-Remove qcom_rm69299_1080p_panel_magic_cmds array(Rob Clark).
Changes in v2:
-Dropping redundant space in Kconfig(Sam Ravnborg).
-Changing structure for include files(Sam Ravnborg).
-Removing backlight related code and functions(Sam Ravnborg).
-Removing repeated printing of error message(Sam Ravnborg).
-Adding drm_connector as an argument for get_modes function.

Signed-off-by: Harigovindan P 
---
 drivers/gpu/drm/panel/Kconfig  |   8 +
 drivers/gpu/drm/panel/Makefile |   1 +
 drivers/gpu/drm/panel/panel-visionox-rm69299.c | 370 +
 3 files changed, 379 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-visionox-rm69299.c

diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index f152bc4..123481f 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -355,4 +355,12 @@ config DRM_PANEL_TRULY_NT35597_WQXGA
help
  Say Y here if you want to enable support for Truly NT35597 WQXGA Dual 
DSI
  Video Mode panel
+
+config DRM_PANEL_VISIONOX_RM69299
+   tristate "Visionox RM69299"
+   depends on OF
+   depends on DRM_MIPI_DSI
+   help
+ Say Y here if you want to enable support for Visionox
+ RM69299  DSI Video Mode panel.
 endmenu
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index b6cd39f..6f1e4c6 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -38,3 +38,4 @@ obj-$(CONFIG_DRM_PANEL_TPO_TD028TTEC1) += 
panel-tpo-td028ttec1.o
 obj-$(CONFIG_DRM_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o
 obj-$(CONFIG_DRM_PANEL_TPO_TPG110) += panel-tpo-tpg110.o
 obj-$(CONFIG_DRM_PANEL_TRULY_NT35597_WQXGA) += panel-truly-nt35597.o
+obj-$(CONFIG_DRM_PANEL_VISIONOX_RM69299) += panel-visionox-rm69299.o
diff --git a/drivers/gpu/drm/panel/panel-visionox-rm69299.c 
b/drivers/gpu/drm/panel/panel-visionox-rm69299.c
new file mode 100644
index 000..3fa1cb4
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-visionox-rm69299.c
@@ -0,0 +1,370 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2019, The Linux Foundation. All rights reserved.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+struct rm69299_config {
+   unsigned long width_mm;
+   unsigned long height_mm;
+   const char *panel_name;
+   u32 num_on_cmds;
+   const struct drm_display_mode *dm;
+};
+
+struct visionox_rm69299 {
+   struct device *dev;
+   struct drm_panel panel;
+
+   struct regulator_bulk_data supplies[2];
+
+   struct gpio_desc *reset_gpio;
+
+   struct mipi_dsi_device *dsi;
+   const struct rm69299_config *config;
+   bool prepared;
+   bool enabled;
+};
+
+static inline struct visionox_rm69299 *panel_to_ctx(struct drm_panel *panel)
+{
+   return container_of(panel, struct visionox_rm69299, panel);
+}
+
+static int visionox_35597_power_on(struct visionox_rm69299 *ctx)
+{
+   int ret;
+
+   ret = regulator_set_load(ctx->supplies[0].consumer, 32000);
+   if (ret)
+   return ret;
+
+   ret = regulator_set_load(ctx->supplies[1].consumer, 13200);
+   if (ret)
+   return ret;
+
+   ret = regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
+   if (ret < 0)
+   return ret;
+
+   /*
+* Reset sequence of visionox panel requires the panel to be
+* out of reset for 10ms, followed by being held in reset
+* for 10ms and then out again
+*/
+   gpiod_set_value(ctx->reset_gpio, 1);
+   usleep_range(1, 2);
+   gpiod_set_value(ctx->reset_gpio, 0);
+   usleep_range(1, 2);
+   gpiod_set_value(ctx->reset_gpio, 1);
+   usleep_range(1, 2);
+
+   return 0;
+}
+
+static int visionox_rm69299_power_off(struct visionox_rm69299 *ctx)
+{
+   int ret;
+
+   gpiod_set_value(ctx->reset_gpio, 0);
+
+   ret = regulator_set_load(ctx->supplies[0].consumer, 80);
+
+   if (ret) {
+   DRM_DEV_ERROR(ctx->dev,
+   "regulator_set_load failed %d\n", ret);
+   return ret;
+   }
+
+   ret = regulator_set_load(ctx->supplies[1].consumer, 80);
+
+   if (ret) {
+   DRM_DEV_ERROR(ctx->dev,
+   "regulator_set_load failed 

[PATCH v2 1/2] dt-bindings: display: add sc7180 panel variant

2020-01-08 Thread Harigovindan P
Add a compatible string to support sc7180 panel version.

Changes in v1:
-Added a compatible string to support sc7180 panel version.
Changes in v2:
-Removed unwanted properties from description.
-Creating source files without execute permissions(Rob Herring).

Signed-off-by: Harigovindan P 
---
 .../bindings/display/visionox,rm69299.txt  | 48 ++
 1 file changed, 48 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/visionox,rm69299.txt

diff --git a/Documentation/devicetree/bindings/display/visionox,rm69299.txt 
b/Documentation/devicetree/bindings/display/visionox,rm69299.txt
new file mode 100644
index 000..d7bbd5f
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/visionox,rm69299.txt
@@ -0,0 +1,48 @@
+Visionox model RM69299 DSI display driver
+
+The Visionox RM69299 is a generic display driver, currently only configured
+for use in the 1080p display on the Qualcomm SC7180 MTP board.
+
+Required properties:
+- compatible: should be "visionox,rm69299-1080p-display"
+- vdda-supply: phandle of the regulator that provides the supply voltage
+  Power IC supply
+- vdd3p3-supply: phandle of the regulator that provides the supply voltage
+  Power IC supply
+- reset-gpios: phandle of gpio for reset line
+  This should be 8mA, gpio can be configured using mux, pinctrl, pinctrl-names
+  (active low)
+- ports: This device has one video port driven by one DSI. Their connections
+  are modeled using the OF graph bindings specified in
+  Documentation/devicetree/bindings/graph.txt.
+  - port@0: DSI input port driven by master DSI
+
+Example:
+
+   dsi@ae94000 {
+   panel@0 {
+   compatible = "visionox,rm69299-1080p-display";
+   reg = <0>;
+
+   vdda-supply = <_pp1800_l8c>;
+   vdd3p3-supply = <_pp2800_l18a>;
+
+   pinctrl-names = "default", "suspend";
+   pinctrl-0 = <_pins_default>;
+   pinctrl-1 = <_pins_default>;
+
+   reset-gpios = <_gpios 3 0>;
+
+   ports {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   port@0 {
+   reg = <0>;
+   panel0_in: endpoint {
+   remote-endpoint = <_out>;
+   };
+   };
+   };
+   };
+   };
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2 0/2] Add support for rm69299 Visionox panel driver and add devicetree bindings for visionox panel

2020-01-08 Thread Harigovindan P
Current patchset adds support for rm69299 visionox panel driver used 
in MSM reference platforms. The visionox panel driver supports a 
resolution of 1080x2248 with 4 lanes and supports only single DSI mode.

Current patchset is tested on actual panel.

Changes in v1:
-add devicetree bindings for visionox panel.
-Split out panel driver patch from dsi config changes(Rob Clark).
-Remove unrelated code(Stephen Boyd).
-Remove static arrays to make regulator setup
 open coded in probe(Stephen Boyd).
-Remove pre-assigning variables(Stephen Boyd).
-Inline panel_add function into probe(Stephen Boyd).
-Use mipi_dsi_dcs_write directly(Rob Clark).
-Remove qcom_rm69299_1080p_panel_magic_cmds array(Rob Clark).
Changes in v2:
-Removed unwanted properties from description.
-Creating source files without execute permissions(Rob Herring).
-Dropping redundant space in Kconfig(Sam Ravnborg).
-Changing structure for include files(Sam Ravnborg).
-Removing backlight related code and functions(Sam Ravnborg).
-Removing repeated printing of error message(Sam Ravnborg).
-Adding drm_connector as an argument for get_modes function.

Harigovindan P (2):
  dt-bindings: display: add sc7180 panel variant
  drm/panel: add support for rm69299 visionox panel driver

 .../bindings/display/visionox,rm69299.txt  |  48 +++
 drivers/gpu/drm/panel/Kconfig  |   8 +
 drivers/gpu/drm/panel/Makefile |   1 +
 drivers/gpu/drm/panel/panel-visionox-rm69299.c | 370 +++
 4 files changed, 427 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/visionox,rm69299.txt
 create mode 100644 drivers/gpu/drm/panel/panel-visionox-rm69299.c

-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[v2] drm/msm: update LANE_CTRL register value from default value

2020-01-07 Thread Harigovindan P
LANE_CTRL register in latest version of DSI controller (v2.2)
has additional functionality introduced to enable/disable HS
signalling with default value set to enabled. To accommodate this
change, LANE_CTRL register should be read and bit wise ORed to enable
non continuous clock mode. Without this change, if register is written
directly, HS signalling will be disabled resulting in black screen.

Changes in v1:
-Update LANE_CTRL register value
Changes in v2:
-Changing commit message accordingly.

Signed-off-by: Harigovindan P 
---
 drivers/gpu/drm/msm/dsi/dsi_host.c | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c 
b/drivers/gpu/drm/msm/dsi/dsi_host.c
index e6289a3..d3c5233 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_host.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
@@ -816,7 +816,7 @@ static void dsi_ctrl_config(struct msm_dsi_host *msm_host, 
bool enable,
u32 flags = msm_host->mode_flags;
enum mipi_dsi_pixel_format mipi_fmt = msm_host->format;
const struct msm_dsi_cfg_handler *cfg_hnd = msm_host->cfg_hnd;
-   u32 data = 0;
+   u32 data = 0, lane_ctrl = 0;
 
if (!enable) {
dsi_write(msm_host, REG_DSI_CTRL, 0);
@@ -904,9 +904,11 @@ static void dsi_ctrl_config(struct msm_dsi_host *msm_host, 
bool enable,
dsi_write(msm_host, REG_DSI_LANE_SWAP_CTRL,
  DSI_LANE_SWAP_CTRL_DLN_SWAP_SEL(msm_host->dlane_swap));
 
-   if (!(flags & MIPI_DSI_CLOCK_NON_CONTINUOUS))
+   if (!(flags & MIPI_DSI_CLOCK_NON_CONTINUOUS)) {
+   lane_ctrl = dsi_read(msm_host, REG_DSI_LANE_CTRL);
dsi_write(msm_host, REG_DSI_LANE_CTRL,
-   DSI_LANE_CTRL_CLKLN_HS_FORCE_REQUEST);
+   lane_ctrl | DSI_LANE_CTRL_CLKLN_HS_FORCE_REQUEST);
+   }
 
data |= DSI_CTRL_ENABLE;
 
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[v2] drm/msm: add support for 2.4.1 DSI version for sc7180 soc

2020-01-06 Thread Harigovindan P
Modify commit text to indicate DSI version and SOC detail

Changes in v1:
-Modify commit text to indicate DSI version and SOC detail(Jeffrey 
Hugo).
-Splitting visionox panel driver code out into a
 different patch(set), since panel drivers are merged into
 drm-next via a different tree(Rob Clark).
Changes in v2:
-Update commit text accordingly(Matthias Kaehlcke).

Signed-off-by: Harigovindan P 
---
 drivers/gpu/drm/msm/dsi/dsi_cfg.c | 21 +
 drivers/gpu/drm/msm/dsi/dsi_cfg.h |  1 +
 2 files changed, 22 insertions(+)

diff --git a/drivers/gpu/drm/msm/dsi/dsi_cfg.c 
b/drivers/gpu/drm/msm/dsi/dsi_cfg.c
index b7b7c1a..7b967dd 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_cfg.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_cfg.c
@@ -133,6 +133,10 @@ static const char * const dsi_sdm845_bus_clk_names[] = {
"iface", "bus",
 };
 
+static const char * const dsi_sc7180_bus_clk_names[] = {
+   "iface", "bus",
+};
+
 static const struct msm_dsi_config sdm845_dsi_cfg = {
.io_offset = DSI_6G_REG_SHIFT,
.reg_cfg = {
@@ -147,6 +151,20 @@ static const struct msm_dsi_config sdm845_dsi_cfg = {
.num_dsi = 2,
 };
 
+static const struct msm_dsi_config sc7180_dsi_cfg = {
+   .io_offset = DSI_6G_REG_SHIFT,
+   .reg_cfg = {
+   .num = 1,
+   .regs = {
+   {"vdda", 21800, 4 },/* 1.2 V */
+   },
+   },
+   .bus_clk_names = dsi_sc7180_bus_clk_names,
+   .num_bus_clks = ARRAY_SIZE(dsi_sc7180_bus_clk_names),
+   .io_start = { 0xae94000 },
+   .num_dsi = 1,
+};
+
 const static struct msm_dsi_host_cfg_ops msm_dsi_v2_host_ops = {
.link_clk_enable = dsi_link_clk_enable_v2,
.link_clk_disable = dsi_link_clk_disable_v2,
@@ -201,6 +219,9 @@ static const struct msm_dsi_cfg_handler dsi_cfg_handlers[] 
= {
_dsi_cfg, _dsi_6g_v2_host_ops},
{MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V2_2_1,
_dsi_cfg, _dsi_6g_v2_host_ops},
+   {MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V2_4_1,
+   _dsi_cfg, _dsi_6g_v2_host_ops},
+
 };
 
 const struct msm_dsi_cfg_handler *msm_dsi_cfg_get(u32 major, u32 minor)
diff --git a/drivers/gpu/drm/msm/dsi/dsi_cfg.h 
b/drivers/gpu/drm/msm/dsi/dsi_cfg.h
index e2b7a7d..9919536 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_cfg.h
+++ b/drivers/gpu/drm/msm/dsi/dsi_cfg.h
@@ -19,6 +19,7 @@
 #define MSM_DSI_6G_VER_MINOR_V1_4_10x10040001
 #define MSM_DSI_6G_VER_MINOR_V2_2_00x2000
 #define MSM_DSI_6G_VER_MINOR_V2_2_10x20020001
+#define MSM_DSI_6G_VER_MINOR_V2_4_10x20040001
 
 #define MSM_DSI_V2_VER_MINOR_8064  0x0
 
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[v1] drm/msm: update LANE_CTRL register value from default value

2019-12-24 Thread Harigovindan P
Updating REG_DSI_LANE_CTRL register value by reading default
register value and writing it back using bitwise OR with
DSI_LANE_CTRL_CLKLN_HS_FORCE_REQUEST. This works for all panels.

Signed-off-by: Harigovindan P 
---
 drivers/gpu/drm/msm/dsi/dsi_host.c | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c 
b/drivers/gpu/drm/msm/dsi/dsi_host.c
index e6289a3..d3c5233 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_host.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
@@ -816,7 +816,7 @@ static void dsi_ctrl_config(struct msm_dsi_host *msm_host, 
bool enable,
u32 flags = msm_host->mode_flags;
enum mipi_dsi_pixel_format mipi_fmt = msm_host->format;
const struct msm_dsi_cfg_handler *cfg_hnd = msm_host->cfg_hnd;
-   u32 data = 0;
+   u32 data = 0, lane_ctrl = 0;
 
if (!enable) {
dsi_write(msm_host, REG_DSI_CTRL, 0);
@@ -904,9 +904,11 @@ static void dsi_ctrl_config(struct msm_dsi_host *msm_host, 
bool enable,
dsi_write(msm_host, REG_DSI_LANE_SWAP_CTRL,
  DSI_LANE_SWAP_CTRL_DLN_SWAP_SEL(msm_host->dlane_swap));
 
-   if (!(flags & MIPI_DSI_CLOCK_NON_CONTINUOUS))
+   if (!(flags & MIPI_DSI_CLOCK_NON_CONTINUOUS)) {
+   lane_ctrl = dsi_read(msm_host, REG_DSI_LANE_CTRL);
dsi_write(msm_host, REG_DSI_LANE_CTRL,
-   DSI_LANE_CTRL_CLKLN_HS_FORCE_REQUEST);
+   lane_ctrl | DSI_LANE_CTRL_CLKLN_HS_FORCE_REQUEST);
+   }
 
data |= DSI_CTRL_ENABLE;
 
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v1 0/2] Add suppport for rm69299 Visionox panel driver and add devicetree bindings for visionox panel.

2019-11-30 Thread Harigovindan P
Current patchset adds support for rm69299 visionox panel driver used in MSM 
reference platforms.
The visionox panel driver supports a resolution of 1080x2248 with 4 lanes and 
supports only single DSI mode.

Current patchset is tested on actual panel.

Changes in v1:
-add devicetree bindings for visionox panel.
-Split out panel driver patch from dsi config changes(Rob Clark).
-Remove unrelated code(Stephen Boyd).
-Remove static arrays to make regulator setup
 open coded in probe(Stephen Boyd).
-Remove pre-assigning variables(Stephen Boyd).
-Inline panel_add function into probe(Stephen Boyd).
-Use mipi_dsi_dcs_write directly(Rob Clark).
-Remove qcom_rm69299_1080p_panel_magic_cmds array(Rob Clark).

Harigovindan P (2):
  dt-bindings: display: add sc7180 panel variant
  drm/panel: add support for rm69299 visionox panel driver

 .../bindings/display/visionox,rm69299.txt  |  68 
 drivers/gpu/drm/panel/Kconfig  |   9 +
 drivers/gpu/drm/panel/Makefile |   1 +
 drivers/gpu/drm/panel/panel-visionox-rm69299.c | 412 +
 4 files changed, 490 insertions(+)
 create mode 100755 
Documentation/devicetree/bindings/display/visionox,rm69299.txt
 create mode 100755 drivers/gpu/drm/panel/panel-visionox-rm69299.c

-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH v1 1/2] dt-bindings: display: add sc7180 panel variant

2019-11-30 Thread Harigovindan P
Add a compatible string to support sc7180 panel version.

Signed-off-by: Harigovindan P 
---
 .../bindings/display/visionox,rm69299.txt  | 68 ++
 1 file changed, 68 insertions(+)
 create mode 100755 
Documentation/devicetree/bindings/display/visionox,rm69299.txt

diff --git a/Documentation/devicetree/bindings/display/visionox,rm69299.txt 
b/Documentation/devicetree/bindings/display/visionox,rm69299.txt
new file mode 100755
index 000..4622191
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/visionox,rm69299.txt
@@ -0,0 +1,68 @@
+Visionox model RM69299 DSI display driver
+
+The Visionox RM69299 is a generic display driver, currently only configured
+for use in the 1080p display on the Qualcomm SC7180 MTP board.
+
+Required properties:
+- compatible: should be "visionox,rm69299-1080p-display"
+- vdda-supply: phandle of the regulator that provides the supply voltage
+  Power IC supply
+- vdd3p3-supply: phandle of the regulator that provides the supply voltage
+  Power IC supply
+- reset-gpios: phandle of gpio for reset line
+  This should be 8mA, gpio can be configured using mux, pinctrl, pinctrl-names
+  (active low)
+- mode-gpios: phandle of the gpio for choosing the mode of the display
+  for single DSI
+- ports: This device has one video port driven by one DSI. Their connections
+  are modeled using the OF graph bindings specified in
+  Documentation/devicetree/bindings/graph.txt.
+  - port@0: DSI input port driven by master DSI
+
+Example:
+
+   dsi@ae94000 {
+   panel@0 {
+   compatible = "visionox,rm69299-1080p-display";
+   reg = <0>;
+
+   vdda-supply = <_pp1800_l8c>;
+   vdd3p3-supply = <_pp2800_l18a>;
+
+   pinctrl-names = "default", "suspend";
+   pinctrl-0 = <_pins_default>;
+   pinctrl-1 = <_pins_default>;
+
+   reset-gpios = <_gpios 3 0>;
+
+   display-timings {
+   timing0: timing-0 {
+   /* originally
+* 268316160 Mhz,
+* but value below fits
+* better w/ downstream
+*/
+   clock-frequency = <158695680>;
+   hactive = <1080>;
+   vactive = <2248>;
+   hfront-porch = <26>;
+   hback-porch = <36>;
+   hsync-len = <2>;
+   vfront-porch = <56>;
+   vback-porch = <4>;
+   vsync-len = <4>;
+   };
+   };
+
+   ports {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   port@0 {
+   reg = <0>;
+   panel0_in: endpoint {
+   remote-endpoint = <_out>;
+   };
+   };
+   };
+   };
+   };
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH v1 2/2] drm/panel: add support for rm69299 visionox panel driver

2019-11-30 Thread Harigovindan P
Add support for Visionox panel driver.

Changes in v1:
-Split out panel driver patch from dsi config changes(Rob Clark).
-Remove unrelated code(Stephen Boyd).
-Remove static arrays to make regulator setup open coded
 in probe(Stephen Boyd).
-Remove pre-assigning variables(Stephen Boyd).
-Inline panel_add function into probe(Stephen Boyd).
-Use mipi_dsi_dcs_write directly(Rob Clark).
-Remove qcom_rm69299_1080p_panel_magic_cmds array(Rob Clark).

Signed-off-by: Harigovindan P 
---
 drivers/gpu/drm/panel/Kconfig  |   9 +
 drivers/gpu/drm/panel/Makefile |   1 +
 drivers/gpu/drm/panel/panel-visionox-rm69299.c | 412 +
 3 files changed, 422 insertions(+)
 create mode 100755 drivers/gpu/drm/panel/panel-visionox-rm69299.c

diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index f152bc4..c06c403 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -355,4 +355,13 @@ config DRM_PANEL_TRULY_NT35597_WQXGA
help
  Say Y here if you want to enable support for Truly NT35597 WQXGA Dual 
DSI
  Video Mode panel
+
+config DRM_PANEL_VISIONOX_RM69299
+   tristate "Visionox RM69299"
+   depends on OF
+   depends on DRM_MIPI_DSI
+   help
+ Say Y here if you want to enable support for Visionox
+ RM69299  DSI Video Mode panel.
+
 endmenu
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index b6cd39f..6f1e4c6 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -38,3 +38,4 @@ obj-$(CONFIG_DRM_PANEL_TPO_TD028TTEC1) += 
panel-tpo-td028ttec1.o
 obj-$(CONFIG_DRM_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o
 obj-$(CONFIG_DRM_PANEL_TPO_TPG110) += panel-tpo-tpg110.o
 obj-$(CONFIG_DRM_PANEL_TRULY_NT35597_WQXGA) += panel-truly-nt35597.o
+obj-$(CONFIG_DRM_PANEL_VISIONOX_RM69299) += panel-visionox-rm69299.o
diff --git a/drivers/gpu/drm/panel/panel-visionox-rm69299.c 
b/drivers/gpu/drm/panel/panel-visionox-rm69299.c
new file mode 100755
index 000..da86714
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-visionox-rm69299.c
@@ -0,0 +1,412 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2019, The Linux Foundation. All rights reserved.
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+struct rm69299_config {
+   unsigned long width_mm;
+   unsigned long height_mm;
+   const char *panel_name;
+   u32 num_on_cmds;
+   const struct drm_display_mode *dm;
+};
+
+struct visionox_rm69299 {
+   struct device *dev;
+   struct drm_panel panel;
+
+   struct regulator_bulk_data supplies[2];
+
+   struct gpio_desc *reset_gpio;
+
+   struct backlight_device *backlight;
+
+   struct mipi_dsi_device *dsi;
+   const struct rm69299_config *config;
+   bool prepared;
+   bool enabled;
+};
+
+static inline struct visionox_rm69299 *panel_to_ctx(struct drm_panel *panel)
+{
+   return container_of(panel, struct visionox_rm69299, panel);
+}
+
+static int visionox_35597_power_on(struct visionox_rm69299 *ctx)
+{
+   int ret;
+
+   ret = regulator_set_load(ctx->supplies[0].consumer, 32000);
+   if (ret)
+   return ret;
+
+   ret = regulator_set_load(ctx->supplies[1].consumer, 13200);
+   if (ret)
+   return ret;
+
+   ret = regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
+   if (ret < 0)
+   return ret;
+
+   /*
+* Reset sequence of visionox panel requires the panel to be
+* out of reset for 10ms, followed by being held in reset
+* for 10ms and then out again
+*/
+   gpiod_set_value(ctx->reset_gpio, 1);
+   usleep_range(1, 2);
+   gpiod_set_value(ctx->reset_gpio, 0);
+   usleep_range(1, 2);
+   gpiod_set_value(ctx->reset_gpio, 1);
+   usleep_range(1, 2);
+
+   return 0;
+}
+
+static int visionox_rm69299_power_off(struct visionox_rm69299 *ctx)
+{
+   int ret;
+
+   gpiod_set_value(ctx->reset_gpio, 0);
+
+   ret = regulator_set_load(ctx->supplies[0].consumer, 80);
+
+   if (ret) {
+   DRM_DEV_ERROR(ctx->dev,
+   "regulator_set_load failed %d\n", ret);
+   return ret;
+   }
+
+   ret = regulator_set_load(ctx->supplies[1].consumer, 80);
+
+   if (ret) {
+   DRM_DEV_ERROR(ctx->dev,
+   "regulator_set_load failed %d\n", ret);
+   return ret;
+   }
+
+   ret = regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
+   if (ret) {
+   DRM_DEV_ERROR(ctx->dev,
+   "regulator_bulk_disable failed %d\n", ret);
+  

[PATCH v1] drm/msm: add support for 2.4.1 DSI version for sc7180 soc

2019-11-30 Thread Harigovindan P
Changes in v1:
-Modify commit text to indicate DSI version and SOC detail(Jeffrey 
Hugo).
-Splitting visionox panel driver code out into a
 different patch(set), since panel drivers are merged into
 drm-next via a different tree(Rob Clark).

Signed-off-by: Harigovindan P 
---
 drivers/gpu/drm/msm/dsi/dsi_cfg.c | 21 +
 drivers/gpu/drm/msm/dsi/dsi_cfg.h |  1 +
 2 files changed, 22 insertions(+)

diff --git a/drivers/gpu/drm/msm/dsi/dsi_cfg.c 
b/drivers/gpu/drm/msm/dsi/dsi_cfg.c
index b7b7c1a..7b967dd 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_cfg.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_cfg.c
@@ -133,6 +133,10 @@ static const char * const dsi_sdm845_bus_clk_names[] = {
"iface", "bus",
 };
 
+static const char * const dsi_sc7180_bus_clk_names[] = {
+   "iface", "bus",
+};
+
 static const struct msm_dsi_config sdm845_dsi_cfg = {
.io_offset = DSI_6G_REG_SHIFT,
.reg_cfg = {
@@ -147,6 +151,20 @@ static const struct msm_dsi_config sdm845_dsi_cfg = {
.num_dsi = 2,
 };
 
+static const struct msm_dsi_config sc7180_dsi_cfg = {
+   .io_offset = DSI_6G_REG_SHIFT,
+   .reg_cfg = {
+   .num = 1,
+   .regs = {
+   {"vdda", 21800, 4 },/* 1.2 V */
+   },
+   },
+   .bus_clk_names = dsi_sc7180_bus_clk_names,
+   .num_bus_clks = ARRAY_SIZE(dsi_sc7180_bus_clk_names),
+   .io_start = { 0xae94000 },
+   .num_dsi = 1,
+};
+
 const static struct msm_dsi_host_cfg_ops msm_dsi_v2_host_ops = {
.link_clk_enable = dsi_link_clk_enable_v2,
.link_clk_disable = dsi_link_clk_disable_v2,
@@ -201,6 +219,9 @@ static const struct msm_dsi_cfg_handler dsi_cfg_handlers[] 
= {
_dsi_cfg, _dsi_6g_v2_host_ops},
{MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V2_2_1,
_dsi_cfg, _dsi_6g_v2_host_ops},
+   {MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V2_4_1,
+   _dsi_cfg, _dsi_6g_v2_host_ops},
+
 };
 
 const struct msm_dsi_cfg_handler *msm_dsi_cfg_get(u32 major, u32 minor)
diff --git a/drivers/gpu/drm/msm/dsi/dsi_cfg.h 
b/drivers/gpu/drm/msm/dsi/dsi_cfg.h
index e2b7a7d..9919536 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_cfg.h
+++ b/drivers/gpu/drm/msm/dsi/dsi_cfg.h
@@ -19,6 +19,7 @@
 #define MSM_DSI_6G_VER_MINOR_V1_4_10x10040001
 #define MSM_DSI_6G_VER_MINOR_V2_2_00x2000
 #define MSM_DSI_6G_VER_MINOR_V2_2_10x20020001
+#define MSM_DSI_6G_VER_MINOR_V2_4_10x20040001
 
 #define MSM_DSI_V2_VER_MINOR_8064  0x0
 
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH v1 1/2] drm/panel: add support for rm69299 visionox panel driver

2019-11-15 Thread Harigovindan P
Add support for Visionox panel driver.

Signed-off-by: Harigovindan P 
---
 drivers/gpu/drm/panel/Kconfig  |   9 +
 drivers/gpu/drm/panel/Makefile |   1 +
 drivers/gpu/drm/panel/panel-visionox-rm69299.c | 478 +
 3 files changed, 488 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-visionox-rm69299.c

diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index f152bc4..c06c403 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -355,4 +355,13 @@ config DRM_PANEL_TRULY_NT35597_WQXGA
help
  Say Y here if you want to enable support for Truly NT35597 WQXGA Dual 
DSI
  Video Mode panel
+
+config DRM_PANEL_VISIONOX_RM69299
+   tristate "Visionox RM69299"
+   depends on OF
+   depends on DRM_MIPI_DSI
+   help
+ Say Y here if you want to enable support for Visionox
+ RM69299  DSI Video Mode panel.
+
 endmenu
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index b6cd39f..6f1e4c6 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -38,3 +38,4 @@ obj-$(CONFIG_DRM_PANEL_TPO_TD028TTEC1) += 
panel-tpo-td028ttec1.o
 obj-$(CONFIG_DRM_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o
 obj-$(CONFIG_DRM_PANEL_TPO_TPG110) += panel-tpo-tpg110.o
 obj-$(CONFIG_DRM_PANEL_TRULY_NT35597_WQXGA) += panel-truly-nt35597.o
+obj-$(CONFIG_DRM_PANEL_VISIONOX_RM69299) += panel-visionox-rm69299.o
diff --git a/drivers/gpu/drm/panel/panel-visionox-rm69299.c 
b/drivers/gpu/drm/panel/panel-visionox-rm69299.c
new file mode 100644
index 000..faf6d05
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-visionox-rm69299.c
@@ -0,0 +1,478 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2019, The Linux Foundation. All rights reserved.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+static const char * const regulator_names[] = {
+   "vdda",
+   "vdd3p3",
+};
+
+static unsigned long const regulator_enable_loads[] = {
+   32000,
+   13200,
+};
+
+static unsigned long const regulator_disable_loads[] = {
+   80,
+   80,
+};
+
+struct cmd_set {
+   u8 commands[4];
+   u8 size;
+};
+
+struct rm69299_config {
+   u32 width_mm;
+   u32 height_mm;
+   const char *panel_name;
+   const struct cmd_set *panel_on_cmds;
+   u32 num_on_cmds;
+   const struct drm_display_mode *dm;
+};
+
+struct visionox_rm69299 {
+   struct device *dev;
+   struct drm_panel panel;
+
+   struct regulator_bulk_data supplies[ARRAY_SIZE(regulator_names)];
+
+   struct gpio_desc *reset_gpio;
+
+   struct backlight_device *backlight;
+
+   struct mipi_dsi_device *dsi;
+   const struct rm69299_config *config;
+   bool prepared;
+   bool enabled;
+};
+
+static inline struct visionox_rm69299 *panel_to_ctx(struct drm_panel *panel)
+{
+   return container_of(panel, struct visionox_rm69299, panel);
+}
+
+static const struct cmd_set qcom_rm69299_1080p_panel_magic_cmds[] = {
+   { { 0xfe, 0x00 }, 2 },
+   { { 0xc2, 0x08 }, 2 },
+   { { 0x35, 0x00 }, 2 },
+   { { 0x51, 0xff }, 2 },
+};
+
+static int visionox_dcs_write(struct drm_panel *panel, u32 command)
+{
+   struct visionox_rm69299 *ctx = panel_to_ctx(panel);
+   int i = 0, ret;
+
+   ret = mipi_dsi_dcs_write(ctx->dsi, command, NULL, 0);
+   if (ret < 0) {
+   DRM_DEV_ERROR(ctx->dev,
+   "cmd 0x%x failed for dsi = %d\n",
+   command, i);
+   }
+
+   return ret;
+}
+
+static int visionox_dcs_write_buf(struct drm_panel *panel,
+   u32 size, const u8 *buf)
+{
+   struct visionox_rm69299 *ctx = panel_to_ctx(panel);
+   int ret = 0;
+   int i = 0;
+
+   ret = mipi_dsi_dcs_write_buffer(ctx->dsi, buf, size);
+   if (ret < 0) {
+   DRM_DEV_ERROR(ctx->dev,
+   "failed to tx cmd [%d], err: %d\n", i, ret);
+   return ret;
+   }
+
+   return ret;
+}
+
+static int visionox_35597_power_on(struct visionox_rm69299 *ctx)
+{
+   int ret, i;
+   for (i = 0; i < ARRAY_SIZE(ctx->supplies); i++) {
+   ret = regulator_set_load(ctx->supplies[i].consumer,
+   regulator_enable_loads[i]);
+   if (ret)
+   return ret;
+   }
+
+   ret = regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
+   if (ret < 0)
+   return ret;
+
+   /*
+* Reset sequence of visionox panel requires the panel to be
+* out of reset for 10ms, followed by being held in reset
+* for 10ms and then out again
+*/
+   gpiod_set_

[PATCH v1 0/2] Add suppport for rm69299 Visionox panel driver and add DSI config to support DSI version

2019-11-15 Thread Harigovindan P
Current patchset adds support for rm69299 visionox panel driver used in MSM 
reference platforms 
and also adds DSI config that supports the respective DSI version.

The visionox panel driver supports a resolution of 1080x2248 with 4 lanes and 
supports only single DSI mode.

Current patchset is tested on actual panel.

Harigovindan P (2):
  drm/panel: add support for rm69299 visionox panel driver
  drm/msm: add DSI config changes to support DSI version

 drivers/gpu/drm/msm/dsi/dsi_cfg.c  |  21 ++
 drivers/gpu/drm/msm/dsi/dsi_cfg.h  |   1 +
 drivers/gpu/drm/panel/Kconfig  |   9 +
 drivers/gpu/drm/panel/Makefile |   1 +
 drivers/gpu/drm/panel/panel-visionox-rm69299.c | 478 +
 5 files changed, 510 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-visionox-rm69299.c

-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH v1 2/2] drm/msm: add DSI config changes to support DSI version

2019-11-15 Thread Harigovindan P
Add DSI config changes to support DSI version.

Signed-off-by: Harigovindan P 
---
 drivers/gpu/drm/msm/dsi/dsi_cfg.c | 21 +
 drivers/gpu/drm/msm/dsi/dsi_cfg.h |  1 +
 2 files changed, 22 insertions(+)

diff --git a/drivers/gpu/drm/msm/dsi/dsi_cfg.c 
b/drivers/gpu/drm/msm/dsi/dsi_cfg.c
index b7b7c1a..d2c4592 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_cfg.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_cfg.c
@@ -133,6 +133,10 @@ static const char * const dsi_sdm845_bus_clk_names[] = {
"iface", "bus",
 };
 
+static const char * const dsi_sc7180_bus_clk_names[] = {
+"iface", "bus",
+};
+
 static const struct msm_dsi_config sdm845_dsi_cfg = {
.io_offset = DSI_6G_REG_SHIFT,
.reg_cfg = {
@@ -147,6 +151,20 @@ static const struct msm_dsi_config sdm845_dsi_cfg = {
.num_dsi = 2,
 };
 
+static const struct msm_dsi_config sc7180_dsi_cfg = {
+   .io_offset = DSI_6G_REG_SHIFT,
+   .reg_cfg = {
+   .num = 1,
+   .regs = {
+   {"vdda", 21800, 4 },/* 1.2 V */
+   },
+   },
+   .bus_clk_names = dsi_sc7180_bus_clk_names,
+   .num_bus_clks = ARRAY_SIZE(dsi_sc7180_bus_clk_names),
+   .io_start = { 0xae94000 },
+   .num_dsi = 1,
+};
+
 const static struct msm_dsi_host_cfg_ops msm_dsi_v2_host_ops = {
.link_clk_enable = dsi_link_clk_enable_v2,
.link_clk_disable = dsi_link_clk_disable_v2,
@@ -201,6 +219,9 @@ static const struct msm_dsi_cfg_handler dsi_cfg_handlers[] 
= {
_dsi_cfg, _dsi_6g_v2_host_ops},
{MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V2_2_1,
_dsi_cfg, _dsi_6g_v2_host_ops},
+   {MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V2_4_1,
+   _dsi_cfg, _dsi_6g_v2_host_ops},
+
 };
 
 const struct msm_dsi_cfg_handler *msm_dsi_cfg_get(u32 major, u32 minor)
diff --git a/drivers/gpu/drm/msm/dsi/dsi_cfg.h 
b/drivers/gpu/drm/msm/dsi/dsi_cfg.h
index e2b7a7d..9919536 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_cfg.h
+++ b/drivers/gpu/drm/msm/dsi/dsi_cfg.h
@@ -19,6 +19,7 @@
 #define MSM_DSI_6G_VER_MINOR_V1_4_10x10040001
 #define MSM_DSI_6G_VER_MINOR_V2_2_00x2000
 #define MSM_DSI_6G_VER_MINOR_V2_2_10x20020001
+#define MSM_DSI_6G_VER_MINOR_V2_4_10x20040001
 
 #define MSM_DSI_V2_VER_MINOR_8064  0x0
 
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel