anshulmakkar
Posts: 1
Joined: Thu Jan 26, 2023 4:25 pm

ssd-1305 device tree for Rpi.

Thu Jan 26, 2023 4:34 pm

Hi,

I am trying to get display out from SSD1305 controller connected via SPI to Rpi.

I took the SSD1306 device tree overlay modified it for 1305, compiled it and loaded, but the ssd1305 driver fails to load. While, if I load the SSD1306 overlay, the fb_ssd1306 driver loads, but that's not what I want.

Below is the overlay I am using :

Code: Select all

/dts-v1/;
/plugin/;

/ {
	compatible = "brcm,bcm2835";

	fragment@0 {
		target = <&spi0>;
		__overlay__ {
			status = "okay";
		};
	};

	fragment@1 {
		target = <&spidev0>;
		__overlay__ {
			status = "disabled";
		};
	};

	fragment@2 {
		target = <&spidev1>;
		__overlay__ {
			status = "disabled";
		};
	};

	fragment@3 {
		target = <&gpio>;
		__overlay__ {
			ssd1305_pins: ssd1305_pins {
                                brcm,pins = <25 24>;
                                brcm,function = <1 1>; /* out out */
			};
		};
	};

	fragment@4 {
		target = <&spi0>;
		__overlay__ {
			/* needed to avoid dtc warning */
			#address-cells = <1>;
			#size-cells = <0>;

			ssd1305: ssd1305@0{
				compatible = "solomon,ssd1305";
				reg = <0>;
				pinctrl-names = "default";
				pinctrl-0 = <&ssd1305_pins>;

				spi-max-frequency = <10000000>;
				bgr = <0>;
				bpp = <1>;
				rotate = <90>;
				fps = <25>;
				buswidth = <8>;
				reset-gpios = <&gpio 25 1>;
				dc-gpios = <&gpio 24 0>;
				debug = <1>;

				solomon,height = <64>;
				solomon,width = <128>;
				solomon,page-offset = <0>;
			};
		};
	};

	__overrides__ {
		speed     = <&ssd1305>,"spi-max-frequency:0";
		rotate    = <&ssd1305>,"rotate:0";
		fps       = <&ssd1305>,"fps:0";
		debug     = <&ssd1305>,"debug:1";
		dc_pin    = <&ssd1305>,"dc-gpios:4",
		            <&ssd1305_pins>,"brcm,pins:4";
		reset_pin = <&ssd1305>,"reset-gpios:4",
		            <&ssd1305_pins>,"brcm,pins:0";
		height    = <&ssd1305>,"solomon,height:0";
	};
};

I have verified the GPIOs are configured properly.

Please any suggestions here .

Thanks
Anshul

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4935
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: ssd-1305 device tree for Rpi.

Thu Jan 26, 2023 5:59 pm

The ssd1305 has its own driver, which isn't enabled:

Code: Select all

$ ls -l drivers/staging/fbtft/fb_ssd130*.c
-rw-rw-r-- 1 phil phil 4569 Jan 14 11:31 drivers/staging/fbtft/fb_ssd1305.c
-rw-rw-r-- 1 phil phil 5093 Jan 14 11:31 drivers/staging/fbtft/fb_ssd1306.c
$ grep SSD130 .config
CONFIG_FB_SSD1307=m
# CONFIG_FB_TFT_SSD1305 is not set
CONFIG_FB_TFT_SSD1306=m
You'll have to compile your own kernel, adding "CONFIG_FB_TFT_SSD1305=m" to the .config.

Or create a Pull request or Issue in our kernel repo (https://github.com/raspberrypi/linux), asking for the module to be enabled in the standard builds.

Return to “Device Tree”