drm: panel: Add Generic MIPI Panel Driver
Subsystems (4)
v2 cover drm: panel: Add Generic MIPI Panel Driver
This is a Generic MIPI-DSI / DPI(+SPI) dual stack panel driver.
Although the MIPI specifications define how to communicate with a panel to display an image, some panels still require a panel-specific initialization sequence to be sent.
While there are many dedicated drivers for such panels, they are very similar to each other, except for the configuration parameters, including the initialization sequence for each panel.
Since there are numerous panels in the wild, adding parameters to the driver for each panel every time is a pain.
Instead, this driver offers more generic and convenient method.
Its fundamental approach is similar to the panel-mipi-dbi driver, which sends an initialization sequence stored in a firmware file.
Moreover, this driver allows display modes, timings, and panel configuration parameters to be stored in the same file.
I've also come up with a firmware generator [1].
It helps to create or configure the panel parameters on the web.
As a reference, similar generic drivers currently exist:
* drivers/gpu/drm/panel/panel-simple.c
- Supports wide variety of panels, but no init-sequence support
* drivers/gpu/drm/tiny/panel-mipi-dbi.c
- Supports init-sequence, but only supports DBI panels
* drivers/gpu/drm/panel/panel-dsi-cm.c
- Supports DSI Command Mode, but no init-sequence support
[1]: https://kikuchan.github.io/panel-firmware-generator/
v2:
- Drop redundant properties from the DT binding
- Fix the compatible property and examples in the DT binding
- Drop support for the redundant DT properties from the driver
- Fix minor issue in the driver
- Add panels to the DT binding
Regards,
kikuchan.
Hironori KIKUCHI (3):
dt-bindings: vendor-prefixes: Add hothmi vendor prefix
dt-bindings: display: panel: Add some generic MIPI-DSI/DPI panels
drm: panel: Add a driver for Generic MIPI-DSI/DPI(+SPI) panels
.../bindings/display/panel/panel-mipi.yaml | 121 ++ .../devicetree/bindings/vendor-prefixes.yaml | 2 + drivers/gpu/drm/panel/Kconfig | 10 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-mipi.c | 1181 +++++++++++++++++ 5 files changed, 1315 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/panel/panel-mipi.yaml create mode 100644 drivers/gpu/drm/panel/panel-mipi.c
Signature · 1 line
2.48.1
PATCH v2 1/3 dt-bindings: vendor-prefixes: Add hothmi vendor prefix
Add prefix for Hotdisplay Technology Co.Ltd
--- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
@@ -650,6 +650,8 @@ patternProperties: description: Shenzhen Hope Microelectronics Co., Ltd. "^hoperun,.*": description: Jiangsu HopeRun Software Co., Ltd. + "^hothmi,.*": + description: Hotdisplay Technology Co.Ltd "^hp,.*": description: Hewlett Packard Inc. "^hpe,.*":
Signature · 1 line
2.48.1
Re: [PATCH v2 1/3] dt-bindings: vendor-prefixes: Add hothmi vendor prefix
Quoted 7 lines · Hironori KIKUCHI
Add prefix for Hotdisplay Technology Co.Ltd
Signed-off-by Hironori KIKUCHI <[email protected]>--- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+)
PATCH v2 2/3 dt-bindings: display: panel: Add some generic MIPI-DSI/DPI panels
In reply to Hironori KIKUCHIThis is a binding for generic MIPI-DSI/DPI panels that require initialization with a simple command sequence before use.
The initialization of the panel requires a firmware binary which can be made with the Panel Firmware Generator[1] on the web.
Add 4 new panels, as they are available on the same page[1] as a preset (excluding already included ones).
Note that the "xx" in the panel name is taken from a product's name, not a wildcard.
[1]: https://kikuchan.github.io/panel-firmware-generator/
--- .../bindings/display/panel/panel-mipi.yaml | 121 ++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/panel/panel-mipi.yaml
Documentation/devicetree/bindings/display/panel/panel-mipi.yaml new file +121 -0
@@ -0,0 +1,121 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/panel/panel-mipi.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Generic MIPI-DSI/DPI Panels Requiring Initialization + +maintainers: + - Hironori KIKUCHI <[email protected]> + +description: This is a binding for generic MIPI-DSI/DPI panels that require + initialization with a simple command sequence before use. + +properties: + compatible: + oneOf: + - items: + - enum: + # Unknown 3.35" 720x480 24-bit IPS LCD panel + # used in Anbernic RG 34XX + - anbernic,rg34xx-panel + # Unknown 4.00" 640x480 24-bit IPS LCD panel (YLM-LBV0400001X-V1) + # used in Anbernic RG40XX series + - anbernic,rg40xx-panel + # Unknown 3.95" 720x720 24-bit IPS LCD panel (YLM-LBN0395004H-V1) + # used in Anbernic RG CubeXX + - anbernic,rgcubexx-panel + - const: panel-mipi-dpi-spi + - items: + - enum: + # HOTHMI TFT-H028B23VGIST7G40-V1 2.80" 480x640 TFT LCD panel + - hothmi,tft-h028b23vgist7g40-v1 + - const: panel-mipi-dsi + + reg: + description: DSI / SPI channel used by that screen + maxItems: 1 + + power-supply: true + + io-supply: + description: I/O system regulator. + No need to set if this is the same as polwer-supply. + + dc-gpios: + maxItems: 1 + description: Controller data/command selection (D/CX) in 4-line SPI mode. + If not set, the controller is in 3-line SPI mode. + Disallowed for DSI. + + port: true + reset-gpios: true + + backlight: true + +required: + - compatible + - reg + +allOf: + - $ref: panel-common.yaml# + - if: + properties: + compatible: + contains: + enum: + - panel-mipi-dpi-spi + then: + # SPI mode + $ref: /schemas/spi/spi-peripheral-props.yaml# + + - if: + properties: + compatible: + contains: + enum: + - panel-mipi-dsi + then: + # DSI mode + properties: + dc-gpios: false + +unevaluatedProperties: false + +examples: + - | + dsi { + #address-cells = <1>; + #size-cells = <0>; + + panel@0 { + compatible = "hothmi,tft-h028b23vgist7g40-v1", "panel-mipi-dsi"; + reg = <0>; + + port { + mipi_in_panel: endpoint { + remote-endpoint = <&mipi_out_panel>; + }; + }; + }; + }; + - | + #include <dt-bindings/gpio/gpio.h> + + spi { + #address-cells = <1>; + #size-cells = <0>; + + panel@0 { + compatible = "anbernic,rg40xx-panel", "panel-mipi-dpi-spi"; + reg = <0>; + + spi-max-frequency = <40000000>; + + dc-gpios = <&gpio 24 GPIO_ACTIVE_HIGH>; + reset-gpios = <&gpio 25 GPIO_ACTIVE_LOW>; + + backlight = <&backlight>; + }; + };
Signature · 1 line
2.48.1
Rob Herring
maintainerRe: [PATCH v2 2/3] dt-bindings: display: panel: Add some generic MIPI-DSI/DPI panels
Quoted 45 lines · Hironori KIKUCHI
This is a binding for generic MIPI-DSI/DPI panels that require initialization with a simple command sequence before use.
The initialization of the panel requires a firmware binary which can be made with the Panel Firmware Generator[1] on the web.
Add 4 new panels, as they are available on the same page[1] as a preset (excluding already included ones).
Note that the "xx" in the panel name is taken from a product's name, not a wildcard.
[1]: https://kikuchan.github.io/panel-firmware-generator/
Signed-off-by Hironori KIKUCHI <[email protected]>--- .../bindings/display/panel/panel-mipi.yaml | 121 ++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/panel/panel-mipi.yamlDocumentation/devicetree/bindings/display/panel/panel-mipi.yaml new file +19
-0@@ -0,0 +1,121 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/panel/panel-mipi.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Generic MIPI-DSI/DPI Panels Requiring Initialization + +maintainers: + - Hironori KIKUCHI <[email protected]> + +description: This is a binding for generic MIPI-DSI/DPI panels that require + initialization with a simple command sequence before use. + +properties: + compatible: + oneOf: + - items: + - enum:
Documentation/devicetree/bindings/display/panel/panel-mipi.yaml line 29
Quoted 10 lines
Documentation/devicetree/bindings/display/panel/panel-mipi.yaml new file +10
-0+ # Unknown 3.35" 720x480 24-bit IPS LCD panel + # used in Anbernic RG 34XX + - anbernic,rg34xx-panel + # Unknown 4.00" 640x480 24-bit IPS LCD panel (YLM-LBV0400001X-V1) + # used in Anbernic RG40XX series + - anbernic,rg40xx-panel + # Unknown 3.95" 720x720 24-bit IPS LCD panel (YLM-LBN0395004H-V1) + # used in Anbernic RG CubeXX + - anbernic,rgcubexx-panel + - const: panel-mipi-dpi-spi
We already have a schema for this: panel-mipi-dpi-spi.yaml
Documentation/devicetree/bindings/display/panel/panel-mipi.yaml line 34
Quoted 5 lines
Documentation/devicetree/bindings/display/panel/panel-mipi.yaml new file +5
-0+ - items: + - enum: + # HOTHMI TFT-H028B23VGIST7G40-V1 2.80" 480x640 TFT LCD panel + - hothmi,tft-h028b23vgist7g40-v1 + - const: panel-mipi-dsi
We have lots of DSI panels already and they don't have a generic fallback. What exactly would "panel-mipi-dsi" mean to the OS? It's got to be useful on its own or it should be dropped.
Quoted 90 lines
Documentation/devicetree/bindings/display/panel/panel-mipi.yaml new file +87
-0+ + reg: + description: DSI / SPI channel used by that screen + maxItems: 1 + + power-supply: true + + io-supply: + description: I/O system regulator. + No need to set if this is the same as polwer-supply. + + dc-gpios: + maxItems: 1 + description: Controller data/command selection (D/CX) in 4-line SPI mode. + If not set, the controller is in 3-line SPI mode. + Disallowed for DSI. + + port: true + reset-gpios: true + + backlight: true + +required: + - compatible + - reg + +allOf: + - $ref: panel-common.yaml# + - if: + properties: + compatible: + contains: + enum: + - panel-mipi-dpi-spi + then: + # SPI mode + $ref: /schemas/spi/spi-peripheral-props.yaml# + + - if: + properties: + compatible: + contains: + enum: + - panel-mipi-dsi + then: + # DSI mode + properties: + dc-gpios: false + +unevaluatedProperties: false + +examples: + - | + dsi { + #address-cells = <1>; + #size-cells = <0>; + + panel@0 { + compatible = "hothmi,tft-h028b23vgist7g40-v1", "panel-mipi-dsi"; + reg = <0>; + + port { + mipi_in_panel: endpoint { + remote-endpoint = <&mipi_out_panel>; + }; + }; + }; + }; + - | + #include <dt-bindings/gpio/gpio.h> + + spi { + #address-cells = <1>; + #size-cells = <0>; + + panel@0 { + compatible = "anbernic,rg40xx-panel", "panel-mipi-dpi-spi"; + reg = <0>; + + spi-max-frequency = <40000000>; + + dc-gpios = <&gpio 24 GPIO_ACTIVE_HIGH>; + reset-gpios = <&gpio 25 GPIO_ACTIVE_LOW>; + + backlight = <&backlight>; + }; + };Signature · 1 line
2.48.1
PATCH v2 3/3 drm: panel: Add a driver for Generic MIPI-DSI/DPI(+SPI) panels
In reply to Hironori KIKUCHIAlthough the MIPI specifications define how to communicate with a panel to display an image, some panels still require a panel-specific initialization sequence to be sent.
This is a driver for such generic MIPI-DSI/DPI panels that require initialization with a simple command sequence before use.
Its fundamental approach is similar to panel-mipi-dbi driver, which sends an initialization sequence stored in a firmware file.
Moreover, this driver allows display modes, timings, and panel configuration parameters to be stored in the same file.
--- drivers/gpu/drm/panel/Kconfig | 10 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-mipi.c | 1181 ++++++++++++++++++++++++++++ 3 files changed, 1192 insertions(+) create mode 100644 drivers/gpu/drm/panel/panel-mipi.c
drivers/gpu/drm/panel/Kconfig +10 -0
@@ -408,6 +408,16 @@ config DRM_PANEL_MANTIX_MLAF057WE51 has a resolution of 720x1440 pixels, a built in backlight and touch controller. +config DRM_PANEL_MIPI + tristate "Generic MIPI-DSI/DPI(+SPI) panel" + depends on OF + depends on SPI || DRM_MIPI_DSI + select DRM_MIPI_DBI if SPI + depends on BACKLIGHT_CLASS_DEVICE + help + Say Y here if you want to enable support for Generic MIPI-DSI / + MIPI-DPI(+SPI) panels. + config DRM_PANEL_NEC_NL8048HL11 tristate "NEC NL8048HL11 RGB panel" depends on GPIOLIB && OF && SPI
drivers/gpu/drm/panel/Makefile +1 -0
@@ -40,6 +40,7 @@ obj-$(CONFIG_DRM_PANEL_LG_LB035Q02) += panel-lg-lb035q02.o obj-$(CONFIG_DRM_PANEL_LG_LG4573) += panel-lg-lg4573.o obj-$(CONFIG_DRM_PANEL_LG_SW43408) += panel-lg-sw43408.o obj-$(CONFIG_DRM_PANEL_MAGNACHIP_D53E6EA8966) += panel-magnachip-d53e6ea8966.o +obj-$(CONFIG_DRM_PANEL_MIPI) += panel-mipi.o obj-$(CONFIG_DRM_PANEL_NEC_NL8048HL11) += panel-nec-nl8048hl11.o obj-$(CONFIG_DRM_PANEL_NEWVISION_NV3051D) += panel-newvision-nv3051d.o obj-$(CONFIG_DRM_PANEL_NEWVISION_NV3052C) += panel-newvision-nv3052c.o
drivers/gpu/drm/panel/panel-mipi.c new file +1181 -0
1,181 lines not on this page · raw message
Signature · 1 line
2.48.1
Re: [PATCH v2 3/3] drm: panel: Add a driver for Generic MIPI-DSI/DPI(+SPI) panels
Quoted 6 lines · Hironori KIKUCHI
drivers/gpu/drm/panel/panel-mipi.c new file +6
-0+ +struct panel_firmware_header { +u8 magic[15 ]; +u8 file_format_version;/* must be 1 */ +} __packed; +
drivers/gpu/drm/panel/panel-mipi.c line 109
Quoted 10 lines
drivers/gpu/drm/panel/panel-mipi.c new file +10
-0+struct panel_firmware_config { +u16 width_mm, height_mm; +u16 rotation; +u8 _reserved_1[2 ]; +u8 _reserved_2[8 ]; + +u16 reset_delay;/* delay after the reset command, in ms */ +u16 init_delay;/* delay for sending the initial command sequence, in ms */ +u16 sleep_delay;/* delay after the sleep command, in ms */ +u16 backlight_delay;/* delay for enabling the backlight, in ms */
These should be implied by compatible.
Quoted 11 lines
drivers/gpu/drm/panel/panel-mipi.c new file +11
-0+u16 _reserved_3[4 ]; + +u16 dsi_lanes;/* unsigned int */ +u16 dsi_format;/* enum mipi_dsi_pixel_format */ +u32 dsi_mode_flags;/* unsigned long */ +u32 bus_flags;/* struct drm_bus_flags */ +u8 _reserved_4[2 ]; +u8 preferred_timing; +u8 num_timings; +} __packed; +
...
Quoted 13 lines
drivers/gpu/drm/panel/panel-mipi.c new file +13
-0+ +static int panel_mipi_probe (struct device *dev,int connector_type) +{ +struct panel_mipi *mipi; +int err; + + mipi =devm_kzalloc (dev,sizeof (*mipi),GFP_KERNEL ); +if (!mipi) +return -ENOMEM ; + +mutex_init (&mipi->lock); + + mipi->display_id =-1 ;
drivers/gpu/drm/panel/panel-mipi.c line 992
Quoted 10 lines
drivers/gpu/drm/panel/panel-mipi.c new file +10
-0+ +/* Get `power-supply` and `io-supply` (if any) */ + mipi->supplies[0 ].supply ="power" ; + mipi->supplies[1 ].supply ="io" ; + err =devm_regulator_bulk_get (dev,ARRAY_SIZE (mipi->supplies), + mipi->supplies); +if (err <0 ) { +return dev_err_probe (dev, err, +"%pOF: Failed to get regulators\n" , + dev->of_node);
Drop pOF. Device name already tells this.
drivers/gpu/drm/panel/panel-mipi.c line 999
Quoted 7 lines
drivers/gpu/drm/panel/panel-mipi.c new file +7
-0+ } + +/* GPIO for /RESET */ + mipi->reset =devm_gpiod_get_optional (dev,"reset" ,GPIOD_OUT_HIGH ); +if (IS_ERR (mipi->reset)) + return dev_err_probe(dev, PTR_ERR(mipi->reset), + "%pOF: Failed to get GPIO for RESET\n",
Drop pOF. Device name already tells this.
Quoted 38 lines
drivers/gpu/drm/panel/panel-mipi.c new file +38
-0+ dev->of_node); + +/* Load the firmware */ + mipi->firmware =panel_mipi_load_firmware (dev); +if (IS_ERR (mipi->firmware)) +return dev_err_probe (dev,PTR_ERR (mipi->firmware), +"Failed to load firmware\n" ); + + err =panel_mipi_read_firmware (dev, mipi, mipi->firmware); +if (err) +return err; + + err =panel_mipi_probe_modes (dev, mipi); +if (err) +return err; + +/* DRM panel setup */ +drm_panel_init (&mipi->panel, dev, &panel_mipi_funcs, connector_type); + + err =panel_mipi_set_backlight (&mipi->panel, dev, mipi); +if (err) +return dev_err_probe (dev, err,"Failed to set backlight\n" ); + +drm_panel_add (&mipi->panel); + +dev_set_drvdata (dev, mipi); + +panel_mipi_debugfs_init (dev, mipi); + +return devm_add_action_or_reset (dev, panel_mipi_cleanup, mipi); +} + +static int panel_mipi_dsi_probe (struct mipi_dsi_device *dsi) +{ +struct panel_mipi *mipi; +int err; + + err =panel_mipi_probe (&dsi->dev,DRM_MODE_CONNECTOR_DSI );
drivers/gpu/drm/panel/panel-mipi.c line 1047
Quoted 10 lines
drivers/gpu/drm/panel/panel-mipi.c new file +10
-0+if (err) +return err; + + mipi =dev_get_drvdata (&dsi->dev); + mipi->dsi = dsi; + mipi->write_command = panel_mipi_dsi_write; + mipi->read_command = panel_mipi_dsi_read; + +/* Read from the firmware */ + dsi->lanes =be16_to_cpu (mipi->firmware->config->dsi_lanes);
lanes are from DT, because they are depending on how panel is wired. At least usually.
Quoted 12 lines
drivers/gpu/drm/panel/panel-mipi.c new file +12
-0+ dsi->format =be16_to_cpu (mipi->firmware->config->dsi_format); + dsi->mode_flags =be32_to_cpu (mipi->firmware->config->dsi_mode_flags); + +if (!dsi->lanes) +return dev_err_probe (&dsi->dev, -EINVAL , +"dsi-lanes == 0 for DSI panel\n" ); + +/* Adjust bus_format */ +switch (dsi->format) { +case MIPI_DSI_FMT_RGB888 : + mipi->bus_format =MEDIA_BUS_FMT_RGB888_1X24 ; +break ;
drivers/gpu/drm/panel/panel-mipi.c line 1069
Quoted 10 lines
drivers/gpu/drm/panel/panel-mipi.c new file +10
-0+case MIPI_DSI_FMT_RGB666 : + mipi->bus_format =MEDIA_BUS_FMT_RGB666_1X24_CPADHI ; +break ; +case MIPI_DSI_FMT_RGB666_PACKED : + mipi->bus_format =MEDIA_BUS_FMT_RGB666_1X18 ; +break ; +case MIPI_DSI_FMT_RGB565 : + mipi->bus_format =MEDIA_BUS_FMT_RGB565_1X16 ; +break ; + }
Best regards,
Krzysztof
kernel test robot
build botRe: [PATCH v2 3/3] drm: panel: Add a driver for Generic MIPI-DSI/DPI(+SPI) panels
In reply to Hironori KIKUCHIkernel test robot noticed the following build warnings:
Hi Hironori,
kernel test robot noticed the following build warnings:
[auto build test WARNING on robh/for-next]
[also build test WARNING on linus/master v6.14-rc5 next-20250305] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Hironori-KIKUCHI/dt-bindings-vendor-prefixes-Add-hothmi-vendor-prefix/20250226-192724 base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next patch link: https://lore.kernel.org/r/20250226112552.52494-4-kikuchan98%40gmail.com patch subject: [PATCH v2 3/3] drm: panel: Add a driver for Generic MIPI-DSI/DPI(+SPI) panels config: csky-randconfig-r112-20250306 (https://download.01.org/0day-ci/archive/20250306/[email protected]/config) compiler: csky-linux-gcc (GCC) 14.2.0 reproduce: (https://download.01.org/0day-ci/archive/20250306/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
sparse warnings: (new ones prefixed by >>)
>> drivers/gpu/drm/panel/panel-mipi.c:407:26: sparse: sparse: cast to restricted __be16 drivers/gpu/drm/panel/panel-mipi.c:408:27: sparse: sparse: cast to restricted __be16 drivers/gpu/drm/panel/panel-mipi.c:410:20: sparse: sparse: cast to restricted __be16 drivers/gpu/drm/panel/panel-mipi.c:424:29: sparse: sparse: cast to restricted __be16 drivers/gpu/drm/panel/panel-mipi.c:425:28: sparse: sparse: cast to restricted __be16 drivers/gpu/drm/panel/panel-mipi.c:426:29: sparse: sparse: cast to restricted __be16 drivers/gpu/drm/panel/panel-mipi.c:427:33: sparse: sparse: cast to restricted __be16 >> drivers/gpu/drm/panel/panel-mipi.c:429:27: sparse: sparse: cast to restricted __be32
drivers/gpu/drm/panel/panel-mipi.c:854:23: sparse: sparse: cast to restricted __be32 drivers/gpu/drm/panel/panel-mipi.c:856:26: sparse: sparse: cast to restricted __be16 drivers/gpu/drm/panel/panel-mipi.c:857:46: sparse: sparse: cast to restricted __be16 drivers/gpu/drm/panel/panel-mipi.c:858:47: sparse: sparse: cast to restricted __be16 drivers/gpu/drm/panel/panel-mipi.c:859:42: sparse: sparse: cast to restricted __be16 drivers/gpu/drm/panel/panel-mipi.c:861:26: sparse: sparse: cast to restricted __be16 drivers/gpu/drm/panel/panel-mipi.c:862:46: sparse: sparse: cast to restricted __be16 drivers/gpu/drm/panel/panel-mipi.c:863:47: sparse: sparse: cast to restricted __be16 drivers/gpu/drm/panel/panel-mipi.c:864:42: sparse: sparse: cast to restricted __be16 drivers/gpu/drm/panel/panel-mipi.c:866:23: sparse: sparse: cast to restricted __be32 drivers/gpu/drm/panel/panel-mipi.c:1047:22: sparse: sparse: cast to restricted __be16 drivers/gpu/drm/panel/panel-mipi.c:1048:23: sparse: sparse: cast to restricted __be16 drivers/gpu/drm/panel/panel-mipi.c:1049:27: sparse: sparse: cast to restricted __be32 drivers/gpu/drm/panel/panel-mipi.c: note: in included file (through include/linux/mutex.h, include/drm/drm_mipi_dbi.h):
include/linux/list.h:83:21: sparse: sparse: self-comparison always evaluates to true
vim +407 drivers/gpu/drm/panel/panel-mipi.c
392
393 static int panel_mipi_read_firmware(const struct device *dev,
394 struct panel_mipi *mipi,
395 const struct panel_firmware *firmware)
396 {
397 int rotation;
398 int err;
399
400 err = panel_mipi_load_commands(mipi, firmware->commands.data,
401 firmware->commands.size);
402 if (err) {
403 dev_err(dev, "firmware: Malformed command sequence\n");
404 return err;
405 }
406
> 407 mipi->width_mm = be16_to_cpu(firmware->config->width_mm);
408 mipi->height_mm = be16_to_cpu(firmware->config->height_mm);
409
410 rotation = be16_to_cpu(firmware->config->rotation);
411 if (rotation == 0)
412 mipi->orientation = DRM_MODE_PANEL_ORIENTATION_NORMAL;
413 else if (rotation == 90)
414 mipi->orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP;
415 else if (rotation == 180)
416 mipi->orientation = DRM_MODE_PANEL_ORIENTATION_BOTTOM_UP;
417 else if (rotation == 270)
418 mipi->orientation = DRM_MODE_PANEL_ORIENTATION_LEFT_UP;
419 else {
420 dev_err(dev, "firmware: Invalid rotation %u\n", rotation);
421 return -EINVAL;
422 }
423
424 mipi->reset_delay = be16_to_cpu(firmware->config->reset_delay);
425 mipi->init_delay = be16_to_cpu(firmware->config->init_delay);
426 mipi->sleep_delay = be16_to_cpu(firmware->config->sleep_delay);
427 mipi->backlight_delay = be16_to_cpu(firmware->config->backlight_delay);
428
> 429 mipi->bus_flags = be32_to_cpu(firmware->config->bus_flags); 430
431 return 0;
432 }
433
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki