Add DSI panel driver for Raydium RM67191
Subsystems (5)
Robert Chiras
maintainerv4 cover Add DSI panel driver for Raydium RM67191
This patch-set contains the DRM panel driver and dt-bindings documentation for the DSI driven panel: Raydium RM67191.
v4:
- Changed default_timing structure type from 'struct display_timing' to 'struct drm_display_mode' (fabio)
- Replaced devm_gpiod_get with devm_gpiod_get_optional (fabio)
- Added power regulators (fabio)
- Removed pm_ops (fabio)
v3:
- Added myself to MAINTAINERS for this driver (sam)
- Removed display-timings property (fabio)
- Fixed dt description (sam)
- Re-arranged calls inside get_modes function (sam)
- Changed ifdefs with _maybe_unused for suspend/resume functions (sam)
- Collected Reviewed-by from Sam
v2:
- Fixed 'reset-gpio' to 'reset-gpios' property naming (fabio)
- Changed the state of the reset gpio to active low and fixed how it is handled in driver (fabio)
- Fixed copyright statement (daniel)
- Reordered includes (sam)
- Added defines for panel specific color formats (fabio)
- Removed unnecessary tests in enable and unprepare (sam)
- Removed the unnecessary backlight write in enable (sam)
Robert Chiras (2):
dt-bindings: display: panel: Add support for Raydium RM67191 panel drm/panel: Add support for Raydium RM67191 panel driver
.../bindings/display/panel/raydium,rm67191.txt | 41 ++ MAINTAINERS | 6 + drivers/gpu/drm/panel/Kconfig | 9 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-raydium-rm67191.c | 673 +++++++++++++++++++++ 5 files changed, 730 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/panel/raydium,rm67191.txt create mode 100644 drivers/gpu/drm/panel/panel-raydium-rm67191.c
Signature · 1 line
2.7.4
Robert Chiras
maintainerPATCH v4 1/2 dt-bindings: display: panel: Add support for Raydium RM67191 panel
Add dt-bindings documentation for Raydium RM67191 DSI panel.
--- .../bindings/display/panel/raydium,rm67191.txt | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/panel/raydium,rm67191.txt
Documentation/devicetree/bindings/display/panel/raydium,rm67191.txt new file +41 -0
@@ -0,0 +1,41 @@ +Raydium RM67171 OLED LCD panel with MIPI-DSI protocol + +Required properties: +- compatible: "raydium,rm67191" +- reg: virtual channel for MIPI-DSI protocol + must be <0> +- dsi-lanes: number of DSI lanes to be used + must be <3> or <4> +- port: input port node with endpoint definition as + defined in Documentation/devicetree/bindings/graph.txt; + the input port should be connected to a MIPI-DSI device + driver + +Optional properties: +- reset-gpios: a GPIO spec for the RST_B GPIO pin +- v3p3-supply: phandle to 3.3V regulator that powers the VDD_3V3 pin +- v1p8-supply: phandle to 1.8V regulator that powers the VDD_1V8 pin +- width-mm: see panel-common.txt +- height-mm: see panel-common.txt +- video-mode: 0 - burst-mode + 1 - non-burst with sync event + 2 - non-burst with sync pulse + +Example: + + panel@0 { + compatible = "raydium,rm67191"; + reg = <0>; + pinctrl-0 = <&pinctrl_mipi_dsi_0_1_en>; + pinctrl-names = "default"; + reset-gpios = <&gpio1 7 GPIO_ACTIVE_LOW>; + dsi-lanes = <4>; + width-mm = <68>; + height-mm = <121>; + + port { + panel_in: endpoint { + remote-endpoint = <&mipi_out>; + }; + }; + };
Signature · 1 line
2.7.4
Robert Chiras
maintainerPATCH v4 2/2 drm/panel: Add support for Raydium RM67191 panel driver
In reply to Robert ChirasThis patch adds Raydium RM67191 TFT LCD panel driver (MIPI-DSI protocol).
--- MAINTAINERS | 6 + drivers/gpu/drm/panel/Kconfig | 9 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-raydium-rm67191.c | 673 ++++++++++++++++++++++++++ 4 files changed, 689 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-raydium-rm67191.c
MAINTAINERS +6 -0
@@ -5089,6 +5089,12 @@ S: Maintained F: drivers/gpu/drm/qxl/ F: include/uapi/drm/qxl_drm.h +DRM DRIVER FOR RAYDIUM RM67191 PANELS +M: Robert Chiras <[email protected]> +S: Maintained +F: drivers/gpu/drm/panel/panel-raydium-rm67191.c +F: Documentation/devicetree/bindings/display/panel/raydium,rm67191.txt + DRM DRIVER FOR RAGE 128 VIDEO CARDS S: Orphan / Obsolete F: drivers/gpu/drm/r128/
drivers/gpu/drm/panel/Kconfig +9 -0
@@ -159,6 +159,15 @@ config DRM_PANEL_RASPBERRYPI_TOUCHSCREEN Pi 7" Touchscreen. To compile this driver as a module, choose M here. +config DRM_PANEL_RAYDIUM_RM67191 + tristate "Raydium RM67191 FHD 1080x1920 DSI video mode panel" + depends on OF + depends on DRM_MIPI_DSI + depends on BACKLIGHT_CLASS_DEVICE + help + Say Y here if you want to enable support for Raydium RM67191 FHD + (1080x1920) DSI panel. + config DRM_PANEL_RAYDIUM_RM68200 tristate "Raydium RM68200 720x1280 DSI video mode panel" depends on OF
drivers/gpu/drm/panel/Makefile +1 -0
@@ -14,6 +14,7 @@ obj-$(CONFIG_DRM_PANEL_ORISETECH_OTM8009A) += panel-orisetech-otm8009a.o obj-$(CONFIG_DRM_PANEL_OSD_OSD101T2587_53TS) += panel-osd-osd101t2587-53ts.o obj-$(CONFIG_DRM_PANEL_PANASONIC_VVX10F034N00) += panel-panasonic-vvx10f034n00.o obj-$(CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN) += panel-raspberrypi-touchscreen.o +obj-$(CONFIG_DRM_PANEL_RAYDIUM_RM67191) += panel-raydium-rm67191.o obj-$(CONFIG_DRM_PANEL_RAYDIUM_RM68200) += panel-raydium-rm68200.o obj-$(CONFIG_DRM_PANEL_ROCKTECH_JH057N00900) += panel-rocktech-jh057n00900.o obj-$(CONFIG_DRM_PANEL_RONBO_RB070D30) += panel-ronbo-rb070d30.o
drivers/gpu/drm/panel/panel-raydium-rm67191.c new file +673 -0
673 lines not on this page · raw message
Signature · 1 line
2.7.4
Re: [PATCH v4 2/2] drm/panel: Add support for Raydium RM67191 panel driver
Hi Robert,
drivers/gpu/drm/panel/panel-raydium-rm67191.c line 477
Quoted 12 lines · Robert Chiras
drivers/gpu/drm/panel/panel-raydium-rm67191.c new file +12
-0+static int rad_bl_get_brightness (struct backlight_device *bl) +{ +struct mipi_dsi_device *dsi =bl_get_data (bl); +struct rad_panel *rad =mipi_dsi_get_drvdata (dsi); +struct device *dev = &dsi->dev; +u16 brightness; +int ret; + +if (!rad->prepared) +return 0 ; + +DRM_DEV_DEBUG_DRIVER (dev,"\n" );
Please remove this debug line.
drivers/gpu/drm/panel/panel-raydium-rm67191.c line 500
Quoted 4 lines
drivers/gpu/drm/panel/panel-raydium-rm67191.c new file +4
-0+if (!rad->prepared) +return 0 ; + +DRM_DEV_DEBUG_DRIVER (dev,"New brightness: %d\n" , bl->props.brightness);
Please remove it.
drivers/gpu/drm/panel/panel-raydium-rm67191.c line 593
Quoted 7 lines
drivers/gpu/drm/panel/panel-raydium-rm67191.c new file +7
-0+ ret =of_property_read_u32 (np,"dsi-lanes" , &dsi->lanes); +if (ret) { +dev_err (dev,"Failed to get dsi-lanes property (%d)\n" , ret); +return ret; + } + + panel->reset =devm_gpiod_get_optional (dev,"reset" ,GPIOD_OUT_LOW );
Even it is optional, you still need to check for error and propagate it in the case of error.
Otherwise defer probe will not work.
drivers/gpu/drm/panel/panel-raydium-rm67191.c line 622
Quoted 5 lines
drivers/gpu/drm/panel/panel-raydium-rm67191.c new file +5
-0+ ret =drm_panel_add (&panel->panel); +if (ret) +return ret; + +
One blank line is enough.