VAR-SOM-MX6 SPI

From Variscite Wiki
Revision as of 16:36, 13 December 2015 by Ron (talk | contribs) (Created page with " Testing SPI from user space require some changes. * Configure your kernel and add spidev driver. Device Drivers -> SPI support -> <*> User mode SPI device driver support<br...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Testing SPI from user space require some changes.

  • Configure your kernel and add spidev driver. Device Drivers -> SPI support -> <*> User mode SPI device driver support
  • Add spidev to your device tree
&ecspi1 {
	fsl,spi-num-chipselects = <1>;
	cs-gpios = <&gpio4 9 0>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_ecspi1_2>;
	status = "okay";

        chip1: spidev@0 {
               compatible = "spidev";
               spi-max-frequency = <12000000>;
               reg = <0>;
        };
/*
        chip2: spidev@1 {
               compatible = "spidev";
               spi-max-frequency = <20000000>;
               reg = <1>;
	};
*/
};

Pick and choose the right chip select and you can also have multiple chip selects.