Not able to create a spi device in Android 12.1

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Not able to create a spi device in Android 12.1

ソリューションへジャンプ
787件の閲覧回数
dgeier315
Contributor III

We are migrating from Android 12.0 to 12.1.   The Android 12.0 build was modified to use spi-imx.c from AN13633 (Using Enhanced Configurable SPI (ECSPI) as Slave in Linux for i.MX 8M
Series).   When migrating to 12.1, the probe of the driver returns an error code of -22. 

[ 0.399225] spi_imx 30820000.spi: bitbang start failed with -22

[ 0.399241] spi_imx: probe of 30820000.spi failed with error -22

When I changed out the spi-imx.c from 12.1 for the one from AN13633, The probe appears to work, but now spi_busnum_to_master() fails.

[   88.391582] spiCtrl_init: MASTER not found

I don't see what has changed from Android 12.0 to 12.1.   Any insights would be appreciated.

#define MASTER_BUS_NUM 0

   //Register information about your device:

   struct spi_board_info spi_device_info = {

       .modalias = "PECL-master-command-port",

       .max_speed_hz = 13000000, //speed your device (slave) can handle

       .bus_num = MASTER_BUS_NUM,

       .chip_select = 0,

       .mode = 0,

   };

  

   pr_debug("%s: Start\n", __func__);

    /* To send data we have to know what spi port/pins should be used. This information

    * can be found in the device-tree. */

   master = spi_busnum_to_master( spi_device_info.bus_num );

   if ( !master ) {

       pr_err("%s: MASTER not found\n", __func__);

       return -ENODEV;

   }

Device Tree:

&ecspi1 {

    #address-cells = <1>;

    #size-cells = <0>;

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

    pinctrl-names = "default";

    pinctrl-0 = <&pinctrl_ecspi1>;

    //cs-gpios = GP_ECSPI1_CS;

    status = "okay";

};

 

0 件の賞賛
返信
1 解決策
747件の閲覧回数
Zhiming_Liu
NXP TechSupport
NXP TechSupport

The real bus number may change, you can try other value.

Or you can dump the real bus index when probe.

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
748件の閲覧回数
Zhiming_Liu
NXP TechSupport
NXP TechSupport

The real bus number may change, you can try other value.

Or you can dump the real bus index when probe.

0 件の賞賛
返信
720件の閲覧回数
dgeier315
Contributor III
The bus numbers have been fixed for many versions of Android. What causes the bus number to change?
0 件の賞賛
返信