AnsweredAssumed Answered

ad7877  spi touch screen device tree interfacing 

Question asked by arungopal kondaveeti on May 16, 2017
Latest reply on May 17, 2017 by igorpadykov

 

 

 

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.

 

 

 

 

 

 

Outcomes