Jump to content

ADS7846 touch screen doesn't work. unknown pin PL8 error.


Go to solution Solved by Gunjan Gupta,

Recommended Posts

Posted (edited)

Hi all! Could someone help me?
I am triying to setup Kedei 3.5 HDLCD touchscreen. I found a common example sunxi-DT-overlay for ads7846.

/dts-v1/;
/plugin/;

/ {
	compatible = "allwinner,sun4i-a10", "allwinner,sun7i-a20", "allwinner,sun8i-h3", "allwinner,sun50i-a64", "allwinner,sun50i-h5";

	fragment@0 {
		target = <&pio>;
		__overlay__ {
			ads7846_pins: ads7846_pins {
				pins= "PA7";
				function = "irq";
           		};
		};
	};

	fragment@1 {
		target = <&spi0>;
		__overlay__ {
			#address-cells = <1>;
			#size-cells = <0>;
			status = "okay";
			ads7846@0 {
				compatible = "ti,ads7846";
				reg = <0>; /* Chip Select 0 */
				status = "okay";
				pinctrl-names = "default";
				pinctrl-0 = <&ads7846_pins>;
				spi-max-frequency = <2000000>;
				interrupt-parent = <&pio>;
				interrupts = <0 7 2>; /* PA7 IRQ_TYPE_EDGE_FALLING */
				pendown-gpio = <&pio 0 7 0>; /* PA7 */

				/* driver defaults, optional */
				ti,x-min = /bits/ 16 <0>;
				ti,y-min = /bits/ 16 <0>;
				ti,x-max = /bits/ 16 <0x0FFF>;
				ti,y-max = /bits/ 16 <0x0FFF>;
				ti,pressure-min = /bits/ 16 <0>;
				ti,pressure-max = /bits/ 16 <0xFFFF>;
				ti,x-plate-ohms = /bits/ 16 <400>;
			};
		};
	};
};

 

I changed pin "PA7" with "PL8" and after reboot got such error:
[    9.788721] sun50i-h6-pinctrl 300b000.pinctrl: unknown pin PL8


Also I can't use other ports, PA and PH support interrupts, but PA is not exposed to the interface pins. All of PH occupated by SPI. PD does not support interrupts (got "no irq" error).

 

My dts:
 

/dts-v1/;
/plugin/;

/ {
        compatible = "allwinner,sun50i-h6";

        fragment@0 {
                target = <&pio>;
                __overlay__ {
                        ads7846_pins: ads7846_pins {
                                pins= "PL8";
                                function = "irq";
                        };
                };
        };

        fragment@1 {
                target = <&spi1>;
                __overlay__ {
                        #address-cells = <1>;
                        #size-cells = <0>;
                        status = "okay";
                        ads7846@0 {
                                compatible = "ti,ads7846";
                                reg = <0>; /* Chip Select 0 */
                                status = "okay";
                                pinctrl-names = "default";
                                pinctrl-0 = <&ads7846_pins>;
                                spi-max-frequency = <2000000>;
                                interrupt-parent = <&pio>;
                                interrupts = <11 8 2>; /* PL8 IRQ_TYPE_EDGE_FALLING */
                                pendown-gpio = <&pio 11 8 0>; /* PL8 */

                                /* driver defaults, optional */
                                ti,x-min = /bits/ 16 <0>;
                                ti,y-min = /bits/ 16 <0>;
                                ti,x-max = /bits/ 16 <0x0FFF>;
                                ti,y-max = /bits/ 16 <0x0FFF>;
                                ti,pressure-min = /bits/ 16 <0>;
                                ti,pressure-max = /bits/ 16 <0xFFFF>;
                                ti,x-plate-ohms = /bits/ 16 <400>;
                        };
                };
        };
};

 

Edited by sas321sas
  • sas321sas changed the title to ADS7846 touch screen doesn't work. unknown pin PL8 error.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines