I'm trying to configure the device tree for my i.MX6 to activate SPI communications and I came across this thread:
Carlos says that this device tree is set-up to manually control the SS - which is exactly what I want to do. However, I am having no success. When I try to export my GPIO I get the message "write error: Device or resource busy".
This is my device tree:
&ecspi1 {
fsl,spi-num-chipselects = <1>;
cs-gpios = <&gpio2 30 GPIO_ACTIVE_LOW>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ecspi1>;
status = "okay";
spidev@0 {
compatible = "rohm,dh2228fv"; /* this is a 'hack' see note below */
reg = <0>;
spi-max-frequency = <1000000>;
status = "okay";
};
};
&iomuxc {
pinctrl_ecspi1: ecspi1grp {
fsl,pins = <
MX6QDL_PAD_EIM_D18__ECSPI1_MOSI 0x0b0b0
MX6QDL_PAD_EIM_D17__ECSPI1_MISO 0x0b0b0
MX6QDL_PAD_EIM_D16__ECSPI1_SCLK 0x0b0b0
MX6QDL_PAD_GPIO_19__ECSPI1_RDY 0x0b0b0
MX6QDL_PAD_EIM_EB2__GPIO2_IO30 0x0b0b0
>;
};
};
I've checked and GPIO2_30 is not used anywhere else - so it seems that the SPI driver has taken command of this pin - and I cannot drive it manually. I don't quite understand what I need to change in order to be able to drive this manually as a GPIO.