Find the answer to your Linux question:
Results 1 to 5 of 5
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Accessing GPIO from User level - pca9670


    I was hoping someone with a good understanding of the GPIO framework can shed some light into a problem.

    I am working on a custom board (SBC - Xpedia 7073)
    I need to trigger an output from a GPIO chip inside of the board. The chip is pca9670 and it is on the i2C bus.
    I am running Ubuntu Desktop 11.04 (2.6.38-8-generic)
    It would be great if I could use the GPIO framework to avoid having to write a kernel driver.
    As far as I understand, Ubuntu already has the pcf857x driver as a kernel option.
    I have read the /documentation/gpio.txt document, but it is not very clear to me.
    The kernel does not seem to be recognizing the pca9670 since dmesg does not show the driver being able to find anything.
    What steps should I follow? Do I need to configure the driver in someway before loading it?
    I have tried loading the driver manually, but nothing changes
    Any help or guidance is greatly appreciated.
    Thanks a lot!!

  2. #2
    here are things I have tried:

    I have tried loading the pcf857x driver.
    However, if I load it, nothing comes up on dmesg

    I understand I should see something along these lines: (this is from the manufacturer on their custom build kernel...I have to run Ubuntu though...)

    pcf857x 0-0020: gpios 0..7 on a pca9670
    pcf857x 0-0026: gpios 8..15 on a pca9670
    pcf857x 0-0027: gpios 16..23 on a pca9670
    pcf857x 0-0024: gpios 24..31 on a pca9670

    It seems that the PCA9670 is not detected.
    So I manually instantiated the i2c device

    # echo pca9670 0x27 > /sys/bus/i2c/devices/i2c-0/new_device
    if I then run

    # modprobe pcf857x
    I get the following

    [ 9065.165261] [drm] GMBUS timed out, falling back to bit banging on pin 0 [i915 gmbus disabled]
    [ 9065.165282] pcf857x: probe of 0-0027 failed with error -12

    I am still not sure why I get this message.

    Any help is greatly appreciated
    Thank you in advance

  3. #3
    I have also been trying with i2c-tools

    i2cdetect 0

    does not seem to find anything.

    I am not sure how to use i2cdetect. I just loaded i2c-dev module and then i2cdetect was able to run....but it did not find any device in a ny port (I tried bus 0,1,2)

    There seems to be a problem with even detecting the i2c bus at all
    What are the steps to find a device in i2c busses?

  4. $spacer_open
  5. #4
    The problem seems to be that the i915 driver is the one exporting the i2C bus. This is not the i2c bus where the PCA9670 is located. It is just the i2c bus of the graphics card.
    A modification to the i2c810 is required in order to ensure that the actual i2c bus is exported.

  6. #5
    Hi every one :

    I am want to create gpio number 51 in sysfs (sys/class/gpio) .but I am unable do it

    XPand_Special_GPIO1 = of_get_named_gpio(temp,"51",0);
    if (XPand_Special_GPIO1 < 0){
    pr_err("xpand_probe of_get_named_gpio xpand-nfc-int err\n");
    rc = gpio_request(XPand_Special_GPIO1, "51");
    if (rc < 0) {
    pr_err("failed \n");

    I am unable to export gpio 51 but I am able to export other gpio pin (gpio 49 ) ..but GPIO 51 used for NFC function also .. please help me how to export gpio51 in sysfs

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts