How to Build Drivers for Zephyr | Interrupt

Thanks for this tutorial @jaredwolff

I wanted to use it to write a driver for my display with an SSD7317.
As a template, I took the display driver of the SSD1306 which is already available in the device tree of Zephyr.

I have packed the shield definition into my overlay file, as I have connected it directly to my board.

	chosen {
		nordic,pm-ext-flash = &mx25r64;
		zephyr,display = &ssd7317;
	};
};

&arduino_i2c {
	status = "okay";

	ssd7317: ssd7317@3c {
		compatible = "solomon,ssd7317";
		reg = <0x3c>;
		width = <128>;
		height = <32>;
		segment-offset = <0>;
		page-offset = <0>;
		display-offset = <0>;
		multiplex-ratio = <31>;
		segment-remap;
		com-invdir;
		com-sequential;
		prechargep = <0x22>;
	};
};

Now when I want to use it with LVGL I have the problem that it doesn’t seem to find the device in the DTS.

I get a No SOURCES given to Zephyr library: drivers__display as a warning when compiling and at the end the linker fails with undefined reference to __device_dts_ord_128`'.

In zephyr.dts my driver is listed as expected.

However, if I place the same driver under zephyr/drivers/display and adjust the Kconfig and CMakeList.txt the compilation runs through without any errors.
It also works if I omit the zephyr_library() in the CMakeLists.txt of the driver.

Do you have any hints what I am doing wrong with the driver in my project or what I could still check?