From patchwork Thu Jul 18 07:33:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1133580 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="cOoo6EYY"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45q5jC5XRlz9s00 for ; Thu, 18 Jul 2019 17:43:27 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 6B45CC2203F; Thu, 18 Jul 2019 07:40:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 13F99C21F52; Thu, 18 Jul 2019 07:35:27 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id CED18C21F97; Thu, 18 Jul 2019 07:35:00 +0000 (UTC) Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by lists.denx.de (Postfix) with ESMTPS id 2AF94C21F4A for ; Thu, 18 Jul 2019 07:34:56 +0000 (UTC) Received: by mail-pg1-f195.google.com with SMTP id i18so12474970pgl.11 for ; Thu, 18 Jul 2019 00:34:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=aua34AFsRhK9qe2w8+kzZTtqDf3k/JM3M08jjddfB4k=; b=cOoo6EYYr52qFXeM2toYce8Hx1bGqsUg7Iha6ZHULKj+xGCe5CwRnK7yzyTfmc+UoK qNaudglV8BfHw8RiST5tXcvKAP57PF3eN9tBA/xLwnYlfADz5Ql6yjuAuT6vxmo3JqwE /YPRkCVk8buJ0yxS/7g1PV/GmeEy0opRSzmvPo+P3glwWdDEw1HzkDGUN0xPLzd6IEC1 l2gnwIYGcd9HL0UZ58fyC1EI51rJKOyg8Zooyy7iexYUROM9tdZBznE+6k9AmEy/aJoO 8gLu8rDI/T4LosPimzBNuFpJ0Iws+Bw0xgB1oJ1Y53S+QbdsMN5pzplgOyXDV+khtlHY ELTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=aua34AFsRhK9qe2w8+kzZTtqDf3k/JM3M08jjddfB4k=; b=VmIw4608caAXw5O4OnScHqfQSNZQz2GZqgFXb6OICpJ2oB+3zrejUSya6dhOV3wjyJ R4MZ8awxioPWD5iYSh5mMbQSI3OQunxZjAKCb70QQuri868iMkiKvSiCjQYjJRWxPiAO KRIplawcGjoN8dNgP8WvG0mly1rtgAJwNIk2g5AH/NVsmksKhzkZh2y6oKvDqqd186mB dNGi0WRKnfRZsZOCr+4p/4ueXdHG3hM5W++jPfrydoS43x7PNA/wS60ZwhYIJMsqXfGC s1SyDkIfnsHO+ZP4BRJzJ45f1K5/gzLPGzct6DHm9cvwUMFxrWU09QGHkP+r3zj/WNMn De6A== X-Gm-Message-State: APjAAAUNss7+6pl9l4mJpUiwe8AbzSgTdMV79waJQIjkk3S9EaKzYWCk MF/6VMbDcfg3NskwwW7Y7YQ= X-Google-Smtp-Source: APXvYqwgogkrqlk+yGcfGQ2aGJfJzotjU0SiLDIPcml2W0nHeo395iZ8h0/dvSbeZxCBu72ZNNulzg== X-Received: by 2002:a63:125c:: with SMTP id 28mr12871640pgs.255.1563435294744; Thu, 18 Jul 2019 00:34:54 -0700 (PDT) Received: from localhost.localdomain (unknown-224-80.windriver.com. [147.11.224.80]) by smtp.gmail.com with ESMTPSA id q1sm39859821pfn.178.2019.07.18.00.34.53 (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 18 Jul 2019 00:34:53 -0700 (PDT) From: Bin Meng To: Tom Rini , Simon Glass , Wolfgang Denk , Heinrich Schuchardt , Mario Six , U-Boot Mailing List Date: Thu, 18 Jul 2019 00:33:57 -0700 Message-Id: <1563435275-22326-13-git-send-email-bmeng.cn@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1563435275-22326-1-git-send-email-bmeng.cn@gmail.com> References: <1563435275-22326-1-git-send-email-bmeng.cn@gmail.com> Subject: [U-Boot] [PATCH 12/50] doc: driver-model: Convert pmic-framework.txt to reST X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Convert plain text documentation to reStructuredText format and add it to Sphinx TOC tree. No essential content change. Signed-off-by: Bin Meng --- doc/driver-model/index.rst | 1 + .../{pmic-framework.txt => pmic-framework.rst} | 131 +++++++++++---------- 2 files changed, 68 insertions(+), 64 deletions(-) rename doc/driver-model/{pmic-framework.txt => pmic-framework.rst} (51%) diff --git a/doc/driver-model/index.rst b/doc/driver-model/index.rst index a83c648..fd33215 100644 --- a/doc/driver-model/index.rst +++ b/doc/driver-model/index.rst @@ -14,3 +14,4 @@ Driver Model migration of-plat pci-info + pmic-framework diff --git a/doc/driver-model/pmic-framework.txt b/doc/driver-model/pmic-framework.rst similarity index 51% rename from doc/driver-model/pmic-framework.txt rename to doc/driver-model/pmic-framework.rst index 95b1a66..d24a1ba 100644 --- a/doc/driver-model/pmic-framework.txt +++ b/doc/driver-model/pmic-framework.rst @@ -1,63 +1,59 @@ -# -# (C) Copyright 2014-2015 Samsung Electronics -# Przemyslaw Marczak -# -# SPDX-License-Identifier: GPL-2.0+ -# +.. SPDX-License-Identifier: GPL-2.0+ +.. (C) Copyright 2014-2015 Samsung Electronics +.. sectionauthor:: Przemyslaw Marczak 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. 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_REGULATOR - additional uclass type for specific PMIC features, - which are Voltage/Current regulators. + +UCLASS_PMIC: + basic uclass type for PMIC I/O, which provides common + read/write interface. +UCLASS_REGULATOR: + additional uclass type for specific PMIC features, which are + Voltage/Current regulators. New files: + UCLASS_PMIC: -- drivers/power/pmic/pmic-uclass.c -- include/power/pmic.h + - drivers/power/pmic/pmic-uclass.c + - include/power/pmic.h UCLASS_REGULATOR: -- drivers/power/regulator/regulator-uclass.c -- include/power/regulator.h + - drivers/power/regulator/regulator-uclass.c + - include/power/regulator.h Commands: - common/cmd_pmic.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 to provide stable, precise and specific voltage power source with over-voltage and thermal protection circuits. The single PMIC can provide various functions by single or multiple interfaces, -like in the example below. - --- SoC - | - | ______________________________________ - | BUS 0 | Multi interface PMIC IC |--> LDO out 1 - | e.g.I2C0 | |--> LDO out N - |-----------|---- PMIC device 0 (READ/WRITE ops) | - | or SPI0 | |_ REGULATOR device (ldo/... ops) |--> BUCK out 1 - | | |_ CHARGER device (charger ops) |--> BUCK out M - | | |_ MUIC device (microUSB con ops) | - | BUS 1 | |_ ... |---> BATTERY - | e.g.I2C1 | | - |-----------|---- PMIC device 1 (READ/WRITE ops) |---> USB in 1 - . or SPI1 | |_ RTC device (rtc ops) |---> USB in 2 - . |______________________________________|---> USB out - . +like in the example below:: + + -- SoC + | + | ______________________________________ + | BUS 0 | Multi interface PMIC IC |--> LDO out 1 + | e.g.I2C0 | |--> LDO out N + |-----------|---- PMIC device 0 (READ/WRITE ops) | + | or SPI0 | |_ REGULATOR device (ldo/... ops) |--> BUCK out 1 + | | |_ CHARGER device (charger ops) |--> BUCK out M + | | |_ MUIC device (microUSB con ops) | + | BUS 1 | |_ ... |---> BATTERY + | e.g.I2C1 | | + |-----------|---- PMIC device 1 (READ/WRITE ops) |---> USB in 1 + . or SPI1 | |_ RTC device (rtc ops) |---> USB in 2 + . |______________________________________|---> USB out + . 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, @@ -66,26 +62,27 @@ and multi-instance device support. Basic design assumptions: -- Common I/O API - UCLASS_PMIC -For the multi-function PMIC devices, this can be used as parent I/O device -for each IC's interface. Then, each children uses the same dev for read/write. +- Common I/O API: + UCLASS_PMIC. For the multi-function PMIC devices, this can be used as + parent I/O device for each IC's interface. Then, each children uses the + same dev for read/write. -- Common regulator API - UCLASS_REGULATOR -For driving the regulator attributes, auto setting function or command line -interface, based on kernel-style regulator device tree constraints. +- Common regulator API: + UCLASS_REGULATOR. For driving the regulator attributes, auto setting + 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 use pmic read/write directly. -3. Pmic uclass -============== +Pmic uclass +----------- The basic information: + * Uclass: 'UCLASS_PMIC' * Header: 'include/power/pmic.h' -* Core: 'drivers/power/pmic/pmic-uclass.c' - config: 'CONFIG_DM_PMIC' -* Command: 'common/cmd_pmic.c' - config: 'CONFIG_CMD_PMIC' +* Core: 'drivers/power/pmic/pmic-uclass.c' (config 'CONFIG_DM_PMIC') +* Command: 'common/cmd_pmic.c' (config 'CONFIG_CMD_PMIC') * Example: 'drivers/power/pmic/max77686.c' 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. -4. Regulator uclass -=================== +Regulator uclass +---------------- The basic information: -* Uclass: 'UCLASS_REGULATOR' -* Header: 'include/power/regulator.h' -* Core: 'drivers/power/regulator/regulator-uclass.c' - config: 'CONFIG_DM_REGULATOR' - binding: 'doc/device-tree-bindings/regulator/regulator.txt' -* Command: 'common/cmd_regulator.c' - config: 'CONFIG_CMD_REGULATOR' + +* Uclass: 'UCLASS_REGULATOR' + +* Header: 'include/power/regulator.h' + +* Core: 'drivers/power/regulator/regulator-uclass.c' + (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' - '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' - config" 'CONFIG_DM_REGULATOR_FIXED' + (config 'CONFIG_DM_REGULATOR_FIXED') For detailed API description, please refer to the header file.