ad7877 device tree spi touch screen interfacing

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ad7877 device tree spi touch screen interfacing

669 Views
kondaveetiarung
Contributor II

 

 

 

Hi,

 

Currently iam working on imx6sololite  ad7877 Touch screen Interfacing with SPI Communcation in kernel 3.10.

 

iam working on YOCTO Project and I did some modifications in device tree as mentioned in Below.

 

This is my DTSI FILE

 

 

ecspi2: ecspi@0200c000 {

                                        #address-cells = <1>;

                                        #size-cells = <0>;

                                        compatible = "fsl,imx6sl-ecspi", "fsl,imx51-ecspi";

                                        reg = <0x0200c000 0x4000>;

                                        interrupts = <0 32 0x04>;

                                        clocks = <&clks IMX6SL_CLK_ECSPI2>,

                                                 <&clks IMX6SL_CLK_ECSPI2>;

                                        clock-names = "ipg", "per";

                                        status = "disabled";

                                };

 

 

ecspi2 {

                pinctrl_ecspi2_2:ecspi3grp-1 {

                        fsl,pins = <

                            

                                MX6SL_PAD_ECSPI2_MISO__ECSPI2_MISO 0x100b1

                                MX6SL_PAD_ECSPI2_MOSI__ECSPI2_MOSI 0x100b1

                                MX6SL_PAD_ECSPI2_SCLK__ECSPI2_SCLK 0x100b1

                        >;

                };

        };

 

Here iam configured as SPI2 communication with MOSI and MISO and clk pins.

 

This is my DTS file.

 

&ecspi2 {

        fsl,spi-num-chipselects = <2>;

        cs-gpios =<&gpio4 15 0>;

        status = "okay";

 

        spidev0: spidev@0{

        compatible="spidev";

        spi-max-frequency = <500000>;

        reg = <0>;

        };

 

        spidev1:spidev@1{

        compatible = "fsl,ad7877";

        cs-gpios = <&gpio1 27  0>;

        pinctrl-0 = <&pinctrl_ecspi2_2>;

        spi-max-frequency = <500000>;

        reg = <1>;

        interrupt-parent = <&gpio5>;

        interrupts = <7 2>;

        adi,swap-xy-axis-enable = <0>;

        adi,x-plate-ohms = <620>;

        adi,pressure-min = <0>;

        adi,pressure-max = <1000>;

        adi,x-min = <0>;

        adi,x-max = <800>;

        adi,y-min = <0>;

        adi,y.max = <600>;

        adi,first-conversion-delay = <3>;

        adi,acquisition-time = <1>;

        adi,averaging = <3>;

        adi,pen-down-acquisition-interval = <1>;

        adi,median = <2>;

                };

};

IN SPI communication iam using two devices one is lcd and second one is ad7877 Touch controller.

Iam New to SPI Communication.Please clarify my doubts. 

First Let me know few things ??

 

  1. Whether i have to configure the slave select line as spi_slave select (or) GPIO_pin in MUXING ??

 

  1. Spi is getting probed. But Pdata is not coming in drivers/input/touchscreen/ad7877.c . Let me know the above procedure is correct or not to send platform data ??
  2. With out the platform data i will place the ad7877 data in probe function in ad7877.c file in touch screen.weather it is correct or not.Please clarify my doubt.
  3. how to configure SPI Devices ?

Please clarify my doubts.

 

 

 

 

Labels (1)
0 Kudos
1 Reply

511 Views
Carlos_Musich
NXP Employee
NXP Employee

This thread is duplicated. Please refer to https://community.nxp.com/thread/451419 

Regards,

Carlos

0 Kudos