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.

LCD Backlight control w/ BeagleBone and SDK

Other Parts Discussed in Thread: TPS65217

We have developed an interface board and attached a 240x320 LCD panel to the header pins of the BeagleBone.

We are currently driving the Backlight with an external voltage source but would like to used the White LED functionality of the TPS65217.

Currently, there is no driver for this device in the SDK.

Is there a work around that will allow us to use I2C to directly modify the WLEDCTRL1/2 values to control the backlight?

  • A couple of questions regarding the TPS65217 interface in the v5.04 SDK for the AM335x (BeagleBone).

    Previously, I was able to modify the WLEDCTRL1/2 registers using i2cset.

    After booting using the latest kernel, I can no longer do i2cget/set commands from the serial terminal.

    I get Device or Resource busy error messages for /dev/i2c-1.

    I've also written test code to try to access it from user space.

    I get the same error message when trying to assign the I2C_SLAVE attribute to chip address 0x24 on the same device using ioctl.

    I am able to modify the registers using i2c_smbus... commands at the tps65217_init in the board-am335xevm.c file at teh kernel level.

    I'd like to migrate the tps65217 direct calls to user space but that requires copying a bunch of include files to the arago linux_devkit directory, to get all the type definitions.

    Is there a better way to achieve my end goal?

     

     

  • Hi David,

    Separate driver needs to be develop for WLED using TPS65217 PMIC.

    Reference drivers under "drivers/leds/"

    Previously, I was able to modify the WLEDCTRL1/2 registers using i2cset.

    Anil: Previously means when? what you had added recently?

    I'd like to migrate the tps65217 direct calls to user space but that requires copying a bunch of include files to the arago linux_devkit directory, to get all the type definitions.

    Is there a better way to achieve my end goal?

    Anil: You can not export the kernel header files to user space (available if build as kernel module).

    Regards

    AnilKumar

    Please mark this Forum post as answered via the Verify Answer button below if it helps answer your question.  Thanks!

  • Hi Anil,

     

    Thanks for shepherding this linux newbie.

    By previously, I meant SDK version v5.03.02 (prior to the tps65217_init call in the new v5.04 SDK BeagleBone initialization).

    I could access the chip directly using:

    'i2cset 1 0x24 0x07 0x09' to turn on the ISINK bit

    and

    'i2cset 1 0x24 0x08 0x??' to adjust the duty cycle of the signal to change brightness of the LCD backlight.

    I did this at the prompt in the minicom terminal.

    With v5.04, I get 'Error: Could not set address to 0x24: Device or resource busy'.

    I also get a similar error when trying to access the device in user space using:

    const char* device = "/dev/i2c-1";

    fd = open(device, O_RDWR);

    ioctl(fd, I2C_SLAVE, 0x24);

    'Error: Device or resource busy'

    Since the tps65217 is registered to i2c-1, I'm confused why I can't talk to it.

     

    Perhaps I'm approaching it wrong. What is the proper method for accessing the regulator portion of the PMIC from user space now that the driver is available?

     

  • Hi David,

    I think v5.03.02 release don't have tps65217 regulator driver, means tps65217_init() API not included and 0x24 slave address is not used at that time. So you haven't seen any issues. In the recent updates regulator driver is added so 0x24 is used, that is the reason why you are seeing issues.

    Try disabling the cpufreq and tps65217 regulator drivers and see if you are able resolve this issue? If not, then you have to develop the wled driver to make use of PMIC calls. (refer these files include/linux/mfd/wm8350/pmic.h, drivers/leds/leds-wm8350.c)

    Regards

    AnilKumar

    Please mark this Forum post as answered via the Verify Answer button below if it helps answer your question.  Thanks!

  • Thanks Anil,

    I was going to ask for a suggestion about which LED files to mimic but stumbled on those same files that you mentioned this morning.

    I'll reply when I have it working.

    Dave

  • You can override the current "owner" by using I2C_SLAVE_FORCE instead of I2C_SLAVE.  Depending on the implementation the previous owner may still try to control the I2C device but you will be at least able to read values back.

  • is there finally an answer on how we can control the wled pin of the power management for controlling the back light of an LCD?

    I am working with beaglebone,

    Thanks