Please be aware of all shipping deadlines before placing your order - we cannot guarantee orders will arrive before Christmas!

Occidentalis + GPIO Expanders
Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/

Occidentalis + GPIO Expanders

by owendelong on Sun Oct 07, 2012 5:26 am

The standard debian source tree for 3.1.9 (and 3.2 and later) includes support for a number of SPI and I2C GPIO expanders, such as the MCP-32[S]08/32[S]17 8/16 pin GPIO expanders (I2C or [S}SPI) from Microchip.

However, for some reason, they aren't built into Occidentalis in the standard release.

Here's the config file diff that you need in order to support them:


root@raspberrypi:/home/owen/kernel-occidentalis/adafruit-raspberrypi-linux# diff .configx .config
273c273
< # CONFIG_GPIO_PCA953X is not set
---
> CONFIG_GPIO_PCA953X=m
1462a1463,1464
> CONFIG_GPIO_GENERIC=m
> CONFIG_GPIO_MAX730X=m
1467c1469
< # CONFIG_GPIO_GENERIC_PLATFORM is not set
---
> CONFIG_GPIO_GENERIC_PLATFORM=m
1474,1476c1476,1478
< # CONFIG_GPIO_MAX7300 is not set
< # CONFIG_GPIO_MAX732X is not set
< # CONFIG_GPIO_PCF857X is not set
---
> CONFIG_GPIO_MAX7300=m
> CONFIG_GPIO_MAX732X=m
> CONFIG_GPIO_PCF857X=m
1478c1480
< # CONFIG_GPIO_ADP5588 is not set
---
> CONFIG_GPIO_ADP5588=m
1487,1490c1489,1492
< # CONFIG_GPIO_MAX7301 is not set
< # CONFIG_GPIO_MCP23S08 is not set
< # CONFIG_GPIO_MC33880 is not set
< # CONFIG_GPIO_74X164 is not set
---
> CONFIG_GPIO_MAX7301=m
> CONFIG_GPIO_MCP23S08=m
> CONFIG_GPIO_MC33880=m
> CONFIG_GPIO_74X164=m

The following procedure assumes that you are already running Occidentalis on RPI and building this on RPI as well. If you are cross-compiling, you're on your own.

1. Clone the source from github
2. zcat /proc/config.gz > .config
3. Make the above changes to .config either by hand or through "make menuconfig"
4. make; make modules
5. make modules_install

Now, if everything went right, you shouldn't even have to install the new kernel or reboot. You should be able to just modprobe the modules you want into the kernel and have working GPIO expanders.

Hope this helps someone. It's the culmination of about 10 days of hunting for a workable solution to get these drivers going.

Owen
owendelong
 
Posts: 58
Joined: Fri Feb 10, 2012 4:25 am