資料介紹
Table of Contents
ADP8860 Back-light LED Linux Driver
Supported Devices
Evaluation Boards
Description
Configuration
Software configurable features
Backlight:
Feature | ADP8860 | ADP8863 | ADP8861 |
---|---|---|---|
Ambient Light Sensor Support (ALS) | ? | ? | ? |
Three programmable ambient light sensing zones for optimal backlight power savings | ? | ? | ? |
Configurable Fade On/Off times | ? | ? | ? |
Configurable Fade Law functions | ? | ? | ? |
Configurable ALS filter settings | ? | ? | ? |
Configurable Brightness/Intensity in 128 steps | ? | ? | ? |
LED:
Feature | ADP8860 | ADP8863 | ADP8861 |
---|---|---|---|
Up to 7 LEDs configurable | ? | ? | ? |
Configurable Fade On/Off times | ? | ? | ? |
LED Blink On/Off times | ? | ? | ? |
Configurable Fade Law functions | ? | ? | ? |
Configurable Brightness/Intensity in 128 steps from [0..255] | ? | ? | ? |
Source Code
Status
Files
Function | File |
---|---|
driver | drivers/video/backlight/adp8860_bl.c |
include | include/linux/i2c/adp8860.h |
Instructions / Theory of operation
Backlight control
With the ADP8860 driver installed, you will find sysfs files in the
/sys/class/backlight/adp8860_bl/
directory. You will be able to query and set the current screen
brightness:
- brightness
- get/set screen brightness (an integer between 0 and 126)
writing 127 will enable the Ambient Light Sensor. - actual_brightness
- reading from this file will query the HW to get real brightness value.
- max_brightness
- the maximum brightness value.
- bl_power
- Current FB Power mode (0: full on, 1..3: power saving modes; 4: full off).
ADP8860 Specific Backlight controls
The ADP8860 features 3 individually programmable Ambient Light Sensing Zones:
- l1_daylight_dim
- Ambient Light Zone Daylight: Backlight DIM Intensity (an integer between 0 and 127, typically set to 0).
- l1_daylight_max
- Ambient Light Zone Daylight: Backlight Intensity (an integer between 0 and 127).
- l2_office_dim
- Ambient Light Zone Office: Backlight DIM Intensity (an integer between 0 and 127, typically set to 0)
- l2_office_max
- Ambient Light Zone Office: Backlight Intensity (an integer between 0 and 127)
- l3_dark_dim
- Ambient Light Zone Dark: Backlight DIM Intensity (an integer between 0 and 127, typically set to 0)
- l3_dark_max
- Ambient Light Zone Dark: Backlight Intensity (an integer between 0 and 127)
- ambient_light_level
- Get conversion value of the first light sensor. This value is updated every 80 ms
(when the light sensor is enabled). Returns integer between 0 (dark) and 8000 (max ambient brightness) - ambient_light_zone
- Get/Set current Ambient Light Zone. Reading returns integer between 1..3
(1 = Daylight, 2 = office, 3 = dark). Writing a value between 1..3 forces the Backlight controller
to enter the corresponding Ambient Light Zone. Writing 0 returns to normal operation.
LED handling under Linux
LEDs not assigned to the Backlight are optionally exposed to the Linux LEDs Class.
The LED class allows control of LEDs from userspace.
LEDs appear in /sys/class/leds/. The brightness file will
set the brightness of the LED (taking a value 0-255).
The LEDS class also introduces the optional concept of an LED trigger. A trigger
is a kernel based source of led events, such as ide-disk or backlight control.
For more information read linux/Documentaion/leds-class.txt
- brightness
- get/set LED brightness (an integer between 0 and 255)
- max_brightness
- the maximum brightness value.
Example platform device initialization
For compile time configuration, it’s common Linux practice to keep board- and application-specific configuration out of the main driver file, instead putting it into the board support file.
For devices on custom boards, as typical of embedded and SoC-(system-on-chip) based hardware, Linux uses platform_data to point to board-specific structures describing devices and how they are connected to the SoC. This can include available ports, chip variants, preferred modes, default initialization, additional pin roles, and so on. This shrinks the board-support packages (BSPs) and minimizes board and application specific #ifdefs in drivers.
platform_data: Platform data specific to the ADP8860 device.
Includes what LEDs are available, feature selections and default initialization.
#include
Declaring I2C devices
Unlike PCI or USB devices, I2C devices are not enumerated at the hardware level. Instead, the software must know which devices are connected on each I2C bus segment, and what address these devices are using. For this reason, the kernel code must instantiate I2C devices explicitly. There are different ways to achieve this, depending on the context and requirements. However the most common method is to declare the I2C devices by bus number.
This method is appropriate when the I2C bus is a system bus, as in many embedded systems, wherein each I2C bus has a number which is known in advance. It is thus possible to pre-declare the I2C devices that inhabit this bus. This is done with an array of struct i2c_board_info, which is registered by calling i2c_register_board_info().
So, to enable such a driver one need only edit the board support file by adding an appropriate entry to i2c_board_info.
For more information see: Documentation/i2c/instantiating-devices
static struct i2c_board_info __initdata bfin_i2c_board_info[] = { #if defined(CONFIG_BACKLIGHT_ADP8860) || defined(CONFIG_BACKLIGHT_ADP8860_MODULE) { I2C_BOARD_INFO("adp8860", 0x2A), .platform_data = (void *)&adp8860_pdata, }, #endif }
Adding Linux driver support
Configure kernel with “make menuconfig” (alternatively use “make xconfig” or “make qconfig”)
The ADP8860 Backlight driver depends on I2C. It therefore requires selected I2C support to show up during kernel configuration.
Device Drivers ---> Graphics support ---> [*] Backlight & LCD device support ---
ADP8860 Back-light LED Linux Driver
Supported Devices
Evaluation Boards
Description
Configuration
Software configurable features
Backlight:
Feature | ADP8860 | ADP8863 | ADP8861 |
---|---|---|---|
Ambient Light Sensor Support (ALS) | ? | ? | ? |
Three programmable ambient light sensing zones for optimal backlight power savings | ? | ? | ? |
Configurable Fade On/Off times | ? | ? | ? |
Configurable Fade Law functions | ? | ? | ? |
Configurable ALS filter settings | ? | ? | ? |
Configurable Brightness/Intensity in 128 steps | ? | ? | ? |
LED:
Feature | ADP8860 | ADP8863 | ADP8861 |
---|---|---|---|
Up to 7 LEDs configurable | ? | ? | ? |
Configurable Fade On/Off times | ? | ? | ? |
LED Blink On/Off times | ? | ? | ? |
Configurable Fade Law functions | ? | ? | ? |
Configurable Brightness/Intensity in 128 steps from [0..255] | ? | ? | ? |
Source Code
Status
Files
Function | File |
---|---|
driver | drivers/video/backlight/adp8860_bl.c |
include | include/linux/i2c/adp8860.h |
Instructions / Theory of operation
Backlight control
With the ADP8860 driver installed, you will find sysfs files in the
/sys/class/backlight/adp8860_bl/
directory. You will be able to query and set the current screen
brightness:
- brightness
- get/set screen brightness (an integer between 0 and 126)
writing 127 will enable the Ambient Light Sensor. - actual_brightness
- reading from this file will query the HW to get real brightness value.
- max_brightness
- the maximum brightness value.
- bl_power
- Current FB Power mode (0: full on, 1..3: power saving modes; 4: full off).
ADP8860 Specific Backlight controls
The ADP8860 features 3 individually programmable Ambient Light Sensing Zones:
- l1_daylight_dim
- Ambient Light Zone Daylight: Backlight DIM Intensity (an integer between 0 and 127, typically set to 0).
- l1_daylight_max
- Ambient Light Zone Daylight: Backlight Intensity (an integer between 0 and 127).
- l2_office_dim
- Ambient Light Zone Office: Backlight DIM Intensity (an integer between 0 and 127, typically set to 0)
- l2_office_max
- Ambient Light Zone Office: Backlight Intensity (an integer between 0 and 127)
- l3_dark_dim
- Ambient Light Zone Dark: Backlight DIM Intensity (an integer between 0 and 127, typically set to 0)
- l3_dark_max
- Ambient Light Zone Dark: Backlight Intensity (an integer between 0 and 127)
- ambient_light_level
- Get conversion value of the first light sensor. This value is updated every 80 ms
(when the light sensor is enabled). Returns integer between 0 (dark) and 8000 (max ambient brightness) - ambient_light_zone
- Get/Set current Ambient Light Zone. Reading returns integer between 1..3
(1 = Daylight, 2 = office, 3 = dark). Writing a value between 1..3 forces the Backlight controller
to enter the corresponding Ambient Light Zone. Writing 0 returns to normal operation.
LED handling under Linux
LEDs not assigned to the Backlight are optionally exposed to the Linux LEDs Class.
The LED class allows control of LEDs from userspace.
LEDs appear in /sys/class/leds/. The brightness file will
set the brightness of the LED (taking a value 0-255).
The LEDS class also introduces the optional concept of an LED trigger. A trigger
is a kernel based source of led events, such as ide-disk or backlight control.
For more information read linux/Documentaion/leds-class.txt
- brightness
- get/set LED brightness (an integer between 0 and 255)
- max_brightness
- the maximum brightness value.
Example platform device initialization
For compile time configuration, it’s common Linux practice to keep board- and application-specific configuration out of the main driver file, instead putting it into the board support file.
For devices on custom boards, as typical of embedded and SoC-(system-on-chip) based hardware, Linux uses platform_data to point to board-specific structures describing devices and how they are connected to the SoC. This can include available ports, chip variants, preferred modes, default initialization, additional pin roles, and so on. This shrinks the board-support packages (BSPs) and minimizes board and application specific #ifdefs in drivers.
platform_data: Platform data specific to the ADP8860 device.
Includes what LEDs are available, feature selections and default initialization.
#include
Declaring I2C devices
Unlike PCI or USB devices, I2C devices are not enumerated at the hardware level. Instead, the software must know which devices are connected on each I2C bus segment, and what address these devices are using. For this reason, the kernel code must instantiate I2C devices explicitly. There are different ways to achieve this, depending on the context and requirements. However the most common method is to declare the I2C devices by bus number.
This method is appropriate when the I2C bus is a system bus, as in many embedded systems, wherein each I2C bus has a number which is known in advance. It is thus possible to pre-declare the I2C devices that inhabit this bus. This is done with an array of struct i2c_board_info, which is registered by calling i2c_register_board_info().
So, to enable such a driver one need only edit the board support file by adding an appropriate entry to i2c_board_info.
For more information see: Documentation/i2c/instantiating-devices
static struct i2c_board_info __initdata bfin_i2c_board_info[] = { #if defined(CONFIG_BACKLIGHT_ADP8860) || defined(CONFIG_BACKLIGHT_ADP8860_MODULE) { I2C_BOARD_INFO("adp8860", 0x2A), .platform_data = (void *)&adp8860_pdata, }, #endif }
Adding Linux driver support
Configure kernel with “make menuconfig” (alternatively use “make xconfig” or “make qconfig”)
The ADP8860 Backlight driver depends on I2C. It therefore requires selected I2C support to show up during kernel configuration.
Device Drivers ---> Graphics support ---> [*] Backlight & LCD device support ---> <*> Lowlevel Backlight controlsBacklight Driver for ADP8860 using WLED
Hardware configuration
During test and driver development we used the ADP8860 Evaluation Mother/Daughter Board.
It can be easily wired to the Blackfin STAMP TWI/I2C header.
BF537-STAMP (P10) TWI/I2C header | ADP886x Adaptor Board (J30) | |
---|---|---|
PIN | Function | PIN/Function |
5 | SCL | SCL |
6 | SDA | SDA |
20 | GND | GND |
Leave J31 and J32 open (these jumpers connect the SCL and SDA to the cypress chip used as USB bridge). Then apply your own SCL, SDA, and GND to the big J30 connector on the left edge of the board.
The ADP8860 chip still needs Vin (to power the chip), Vddio (to pull nRST and nINT high), and Vboard (to power the ALS sensor on the daughter card). These are provided through the USB port and then get regulated down (Vin becomes 3.6V, Vddio is 2.7V, and Vboard is around 4 V). So even though you won't be using the USB to program the part, it would still be easiest to plug the board into a USB port just to power Vin, Vddio, and Vboard. Of course, if you want, you can power these supplies from a lab bench power supply. In that case, move LK1, 2, and 3 to the “EXT” position and apply the signals to J29.
Driver testing
Driver compiled as a module
ADP8860 driver is build as a module
root:/> modprobe adp8860_bl adp8860_bl 0-002a: Rev.7 Backlight Registered led device: adp8860-led7 root:/>
Example Backlight usage
root:/> cd sys/class/backlight/adp8860_bl/ root:/sys/devices/platform/i2c-bfin-twi.0/i2c-adapter/i2c-0/0-002a/backlight/adp8860_bl> ls -l -r--r--r-- 1 root root 4096 Jan 1 03:29 actual_brightness -r--r--r-- 1 root root 4096 Jan 1 03:29 ambient_light_level -rw-rw-r-- 1 root root 4096 Jan 1 03:29 ambient_light_zone -rw-r--r-- 1 root root 4096 Jan 1 03:31 bl_power -rw-r--r-- 1 root root 4096 Jan 1 04:55 brightness lrwxrwxrwx 1 root root 0 Jan 1 03:29 device -> ../../../0-002a -rw-rw-r-- 1 root root 4096 Jan 1 03:29 l1_daylight_dim -rw-rw-r-- 1 root root 4096 Jan 1 03:29 l1_daylight_max -rw-rw-r-- 1 root root 4096 Jan 1 03:30 l2_office_dim -rw-rw-r-- 1 root root 4096 Jan 1 03:29 l2_office_max -rw-rw-r-- 1 root root 4096 Jan 1 03:31 l3_dark_dim -rw-rw-r-- 1 root root 4096 Jan 1 03:29 l3_dark_max -r--r--r-- 1 root root 4096 Jan 1 03:29 max_brightness drwxr-xr-x 2 root root 0 Jan 1 03:29 power lrwxrwxrwx 1 root root 0 Jan 1 03:29 subsystem -> ../../../../../../../../class/backlight -rw-r--r-- 1 root root 4096 Jan 1 03:29 uevent root:/sys/devices/platform/i2c-bfin-twi.0/i2c-adapter/i2c-0/0-002a/backlight/adp8860_bl>
Set Backlight Intensity
root:/sys/devices/platform/i2c-bfin-twi.0/i2c-adapter/i2c-0/0-002a/backlight/adp8860_bl> echo 42 > brightness
Query Backlight Intensity
root:/sys/devices/platform/i2c-bfin-twi.0/i2c-adapter/i2c-0/0-002a/backlight/adp8860_bl> cat brightness 42
Enable Ambient Light Sensing Feature
root:/sys/devices/platform/i2c-bfin-twi.0/i2c-adapter/i2c-0/0-002a/backlight/adp8860_bl> echo 127 > brightness
Query Ambient Light Level
root:/sys/devices/platform/i2c-bfin-twi.0/i2c-adapter/i2c-0/0-002a/backlight/adp8860_bl> cat ambient_light_level 1276
Query Ambient Light Zone
root:/sys/devices/platform/i2c-bfin-twi.0/i2c-adapter/i2c-0/0-002a/backlight/adp8860_bl> cat ambient_light_zone 2
Adjust Intensity for Ambient Light Zone 2 (office)
root:/sys/devices/platform/i2c-bfin-twi.0/i2c-adapter/i2c-0/0-002a/backlight/adp8860_bl> echo 22 > l2_office_max 22
root:/sys/devices/platform/i2c-bfin-twi.0/i2c-adapter/i2c-0/0-002a/backlight/adp8860_bl> cat l2_office_max 22
Example LED usage
root:/> cd /sys/class/leds/adp8860-led7/ root:/sys/devices/platform/i2c-bfin-twi.0/i2c-adapter/i2c-0/0-002a/leds/adp8860-led7> ls -l -rw-r--r-- 1 root root 4096 Jan 1 03:29 brightness lrwxrwxrwx 1 root root 0 Jan 1 03:29 device -> ../../../0-002a -r--r--r-- 1 root root 4096 Jan 1 03:29 max_brightness drwxr-xr-x 2 root root 0 Jan 1 03:29 power lrwxrwxrwx 1 root root 0 Jan 1 03:29 subsystem -> ../../../../../../../../class/leds
Set Intensity
root:/sys/devices/platform/i2c-bfin-twi.0/i2c-adapter/i2c-0/0-002a/leds/adp8860-led7>echo 99 > brightness
Turn LED OFF
root:/sys/devices/platform/i2c-bfin-twi.0/i2c-adapter/i2c-0/0-002a/leds/adp8860-led7> echo 0 > brightness
Query Max Brightness
root:/sys/devices/platform/i2c-bfin-twi.0/i2c-adapter/i2c-0/0-002a/leds/adp8860-led7> cat max_brightness 255 root:/sys/devices/platform/i2c-bfin-twi.0/i2c-adapter/i2c-0/0-002a/leds/adp8860-led7>
More Information
- AL8860Q-LED驅(qū)動(dòng)器遠(yuǎn)程安裝和LED開(kāi)路/短路至接地防護(hù)解決方案
- 通用led背光驅(qū)動(dòng)器設(shè)計(jì)
- EVADP8860 ADP8860評(píng)估板
- ADP5520:帶I/O擴(kuò)展器的背光驅(qū)動(dòng)器產(chǎn)品手冊(cè)
- ADP5520 LED驅(qū)動(dòng)器
- ADP8870:電荷泵并行背光驅(qū)動(dòng)器,帶圖像內(nèi)容PWM輸入數(shù)據(jù)表
- ADP8860:帶I<sup>2</sup>C接口的電荷泵7通道智能LED驅(qū)動(dòng)器產(chǎn)品手冊(cè)
- ADP1650 LED Linux驅(qū)動(dòng)器
- ADP8870背光LED Linux驅(qū)動(dòng)器
- 帶ALS的并行背光驅(qū)動(dòng)器ADP8860的評(píng)估板(EVAL-ADP8860)手冊(cè)
- 基于ADP8860DBCB-EVALZ背光發(fā)光二極管驅(qū)動(dòng)器的參考設(shè)計(jì)
- ADP8860原文資料數(shù)據(jù)手冊(cè)PDF免費(fèi)下載(可編程背光LED電荷泵驅(qū)動(dòng)器) 13次下載
- LED背光恒流驅(qū)動(dòng)器 28次下載
- 液晶顯示器背光源LED驅(qū)動(dòng)器產(chǎn)品說(shuō)明書(shū) 4次下載
- LED背光boost驅(qū)動(dòng)器
- 采用MAX25014的LED背光驅(qū)動(dòng)系統(tǒng)的低輸入電壓工作 773次閱讀
- PWM設(shè)置LCD/LED驅(qū)動(dòng)器的輸出 2325次閱讀
- 使用高調(diào)光比汽車(chē)LED驅(qū)動(dòng)器保持抬頭 1032次閱讀
- 局部調(diào)光LED驅(qū)動(dòng)器IC的解決方案尺寸 1498次閱讀
- 基于原邊反饋方式的LED背光驅(qū)動(dòng)方案探討 2355次閱讀
- 基于ROHM的車(chē)載背光燈用LED驅(qū)動(dòng)器電路設(shè)計(jì) 2435次閱讀
- On Semi公司推出了LED驅(qū)動(dòng)器評(píng)估板NCL30051電路解決方案 1478次閱讀
- 淺談LED驅(qū)動(dòng)器的應(yīng)用及驅(qū)動(dòng)方法 7394次閱讀
- 設(shè)計(jì)白光LED驅(qū)動(dòng)器時(shí)的EMI干擾問(wèn)題不可忽視 3634次閱讀
- 什么是LED驅(qū)動(dòng)時(shí)序?LCD背光驅(qū)動(dòng)程序設(shè)計(jì) 2937次閱讀
- 防止LED驅(qū)動(dòng)器輸出對(duì)地短路 2790次閱讀
- 基于四路LED驅(qū)動(dòng)器驅(qū)動(dòng)的解決方案 3850次閱讀
- 帶有集成電源的10通道LED背光驅(qū)動(dòng)器 2212次閱讀
- 專(zhuān)家揭秘:汽車(chē)前向照明為何需要高性能LED驅(qū)動(dòng)器 3477次閱讀
- 針對(duì)高功率LED燈泡替換應(yīng)用的LED驅(qū)動(dòng)器設(shè)計(jì) 1182次閱讀
下載排行
本周
- 1電子電路原理第七版PDF電子教材免費(fèi)下載
- 0.00 MB | 1491次下載 | 免費(fèi)
- 2單片機(jī)典型實(shí)例介紹
- 18.19 MB | 95次下載 | 1 積分
- 3S7-200PLC編程實(shí)例詳細(xì)資料
- 1.17 MB | 27次下載 | 1 積分
- 4筆記本電腦主板的元件識(shí)別和講解說(shuō)明
- 4.28 MB | 18次下載 | 4 積分
- 5開(kāi)關(guān)電源原理及各功能電路詳解
- 0.38 MB | 11次下載 | 免費(fèi)
- 6100W短波放大電路圖
- 0.05 MB | 4次下載 | 3 積分
- 7基于單片機(jī)和 SG3525的程控開(kāi)關(guān)電源設(shè)計(jì)
- 0.23 MB | 4次下載 | 免費(fèi)
- 8基于AT89C2051/4051單片機(jī)編程器的實(shí)驗(yàn)
- 0.11 MB | 4次下載 | 免費(fèi)
本月
- 1OrCAD10.5下載OrCAD10.5中文版軟件
- 0.00 MB | 234313次下載 | 免費(fèi)
- 2PADS 9.0 2009最新版 -下載
- 0.00 MB | 66304次下載 | 免費(fèi)
- 3protel99下載protel99軟件下載(中文版)
- 0.00 MB | 51209次下載 | 免費(fèi)
- 4LabView 8.0 專(zhuān)業(yè)版下載 (3CD完整版)
- 0.00 MB | 51043次下載 | 免費(fèi)
- 5555集成電路應(yīng)用800例(新編版)
- 0.00 MB | 33562次下載 | 免費(fèi)
- 6接口電路圖大全
- 未知 | 30320次下載 | 免費(fèi)
- 7Multisim 10下載Multisim 10 中文版
- 0.00 MB | 28588次下載 | 免費(fèi)
- 8開(kāi)關(guān)電源設(shè)計(jì)實(shí)例指南
- 未知 | 21539次下載 | 免費(fèi)
總榜
- 1matlab軟件下載入口
- 未知 | 935053次下載 | 免費(fèi)
- 2protel99se軟件下載(可英文版轉(zhuǎn)中文版)
- 78.1 MB | 537793次下載 | 免費(fèi)
- 3MATLAB 7.1 下載 (含軟件介紹)
- 未知 | 420026次下載 | 免費(fèi)
- 4OrCAD10.5下載OrCAD10.5中文版軟件
- 0.00 MB | 234313次下載 | 免費(fèi)
- 5Altium DXP2002下載入口
- 未知 | 233046次下載 | 免費(fèi)
- 6電路仿真軟件multisim 10.0免費(fèi)下載
- 340992 | 191183次下載 | 免費(fèi)
- 7十天學(xué)會(huì)AVR單片機(jī)與C語(yǔ)言視頻教程 下載
- 158M | 183277次下載 | 免費(fèi)
- 8proe5.0野火版下載(中文版免費(fèi)下載)
- 未知 | 138039次下載 | 免費(fèi)
評(píng)論
查看更多