Quantcast
Channel: Processors forum - Recent Threads
Viewing all articles
Browse latest Browse all 17527

OMAP-L137, can't send data via spidev.

$
0
0

Hello, I am trying to send data via spidev in Linux with kernel 4.4.8.

I've added support of spi in menuconfig (support of userspace operations and support of TI spi devices).

Also, I changed board-da-830-evm.c file:

static struct spi_board_info da830evm_spi_info[] = {
	[0] = {
		.modalias		= "m25p80",
		.platform_data		= &da830evm_spiflash_data,
		.controller_data	= &da830evm_spiflash_cfg,
		.mode			= SPI_MODE_0,
		.max_speed_hz		= 30000000,
		.bus_num		= 0,
		.chip_select		= 0,
	},
	[1] = {
		.modalias		= "spidev",
		.mode			= SPI_MODE_0 | SPI_NO_CS,	
		.controller_data	= &da830evm_spi1_cfg,
		.max_speed_hz		= 100000,
		.bus_num		= 1,
		.chip_select		= 0,
	},
};

...

    ret = davinci_cfg_reg_list(da830_spi1_pins);
    if (ret)
        pr_warn("%s: spi1 setup failed: %d\n", __func__, ret);    

    if (ret)
        pr_warn("%s: spi info registration failed: %d\n",
            __func__, ret);    

    ret = da8xx_register_spi_bus(0, ARRAY_SIZE(da830evm_spi_info));
    if (ret)
        pr_warn("%s: spi 0 registration failed: %d\n", __func__, ret);

        
    ret = da8xx_register_spi_bus(1, 0);//ARRAY_SIZE(da830evm_spi_info));
    if (ret)
        pr_warn("%s: spi 1 registration failed: %d\n", __func__, ret);
    
        
    ret = spi_register_board_info(da830evm_spi_info,
                      ARRAY_SIZE(da830evm_spi_info));

And now I have spidev1.0 in /dev/ folder.

But I can't send data through it:

$ echo -ne test > /dev/spidev1.0 

spidev spi1.0: SPI transfer failed: -22
spi_master spi1: failed to transfer one message from queue
sh: write error: Invalid argument

And I can see, that the error happens  in file spi.c in the command:


            ret = master->transfer_one(master, msg->spi, xfer);

So, now I am trying to find transfer_one implementation for omap-l137, but I can't.

Can you help me with this problem?


Viewing all articles
Browse latest Browse all 17527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>