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?
Separate driver needs to be develop for WLED using TPS65217 PMIC.
Reference drivers under "drivers/leds/"
Anil: Previously means when? what you had added recently?
Anil: You can not export the kernel header files to user space (available if build as kernel module).
Please mark this Forum post as answered via the Verify Answer button below if it helps answer your question. Thanks!
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
'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?
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)
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.
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,
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.