doc: driver-model: Convert pmic-framework.txt to reST

Convert plain text documentation to reStructuredText format and add
it to Sphinx TOC tree. No essential content change.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
This commit is contained in:
Bin Meng 2019-07-18 00:33:57 -07:00 committed by Tom Rini
parent b598648947
commit cf4747d294
2 changed files with 66 additions and 62 deletions

View File

@ -14,3 +14,4 @@ Driver Model
migration migration
of-plat of-plat
pci-info pci-info
pmic-framework

View File

@ -1,63 +1,59 @@
# .. SPDX-License-Identifier: GPL-2.0+
# (C) Copyright 2014-2015 Samsung Electronics .. (C) Copyright 2014-2015 Samsung Electronics
# Przemyslaw Marczak <p.marczak@samsung.com> .. sectionauthor:: Przemyslaw Marczak <p.marczak@samsung.com>
#
# SPDX-License-Identifier: GPL-2.0+
#
PMIC framework based on Driver Model PMIC framework based on Driver Model
==================================== ====================================
TOC:
1. Introduction
2. How does it work
3. Pmic uclass
4. Regulator uclass
1. Introduction Introduction
=============== ------------
This is an introduction to driver-model multi uclass PMIC IC's support. This is an introduction to driver-model multi uclass PMIC IC's support.
At present it's based on two uclass types: At present it's based on two uclass types:
- UCLASS_PMIC - basic uclass type for PMIC I/O, which provides common
read/write interface. UCLASS_PMIC:
- UCLASS_REGULATOR - additional uclass type for specific PMIC features, basic uclass type for PMIC I/O, which provides common
which are Voltage/Current regulators. read/write interface.
UCLASS_REGULATOR:
additional uclass type for specific PMIC features, which are
Voltage/Current regulators.
New files: New files:
UCLASS_PMIC: UCLASS_PMIC:
- drivers/power/pmic/pmic-uclass.c - drivers/power/pmic/pmic-uclass.c
- include/power/pmic.h - include/power/pmic.h
UCLASS_REGULATOR: UCLASS_REGULATOR:
- drivers/power/regulator/regulator-uclass.c - drivers/power/regulator/regulator-uclass.c
- include/power/regulator.h - include/power/regulator.h
Commands: Commands:
- common/cmd_pmic.c - common/cmd_pmic.c
- common/cmd_regulator.c - common/cmd_regulator.c
2. How doees it work How doees it work
==================== -----------------
The Power Management Integrated Circuits (PMIC) are used in embedded systems The Power Management Integrated Circuits (PMIC) are used in embedded systems
to provide stable, precise and specific voltage power source with over-voltage to provide stable, precise and specific voltage power source with over-voltage
and thermal protection circuits. and thermal protection circuits.
The single PMIC can provide various functions by single or multiple interfaces, The single PMIC can provide various functions by single or multiple interfaces,
like in the example below. like in the example below::
-- SoC -- SoC
| |
| ______________________________________ | ______________________________________
| BUS 0 | Multi interface PMIC IC |--> LDO out 1 | BUS 0 | Multi interface PMIC IC |--> LDO out 1
| e.g.I2C0 | |--> LDO out N | e.g.I2C0 | |--> LDO out N
|-----------|---- PMIC device 0 (READ/WRITE ops) | |-----------|---- PMIC device 0 (READ/WRITE ops) |
| or SPI0 | |_ REGULATOR device (ldo/... ops) |--> BUCK out 1 | or SPI0 | |_ REGULATOR device (ldo/... ops) |--> BUCK out 1
| | |_ CHARGER device (charger ops) |--> BUCK out M | | |_ CHARGER device (charger ops) |--> BUCK out M
| | |_ MUIC device (microUSB con ops) | | | |_ MUIC device (microUSB con ops) |
| BUS 1 | |_ ... |---> BATTERY | BUS 1 | |_ ... |---> BATTERY
| e.g.I2C1 | | | e.g.I2C1 | |
|-----------|---- PMIC device 1 (READ/WRITE ops) |---> USB in 1 |-----------|---- PMIC device 1 (READ/WRITE ops) |---> USB in 1
. or SPI1 | |_ RTC device (rtc ops) |---> USB in 2 . or SPI1 | |_ RTC device (rtc ops) |---> USB in 2
. |______________________________________|---> USB out . |______________________________________|---> USB out
. .
Since U-Boot provides driver model features for I2C and SPI bus drivers, Since U-Boot provides driver model features for I2C and SPI bus drivers,
the PMIC devices should also support this. By the pmic and regulator API's, the PMIC devices should also support this. By the pmic and regulator API's,
@ -66,26 +62,27 @@ and multi-instance device support.
Basic design assumptions: Basic design assumptions:
- Common I/O API - UCLASS_PMIC - Common I/O API:
For the multi-function PMIC devices, this can be used as parent I/O device UCLASS_PMIC. For the multi-function PMIC devices, this can be used as
for each IC's interface. Then, each children uses the same dev for read/write. parent I/O device for each IC's interface. Then, each children uses the
same dev for read/write.
- Common regulator API - UCLASS_REGULATOR - Common regulator API:
For driving the regulator attributes, auto setting function or command line UCLASS_REGULATOR. For driving the regulator attributes, auto setting
interface, based on kernel-style regulator device tree constraints. function or command line interface, based on kernel-style regulator device
tree constraints.
For simple implementations, regulator drivers are not required, so the code can For simple implementations, regulator drivers are not required, so the code can
use pmic read/write directly. use pmic read/write directly.
3. Pmic uclass Pmic uclass
============== -----------
The basic information: The basic information:
* Uclass: 'UCLASS_PMIC' * Uclass: 'UCLASS_PMIC'
* Header: 'include/power/pmic.h' * Header: 'include/power/pmic.h'
* Core: 'drivers/power/pmic/pmic-uclass.c' * Core: 'drivers/power/pmic/pmic-uclass.c' (config 'CONFIG_DM_PMIC')
config: 'CONFIG_DM_PMIC' * Command: 'common/cmd_pmic.c' (config 'CONFIG_CMD_PMIC')
* Command: 'common/cmd_pmic.c'
config: 'CONFIG_CMD_PMIC'
* Example: 'drivers/power/pmic/max77686.c' * Example: 'drivers/power/pmic/max77686.c'
For detailed API description, please refer to the header file. For detailed API description, please refer to the header file.
@ -109,20 +106,26 @@ for pmic I/O operations only.
For more information, please refer to the core file. For more information, please refer to the core file.
4. Regulator uclass Regulator uclass
=================== ----------------
The basic information: The basic information:
* Uclass: 'UCLASS_REGULATOR'
* Header: 'include/power/regulator.h' * Uclass: 'UCLASS_REGULATOR'
* Core: 'drivers/power/regulator/regulator-uclass.c'
config: 'CONFIG_DM_REGULATOR' * Header: 'include/power/regulator.h'
binding: 'doc/device-tree-bindings/regulator/regulator.txt'
* Command: 'common/cmd_regulator.c' * Core: 'drivers/power/regulator/regulator-uclass.c'
config: 'CONFIG_CMD_REGULATOR' (config 'CONFIG_DM_REGULATOR')
* Binding: 'doc/device-tree-bindings/regulator/regulator.txt'
* Command: 'common/cmd_regulator.c' (config 'CONFIG_CMD_REGULATOR')
* Example: 'drivers/power/regulator/max77686.c' * Example: 'drivers/power/regulator/max77686.c'
'drivers/power/pmic/max77686.c' (required I/O driver for the above) 'drivers/power/pmic/max77686.c' (required I/O driver for the above)
* Example: 'drivers/power/regulator/fixed.c' * Example: 'drivers/power/regulator/fixed.c'
config" 'CONFIG_DM_REGULATOR_FIXED' (config 'CONFIG_DM_REGULATOR_FIXED')
For detailed API description, please refer to the header file. For detailed API description, please refer to the header file.