* [PATCH 1/3] dt-bindings: vendor-prefixes: Add lxd
@ 2024-10-23 12:44 Rouven Czerwinski
2024-10-23 12:44 ` [PATCH 2/3] dt-bindings: display: panel: add YAML schema for LXD M9189A Rouven Czerwinski
2024-10-23 12:44 ` [PATCH 3/3] drm/panel: add Fitipower EK79007AD3 panel driver Rouven Czerwinski
0 siblings, 2 replies; 7+ messages in thread
From: Rouven Czerwinski @ 2024-10-23 12:44 UTC (permalink / raw)
To: Rob Herring, devicetree, linux-kernel
Cc: kernel, Rouven Czerwinski, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Add vendor prefix for LXD Research & Display, LLC.
Link: https://www.lxdinc.com/
Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
---
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 b320a39de7fe4..83d9e49eeb869 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.yaml
+++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml
@@ -872,6 +872,8 @@ patternProperties:
description: Liebherr-Werk Nenzing GmbH
"^lxa,.*":
description: Linux Automation GmbH
+ "^lxd,.*":
+ description: LXD Research & Display, LLC
"^m5stack,.*":
description: M5Stack
"^macnica,.*":
base-commit: c2ee9f594da826bea183ed14f2cc029c719bf4da
--
2.39.5
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/3] dt-bindings: display: panel: add YAML schema for LXD M9189A
2024-10-23 12:44 [PATCH 1/3] dt-bindings: vendor-prefixes: Add lxd Rouven Czerwinski
@ 2024-10-23 12:44 ` Rouven Czerwinski
2024-10-23 13:23 ` Rouven Czerwinski
2024-10-23 14:46 ` Rob Herring (Arm)
2024-10-23 12:44 ` [PATCH 3/3] drm/panel: add Fitipower EK79007AD3 panel driver Rouven Czerwinski
1 sibling, 2 replies; 7+ messages in thread
From: Rouven Czerwinski @ 2024-10-23 12:44 UTC (permalink / raw)
To: Jessica Zhang, Sam Ravnborg, dri-devel, devicetree, linux-kernel
Cc: kernel, Rouven Czerwinski, Neil Armstrong, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Daniel Vetter,
Rob Herring, Krzysztof Kozlowski, Conor Dooley
The LXD M9189A is a 1024x600 MIPI-DSI panel.
Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
---
.../bindings/display/panel/lxd,m9189a.yaml | 64 +++++++++++++++++++
1 file changed, 64 insertions(+)
create mode 100644 Documentation/devicetree/bindings/display/panel/lxd,m9189a.yaml
diff --git a/Documentation/devicetree/bindings/display/panel/lxd,m9189a.yaml b/Documentation/devicetree/bindings/display/panel/lxd,m9189a.yaml
new file mode 100644
index 0000000000000..49cee8865cae1
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/panel/lxd,m9189a.yaml
@@ -0,0 +1,64 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/panel/lxd,m9189a.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: LXD M9189 DSI Display Panel
+
+maintainers:
+ - Rouven Czerwinski <r.czerwinski@pengutronix.de>
+
+properties:
+ compatible:
+ const: ronbo,rb070d30
+
+ reg:
+ maxItems: 1
+
+ standby-gpios:
+ description: GPIO used for the standby pin
+ maxItems: 1
+
+ reset-gpios:
+ description: GPIO used for the reset pin
+ maxItems: 1
+
+ vdd-supply:
+ description: Power regulator
+
+ backlight:
+ description: Backlight used by the panel
+ $ref: /schemas/types.yaml#/definitions/phandle
+
+required:
+ - compatible
+ - reg
+ - standby-gpios
+ - reset-gpios
+ - vdd-supply
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/gpio/gpio.h>
+
+ dsi {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ panel@0 {
+ compatible = "lxd,m9189a";
+ reg = <0>;
+ backlight = <&backlight>;
+ reset-gpios = <&gpio3 25 GPIO_ACTIVE_LOW>;
+ standby-gpios = <&gpio5 22 GPIO_ACTIVE_LOW>;
+
+ port {
+ mipi_panel_in: endpoint {
+ remote-endpoint = <&mipi_dsi_out>;
+ };
+ };
+ };
+ };
--
2.39.5
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 3/3] drm/panel: add Fitipower EK79007AD3 panel driver
2024-10-23 12:44 [PATCH 1/3] dt-bindings: vendor-prefixes: Add lxd Rouven Czerwinski
2024-10-23 12:44 ` [PATCH 2/3] dt-bindings: display: panel: add YAML schema for LXD M9189A Rouven Czerwinski
@ 2024-10-23 12:44 ` Rouven Czerwinski
2024-10-25 0:35 ` Dmitry Baryshkov
2024-10-25 14:34 ` Dan Carpenter
1 sibling, 2 replies; 7+ messages in thread
From: Rouven Czerwinski @ 2024-10-23 12:44 UTC (permalink / raw)
To: Jessica Zhang, Sam Ravnborg, linux-kernel, dri-devel
Cc: kernel, Rouven Czerwinski, Neil Armstrong, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Daniel Vetter
The LXD M9189A panel is based on the EK79007AD3 DSI display controller.
It currently supports only 4 lane operation.
Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
---
MAINTAINERS | 6 +
drivers/gpu/drm/panel/Kconfig | 9 +
drivers/gpu/drm/panel/Makefile | 1 +
drivers/gpu/drm/panel/panel-lxd-m9189a.c | 261 +++++++++++++++++++++++
4 files changed, 277 insertions(+)
create mode 100644 drivers/gpu/drm/panel/panel-lxd-m9189a.c
diff --git a/MAINTAINERS b/MAINTAINERS
index e9659a5a7fb33..e4d749b403c28 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -7179,6 +7179,12 @@ F: Documentation/devicetree/bindings/display/lvds.yaml
F: Documentation/devicetree/bindings/display/panel/panel-lvds.yaml
F: drivers/gpu/drm/panel/panel-lvds.c
+DRM DRIVER FOR LXD M9189A PANELS
+M: Rouven Czerwinski <r.czerwinski@pengutronix.de>
+S: Maintained
+F: Documentation/devicetree/bindings/display/panel/lxd,m9189a.yaml
+F: drivers/gpu/drm/panel/panel-lxd-m9189a.c
+
DRM DRIVER FOR MANTIX MLAF057WE51 PANELS
M: Guido Günther <agx@sigxcpu.org>
R: Purism Kernel Team <kernel@puri.sm>
diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index d3a9a9fafe4ec..7667ac1ef80e3 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -135,6 +135,15 @@ config DRM_PANEL_FEIYANG_FY07024DI26A30D
Say Y if you want to enable support for panels based on the
Feiyang FY07024DI26A30-D MIPI-DSI interface.
+config DRM_PANEL_LXD_M9189A
+ tristate "LXD M9189A MIPI-DSI LCD panel"
+ depends on OF
+ depends on DRM_MIPI_DSI
+ depends on BACKLIGHT_CLASS_DEVICE
+ help
+ Say Y if you want to enable support for the LXD M9189A 4-Lane
+ 1024x600 MIPI DSI panel.
+
config DRM_PANEL_DSI_CM
tristate "Generic DSI command mode panels"
depends on OF
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index 987a087024103..6d77c304e7529 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -16,6 +16,7 @@ obj-$(CONFIG_DRM_PANEL_EBBG_FT8719) += panel-ebbg-ft8719.o
obj-$(CONFIG_DRM_PANEL_ELIDA_KD35T133) += panel-elida-kd35t133.o
obj-$(CONFIG_DRM_PANEL_FEIXIN_K101_IM2BA02) += panel-feixin-k101-im2ba02.o
obj-$(CONFIG_DRM_PANEL_FEIYANG_FY07024DI26A30D) += panel-feiyang-fy07024di26a30d.o
+obj-$(CONFIG_DRM_PANEL_LXD_M9189A) += panel-lxd-m9189a.o
obj-$(CONFIG_DRM_PANEL_HIMAX_HX83102) += panel-himax-hx83102.o
obj-$(CONFIG_DRM_PANEL_HIMAX_HX83112A) += panel-himax-hx83112a.o
obj-$(CONFIG_DRM_PANEL_HIMAX_HX8394) += panel-himax-hx8394.o
diff --git a/drivers/gpu/drm/panel/panel-lxd-m9189a.c b/drivers/gpu/drm/panel/panel-lxd-m9189a.c
new file mode 100644
index 0000000000000..71c5a18541bae
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-lxd-m9189a.c
@@ -0,0 +1,261 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Generated with linux-mdss-dsi-panel-driver-generator from vendor device tree.
+ * Copyright (c) 2024 Luca Weiss <luca.weiss@fairphone.com>
+ */
+
+#include <linux/delay.h>
+#include <linux/gpio/consumer.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/regulator/consumer.h>
+
+#include <drm/drm_mipi_dsi.h>
+#include <drm/drm_modes.h>
+#include <drm/drm_panel.h>
+#include <drm/drm_probe_helper.h>
+
+/* Manufacturer specific DSI commands */
+#define EK79007AD3_GAMMA1 0x80
+#define EK79007AD3_GAMMA2 0x81
+#define EK79007AD3_GAMMA3 0x82
+#define EK79007AD3_GAMMA4 0x83
+#define EK79007AD3_GAMMA5 0x84
+#define EK79007AD3_GAMMA6 0x85
+#define EK79007AD3_GAMMA7 0x86
+#define EK79007AD3_PANEL_CTRL3 0xB2
+
+struct ek79007ad3_panel {
+ struct drm_panel panel;
+ struct mipi_dsi_device *dsi;
+ struct regulator *supply;
+ struct gpio_desc *reset_gpio;
+ struct gpio_desc *standby_gpio;
+};
+
+static inline struct ek79007ad3_panel *to_ek79007ad3_panel(struct drm_panel *panel)
+{
+ return container_of(panel, struct ek79007ad3_panel, panel);
+}
+
+static void ek79007ad3_reset(struct ek79007ad3_panel *ctx)
+{
+ gpiod_set_value_cansleep(ctx->reset_gpio, 0);
+ msleep(20);
+ gpiod_set_value_cansleep(ctx->reset_gpio, 1);
+ msleep(30);
+ gpiod_set_value_cansleep(ctx->reset_gpio, 0);
+ msleep(55);
+}
+
+static int ek79007ad3_on(struct ek79007ad3_panel *ctx)
+{
+ struct mipi_dsi_device *dsi = ctx->dsi;
+ struct device *dev = &dsi->dev;
+ int ret;
+
+ dsi->mode_flags |= MIPI_DSI_MODE_LPM;
+
+ /* Gamma 2.2 */
+ mipi_dsi_dcs_write_seq(dsi, EK79007AD3_GAMMA1, 0x48);
+ mipi_dsi_dcs_write_seq(dsi, EK79007AD3_GAMMA2, 0xB8);
+ mipi_dsi_dcs_write_seq(dsi, EK79007AD3_GAMMA3, 0x88);
+ mipi_dsi_dcs_write_seq(dsi, EK79007AD3_GAMMA4, 0x88);
+ mipi_dsi_dcs_write_seq(dsi, EK79007AD3_GAMMA5, 0x58);
+ mipi_dsi_dcs_write_seq(dsi, EK79007AD3_GAMMA6, 0xD2);
+ mipi_dsi_dcs_write_seq(dsi, EK79007AD3_GAMMA7, 0x88);
+ msleep(50);
+
+ /* 4 Lanes */
+ ret = mipi_dsi_generic_write(dsi, (u8[]){ EK79007AD3_PANEL_CTRL3, 0x70 }, 2);
+ if (ret)
+ goto fail;
+
+ ret = mipi_dsi_dcs_exit_sleep_mode(dsi);
+ if (ret < 0) {
+ dev_err(dev, "Failed to exit sleep mode: %d\n", ret);
+ return ret;
+ }
+ msleep(120);
+
+ ret = mipi_dsi_dcs_set_display_on(dsi);
+ msleep(120);
+
+fail:
+ return ret;
+}
+
+static int ek79007ad3_disable(struct drm_panel *panel)
+{
+ struct ek79007ad3_panel *ctx = to_ek79007ad3_panel(panel);
+ struct mipi_dsi_device *dsi = ctx->dsi;
+ struct device *dev = &dsi->dev;
+ int ret;
+
+ dsi->mode_flags &= ~MIPI_DSI_MODE_LPM;
+
+ ret = mipi_dsi_dcs_enter_sleep_mode(dsi);
+ if (ret < 0) {
+ dev_err(dev, "Failed to enter sleep mode: %d\n", ret);
+ return ret;
+ }
+ msleep(120);
+
+ gpiod_set_value_cansleep(ctx->standby_gpio, 1);
+
+ return 0;
+}
+
+static int ek79007ad3_prepare(struct drm_panel *panel)
+{
+ struct ek79007ad3_panel *ctx = to_ek79007ad3_panel(panel);
+ struct mipi_dsi_device *dsi = ctx->dsi;
+ struct device *dev = &ctx->dsi->dev;
+ int ret;
+
+ ret = regulator_enable(ctx->supply);
+ if (ret < 0) {
+ dev_err(dev, "Failed to enable regulators: %d\n", ret);
+ return ret;
+ }
+
+ gpiod_set_value_cansleep(ctx->standby_gpio, 0);
+ msleep(20);
+
+ mipi_dsi_dcs_nop(dsi);
+ usleep_range(1000, 2000);
+
+ ek79007ad3_reset(ctx);
+
+ ret = ek79007ad3_on(ctx);
+ if (ret < 0) {
+ dev_err(dev, "Failed to initialize panel: %d\n", ret);
+ gpiod_set_value_cansleep(ctx->reset_gpio, 1);
+ regulator_disable(ctx->supply);
+ return ret;
+ }
+
+ return 0;
+}
+
+static int ek79007ad3_unprepare(struct drm_panel *panel)
+{
+ struct ek79007ad3_panel *ctx = to_ek79007ad3_panel(panel);
+
+ gpiod_set_value_cansleep(ctx->standby_gpio, 1);
+ msleep(50);
+
+ gpiod_set_value_cansleep(ctx->reset_gpio, 1);
+ regulator_disable(ctx->supply);
+
+ return 0;
+}
+
+static const struct drm_display_mode ek79007ad3_mode = {
+ .clock = 51200,
+ .hdisplay = 1024,
+ .hsync_start = 1024 + 160,
+ .hsync_end = 1024 + 160 + 160,
+ .htotal = 1024 + 160 + 160 + 10,
+ .vdisplay = 600,
+ .vsync_start = 600 + 12,
+ .vsync_end = 600 + 12 + 23,
+ .vtotal = 600 + 23 + 12 + 1,
+ .width_mm = 154,
+ .height_mm = 86,
+};
+
+static int ek79007ad3_get_modes(struct drm_panel *panel,
+ struct drm_connector *connector)
+{
+ return drm_connector_helper_get_modes_fixed(connector, &ek79007ad3_mode);
+}
+
+static const struct drm_panel_funcs ek79007ad3_panel_funcs = {
+ .prepare = ek79007ad3_prepare,
+ .unprepare = ek79007ad3_unprepare,
+ .disable = ek79007ad3_disable,
+ .get_modes = ek79007ad3_get_modes,
+};
+
+static int ek79007ad3_probe(struct mipi_dsi_device *dsi)
+{
+ struct device *dev = &dsi->dev;
+ struct ek79007ad3_panel *ctx;
+ int ret;
+
+ ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
+ if (!ctx)
+ return -ENOMEM;
+
+ ctx->supply = devm_regulator_get(dev, "vdd");
+ if (IS_ERR(ctx->supply))
+ return dev_err_probe(dev, ret, "Failed to get regulator\n");
+
+ ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
+ if (IS_ERR(ctx->reset_gpio))
+ return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio),
+ "Failed to get reset-gpios\n");
+
+ ctx->standby_gpio = devm_gpiod_get(dev, "standby", GPIOD_OUT_LOW);
+ if (IS_ERR(ctx->standby_gpio))
+ return dev_err_probe(dev, PTR_ERR(ctx->standby_gpio),
+ "Failed to get standby-gpios\n");
+
+ ctx->dsi = dsi;
+ mipi_dsi_set_drvdata(dsi, ctx);
+
+ dsi->lanes = 4;
+ dsi->format = MIPI_DSI_FMT_RGB888;
+ dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST;
+
+ drm_panel_init(&ctx->panel, dev, &ek79007ad3_panel_funcs,
+ DRM_MODE_CONNECTOR_DSI);
+ ctx->panel.prepare_prev_first = true;
+
+ ret = drm_panel_of_backlight(&ctx->panel);
+ if (ret)
+ return dev_err_probe(dev, ret, "Failed to get backlight\n");
+
+ drm_panel_add(&ctx->panel);
+
+ ret = mipi_dsi_attach(dsi);
+ if (ret < 0) {
+ dev_err_probe(dev, ret, "Failed to attach to DSI host\n");
+ drm_panel_remove(&ctx->panel);
+ return ret;
+ }
+
+ return 0;
+}
+
+static void ek79007ad3_remove(struct mipi_dsi_device *dsi)
+{
+ struct ek79007ad3_panel *ctx = mipi_dsi_get_drvdata(dsi);
+ int ret;
+
+ ret = mipi_dsi_detach(dsi);
+ if (ret < 0)
+ dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret);
+
+ drm_panel_remove(&ctx->panel);
+}
+
+static const struct of_device_id ek79007ad3_of_match[] = {
+ { .compatible = "lxd,m9189a" },
+ { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, ek79007ad3_of_match);
+
+static struct mipi_dsi_driver ek79007ad3_driver = {
+ .probe = ek79007ad3_probe,
+ .remove = ek79007ad3_remove,
+ .driver = {
+ .name = "panel-fitipower-ek79007ad3",
+ .of_match_table = ek79007ad3_of_match,
+ },
+};
+module_mipi_dsi_driver(ek79007ad3_driver);
+
+MODULE_DESCRIPTION("DRM driver for ek79007ad3-equipped DSI panels");
+MODULE_LICENSE("GPL");
--
2.39.5
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/3] dt-bindings: display: panel: add YAML schema for LXD M9189A
2024-10-23 12:44 ` [PATCH 2/3] dt-bindings: display: panel: add YAML schema for LXD M9189A Rouven Czerwinski
@ 2024-10-23 13:23 ` Rouven Czerwinski
2024-10-23 14:46 ` Rob Herring (Arm)
1 sibling, 0 replies; 7+ messages in thread
From: Rouven Czerwinski @ 2024-10-23 13:23 UTC (permalink / raw)
To: Jessica Zhang, Sam Ravnborg, dri-devel, devicetree, linux-kernel
Cc: kernel, Neil Armstrong, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Daniel Vetter, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Hi,
On Wed, 2024-10-23 at 14:44 +0200, Rouven Czerwinski wrote:
> The LXD M9189A is a 1024x600 MIPI-DSI panel.
>
> Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
> ---
> .../bindings/display/panel/lxd,m9189a.yaml | 64
> +++++++++++++++++++
> 1 file changed, 64 insertions(+)
> create mode 100644
> Documentation/devicetree/bindings/display/panel/lxd,m9189a.yaml
>
> diff --git
> a/Documentation/devicetree/bindings/display/panel/lxd,m9189a.yaml
> b/Documentation/devicetree/bindings/display/panel/lxd,m9189a.yaml
> new file mode 100644
> index 0000000000000..49cee8865cae1
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/display/panel/lxd,m9189a.yaml
> @@ -0,0 +1,64 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/display/panel/lxd,m9189a.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: LXD M9189 DSI Display Panel
^ is missing an A
> +
> +maintainers:
> + - Rouven Czerwinski <r.czerwinski@pengutronix.de>
> +
> +properties:
> + compatible:
> + const: ronbo,rb070d30
This is the wrong compatible.
> +
> + reg:
> + maxItems: 1
> +
> + standby-gpios:
> + description: GPIO used for the standby pin
> + maxItems: 1
> +
> + reset-gpios:
> + description: GPIO used for the reset pin
> + maxItems: 1
> +
> + vdd-supply:
> + description: Power regulator
> +
> + backlight:
> + description: Backlight used by the panel
> + $ref: /schemas/types.yaml#/definitions/phandle
> +
> +required:
> + - compatible
> + - reg
> + - standby-gpios
> + - reset-gpios
> + - vdd-supply
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + #include <dt-bindings/gpio/gpio.h>
> +
> + dsi {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + panel@0 {
> + compatible = "lxd,m9189a";
> + reg = <0>;
> + backlight = <&backlight>;
> + reset-gpios = <&gpio3 25 GPIO_ACTIVE_LOW>;
> + standby-gpios = <&gpio5 22 GPIO_ACTIVE_LOW>;
> +
> + port {
> + mipi_panel_in: endpoint {
> + remote-endpoint = <&mipi_dsi_out>;
> + };
> + };
> + };
> + };
Fixed both for a v2 of this series, will wait for more feedback before
resending.
Best Regards,
Rouven Czerwinski
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/3] dt-bindings: display: panel: add YAML schema for LXD M9189A
2024-10-23 12:44 ` [PATCH 2/3] dt-bindings: display: panel: add YAML schema for LXD M9189A Rouven Czerwinski
2024-10-23 13:23 ` Rouven Czerwinski
@ 2024-10-23 14:46 ` Rob Herring (Arm)
1 sibling, 0 replies; 7+ messages in thread
From: Rob Herring (Arm) @ 2024-10-23 14:46 UTC (permalink / raw)
To: Rouven Czerwinski
Cc: Krzysztof Kozlowski, Maarten Lankhorst, devicetree,
Neil Armstrong, Rob Herring, Conor Dooley, Jessica Zhang,
Daniel Vetter, kernel, linux-kernel, dri-devel, Sam Ravnborg,
David Airlie, Maxime Ripard, Thomas Zimmermann
On Wed, 23 Oct 2024 14:44:09 +0200, Rouven Czerwinski wrote:
> The LXD M9189A is a 1024x600 MIPI-DSI panel.
>
> Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
> ---
> .../bindings/display/panel/lxd,m9189a.yaml | 64 +++++++++++++++++++
> 1 file changed, 64 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/display/panel/lxd,m9189a.yaml
>
My bot found errors running 'make dt_binding_check' on your patch:
yamllint warnings/errors:
dtschema/dtc warnings/errors:
Warning: Duplicate compatible "ronbo,rb070d30" found in schemas matching "$id":
http://devicetree.org/schemas/display/panel/ronbo,rb070d30.yaml#
http://devicetree.org/schemas/display/panel/lxd,m9189a.yaml#
Documentation/devicetree/bindings/display/panel/lxd,m9189a.example.dtb: /example-0/dsi/panel@0: failed to match any schema with compatible: ['lxd,m9189a']
doc reference errors (make refcheckdocs):
See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20241023124411.1153552-2-r.czerwinski@pengutronix.de
The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.
If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:
pip3 install dtschema --upgrade
Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 3/3] drm/panel: add Fitipower EK79007AD3 panel driver
2024-10-23 12:44 ` [PATCH 3/3] drm/panel: add Fitipower EK79007AD3 panel driver Rouven Czerwinski
@ 2024-10-25 0:35 ` Dmitry Baryshkov
2024-10-25 14:34 ` Dan Carpenter
1 sibling, 0 replies; 7+ messages in thread
From: Dmitry Baryshkov @ 2024-10-25 0:35 UTC (permalink / raw)
To: Rouven Czerwinski
Cc: Jessica Zhang, Sam Ravnborg, linux-kernel, dri-devel, kernel,
Neil Armstrong, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Daniel Vetter
On Wed, Oct 23, 2024 at 02:44:10PM +0200, Rouven Czerwinski wrote:
> The LXD M9189A panel is based on the EK79007AD3 DSI display controller.
> It currently supports only 4 lane operation.
>
> Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
> ---
> MAINTAINERS | 6 +
> drivers/gpu/drm/panel/Kconfig | 9 +
> drivers/gpu/drm/panel/Makefile | 1 +
> drivers/gpu/drm/panel/panel-lxd-m9189a.c | 261 +++++++++++++++++++++++
> 4 files changed, 277 insertions(+)
> create mode 100644 drivers/gpu/drm/panel/panel-lxd-m9189a.c
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index e9659a5a7fb33..e4d749b403c28 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -7179,6 +7179,12 @@ F: Documentation/devicetree/bindings/display/lvds.yaml
> F: Documentation/devicetree/bindings/display/panel/panel-lvds.yaml
> F: drivers/gpu/drm/panel/panel-lvds.c
>
> +DRM DRIVER FOR LXD M9189A PANELS
> +M: Rouven Czerwinski <r.czerwinski@pengutronix.de>
> +S: Maintained
> +F: Documentation/devicetree/bindings/display/panel/lxd,m9189a.yaml
> +F: drivers/gpu/drm/panel/panel-lxd-m9189a.c
> +
> DRM DRIVER FOR MANTIX MLAF057WE51 PANELS
> M: Guido Günther <agx@sigxcpu.org>
> R: Purism Kernel Team <kernel@puri.sm>
> diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
> index d3a9a9fafe4ec..7667ac1ef80e3 100644
> --- a/drivers/gpu/drm/panel/Kconfig
> +++ b/drivers/gpu/drm/panel/Kconfig
> @@ -135,6 +135,15 @@ config DRM_PANEL_FEIYANG_FY07024DI26A30D
> Say Y if you want to enable support for panels based on the
> Feiyang FY07024DI26A30-D MIPI-DSI interface.
>
> +config DRM_PANEL_LXD_M9189A
> + tristate "LXD M9189A MIPI-DSI LCD panel"
> + depends on OF
> + depends on DRM_MIPI_DSI
> + depends on BACKLIGHT_CLASS_DEVICE
> + help
> + Say Y if you want to enable support for the LXD M9189A 4-Lane
> + 1024x600 MIPI DSI panel.
> +
> config DRM_PANEL_DSI_CM
> tristate "Generic DSI command mode panels"
> depends on OF
> diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
> index 987a087024103..6d77c304e7529 100644
> --- a/drivers/gpu/drm/panel/Makefile
> +++ b/drivers/gpu/drm/panel/Makefile
> @@ -16,6 +16,7 @@ obj-$(CONFIG_DRM_PANEL_EBBG_FT8719) += panel-ebbg-ft8719.o
> obj-$(CONFIG_DRM_PANEL_ELIDA_KD35T133) += panel-elida-kd35t133.o
> obj-$(CONFIG_DRM_PANEL_FEIXIN_K101_IM2BA02) += panel-feixin-k101-im2ba02.o
> obj-$(CONFIG_DRM_PANEL_FEIYANG_FY07024DI26A30D) += panel-feiyang-fy07024di26a30d.o
> +obj-$(CONFIG_DRM_PANEL_LXD_M9189A) += panel-lxd-m9189a.o
> obj-$(CONFIG_DRM_PANEL_HIMAX_HX83102) += panel-himax-hx83102.o
> obj-$(CONFIG_DRM_PANEL_HIMAX_HX83112A) += panel-himax-hx83112a.o
> obj-$(CONFIG_DRM_PANEL_HIMAX_HX8394) += panel-himax-hx8394.o
> diff --git a/drivers/gpu/drm/panel/panel-lxd-m9189a.c b/drivers/gpu/drm/panel/panel-lxd-m9189a.c
> new file mode 100644
> index 0000000000000..71c5a18541bae
> --- /dev/null
> +++ b/drivers/gpu/drm/panel/panel-lxd-m9189a.c
> @@ -0,0 +1,261 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +/*
> + * Generated with linux-mdss-dsi-panel-driver-generator from vendor device tree.
> + * Copyright (c) 2024 Luca Weiss <luca.weiss@fairphone.com>
> + */
> +
> +#include <linux/delay.h>
> +#include <linux/gpio/consumer.h>
> +#include <linux/module.h>
> +#include <linux/of.h>
> +#include <linux/regulator/consumer.h>
> +
> +#include <drm/drm_mipi_dsi.h>
> +#include <drm/drm_modes.h>
> +#include <drm/drm_panel.h>
> +#include <drm/drm_probe_helper.h>
> +
> +/* Manufacturer specific DSI commands */
> +#define EK79007AD3_GAMMA1 0x80
> +#define EK79007AD3_GAMMA2 0x81
> +#define EK79007AD3_GAMMA3 0x82
> +#define EK79007AD3_GAMMA4 0x83
> +#define EK79007AD3_GAMMA5 0x84
> +#define EK79007AD3_GAMMA6 0x85
> +#define EK79007AD3_GAMMA7 0x86
> +#define EK79007AD3_PANEL_CTRL3 0xB2
> +
> +struct ek79007ad3_panel {
> + struct drm_panel panel;
> + struct mipi_dsi_device *dsi;
> + struct regulator *supply;
> + struct gpio_desc *reset_gpio;
> + struct gpio_desc *standby_gpio;
> +};
> +
> +static inline struct ek79007ad3_panel *to_ek79007ad3_panel(struct drm_panel *panel)
> +{
> + return container_of(panel, struct ek79007ad3_panel, panel);
> +}
> +
> +static void ek79007ad3_reset(struct ek79007ad3_panel *ctx)
> +{
> + gpiod_set_value_cansleep(ctx->reset_gpio, 0);
> + msleep(20);
> + gpiod_set_value_cansleep(ctx->reset_gpio, 1);
> + msleep(30);
> + gpiod_set_value_cansleep(ctx->reset_gpio, 0);
> + msleep(55);
> +}
> +
> +static int ek79007ad3_on(struct ek79007ad3_panel *ctx)
> +{
> + struct mipi_dsi_device *dsi = ctx->dsi;
> + struct device *dev = &dsi->dev;
> + int ret;
> +
> + dsi->mode_flags |= MIPI_DSI_MODE_LPM;
> +
> + /* Gamma 2.2 */
> + mipi_dsi_dcs_write_seq(dsi, EK79007AD3_GAMMA1, 0x48);
> + mipi_dsi_dcs_write_seq(dsi, EK79007AD3_GAMMA2, 0xB8);
> + mipi_dsi_dcs_write_seq(dsi, EK79007AD3_GAMMA3, 0x88);
> + mipi_dsi_dcs_write_seq(dsi, EK79007AD3_GAMMA4, 0x88);
> + mipi_dsi_dcs_write_seq(dsi, EK79007AD3_GAMMA5, 0x58);
> + mipi_dsi_dcs_write_seq(dsi, EK79007AD3_GAMMA6, 0xD2);
> + mipi_dsi_dcs_write_seq(dsi, EK79007AD3_GAMMA7, 0x88);
mipi_dsi_dcs_write_seq_multi
> + msleep(50);
mipi_dsi_msleep(), here and further below
> +
> + /* 4 Lanes */
> + ret = mipi_dsi_generic_write(dsi, (u8[]){ EK79007AD3_PANEL_CTRL3, 0x70 }, 2);
mipi_dsi_generic_write_multi
> + if (ret)
> + goto fail;
> +
> + ret = mipi_dsi_dcs_exit_sleep_mode(dsi);
_multi
> + if (ret < 0) {
> + dev_err(dev, "Failed to exit sleep mode: %d\n", ret);
> + return ret;
> + }
> + msleep(120);
> +
> + ret = mipi_dsi_dcs_set_display_on(dsi);
_multi
> + msleep(120);
> +
> +fail:
> + return ret;
> +}
> +
> +static int ek79007ad3_disable(struct drm_panel *panel)
> +{
> + struct ek79007ad3_panel *ctx = to_ek79007ad3_panel(panel);
> + struct mipi_dsi_device *dsi = ctx->dsi;
> + struct device *dev = &dsi->dev;
> + int ret;
> +
> + dsi->mode_flags &= ~MIPI_DSI_MODE_LPM;
> +
> + ret = mipi_dsi_dcs_enter_sleep_mode(dsi);
_multi
> + if (ret < 0) {
> + dev_err(dev, "Failed to enter sleep mode: %d\n", ret);
> + return ret;
> + }
> + msleep(120);
> +
> + gpiod_set_value_cansleep(ctx->standby_gpio, 1);
> +
> + return 0;
> +}
> +
> +static int ek79007ad3_prepare(struct drm_panel *panel)
> +{
> + struct ek79007ad3_panel *ctx = to_ek79007ad3_panel(panel);
> + struct mipi_dsi_device *dsi = ctx->dsi;
> + struct device *dev = &ctx->dsi->dev;
> + int ret;
> +
> + ret = regulator_enable(ctx->supply);
> + if (ret < 0) {
> + dev_err(dev, "Failed to enable regulators: %d\n", ret);
> + return ret;
> + }
> +
> + gpiod_set_value_cansleep(ctx->standby_gpio, 0);
> + msleep(20);
> +
> + mipi_dsi_dcs_nop(dsi);
PLease move these calls to _on() and use mipi_dsi_dcs_nop_multi() and
mipi_dsi_usleep_range().
> + usleep_range(1000, 2000);
> +
> + ek79007ad3_reset(ctx);
> +
> + ret = ek79007ad3_on(ctx);
> + if (ret < 0) {
> + dev_err(dev, "Failed to initialize panel: %d\n", ret);
> + gpiod_set_value_cansleep(ctx->reset_gpio, 1);
> + regulator_disable(ctx->supply);
> + return ret;
> + }
> +
> + return 0;
> +}
> +
> +static int ek79007ad3_unprepare(struct drm_panel *panel)
> +{
> + struct ek79007ad3_panel *ctx = to_ek79007ad3_panel(panel);
> +
> + gpiod_set_value_cansleep(ctx->standby_gpio, 1);
> + msleep(50);
> +
> + gpiod_set_value_cansleep(ctx->reset_gpio, 1);
> + regulator_disable(ctx->supply);
> +
> + return 0;
> +}
> +
> +static const struct drm_display_mode ek79007ad3_mode = {
> + .clock = 51200,
.clock = (1024 + 160 + 160 + 10) * (600 + 23 + 12 + 1) * N / 1000;
> + .hdisplay = 1024,
> + .hsync_start = 1024 + 160,
> + .hsync_end = 1024 + 160 + 160,
> + .htotal = 1024 + 160 + 160 + 10,
> + .vdisplay = 600,
> + .vsync_start = 600 + 12,
> + .vsync_end = 600 + 12 + 23,
> + .vtotal = 600 + 23 + 12 + 1,
> + .width_mm = 154,
> + .height_mm = 86,
> +};
> +
> +static int ek79007ad3_get_modes(struct drm_panel *panel,
> + struct drm_connector *connector)
> +{
> + return drm_connector_helper_get_modes_fixed(connector, &ek79007ad3_mode);
> +}
> +
> +static const struct drm_panel_funcs ek79007ad3_panel_funcs = {
> + .prepare = ek79007ad3_prepare,
> + .unprepare = ek79007ad3_unprepare,
> + .disable = ek79007ad3_disable,
> + .get_modes = ek79007ad3_get_modes,
> +};
> +
> +static int ek79007ad3_probe(struct mipi_dsi_device *dsi)
> +{
> + struct device *dev = &dsi->dev;
> + struct ek79007ad3_panel *ctx;
> + int ret;
> +
> + ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
> + if (!ctx)
> + return -ENOMEM;
> +
> + ctx->supply = devm_regulator_get(dev, "vdd");
> + if (IS_ERR(ctx->supply))
> + return dev_err_probe(dev, ret, "Failed to get regulator\n");
> +
> + ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
> + if (IS_ERR(ctx->reset_gpio))
> + return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio),
> + "Failed to get reset-gpios\n");
> +
> + ctx->standby_gpio = devm_gpiod_get(dev, "standby", GPIOD_OUT_LOW);
> + if (IS_ERR(ctx->standby_gpio))
> + return dev_err_probe(dev, PTR_ERR(ctx->standby_gpio),
> + "Failed to get standby-gpios\n");
> +
> + ctx->dsi = dsi;
> + mipi_dsi_set_drvdata(dsi, ctx);
> +
> + dsi->lanes = 4;
> + dsi->format = MIPI_DSI_FMT_RGB888;
> + dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST;
> +
> + drm_panel_init(&ctx->panel, dev, &ek79007ad3_panel_funcs,
> + DRM_MODE_CONNECTOR_DSI);
> + ctx->panel.prepare_prev_first = true;
> +
> + ret = drm_panel_of_backlight(&ctx->panel);
> + if (ret)
> + return dev_err_probe(dev, ret, "Failed to get backlight\n");
> +
> + drm_panel_add(&ctx->panel);
> +
> + ret = mipi_dsi_attach(dsi);
> + if (ret < 0) {
> + dev_err_probe(dev, ret, "Failed to attach to DSI host\n");
> + drm_panel_remove(&ctx->panel);
> + return ret;
> + }
> +
> + return 0;
> +}
> +
> +static void ek79007ad3_remove(struct mipi_dsi_device *dsi)
> +{
> + struct ek79007ad3_panel *ctx = mipi_dsi_get_drvdata(dsi);
> + int ret;
> +
> + ret = mipi_dsi_detach(dsi);
> + if (ret < 0)
> + dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret);
> +
> + drm_panel_remove(&ctx->panel);
> +}
> +
> +static const struct of_device_id ek79007ad3_of_match[] = {
> + { .compatible = "lxd,m9189a" },
> + { /* sentinel */ }
> +};
> +MODULE_DEVICE_TABLE(of, ek79007ad3_of_match);
> +
> +static struct mipi_dsi_driver ek79007ad3_driver = {
> + .probe = ek79007ad3_probe,
> + .remove = ek79007ad3_remove,
> + .driver = {
> + .name = "panel-fitipower-ek79007ad3",
> + .of_match_table = ek79007ad3_of_match,
> + },
> +};
> +module_mipi_dsi_driver(ek79007ad3_driver);
> +
> +MODULE_DESCRIPTION("DRM driver for ek79007ad3-equipped DSI panels");
> +MODULE_LICENSE("GPL");
> --
> 2.39.5
>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 3/3] drm/panel: add Fitipower EK79007AD3 panel driver
2024-10-23 12:44 ` [PATCH 3/3] drm/panel: add Fitipower EK79007AD3 panel driver Rouven Czerwinski
2024-10-25 0:35 ` Dmitry Baryshkov
@ 2024-10-25 14:34 ` Dan Carpenter
1 sibling, 0 replies; 7+ messages in thread
From: Dan Carpenter @ 2024-10-25 14:34 UTC (permalink / raw)
To: oe-kbuild, Rouven Czerwinski, Jessica Zhang, Sam Ravnborg,
linux-kernel, dri-devel
Cc: lkp, oe-kbuild-all, kernel, Rouven Czerwinski, Neil Armstrong,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Daniel Vetter
Hi Rouven,
kernel test robot noticed the following build warnings:
url: https://github.com/intel-lab-lkp/linux/commits/Rouven-Czerwinski/dt-bindings-display-panel-add-YAML-schema-for-LXD-M9189A/20241023-204826
base: c2ee9f594da826bea183ed14f2cc029c719bf4da
patch link: https://lore.kernel.org/r/20241023124411.1153552-3-r.czerwinski%40pengutronix.de
patch subject: [PATCH 3/3] drm/panel: add Fitipower EK79007AD3 panel driver
config: nios2-randconfig-r072-20241025 (https://download.01.org/0day-ci/archive/20241025/202410252201.QglvauIC-lkp@intel.com/config)
compiler: nios2-linux-gcc (GCC) 14.1.0
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
| Closes: https://lore.kernel.org/r/202410252201.QglvauIC-lkp@intel.com/
smatch warnings:
drivers/gpu/drm/panel/panel-lxd-m9189a.c:193 ek79007ad3_probe() error: uninitialized symbol 'ret'.
vim +/ret +193 drivers/gpu/drm/panel/panel-lxd-m9189a.c
a69b961abc36b3 Rouven Czerwinski 2024-10-23 181 static int ek79007ad3_probe(struct mipi_dsi_device *dsi)
a69b961abc36b3 Rouven Czerwinski 2024-10-23 182 {
a69b961abc36b3 Rouven Czerwinski 2024-10-23 183 struct device *dev = &dsi->dev;
a69b961abc36b3 Rouven Czerwinski 2024-10-23 184 struct ek79007ad3_panel *ctx;
a69b961abc36b3 Rouven Czerwinski 2024-10-23 185 int ret;
a69b961abc36b3 Rouven Czerwinski 2024-10-23 186
a69b961abc36b3 Rouven Czerwinski 2024-10-23 187 ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
a69b961abc36b3 Rouven Czerwinski 2024-10-23 188 if (!ctx)
a69b961abc36b3 Rouven Czerwinski 2024-10-23 189 return -ENOMEM;
a69b961abc36b3 Rouven Czerwinski 2024-10-23 190
a69b961abc36b3 Rouven Czerwinski 2024-10-23 191 ctx->supply = devm_regulator_get(dev, "vdd");
a69b961abc36b3 Rouven Czerwinski 2024-10-23 192 if (IS_ERR(ctx->supply))
a69b961abc36b3 Rouven Czerwinski 2024-10-23 @193 return dev_err_probe(dev, ret, "Failed to get regulator\n");
s/ret/PTR_ERR(ctx->supply)/
a69b961abc36b3 Rouven Czerwinski 2024-10-23 194
a69b961abc36b3 Rouven Czerwinski 2024-10-23 195 ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
a69b961abc36b3 Rouven Czerwinski 2024-10-23 196 if (IS_ERR(ctx->reset_gpio))
a69b961abc36b3 Rouven Czerwinski 2024-10-23 197 return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio),
a69b961abc36b3 Rouven Czerwinski 2024-10-23 198 "Failed to get reset-gpios\n");
a69b961abc36b3 Rouven Czerwinski 2024-10-23 199
a69b961abc36b3 Rouven Czerwinski 2024-10-23 200 ctx->standby_gpio = devm_gpiod_get(dev, "standby", GPIOD_OUT_LOW);
a69b961abc36b3 Rouven Czerwinski 2024-10-23 201 if (IS_ERR(ctx->standby_gpio))
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-10-25 14:34 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-23 12:44 [PATCH 1/3] dt-bindings: vendor-prefixes: Add lxd Rouven Czerwinski
2024-10-23 12:44 ` [PATCH 2/3] dt-bindings: display: panel: add YAML schema for LXD M9189A Rouven Czerwinski
2024-10-23 13:23 ` Rouven Czerwinski
2024-10-23 14:46 ` Rob Herring (Arm)
2024-10-23 12:44 ` [PATCH 3/3] drm/panel: add Fitipower EK79007AD3 panel driver Rouven Czerwinski
2024-10-25 0:35 ` Dmitry Baryshkov
2024-10-25 14:34 ` Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®