AnsweredAssumed Answered

use SPI MCP23S17

Question asked by Tobias Härter on Jan 10, 2017
Latest reply on Jan 16, 2017 by Tobias Härter

Hello
I have problems to get the GPIO Port Expander MCP23S17 to run and to use the Driver gpio-mcp23s08.c on a i.MX6


I have add the following Kernel configs

 CONFIG_GPIO_MCP23S08=y
CONFIG_SPI_IMX=y

 

I have change my Devicetree like following:

&ecspi1 {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_ecspi1>;
    fsl,spi-num-chipselects = <2>;
    cs-gpios = <
        &gpio2 30 GPIO_ACTIVE_HIGH
        &gpio3 19 GPIO_ACTIVE_HIGH
    >;
    status = "okay";

 

    gpiom0: gpio8@0 {
        compatible = "microchip,mcp23s17";
        gpio-controller;
        #gpio-cells = <2>;
        microchip,spi-present-mask = <0x01>;
        reg = <0>;
        spi-max-frequency = <1000000>;
        };

 

    spidev1: spi@1 {
        compatible = "spidev";
        reg = <1>;
        spi-max-frequency = <54000000>;
    };
};

 

With

dmesg | grep spi
I get

[ 3.751757] spi_imx 2008000.ecspi: registered master spi0
[ 3.756600] spi spi0.0: spi_imx_setup: mode 0, 8 bpw, 1000000 hz
[ 3.761616] spi spi0.0: setup mode 0, 8 bits/w, 1000000 Hz max --> 0
[ 3.770168] spi_imx 2008000.ecspi: registered child spi0.0
[ 3.780987] spi spi0.1: spi_imx_setup: mode 0, 8 bpw, 54000000 hz
[ 3.785848] spi spi0.1: setup mode 0, 8 bits/w, 54000000 Hz max --> 0

 

How do I load, test and use the gpio-mcp23s08 Driver?

regards

Tobias

Outcomes