For a small project of mine, I was planning to use an MCP23017 I2C GPIO Expander because I need many I/Os and I didn't want to occupy all GPIOs of the Pi.
First I wanted to write some C++ userspace code which uses i2c-dev and wrap a class around it.
But then I recently discovered the possibility to use device-tree on the Pi, and found that there is already a kernel driver gpio-mcp23s08 existing which is capable of providing /sys/class/gpio style GPIOs with the MCP23S08 (SPI), MCP23S17 (SPI), MCP23008 (I2C) and MCP23017 (I2C) chips.
I thought: "Hey, would be a cool thing, if I could use the external I/Os exactly the same way as I can use the Pi's GPIOs".
So I started to search if there is already some overlay existing for these chips.
I found none, so I wrote my own
Currently it only supports the MCP23017, as it is the only one I have available here to test it.
But I plan to extend it to include support for all 4 ICs which are supported by the driver.
As soon as I have finished testing (input/output work since today, but I need to verify the IRQ capability by writing some test code), I would like to share it with the community.
But first I have some questions:
- My goal is that this overlay will some day be part of the official rpi overlays. What kind of release process is used for that purpose? Who will review this, and who decides when it can be added?
- One problem is that the required gpio-mcp23s08 driver is not included in the raspbian (and probably all other distro) kernel packages. I had to make a custom kernel on my own ... so, again: what is the process to get this into the official kernel builds?
- Because I don't own the other 3 ICs, I would like to invite owners of one (or more) of the following to get in contact with me, so we can test them...: MCP23008, MCP23S08 and MCP23S17
Please note that a custom kernel is needed for this. Maybe I can upload this somewhere too, if needed
Stay cool and regards,