| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

I2C

This version was saved 17 years, 4 months ago View current version     Page history
Saved by PBworks
on November 5, 2006 at 8:32:42 pm
 

I've been working on an I2C bus driver for the WGT634U's GPIO pins. This I2C bus driver has worked (preliminary testing only) under Kamikaze r5435 with 2.6.17 kernel:

http://openwrt.pbwiki.com/f/i2c-bcm5365.c

I was able to flip the output bits on a PCF8574 chip with a user-space program talking to /dev/i2c-0.

 

Here are my steps to installing it:

  • copy or link the i2c-bcm5365.c file above into build_mipsel/linux/drivers/i2c/busses
  • edit build_mipsel/linux/drivers/i2c/busses/Makefile adding i2c-bcm5365.o line
  • edit build_mipsel/linux/drivers/i2c/busses/Kconfig adding I2C_BCM5365 stanza
  • edit package/kernel/modules/other.mk adding i2c-core, i2c-dev, i2c-algo-bit, and i2c-bcm5365 stanzas. Autoload priorities should be set so i2c-core loads first, and i2c-bcm5365 loads last.
  • make ARCH=mips menuconfig in the kernel build directory (see http://wiki.openwrt.org/BuildRoot#Customizingthekerneloptions) and choose <m> for I2C, I2C_CHARDEV, I2C_ALGO_BIT, and I2C_BCM5365
  • make menuconfig in the top directory and choose <*> for i2c-core, i2c-dev, i2c-algo-bit, and i2c-bcm5365.
  • make in the top directory.
  • copy the new binary to the router with tftp

 

running lsmod on the router should show all four i2c-* modules loaded.

 

You can specify which gpio bits are used in /etc/modules.d/nn-i2c-bcm5365, e.g.

  • i2c-bcm5365 sclbit=0x10 sdabit=0x20

 

You must mknod /dev/i2c-0 c 89 0 to create the character device for user-space access to the bus.

Comments (0)

You don't have permission to comment on this page.