AnsweredAssumed Answered

How to enable native and gpio cs on ecspi

Question asked by Ali Malik on Mar 7, 2016
Latest reply on Mar 14, 2016 by alejandrolozano

Hi

I am having some issue getting the SPI to work on IMX6. The question I have is how do we enable multiple CS on SPI. This is what I currently have.

 

ecspi1 is using its 2 native chipselects and I also have a gpio CS.

This is what i did in my .dtsi file

ecspi1 {

        pinctrl_ecspi1_cs_1: ecspi1_cs_grp-1 {

            fsl,pins = <

                MX6QDL_PAD_KEY_ROW2__GPIO4_IO11 0x80000000 /* GPIO CS*/

                MX6QDL_PAD_KEY_COL2__ECSPI1_SS1 0x80000000

                MX6QDL_PAD_KEY_ROW1__ECSPI1_SS0 0x80000000

            >;

        };

&ecspi1 {

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

    cs-gpios = <&gpio4 11 0>, <&gpio4 10 0>, <&gpio4 9 0>;

    pinctrl-names = "default";

    pinctrl-0 = <&pinctrl_ecspi1_2>, <&pinctrl_ecspi1_cs_1>;

    status = "okay";

 

    ads7846@0x00 {

        reg = <0>;    /* CS0 */

        compatible = "ti,ads7846";

        interrupt-parent = <&gpio1>;

        interrupts = <4 1>;   

        spi-max-frequency = <1500000>;

        pendown-gpio = <&gpio1 4 0>;

        vcc-supply = <&reg_soc>;

        ti,x-min = /bits/ 16 <4200>;

        ti,x-max = /bits/ 16 <8080>;

        ti,y-min = /bits/ 16 <4330>;

        ti,y-max = /bits/ 16 <7980>;

        ti,x-plate-ohms = /bits/ 16 <180>;

        ti,pressure-max = /bits/ 16 <255>;

        ti,debounce-max    = /bits/ 16 <10>;

        ti,debounce-tol = /bits/ 16 <3>;

        ti,debounce-rep    = /bits/ 16 <1>;

        ti,settle-delay-usec    = /bits/ 16 <150>;

        ti,keep-vref-on;

        ti,swap-xy;   

        linux,wakeup;

    };

   

    io_expander_1: spi_imx@0x00 {

        compatible = "spi_imx";

        spi-max-frequency = <20000000>;

        reg = <1>;

    };

 

    io_expander_2: spi_imx@0x01 {

        compatible = "spi_imx";

        spi-max-frequency = <20000000>;

        reg = <2>;

    };

};

 

But I dont seem to get the io_expanders enables and noting appears in my /dev folder.

Any Ideas

Outcomes