色哟哟视频在线观看-色哟哟视频在线-色哟哟欧美15最新在线-色哟哟免费在线观看-国产l精品国产亚洲区在线观看-国产l精品国产亚洲区久久

電子發(fā)燒友App

硬聲App

0
  • 聊天消息
  • 系統(tǒng)消息
  • 評論與回復(fù)
登錄后你可以
  • 下載海量資料
  • 學習在線課程
  • 觀看技術(shù)視頻
  • 寫文章/發(fā)帖/加入社區(qū)
會員中心
創(chuàng)作中心

完善資料讓更多小伙伴認識你,還能領(lǐng)取20積分哦,立即完善>

3天內(nèi)不再提示
創(chuàng)作
電子發(fā)燒友網(wǎng)>電子資料下載>類型>參考設(shè)計>ADP5520/01 MFD Linux驅(qū)動程序

ADP5520/01 MFD Linux驅(qū)動程序

2021-04-21 | pdf | 258.93KB | 次下載 | 免費

資料介紹

This version (09 Oct 2015 16:26) was approved by Lars-Peter Clausen.The Previously approved version (05 Sep 2012 14:16) is available.Diff

ADP5520/01 MFD Linux Driver

Supported Devices

Evaluation Boards

Description

The ADP5520/01 driver utilizes several Linux device-driver subsystems and provides various software interfaces. It is therefore implemented as a multifunction device (MFD). In this particular case the ADP5520 backlight driver and I/O expander, concurrently leverages the Linux backlight, LED, GPIO, and input subsystems for its keypad functionality.

Core

The ADP5520/01 core driver in drivers/mfd provides common services for the subsystem drivers. These services include register access, control and shared interrupt management.

The core registers/enumerates platform devices for the various subsystems via the platform device and driver system.

When a platform driver for one of the subsystems is instantiated, the core initializes the chip (which may be specified by the platform data).

The ADP5520/01 platform drivers follow the standard driver model convention, where discovery/enumeration is handled outside the drivers, and drivers provide probe() and remove() methods.

Resources

Each peripheral (subsystem device) has a view of the device which is implicitly narrowed to the specific set of resources that peripheral requires in order to function correctly.

Configuration

The device driver uses a set of platform data to pass configurations through to the core and the subsidiary drivers so that there can be support for multiple ADP5520/01 devices built into a single kernel image.

Software configurable features

Backlight:

  • Ambient Light Sensor Support
  • Configurable Fade On/Off times
  • Configurable Brightness/Intensity in 127 steps

LED:

  • Up to 3 LEDs configurable
  • Configurable Fade On/Off times
  • LED Blink On/Off times
  • Configurable Brightness/Intensity in 64 steps from [0..255]

Keypad:

  • Configurable keypad size matrix (rows, columns) up to 16 keys
  • Enabling and disabling automatic key repeat feature.

GPIO:

  • Configurable number of dedicated GPIOs, up to 8 GPIOs
  • Configurable Pull-Ups

Source Code

Status

Source Mainlined?
git Yes

Files

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.

21 Oct 2010 16:10

Since Keypad, GPIO and optional LEDs (2, 3) are multiplexed, you need to avoid double configurations. Please refer to the table below.

ADP5520 PIN R3 R2 R1 R0 C0 C1 C2 C3
GPIO GPIO_R3 GPIO_R2 GPIO_R1 GPIO_R0 GPIO_C0 GPIO_C1 GPIO_C2 GPIO_C3
Keypad ROW_R3 ROW_R2 ROW_R1 ROW_R0 COL_C0 COL_C1 COL_C2 COL_C3
LED LED3 LED2

Please refer to include/linux/mfd/adp5520.h for detailed configuration defines.

Backlight

LED

GPIO

Keypad

ADP5520/ADP5501 MFD Core Support

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

21 Oct 2010 16:10

ADP5520 IRQ Usage:
If you aren’t planning to utilize the Keypad interface, you don’t need to specify an IRQ in bfin_i2c_board_info.

Adding Linux driver support

Fist of all you need to enable i2c support followed by the ADP5520 MFD Core Driver. Then you may select individual components like LCD backlight, LEDs, GPIOs and Keypad under the corresponding menus.

ADP5520 MFD Core Support

Device Drivers  ---> 
	<*> I2C support  --->
		<*> Blackfin TWI I2C support
		Or:
		<*> GPIO-based bitbanging I2C


Device Drivers  ---> 
	Multifunction device drivers  --->
		[*] Analog Devices ADP5520/01 MFD PMIC Core Support

Backlight

Device Drivers  ---> 
	Graphics support  --->
		[*] Backlight & LCD device support  --->
			<*>   Lowlevel Backlight controls
			     Backlight Driver for ADP5520/ADP5501 using WLED

LED

Device Drivers  --->
	[*] LED Support  --->
		<*>   LED Class Support
		   LED Support for ADP5520/ADP5501 PMIC

GPIO

Device Drivers  --->
	[*] GPIO Support  --->
		[*]   /sys/class/gpio/... (sysfs interface)
		   GPIO Support for ADP5520 PMIC

Keypad

Device Drivers  --->
	Input device support  --->
		<*> Generic input layer (needed for keyboard, mouse, ...)
		<*>   Event interface
		[*]   Keyboards  --->
			   Keypad Support for ADP5520 PMIC

Hardware configuration

ADP5520 Demo Mother/Daughter Board

There is no dedicated Blackfin STAMP evaluation board for the ADP5520. During test and driver development we used the ADP5520 Demo Mother/Daughter Board. Connect the ADP5520 Demo Mother to an USB port.

It can be easily wired to the Blackfin STAMP TWI/I2C header.

BF537-STAMP (P10) TWI/I2C header ADP5520 Daughter Board
PIN Function PIN/Function
5 SCL SCL
6 SDA SDA
10 GPIO_PG0 nINT
20 GND GND

Driver testing

Backlight

root:/> modprobe adp5520_bl
root:/>

root:/> cd sys/class/backlight/adp5520-backlight/
root:/sys/devices/platform/i2c-bfin-twi.0/i2c-adapter/i2c-0/0-0032/backlight/adp5520-backlight> ls -l
-r--r--r--    1 root     root         4096 Nov 12 10:31 actual_brightness
-rw-r--r--    1 root     root         4096 Nov 12 10:31 bl_power
-rw-r--r--    1 root     root         4096 Nov 12 10:31 brightness
-rw-rw-r--    1 root     root         4096 Nov 12 10:31 dark_dim
-rw-rw-r--    1 root     root         4096 Nov 12 10:31 dark_max
-rw-rw-r--    1 root     root         4096 Nov 12 10:31 daylight_dim
-rw-rw-r--    1 root     root         4096 Nov 12 10:31 daylight_max
lrwxrwxrwx    1 root     root            0 Nov 12 10:31 device -> ../../../0-0032
-r--r--r--    1 root     root         4096 Nov 12 10:31 max_brightness
-rw-rw-r--    1 root     root         4096 Nov 12 10:31 office_dim
-rw-rw-r--    1 root     root         4096 Nov 12 10:31 office_max
drwxr-xr-x    2 root     root            0 Nov 12 10:31 power
lrwxrwxrwx    1 root     root            0 Nov 12 10:31 subsystem -> ../../../../../../../../class/backlight

root:/sys/devices/platform/i2c-bfin-twi.0/i2c-adapter/i2c-0/0-0032/backlight/adp5520-backlight> echo 127 > brightness
root:/sys/devices/platform/i2c-bfin-twi.0/i2c-adapter/i2c-0/0-0032/backlight/adp5520-backlight> echo 50 > brightness
root:/sys/devices/platform/i2c-bfin-twi.0/i2c-adapter/i2c-0/0-0032/backlight/adp5520-backlight> echo 0 > brightness

For more information on Backlight handling in Linux read: Documentation/ABI/stable/sysfs-class-backlight

LED

root:/> modprobe leds-adp5520
Registered led device: adp5520-led1
Registered led device: adp5520-led2
Registered led device: adp5520-led3

root:/> cd sys/class/leds/adp5520-led
sys/class/leds/adp5520-led1/  sys/class/leds/adp5520-led3/
sys/class/leds/adp5520-led2/

root:/> cd sys/class/leds/adp5520-led1
root:/sys/devices/platform/i2c-bfin-twi.0/i2c-adapter/i2c-0/0-0032/leds/adp5520-led1> ls -l
-rw-r--r--    1 root     root         4096 Nov 12 10:34 brightness
lrwxrwxrwx    1 root     root            0 Nov 12 10:34 device -> ../../../0-0032
drwxr-xr-x    2 root     root            0 Nov 12 10:34 power
lrwxrwxrwx    1 root     root            0 Nov 12 10:34 subsystem -> ../../../../../../../../class/leds
-rw-r--r--    1 root     root         4096 Nov 12 10:34 trigger
root:/sys/devices/platform/i2c-bfin-twi.0/i2c-adapter/i2c-0/0-0032/leds/adp5520-led1> echo 10 > brightness
root:/sys/devices/platform/i2c-bfin-twi.0/i2c-adapter/i2c-0/0-0032/leds/adp5520-led1> echo 255 > brightness
root:/sys/devices/platform/i2c-bfin-twi.0/i2c-adapter/i2c-0/0-0032/leds/adp5520-led1> echo 0 > brightness

root:/> modprobe -r leds-adp5520
root:/>

For more information on LEDs handling in Linux read: Documentation/leds-class.txt

GPIO

root:/> modprobe adp5520-gpio
root:/> cd sys/class/gpio/gpiochip50/
root:/sys/devices/virtual/gpio/gpiochip50> ls -l
-r--r--r--    1 root     root         4096 Nov 12 10:37 base
-r--r--r--    1 root     root         4096 Nov 12 10:37 label
-r--r--r--    1 root     root         4096 Nov 12 10:37 ngpio
drwxr-xr-x    2 root     root            0 Nov 12 10:37 power
lrwxrwxrwx    1 root     root            0 Nov 12 10:37 subsystem -> ../../../../class/gpio
-rw-r--r--    1 root     root         4096 Nov 12 10:37 uevent
root:/sys/devices/virtual/gpio/gpiochip50> cd
root:/>
Note that you will have to enable the event_test utility under “Blackfin test programs” in your user space configuration.
--- Blackfin test programs
                   [*] Input event device test

For more information on GPIO handling in Linux read: Documentation/gpio.txt

Keypad

root:/> modprobe adp5520-keys
input: adp5520-keys as /devices/platform/i2c-bfin-twi.0/i2c-adapter/i2c-0/0-0032/adp5520-keys.5520/input/input0

root:/> event_test /dev/input/event0
Input driver version is 1.0.0
Input device ID: bus 0x18 vendor 0x1 product 0x5520 version 0x1
Input device name: "adp5520-keys"
Supported events:
  Event type 0 (Reset)
    Event code 0 (Reset)
    Event code 1 (Key)
  Event type 1 (Key)
    Event code 2 (1)
    Event code 3 (2)
    Event code 4 (3)
    Event code 5 (4)
    Event code 6 (5)
    Event code 7 (6)
    Event code 8 (7)
    Event code 9 (8)
    Event code 10 (9)
    Event code 11 (0)
    Event code 12 (Minus)
    Event code 13 (Equal)
    Event code 28 (Enter)
    Event code 41 (Grave)
    Event code 43 (BackSlash)
Testing ... (interrupt to exit)
Event: time 1415788674.340000, type 1 (Key), code 41 (Grave), value 1
Event: time 1415788674.340000, type 0 (Reset), code 0 (Reset), value 0
Event: time 1415788674.516000, type 1 (Key), code 41 (Grave), value 0
Event: time 1415788674.516000, type 0 (Reset), code 0 (Reset), value 0
Event: time 1415788674.912000, type 1 (Key), code 2 (1), value 1
Event: time 1415788674.912000, type 0 (Reset), code 0 (Reset), value 0
Event: time 1415788675.140000, type 1 (Key), code 2 (1), value 0
Event: time 1415788675.140000, type 0 (Reset), code 0 (Reset), value 0
Event: time 1415788675.892000, type 1 (Key), code 6 (5), value 1
Event: time 1415788675.892000, type 0 (Reset), code 0 (Reset), value 0
Event: time 1415788676.092000, type 1 (Key), code 6 (5), value 0
Event: time 1415788676.092000, type 0 (Reset), code 0 (Reset), value 0

root:/> modprobe -r adp5520-keys
root:/>

For more information on Input handling in Linux read: Documentation/input/input.txt

More Information

1) , 2)
ADP5520 only
下載該資料的人也在下載 下載該資料的人還在閱讀
更多 >

評論

查看更多

下載排行

本周

  1. 1AN-1267: 使用ADSP-CM408F ADC控制器的電機控制反饋采樣時序
  2. 1.41MB   |  3次下載  |  免費
  3. 2AN158 GD32VW553 Wi-Fi開發(fā)指南
  4. 1.51MB   |  2次下載  |  免費
  5. 3AN148 GD32VW553射頻硬件開發(fā)指南
  6. 2.07MB   |  1次下載  |  免費
  7. 4AN-1154: 采用恒定負滲漏電流優(yōu)化ADF4157和ADF4158 PLL的相位噪聲和雜散性能
  8. 199.28KB   |  次下載  |  免費
  9. 5AN-960: RS-485/RS-422電路實施指南
  10. 380.8KB   |  次下載  |  免費
  11. 6EE-249:使用VisualDSP在ADSP-218x DSP上實現(xiàn)軟件疊加
  12. 60.02KB   |  次下載  |  免費
  13. 7AN-1111: 使用ADuCM360/ADuCM361時的降低功耗選項
  14. 306.09KB   |  次下載  |  免費
  15. 8AN-904: ADuC7028評估板參考指南
  16. 815.82KB   |  次下載  |  免費

本月

  1. 1ADI高性能電源管理解決方案
  2. 2.43 MB   |  450次下載  |  免費
  3. 2免費開源CC3D飛控資料(電路圖&PCB源文件、BOM、
  4. 5.67 MB   |  138次下載  |  1 積分
  5. 3基于STM32單片機智能手環(huán)心率計步器體溫顯示設(shè)計
  6. 0.10 MB   |  130次下載  |  免費
  7. 4使用單片機實現(xiàn)七人表決器的程序和仿真資料免費下載
  8. 2.96 MB   |  44次下載  |  免費
  9. 5美的電磁爐維修手冊大全
  10. 1.56 MB   |  24次下載  |  5 積分
  11. 6如何正確測試電源的紋波
  12. 0.36 MB   |  18次下載  |  免費
  13. 7感應(yīng)筆電路圖
  14. 0.06 MB   |  10次下載  |  免費
  15. 8萬用表UT58A原理圖
  16. 0.09 MB   |  9次下載  |  5 積分

總榜

  1. 1matlab軟件下載入口
  2. 未知  |  935121次下載  |  10 積分
  3. 2開源硬件-PMP21529.1-4 開關(guān)降壓/升壓雙向直流/直流轉(zhuǎn)換器 PCB layout 設(shè)計
  4. 1.48MB  |  420062次下載  |  10 積分
  5. 3Altium DXP2002下載入口
  6. 未知  |  233088次下載  |  10 積分
  7. 4電路仿真軟件multisim 10.0免費下載
  8. 340992  |  191367次下載  |  10 積分
  9. 5十天學會AVR單片機與C語言視頻教程 下載
  10. 158M  |  183335次下載  |  10 積分
  11. 6labview8.5下載
  12. 未知  |  81581次下載  |  10 積分
  13. 7Keil工具MDK-Arm免費下載
  14. 0.02 MB  |  73810次下載  |  10 積分
  15. 8LabVIEW 8.6下載
  16. 未知  |  65988次下載  |  10 積分
主站蜘蛛池模板: 久热在线这里只有精品7 | 小寡妇好紧进去了好大看视频 | 女人张腿让男人桶免费 | 亚洲综合中文字幕无线码 | 精品国产自在现线拍400部 | 久久笫一福利免费导航 | 漂亮妈妈中文字幕版 | 伊人精品久久久大香线蕉99 | 青青草国拍2018 | 一本道久在线综合色姐 | 国产亚洲制服免视频 | 国产亚洲精品免费视频 | 好紧的小嫩嫩17p | 草久热的视频在线观看 | 久久亚洲高清观看 | 国产亚洲精品在线视频 | 四虎永久在线精品免费A | 奶头被客人吸得又红又肿 | 久久国产视频网 | 色橹橹欧美在线观看视频高清 | 午夜理论电影在线观看亚洲 | 吉吉影音先锋av资源网 | 国产亚洲精品字幕在线观看 | 九九热只有精品 | 语文老师扒开胸罩喂我奶 | 九九热在线观看 | gratis videos欧美最新 | 暖暖日本大全免费观看 | 国产无线乱码一区二三区 | 真人美女精美小穴 | 毛片免费观看的视频在线 | 小SAO货边洗澡边CAO你动漫 | 亚洲色在线 | 暖暖 视频 免费 高清 在线观看 | 在教室伦流澡到高潮HNP视频 | 玄幻全黄h全肉后宫 | 性与肉体电影免费观看 | 三级色视频 | 精品午夜视频 | 欧美区 bt| 1000部做羞羞事禁片免费视频网站 |