Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
software:driver:linux:adp5520 [27 Sep 2010 17:00] – make files links to kernel.org hennerichresources:tools-software:linux-drivers:multifunction-device:adp5520 [03 Jan 2013 20:42] – external edit
Line 1: Line 1:
-====== Source Code ======+====== ADP5520/01 MFD Linux Driver ======
  
-===== Status ===== +===== Supported Devices =====
- +
-^  Source  ^  Mainlined? +
-|  [[bf>project/linux-kernel/scmsvn/trunk/drivers/mfd/adp5520.c|svn]]  [[bfin>git/?p=readonly-mirrors/linux-kernel.git;a=history;f=drivers/mfd/adp5520.c;hb=HEAD|git]]  |  [[http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=drivers/mfd/adp5520.c;hb=HEAD|Yes]] +
- +
-===== Files ===== +
- +
-^ Function ^ File ^ +
-| MFD-CORE | [[http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=drivers/mfd/adp5520.c;hb=HEAD|drivers/mfd/adp5520.c]] | +
-| include | [[http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=include/linux/mfd/adp5520.h;hb=HEAD|include/linux/mfd/adp5520.h]] | +
-| BACKLIGHT | [[http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=drivers/video/backlight/adp5520_bl.c;hb=HEAD|drivers/video/backlight/adp5520_bl.c]] |  +
-| LED | [[http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=drivers/led/leds-adp5520.c;hb=HEAD|drivers/led/leds-adp5520.c]] | +
-| GPIO | [[http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=drivers/gpio/adp5520-gpio.c;hb=HEAD|drivers/gpio/adp5520-gpio.c (ADP5520 only)]] | +
-| KEYPAD | [[http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=drivers/input/keyboard/adp5520-keys.c;hb=HEAD|drivers/input/keyboard/adp5520-keys.c (ADP5520 only)]] |+
  
 +  * [[adi>ADP5520]]
 +  * [[adi>ADP5501]]
  
-====== Driver Overview ======+===== Evaluation Boards =====
  
-More information on the:\\ +  * [[adi>ADP5520-EVALZ]]   
-  ADP5520 can be found here [[:adp5520]] +===== Description =====
-  * ADP5501 can be found here [[:adp5501]]+
  
-The ADP5520/01 utilizes several Linux device-driver subsystems and provides +The ADP5520/01 driver utilizes several Linux device-driver subsystems and provides 
 various software interfaces. It is therefore implemented as a multifunction device (MFD). 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 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. leverages the Linux backlight, LED, GPIO, and input subsystems for its keypad functionality.
  
-<graphviz dot>+<graphviz dot 650x200>
 digraph { digraph {
 + size="8,5"
  ADP5520_MFD_CORE [shape=box]  ADP5520_MFD_CORE [shape=box]
  ADP5520_BACKLIGHT [shape=box]  ADP5520_BACKLIGHT [shape=box]
Line 90: Line 79:
   * Configurable number of dedicated GPIOs, up to 8 GPIOs   * Configurable number of dedicated GPIOs, up to 8 GPIOs
   * Configurable Pull-Ups     * Configurable Pull-Ups  
 +
 +
 +
 +====== Source Code ======
 +
 +===== Status =====
 +
 +^  Source  ^  Mainlined?  ^
 +| [[git.linux.org>drivers/mfd/adp5520.c|git]] |  [[git.linux.org>drivers/mfd/adp5520.c|Yes]]  |
 +
 +
 +===== Files =====
 +
 +^ Function ^ File ^
 +| MFD-CORE  | [[git.linux.org>drivers/mfd/adp5520.c]] |
 +| include   | [[git.linux.org>include/linux/mfd/adp5520.h]] |
 +| BACKLIGHT | [[git.linux.org>drivers/video/backlight/adp5520_bl.c]] | 
 +| LED       | [[git.linux.org>drivers/led/leds-adp5520.c]] |
 +| GPIO      | [[git.linux.org>drivers/gpio/adp5520-gpio.c]]((ADP5520 only)) |
 +| KEYPAD    | [[git.linux.org>drivers/input/keyboard/adp5520-keys.c]]((ADP5520 only)) |
  
 ====== Example platform device initialization ====== ====== Example platform device initialization ======
  
-<note important>+{{page>software/linux/docs/platform_and_bus_model#Platform Data&noheader&firstseconly&noeditbtn}} 
 + 
 +<WRAP important>
 Since Keypad, GPIO and optional LEDs (2, 3) are multiplexed, you need to avoid double configurations. Please refer to the table below. Since Keypad, GPIO and optional LEDs (2, 3) are multiplexed, you need to avoid double configurations. Please refer to the table below.
-</note>+</WRAP>
  
 ^ ADP5520 PIN ^ R3 ^ R2 ^ R1 ^ R0 ^ C0 ^ C1 ^ C2 ^ C3 ^ ^ ADP5520 PIN ^ R3 ^ R2 ^ R1 ^ R0 ^ C0 ^ C1 ^ C2 ^ C3 ^
Line 102: Line 113:
 | **LED** | LED3 |  |  |  |  |  |  | LED2 |   | **LED** | LED3 |  |  |  |  |  |  | LED2 |  
  
-<note tip>  +<WRAP tip>  
-Please refer to include/linux/mfd/adp5520.h for detailed configuration defines. +Please refer to [[git.linux.org>include/linux/mfd/adp5520.h]] for detailed configuration defines. 
-</note> +</WRAP>
- +
-<source trunk/include/linux/mfd/adp5520.h:/LEDs/ssubdevice/sbits/sand/smasks/1-/functions/ c linux-kernel>+
  
 ==== Backlight ===== ==== Backlight =====
Line 129: Line 138:
  
 ==== ADP5520/ADP5501 MFD Core Support ===== ==== ADP5520/ADP5501 MFD Core Support =====
 +
 +{{page>software/linux/docs/platform_and_bus_model#Declaring I2C devices&firstseconly&noeditbtn}}
  
 <source trunk/arch/blackfin/mach-bf537/boards/stamp.c:adp5520_pdev_data{} c linux-kernel> <source trunk/arch/blackfin/mach-bf537/boards/stamp.c:adp5520_pdev_data{} c linux-kernel>
 <source trunk/arch/blackfin/mach-bf537/boards/stamp.c:/CONFIG_PMIC_ADP5520/2-/#if/ c linux-kernel> <source trunk/arch/blackfin/mach-bf537/boards/stamp.c:/CONFIG_PMIC_ADP5520/2-/#if/ c linux-kernel>
  
-<note tip>+<WRAP tip>
 **ADP5520 IRQ Usage:**\\ **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. If you aren’t planning to utilize the Keypad interface, you don’t need to specify an IRQ in bfin_i2c_board_info.
-</note>+</WRAP>
  
 ====== Adding Linux driver support ====== ====== Adding Linux driver support ======
Line 199: Line 210:
  
 ====== Hardware configuration ====== ====== Hardware configuration ======
 +
 +{{:software:driver:linux:adp5520_brd.jpg?800|ADP5520 Demo Mother/Daughter Board}}
  
 There is no dedicated Blackfin STAMP evaluation board for the ADP5520. There is no dedicated Blackfin STAMP evaluation board for the ADP5520.
 During test and driver development we used the ADP5520 Demo Mother/Daughter Board. 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. It can be easily wired to the Blackfin STAMP TWI/I2C header.
Line 207: Line 221:
 ^ BF537-STAMP (P10) TWI/I2C header  ^^ ADP5520 Daughter Board ^ ^ BF537-STAMP (P10) TWI/I2C header  ^^ ADP5520 Daughter Board ^
 ^ PIN ^ Function ^ PIN/Function ^ ^ PIN ^ Function ^ PIN/Function ^
-| 2 | (+3.3V) | VCC | 
 | 5 | SCL | SCL | | 5 | SCL | SCL |
 | 6 | SDA| SDA | | 6 | SDA| SDA |
Line 243: Line 256:
 root:/sys/devices/platform/i2c-bfin-twi.0/i2c-adapter/i2c-0/0-0032/backlight/adp5520-backlight> **echo 0 > brightness** root:/sys/devices/platform/i2c-bfin-twi.0/i2c-adapter/i2c-0/0-0032/backlight/adp5520-backlight> **echo 0 > brightness**
 </xterm> </xterm>
 +
 +__**For more information on Backlight handling in Linux read:**__ [[git.linux.org>Documentation/ABI/stable/sysfs-class-backlight]] 
  
 ==== LED ===== ==== LED =====
Line 270: Line 285:
 root:/> root:/>
 </xterm> </xterm>
 +
 +__**For more information on LEDs handling in Linux read:**__ [[git.linux.org>Documentation/leds-class.txt]] 
  
 ==== GPIO ===== ==== GPIO =====
Line 290: Line 307:
                    [*] Input event device test                    [*] Input event device test
 </xterm> </xterm>
 +
 +__**For more information on GPIO handling in Linux read:**__ [[git.linux.org>Documentation/gpio.txt]] 
 +
  
 ==== Keypad ===== ==== Keypad =====
Line 338: Line 358:
 root:/> root:/>
 </xterm> </xterm>
 +
 +__**For more information on Input handling in Linux read:**__ [[git.linux.org>Documentation/input/input.txt]]
 +
 +====== More Information ======
 +
 +{{page>resources/tools-software/linux-drivers/snippets#input_pointers&noheader&firstseconly&noeditbtn}} 
 +
resources/tools-software/linux-drivers/multifunction-device/adp5520.txt · Last modified: 16 Feb 2015 11:50 by Lars-Peter Clausen