Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: drivers: build_all: display: Add mipi-dsi devices to build test #79109

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions drivers/mipi_dsi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ zephyr_sources_ifdef(CONFIG_MIPI_DSI mipi_dsi.c)
zephyr_sources_ifdef(CONFIG_MIPI_DSI_MCUX dsi_mcux.c)
zephyr_sources_ifdef(CONFIG_MIPI_DSI_MCUX_2L dsi_mcux_2l.c)
zephyr_sources_ifdef(CONFIG_MIPI_DSI_STM32 dsi_stm32.c)
zephyr_sources_ifdef(CONFIG_MIPI_DSI_TEST dsi_test.c)
3 changes: 2 additions & 1 deletion drivers/mipi_dsi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ source "subsys/logging/Kconfig.template.log_config"

config MIPI_DSI_INIT_PRIORITY
int "Initialization priority"
default 86
default 85
help
MIPI-DSI Host Controllers initialization priority.

source "drivers/mipi_dsi/Kconfig.mcux"
source "drivers/mipi_dsi/Kconfig.stm32"
source "drivers/mipi_dsi/Kconfig.test"

endif
6 changes: 6 additions & 0 deletions drivers/mipi_dsi/Kconfig.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright (c) 2024 TOKITA Hiroshi
# SPDX-License-Identifier: Apache-2.0

config MIPI_DSI_TEST
def_bool DT_HAS_VND_MIPI_DSI_ENABLED
depends on DT_HAS_VND_MIPI_DSI_ENABLED
56 changes: 56 additions & 0 deletions drivers/mipi_dsi/dsi_test.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* Copyright (c) 2024 TOKITA Hiroshi
*
* SPDX-License-Identifier: Apache-2.0
*/

/*
* This is not a real mipi-dsi driver. It is used to instantiate struct
* devices for the "vnd,mipi-dsi" devicetree compatible used in test code.
*/

#include <zephyr/drivers/mipi_dsi.h>

#define DT_DRV_COMPAT vnd_mipi_dsi

static int vnd_mipi_dsi_attach(const struct device *dev, uint8_t channel,
const struct mipi_dsi_device *mdev)
{
ARG_UNUSED(dev);
ARG_UNUSED(channel);
ARG_UNUSED(mdev);

return -ENOTSUP;
}

static ssize_t vnd_mipi_dsi_transfer(const struct device *dev, uint8_t channel,
struct mipi_dsi_msg *msg)
{
ARG_UNUSED(dev);
ARG_UNUSED(channel);
ARG_UNUSED(msg);

return -1;
}

static int vnd_mipi_dsi_detach(const struct device *dev, uint8_t channel,
const struct mipi_dsi_device *mdev)
{
ARG_UNUSED(dev);
ARG_UNUSED(channel);
ARG_UNUSED(mdev);

return -ENOTSUP;
}

static struct mipi_dsi_driver_api vnd_mipi_dsi_api = {
.attach = vnd_mipi_dsi_attach,
.transfer = vnd_mipi_dsi_transfer,
.detach = vnd_mipi_dsi_detach,
};

#define VND_MIPI_DSI_INIT(n) \
DEVICE_DT_INST_DEFINE(n, NULL, NULL, NULL, NULL, POST_KERNEL, \
CONFIG_MIPI_DSI_INIT_PRIORITY, &vnd_mipi_dsi_api);

DT_INST_FOREACH_STATUS_OKAY(VND_MIPI_DSI_INIT)
11 changes: 11 additions & 0 deletions dts/bindings/test/vnd,mipi-dsi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#
# Copyright (c) 2024 TOKITA Hiroshi
#
# SPDX-License-Identifier: Apache-2.0
#

description: Test MIPI DSI host

compatible: "vnd,mipi-dsi"

include: [mipi-dsi-host.yaml]
82 changes: 82 additions & 0 deletions tests/drivers/build_all/display/app.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,90 @@
width = <240>;
height = <240>;
};

test_spi_ssd1327fb: ssd1327fb@7 {
compatible = "solomon,ssd1327fb";
reg = <7>;
mipi-max-frequency = <100000000>;

width = <240>;
height = <240>;
oscillator-freq = <0>;
display-offset = <0>;
start-line = <0>;
multiplex-ratio = <0>;
prechargep = <0>;
remap-value = <0>;
};
};

test_mipi_dsi {
compatible = "vnd,mipi-dsi";
#address-cells = <1>;
#size-cells = <0>;
status = "okay";

test_hx8394: hx8394@0 {
status = "okay";
compatible = "himax,hx8394";
reg = <0x0>;
reset-gpios = <&test_gpio 0 0>;
data-lanes = <2>;
width = <720>;
height = <1280>;
pixel-format = <0>;
};

test_nt35510: nt35510@1 {
status = "okay";
compatible = "frida,nt35510";
reg = <0x1>;
height = <800>;
width = <480>;
reset-gpios = <&test_gpio 0 0>;
bl-gpios = <&test_gpio 0 0>;
data-lanes = <2>;
pixel-format = <0>;
rotation = <90>;
};

test_otm8009a: otm8009a@2 {
status = "okay";
compatible = "orisetech,otm8009a";
reg = <0x2>;
height = <800>;
width = <480>;
reset-gpios = <&test_gpio 0 0>;
bl-gpios = <&test_gpio 0 0>;
data-lanes = <2>;
pixel-format = <0>;
rotation = <90>;
};

test_rm67162: rm67162@3 {
status = "okay";
compatible = "raydium,rm67162";
reg = <0x3>;
reset-gpios = <&test_gpio 0 0>;
bl-gpios = <&test_gpio 0 0>;
te-gpios = <&test_gpio 0 0>;
data-lanes = <1>;
width = <400>;
height = <392>;
pixel-format = <0>;
};

test_rm68200: rm68200@4 {
status = "okay";
compatible = "raydium,rm68200";
reg = <0x4>;
reset-gpios = <&test_gpio 0 0>;
data-lanes = <2>;
width = <720>;
height = <1280>;
pixel-format = <0>;
};
};

test_spi: spi@33334444 {
#address-cells = <1>;
Expand Down
1 change: 1 addition & 0 deletions tests/drivers/build_all/display/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ CONFIG_TEST=y
CONFIG_SPI=y
CONFIG_GPIO=y
CONFIG_DISPLAY=y
CONFIG_MIPI_DSI=y
Loading