This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux SDK for OMAPL-138

Other Parts Discussed in Thread: OMAPL138, TCA6416

Hello everyone,

I would like some of you can help me to explain my following question. It is related to Linux psp for omapl138. This package of Linux is "ti-dvsdk_omapl138-evm_04_03_00_06/psp/linux-2.6.37-psp03.21.00.04.sdk"

The question is regard to I2C bus.From /arch/arm/mach-davinci/board-da850-evm.c, one can find an I2C device TCA6416 is connected onto board's I2C bus.


da850_evm_i2c_devices[] = {
{
I2C_BOARD_INFO("tca6416", 0x21), 
.platform_data = &da850_evm_bb_expander_info, 
},

However, this i2c device uses pca953x.c (driver/gpio) as its driver. I knew both are same functionality, but I don't know how this pca953x driver is hooked with tca6416?

I saw there are some code relates to gpio, but I don't see the name of this driver. So,  can anyone help me? Thank you.

Joe

  • Hi Joe,

    Please have look at the "pca953x_id" structure inside the "drivers/gpio/gpio-pca953x.c" file and you can find that tca6416 is also listed.

    Regards, Sudhakar

  • Hi Sudhakar,

    Thank you. I see how it hooked.

    I come with other question related to this "pca953x.c". As we knew this driver has address 0x21 on i2c-1 bus at this board. If I write an application through the i2c driver to control on board user switch and led by opening this /dev/i2c-1 driver, either read() or write() doesn't call functions from "pca953x.c" even thought this application can read user switch and write LEDs right.

    How this happen? It seems to me the write(i2c_file_ptr, write_buf, 1) or read(i2c_file_ptr, buf_ptr, length) doesn't use function from "pca953x.c". May it use something from i2c-dev.c? How this happen?

    The funny thing is I got error when I play a audio.

    pca953x 1-0021: failed reading register

    My audio play program comes from /audio-soc-example_1_00_00_03 or 

     http://processors.wiki.ti.com/index.php/Audio_Soc_example

    It doesn't use this driver. How these two are related?

    Regards,

    Joe

  • Hi Joe,

    If you have opened the device through i2c interface then the control will come to i2c-davinci.c file through i2c-dev.c. If you want to use the functions within the pca953x driver then you should use the interface which is exported by the GPIO driver.

    Joe Z said:

    The funny thing is I got error when I play a audio.

    pca953x 1-0021: failed reading register

    My audio play program comes from /audio-soc-example_1_00_00_03 or 

     http://processors.wiki.ti.com/index.php/Audio_Soc_example

    It doesn't use this driver. How these two are related?

    I think this application is for DSP/BIOS SDK platform. If you want to run audio with Linux, then just run the standard 'aplay' command which comes with the file system.

    Regards, Sudhakar

  • Hi Sudhakar,

    I haven't seen how i2c-davinci.c has been called if I used read() or write() on this device. I traced down only i2c-dev.c's function have been called. Since the i2c-dev.c can be used communicated with this i2c device, why it is still connected to the pca953x driver? is it because of speed? If it is so, my next question will be as following.

    As you stated above, to access this driver can be through gpio driver, but question is that how to open a file pointer for this gpio driver? We knew that this device is hooked on i2c bus with address 0x21, how do I point to this device's driver in my code? Usually we use open("dev/gpio-x",O_RDWR ) for gpio driver, but this pca953x driver belongs to /dev/i2c-1. That is confuse me know.

    Thank you for you help.

    Joe