Jetson TX2 mcp23s17 I/O Expander

Hello,

I´m new to embedded Linux development.
We wish to use a mcp23s17 I/O expander on the TX2. We have used the jetsonhacks script to get the kernel GUI

$ ./getKernelSources.sh

In this configuration the mcp23xxx driver is enabled. After making the kernel and booted with the new kernel using the following scripts:

$ ./makeKernel.sh$
 ./copyImage.sh

And using the lsmod command, we where unable to find a mcp23xxx module.

What are the step to enable this driver, and how to use them in user space using c++ code to drive the I/O of the mcp23xxx driver?

EDIT:

I managed to get the gpio_mcp23s08 to show up in /lib/module/kernel/drivers/gpio

Also, when I use

insmod gpio_mcp23s08.ko

it hows up in

lsmod

The remaining question is, how to use the driver to talk to the device?

hello kcwschou,

seems you would like to use kernel APIs to control GPIO pins,
you may also dowload L4T TX2 Sources, please check gpio_set_value() functions about how to toggle GPIO pins.
please also refer to Tegra Linux Driver Package TX2 Adaptation Guide, you should check the [GPIO Changes] session about the GPIO mapping formula.
thanks