How to increase the buffer of spi?

I am using jetson TX1 board and setting the spidev by the webset [u]http://elinux.org/Jetson/TX1_SPI[/u]
The spi can works well. the default size of spi buffer is 4096 byte.
Now I want to increase it, some one have meet the same question?

Hi viktor
Could you share where you find the default buffer is 4096?
And why do you need to increase it.

I used this cammand
cat /sys/module/spidev/parameters/bufsiz
I want to read many letter one time.

Hi viktor
Could you try below

Below step is working for me.

sudo su
cd /sys/module/spidev/parameters
chmod 666 bufsiz
echo 65534 > bufsiz

Hi ShaneCCC

The method above I had try. and it was OK if i did not power off or reboot the computer.
It will be changed back to 4096. and i do not want to do this every time after power on.
so do you have another good method to fix this problem.

Hi viktor
I guess you can modify the spidev.c to change it.

static LIST_HEAD(device_list);
static DEFINE_MUTEX(device_list_lock);

static unsigned bufsiz = 4096;
module_param(bufsiz, uint, S_IRUGO);
1 Like

Hi viktorzhang,

Can the suggested method work on your case?

Thanks