Adding new GPIO device/driver to Barebox

Ivor Kruger ivor at veriline.co.za
Wed Oct 9 12:01:46 EDT 2013


I wish to add a new device to barebox (in fact, quite a few but lets just
look at one). I am a newbie to barebox but very comfortable with C.

The device is a TCA9555 GPIO expander on the I2C bus. The device is
probably covered by the linux driver gpio_pca953x.c so I will go ahead and
just add the pca953x device/driver pair or now. I am trying to sort out
the process of adding a driver at the moment and not so much the exact
details of the device/driver.

So the steps I took to do this was:

1. Copy the gpio_pca953x.c file to the barebox driver/gpio directory
2. Copy the pca953x.h file to the barebox include directory.
3. I then edited the .c file to fall in line with the barebox format
(looked at some other files as examples)
4. I edited the kConfig in the barebox/drivers/gpio directory to add the
option to select this device
5. I edited the makefile to include this file.
6. Changed the board.c file to load this device on the i2c bus

Then I used "ptxdist menuconfig barebox" to enable this device which is
now listed in the menu under drivers/config as expected.
Did the "ptxdist go" and checked the output BUT the file is not compiled.
I sort of expected it to try and compile and possible give a load of
errorsŠ.but it did not even try to compile.

Clearly I am missing a step that is so obvious that it is not mentioned
anywhere.

Can someone please point me in the right direction?

Thanks in advance








More information about the barebox mailing list