From patchwork Tue Jun 6 08:51:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guodong Xu X-Patchwork-Id: 103131 Delivered-To: patch@linaro.org Received: by 10.182.29.35 with SMTP id g3csp1163237obh; Tue, 6 Jun 2017 01:53:20 -0700 (PDT) X-Received: by 10.84.230.134 with SMTP id e6mr19682178plk.256.1496739200501; Tue, 06 Jun 2017 01:53:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496739200; cv=none; d=google.com; s=arc-20160816; b=xKSn/X3lZKdqF5Ngsut/V8yXWvCK37o1iaRwslzPcYUN98R48mijEtBbx46jSwdP3r MPTWZBC0rfuY9YnUlFwm9b88iS+/38MD7D2Q/LGwqPVjITvOq8VYwS9EODbIkJ2jN4dB Bu888yCciX8Fpc3iVz2OiQ8Y0cp8V/IuUMg/v68IXDvdkMOt1KOXXJctnxFukYppUM7V mGYwJE/d5ajFfN7S67jgs4ZAlPuj/rXkS9P5iG8UiBi6JRNFC9T6j/rd5U4DeWPY+VHX UCsF+75e/h20HUXpVdSqr4TbCEWXgqFRSVZwRhHpJsqjcwX47tHDemLG5g2Dr9nJsdN6 JzHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=JRxRbQ1LhMdZczoXwsLnSYgzsvO6fg7RGsIeXp5Waao=; b=qQKcr0mXmndlknwW0UnMzgtUOxjm+Ydrq1pJV6RqlTzPN9cjqdBq1GWMdDMWUmxyN0 hIwaIbvCi7SqQEUFVx2uGq6gw3pmLvvANe4Q8eN8RK5xE2SmVcmZ4zEiJ/D6zOdTPFHs wvQ7LsmTEy3xKU/iCPGMmNR2m0KLE6NyIlthfyWgtmfUDQb2DZglT/jcjFJmZCZ0Zp6X ernh0dhGI+B/TSwQaBjI/2UYfoy1I0EhJO0Cef/67JBWDG+MYcOG4Zzo8kfAClpBweud IeycVx8sq6Vcs0UGyALWxioW+k6GOj5f+OOezGHmZBmOXxHYLzEy5Av8UJxK9mLUiE3k W99A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v8si8727143plk.92.2017.06.06.01.53.20; Tue, 06 Jun 2017 01:53:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751512AbdFFIw5 (ORCPT + 25 others); Tue, 6 Jun 2017 04:52:57 -0400 Received: from mail-pg0-f43.google.com ([74.125.83.43]:33519 "EHLO mail-pg0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751303AbdFFIwz (ORCPT ); Tue, 6 Jun 2017 04:52:55 -0400 Received: by mail-pg0-f43.google.com with SMTP id f185so32371403pgc.0 for ; Tue, 06 Jun 2017 01:52:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=JRxRbQ1LhMdZczoXwsLnSYgzsvO6fg7RGsIeXp5Waao=; b=gHNsUaqURL6TNVzHAhX62om9C8FUAeU13F0uHQQLGXvZzMK/xOWvWvIuy/Pd5wLjR2 qQ7ZVaP9Xe+VeIQPpnQZM3OEIWUQmCYC8DUcX9r8l5c2L2TysAyUVxGboi+/YCEfp1U7 4cOkN+2m5alblBlGNXAeBPJrKd9GBT1Vz+Cco= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=JRxRbQ1LhMdZczoXwsLnSYgzsvO6fg7RGsIeXp5Waao=; b=t1GA2LrpXaArbcb7wewLFSFHLcEkqZcT2SlzK1WzIsi72E7mXKGygC1A2+xIx+UWSr eGjxyL/fmUuQ0K5zZVDrLGm2UAcDkeBH4sUUvMBAmWk3sOK/penOs2R0HI34w4A5IQW+ +O/UDtlZq9YQtNKvt53qKVVemos3Ykw0U4Uq3dtPaafzj3R92qBYYS+eu9wsYl5l3Hx7 yQ9KJeRqCYbasVswhQJxpJSpoRkClQg8tELImvWJLXEqlMwy9DOkl5ss8Z5poNyu7Oi6 6hpmjuBHnx+J6tlw+SzSz1z/IEsLQ2ofGxXwio3FUX9qwCh7gx0+P/OMt42mOdAXKvgR /eiw== X-Gm-Message-State: AODbwcAvXtKUTu+aSG4yMWhXbyhhAbQuLZWShSoqffLLv5HMfSJdiA1O E3Bk1uNfyQSMNKKw X-Received: by 10.98.69.68 with SMTP id s65mr24819250pfa.178.1496739169289; Tue, 06 Jun 2017 01:52:49 -0700 (PDT) Received: from docularxu-ThinkPad-T440p.219.146.1.66 ([45.56.159.173]) by smtp.gmail.com with ESMTPSA id b14sm49851988pga.12.2017.06.06.01.52.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 06 Jun 2017 01:52:48 -0700 (PDT) From: Guodong Xu To: lee.jones@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, xuwei5@hisilicon.com, catalin.marinas@arm.com, will.deacon@arm.com, lgirdwood@gmail.com, broonie@kernel.org, khilman@baylibre.com, arnd@arndb.de, gregory.clement@free-electrons.com, horms+renesas@verge.net.au, olof@lixom.net, thomas.petazzoni@free-electrons.com, yamada.masahiro@socionext.com, riku.voipio@linaro.org, treding@nvidia.com, krzk@kernel.org, eric@anholt.net, damm+renesas@opensource.se, ard.biesheuvel@linaro.org, linus.walleij@linaro.org, geert+renesas@glider.be Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, hw.wangxiaoyin@hisilicon.com, Guodong Xu Subject: [PATCH v4 4/8] mfd: hi6421-pmic: add support for HiSilicon Hi6421v530 Date: Tue, 6 Jun 2017 16:51:39 +0800 Message-Id: <20170606085143.13154-5-guodong.xu@linaro.org> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20170606085143.13154-1-guodong.xu@linaro.org> References: <20170606085143.13154-1-guodong.xu@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add support for HiSilicon Hi6421v530 PMIC. Hi6421v530 communicates with main SoC via memory-mapped I/O. Hi6421v530 and Hi6421 are PMIC chips from the same vendor, HiSilicon, but at different revisions. They share the same memory-mapped I/O design. They differ in integrated devices, such as regulator details, LDO voltage points. Signed-off-by: Wang Xiaoyin Signed-off-by: Guodong Xu --- drivers/mfd/hi6421-pmic-core.c | 68 ++++++++++++++++++++++++++++++----------- include/linux/mfd/hi6421-pmic.h | 5 +++ 2 files changed, 55 insertions(+), 18 deletions(-) -- 2.10.2 diff --git a/drivers/mfd/hi6421-pmic-core.c b/drivers/mfd/hi6421-pmic-core.c index b1139d4..4568a43 100644 --- a/drivers/mfd/hi6421-pmic-core.c +++ b/drivers/mfd/hi6421-pmic-core.c @@ -1,9 +1,9 @@ /* - * Device driver for Hi6421 IC + * Device driver for Hi6421 PMIC * * Copyright (c) <2011-2014> HiSilicon Technologies Co., Ltd. * http://www.hisilicon.com - * Copyright (c) <2013-2014> Linaro Ltd. + * Copyright (c) <2013-2017> Linaro Ltd. * http://www.linaro.org * * Author: Guodong Xu @@ -16,16 +16,20 @@ #include #include #include +#include #include -#include +#include #include #include -#include static const struct mfd_cell hi6421_devs[] = { { .name = "hi6421-regulator", }, }; +static const struct mfd_cell hi6421v530_devs[] = { + { .name = "hi6421v530-regulator", }, +}; + static const struct regmap_config hi6421_regmap_config = { .reg_bits = 32, .reg_stride = 4, @@ -33,12 +37,31 @@ static const struct regmap_config hi6421_regmap_config = { .max_register = HI6421_REG_TO_BUS_ADDR(HI6421_REG_MAX), }; +static const struct of_device_id of_hi6421_pmic_match[] = { + { + .compatible = "hisilicon,hi6421-pmic", + .data = (void *)HI6421 + }, + { + .compatible = "hisilicon,hi6421v530-pmic", + .data = (void *)HI6421_V530 + }, + { }, +}; +MODULE_DEVICE_TABLE(of, of_hi6421_pmic_match); + static int hi6421_pmic_probe(struct platform_device *pdev) { struct hi6421_pmic *pmic; struct resource *res; + const struct of_device_id *id; + const struct mfd_cell *subdevs; void __iomem *base; - int ret; + int n_subdevs, ret; + + id = of_match_device(of_hi6421_pmic_match, &pdev->dev); + if (!id) + return -EINVAL; pmic = devm_kzalloc(&pdev->dev, sizeof(*pmic), GFP_KERNEL); if (!pmic) @@ -57,18 +80,33 @@ static int hi6421_pmic_probe(struct platform_device *pdev) return PTR_ERR(pmic->regmap); } - /* set over-current protection debounce 8ms */ - regmap_update_bits(pmic->regmap, HI6421_OCP_DEB_CTRL_REG, + platform_set_drvdata(pdev, pmic); + + switch ((unsigned long)id->data) { + case HI6421: + /* set over-current protection debounce 8ms */ + regmap_update_bits(pmic->regmap, HI6421_OCP_DEB_CTRL_REG, (HI6421_OCP_DEB_SEL_MASK | HI6421_OCP_EN_DEBOUNCE_MASK | HI6421_OCP_AUTO_STOP_MASK), (HI6421_OCP_DEB_SEL_8MS | HI6421_OCP_EN_DEBOUNCE_ENABLE)); - platform_set_drvdata(pdev, pmic); + subdevs = hi6421_devs; + n_subdevs = ARRAY_SIZE(hi6421_devs); + break; + case HI6421_V530: + subdevs = hi6421v530_devs; + n_subdevs = ARRAY_SIZE(hi6421v530_devs); + break; + default: + dev_err(&pdev->dev, "Unknown device type %ld\n", + (unsigned long)id->data); + return -EINVAL; + } - ret = devm_mfd_add_devices(&pdev->dev, 0, hi6421_devs, - ARRAY_SIZE(hi6421_devs), NULL, 0, NULL); + ret = devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_NONE, + subdevs, n_subdevs, NULL, 0, NULL); if (ret) { dev_err(&pdev->dev, "Failed to add child devices: %d\n", ret); return ret; @@ -77,16 +115,10 @@ static int hi6421_pmic_probe(struct platform_device *pdev) return 0; } -static const struct of_device_id of_hi6421_pmic_match_tbl[] = { - { .compatible = "hisilicon,hi6421-pmic", }, - { }, -}; -MODULE_DEVICE_TABLE(of, of_hi6421_pmic_match_tbl); - static struct platform_driver hi6421_pmic_driver = { .driver = { - .name = "hi6421_pmic", - .of_match_table = of_hi6421_pmic_match_tbl, + .name = "hi6421_pmic", + .of_match_table = of_hi6421_pmic_match, }, .probe = hi6421_pmic_probe, }; diff --git a/include/linux/mfd/hi6421-pmic.h b/include/linux/mfd/hi6421-pmic.h index 587273e..2457438 100644 --- a/include/linux/mfd/hi6421-pmic.h +++ b/include/linux/mfd/hi6421-pmic.h @@ -38,4 +38,9 @@ struct hi6421_pmic { struct regmap *regmap; }; +enum hi6421_type { + HI6421 = 1, + HI6421_V530 = 2, +}; + #endif /* __HI6421_PMIC_H */ From patchwork Tue Jun 6 08:51:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guodong Xu X-Patchwork-Id: 103132 Delivered-To: patch@linaro.org Received: by 10.182.29.35 with SMTP id g3csp1163243obh; Tue, 6 Jun 2017 01:53:21 -0700 (PDT) X-Received: by 10.84.229.77 with SMTP id d13mr19816676pln.72.1496739201227; Tue, 06 Jun 2017 01:53:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496739201; cv=none; d=google.com; s=arc-20160816; b=rrDOnVdkJSHkaER9pii900Qw60Gv/CuX0e/TDF6VHIdpVqhKxAFDd/d6nRcHXCM26X WtmQTw3VZu+1Q8aRr3ce4m3htLYhY9Z3wBUHxJWXeNhPKrQyLb+QS92jze0bD+n2902h 5zDkAhpeM0KcSjvkB8dNPsbGUf8qzkUrOl2jybd0l7w52KRVvqy4cAYm1tPCK+6x9iTK KwP2HSzg7M9M7kOzLex6y65qAyfiesRn0sDv+xwiXftsVABLInCZLI1v8RxmZDMyTvxl 6u62KefxDX3Vb3HeqxljUjCD3qeaMdjwIxq8ko22tFTSN/btXOvf3SrjYjkOoeLe0eTF EGTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=PPxH0/YSvgTZKnM2bGbHt0RVaygtzfTtSHzv6i2twqk=; b=pF23EXCY0qUz1YztgCp+rHrieeaTxLCJne7sWavj1TwaHVBU/PqyopaWkYx7x8WEiT o1+S92Jllr3ygJvVOkOCdaYdpZZKosWKMU+pDMsB7NBxHnkSX7wHno1dg1CK78jS6FwQ qOqCFl+FSK0YJhBfC3EPtVMilPTjnj5SYgWzj6Les735dztQ2INNeYBqOaZEYqhiFtfI 0MohO5r5UqhlsjqBG3kwx/nY19iHvkbXmYw2e67Cpp6PaID6C6V35MA20Yey6iI0V9Vp NPMsv3L5ITvo4mfi+5EEAeJhSX0rKL6hADg7UycrhyUznG686r6TilE0ldTof2191bv4 GERQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v8si8727143plk.92.2017.06.06.01.53.20; Tue, 06 Jun 2017 01:53:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751526AbdFFIxI (ORCPT + 25 others); Tue, 6 Jun 2017 04:53:08 -0400 Received: from mail-pf0-f177.google.com ([209.85.192.177]:33724 "EHLO mail-pf0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751514AbdFFIxB (ORCPT ); Tue, 6 Jun 2017 04:53:01 -0400 Received: by mail-pf0-f177.google.com with SMTP id 83so37916741pfr.0 for ; Tue, 06 Jun 2017 01:53:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=PPxH0/YSvgTZKnM2bGbHt0RVaygtzfTtSHzv6i2twqk=; b=ca3NxxfVPrM/Pd/5xqAYs8Mq3fysY7LoYD+Nl3zidMBJFAsCUkze4OHX1Ulo72kTZ6 pbu7Uq4NVCk+B5o2Pk0WT7s9nx6Ui+jUmm8oL4Xn2xFMEfUMjMsrBZDWWd7TXD/9qnDP vKb7S+MPSDKpc8G7DjsBtYXIQk0Tpx3BbN5C8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=PPxH0/YSvgTZKnM2bGbHt0RVaygtzfTtSHzv6i2twqk=; b=rI7T/F0onr1hZeSqqWbUacwUonxtbzhosm7kwBnyMk1OjzDTs8x3gDVEAturPdFA5v FwC/XZjaREEzQg7rWm5/ExWQYCPPFX9uaUJ4m11u7iSCup2FcK5pGqfY9/Yy83cW3wZH 6sqcY5mfdM6KGsezeQCX2/3s6G4Crw9Pm2Xk17kPsN2KWlpmkZtux7DwiSRl9reGmDnp X84PVHrdumBWfH61Mr3mNTZSo5lU01eoxiEOE6rGGTGaz7mEmLvLamYMJUwUoVEFL9io Q9N7Rpk6quYRbtvroCiX0SaVUSxwUFYn1RJ/KFSK0eCrymnKi0POTBkekKRSV7Tatd0d KmiQ== X-Gm-Message-State: AODbwcCYABr+eDhfW9psbCR48cImP57w/qQZ49KPH5OH8abAodar17i/ Mg9MyaK/L04NUbz0 X-Received: by 10.101.83.143 with SMTP id x15mr15470963pgq.205.1496739180190; Tue, 06 Jun 2017 01:53:00 -0700 (PDT) Received: from docularxu-ThinkPad-T440p.219.146.1.66 ([45.56.159.173]) by smtp.gmail.com with ESMTPSA id b14sm49851988pga.12.2017.06.06.01.52.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 06 Jun 2017 01:52:59 -0700 (PDT) From: Guodong Xu To: lee.jones@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, xuwei5@hisilicon.com, catalin.marinas@arm.com, will.deacon@arm.com, lgirdwood@gmail.com, broonie@kernel.org, khilman@baylibre.com, arnd@arndb.de, gregory.clement@free-electrons.com, horms+renesas@verge.net.au, olof@lixom.net, thomas.petazzoni@free-electrons.com, yamada.masahiro@socionext.com, riku.voipio@linaro.org, treding@nvidia.com, krzk@kernel.org, eric@anholt.net, damm+renesas@opensource.se, ard.biesheuvel@linaro.org, linus.walleij@linaro.org, geert+renesas@glider.be Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, hw.wangxiaoyin@hisilicon.com, Guodong Xu Subject: [PATCH v4 5/8] regulator: hi6421v530: add driver for hi6421v530 voltage regulator Date: Tue, 6 Jun 2017 16:51:40 +0800 Message-Id: <20170606085143.13154-6-guodong.xu@linaro.org> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20170606085143.13154-1-guodong.xu@linaro.org> References: <20170606085143.13154-1-guodong.xu@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wang Xiaoyin add the driver for hi6421v530 voltage regulator Signed-off-by: Wang Xiaoyin Signed-off-by: Guodong Xu --- drivers/regulator/Kconfig | 10 ++ drivers/regulator/Makefile | 1 + drivers/regulator/hi6421v530-regulator.c | 207 +++++++++++++++++++++++++++++++ 3 files changed, 218 insertions(+) create mode 100644 drivers/regulator/hi6421v530-regulator.c -- 2.10.2 diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig index 48db87d..78cd8d8 100644 --- a/drivers/regulator/Kconfig +++ b/drivers/regulator/Kconfig @@ -296,6 +296,16 @@ config REGULATOR_HI6421 21 general purpose LDOs, 3 dedicated LDOs, and 5 BUCKs. All of them come with support to either ECO (idle) or sleep mode. +config REGULATOR_HI6421V530 + tristate "HiSilicon Hi6421v530 PMIC voltage regulator support" + depends on MFD_HI6421_PMIC && OF + help + This driver provides support for the voltage regulators on + HiSilicon Hi6421v530 PMU / Codec IC. + Hi6421v530 is a multi-function device which, on regulator part, + provides 5 general purpose LDOs, and all of them come with support + to either ECO (idle) or sleep mode. + config REGULATOR_HI655X tristate "Hisilicon HI655X PMIC regulators support" depends on ARCH_HISI || COMPILE_TEST diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile index dc3503f..36e2b75 100644 --- a/drivers/regulator/Makefile +++ b/drivers/regulator/Makefile @@ -38,6 +38,7 @@ obj-$(CONFIG_REGULATOR_DB8500_PRCMU) += db8500-prcmu.o obj-$(CONFIG_REGULATOR_FAN53555) += fan53555.o obj-$(CONFIG_REGULATOR_GPIO) += gpio-regulator.o obj-$(CONFIG_REGULATOR_HI6421) += hi6421-regulator.o +obj-$(CONFIG_REGULATOR_HI6421V530) += hi6421v530-regulator.o obj-$(CONFIG_REGULATOR_HI655X) += hi655x-regulator.o obj-$(CONFIG_REGULATOR_ISL6271A) += isl6271a-regulator.o obj-$(CONFIG_REGULATOR_ISL9305) += isl9305.o diff --git a/drivers/regulator/hi6421v530-regulator.c b/drivers/regulator/hi6421v530-regulator.c new file mode 100644 index 0000000..46bbba9 --- /dev/null +++ b/drivers/regulator/hi6421v530-regulator.c @@ -0,0 +1,207 @@ +/* + * Device driver for regulators in Hi6421V530 IC + * + * Copyright (c) <2017> HiSilicon Technologies Co., Ltd. + * http://www.hisilicon.com + * Copyright (c) <2017> Linaro Ltd. + * http://www.linaro.org + * + * Author: Wang Xiaoyin + * Guodong Xu + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include +#include +#include +#include +#include +#include + +/* + * struct hi6421v530_regulator_info - hi6421v530 regulator information + * @desc: regulator description + * @mode_mask: ECO mode bitmask of LDOs; for BUCKs, this masks sleep + * @eco_microamp: eco mode load upper limit (in uA), valid for LDOs only + */ +struct hi6421v530_regulator_info { + struct regulator_desc rdesc; + u8 mode_mask; + u32 eco_microamp; +}; + +/* HI6421v530 regulators */ +enum hi6421v530_regulator_id { + HI6421V530_LDO3, + HI6421V530_LDO9, + HI6421V530_LDO11, + HI6421V530_LDO15, + HI6421V530_LDO16, +}; + +static const unsigned int ldo_3_voltages[] = { + 1800000, 1825000, 1850000, 1875000, + 1900000, 1925000, 1950000, 1975000, + 2000000, 2025000, 2050000, 2075000, + 2100000, 2125000, 2150000, 2200000, +}; + +static const unsigned int ldo_9_11_voltages[] = { + 1750000, 1800000, 1825000, 2800000, + 2850000, 2950000, 3000000, 3300000, +}; + +static const unsigned int ldo_15_16_voltages[] = { + 1750000, 1800000, 2400000, 2600000, + 2700000, 2850000, 2950000, 3000000, +}; + +static const struct regulator_ops hi6421v530_ldo_ops; + +#define HI6421V530_LDO_ENABLE_TIME (350) + +/* + * _id - LDO id name string + * v_table - voltage table + * vreg - voltage select register + * vmask - voltage select mask + * ereg - enable register + * emask - enable mask + * odelay - off/on delay time in uS + * ecomask - eco mode mask + * ecoamp - eco mode load uppler limit in uA + */ +#define HI6421V530_LDO(_ID, v_table, vreg, vmask, ereg, emask, \ + odelay, ecomask, ecoamp) { \ + .rdesc = { \ + .name = #_ID, \ + .of_match = of_match_ptr(#_ID), \ + .regulators_node = of_match_ptr("regulators"), \ + .ops = &hi6421v530_ldo_ops, \ + .type = REGULATOR_VOLTAGE, \ + .id = HI6421V530_##_ID, \ + .owner = THIS_MODULE, \ + .n_voltages = ARRAY_SIZE(v_table), \ + .volt_table = v_table, \ + .vsel_reg = HI6421_REG_TO_BUS_ADDR(vreg), \ + .vsel_mask = vmask, \ + .enable_reg = HI6421_REG_TO_BUS_ADDR(ereg), \ + .enable_mask = emask, \ + .enable_time = HI6421V530_LDO_ENABLE_TIME, \ + .off_on_delay = odelay, \ + }, \ + .mode_mask = ecomask, \ + .eco_microamp = ecoamp, \ +} + +/* HI6421V530 regulator information */ + +static struct hi6421v530_regulator_info hi6421v530_regulator_info[] = { + HI6421V530_LDO(LDO3, ldo_3_voltages, 0x061, 0xf, 0x060, 0x2, + 20000, 0x6, 8000), + HI6421V530_LDO(LDO9, ldo_9_11_voltages, 0x06b, 0x7, 0x06a, 0x2, + 40000, 0x6, 8000), + HI6421V530_LDO(LDO11, ldo_9_11_voltages, 0x06f, 0x7, 0x06e, 0x2, + 40000, 0x6, 8000), + HI6421V530_LDO(LDO15, ldo_15_16_voltages, 0x077, 0x7, 0x076, 0x2, + 40000, 0x6, 8000), + HI6421V530_LDO(LDO16, ldo_15_16_voltages, 0x079, 0x7, 0x078, 0x2, + 40000, 0x6, 8000), +}; + +static unsigned int hi6421v530_regulator_ldo_get_mode( + struct regulator_dev *rdev) +{ + struct hi6421v530_regulator_info *info; + unsigned int reg_val; + + info = rdev_get_drvdata(rdev); + regmap_read(rdev->regmap, rdev->desc->enable_reg, ®_val); + + if (reg_val & (info->mode_mask)) + return REGULATOR_MODE_IDLE; + + return REGULATOR_MODE_NORMAL; +} + +static int hi6421v530_regulator_ldo_set_mode(struct regulator_dev *rdev, + unsigned int mode) +{ + struct hi6421v530_regulator_info *info; + unsigned int new_mode; + + info = rdev_get_drvdata(rdev); + switch (mode) { + case REGULATOR_MODE_NORMAL: + new_mode = 0; + break; + case REGULATOR_MODE_IDLE: + new_mode = info->mode_mask; + break; + default: + return -EINVAL; + } + + regmap_update_bits(rdev->regmap, rdev->desc->enable_reg, + info->mode_mask, new_mode); + + return 0; +} + + +static const struct regulator_ops hi6421v530_ldo_ops = { + .is_enabled = regulator_is_enabled_regmap, + .enable = regulator_enable_regmap, + .disable = regulator_disable_regmap, + .list_voltage = regulator_list_voltage_table, + .map_voltage = regulator_map_voltage_ascend, + .get_voltage_sel = regulator_get_voltage_sel_regmap, + .set_voltage_sel = regulator_set_voltage_sel_regmap, + .get_mode = hi6421v530_regulator_ldo_get_mode, + .set_mode = hi6421v530_regulator_ldo_set_mode, +}; + +static int hi6421v530_regulator_probe(struct platform_device *pdev) +{ + struct hi6421_pmic *pmic; + struct regulator_dev *rdev; + struct regulator_config config = { }; + unsigned int i; + + pmic = dev_get_drvdata(pdev->dev.parent); + if (!pmic) { + dev_err(&pdev->dev, "no pmic in the regulator parent node\n"); + return -ENODEV; + } + + for (i = 0; i < ARRAY_SIZE(hi6421v530_regulator_info); i++) { + config.dev = pdev->dev.parent; + config.regmap = pmic->regmap; + config.driver_data = &hi6421v530_regulator_info[i]; + + rdev = devm_regulator_register(&pdev->dev, + &hi6421v530_regulator_info[i].rdesc, + &config); + if (IS_ERR(rdev)) { + dev_err(&pdev->dev, "failed to register regulator %s\n", + hi6421v530_regulator_info[i].rdesc.name); + return PTR_ERR(rdev); + } + } + return 0; +} + +static struct platform_driver hi6421v530_regulator_driver = { + .driver = { + .name = "hi6421v530-regulator", + }, + .probe = hi6421v530_regulator_probe, +}; +module_platform_driver(hi6421v530_regulator_driver); + +MODULE_AUTHOR("Wang Xiaoyin "); +MODULE_DESCRIPTION("Hi6421v530 regulator driver"); +MODULE_LICENSE("GPL v2"); From patchwork Tue Jun 6 08:51:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guodong Xu X-Patchwork-Id: 103133 Delivered-To: patch@linaro.org Received: by 10.182.29.35 with SMTP id g3csp1163327obh; Tue, 6 Jun 2017 01:53:41 -0700 (PDT) X-Received: by 10.101.73.135 with SMTP id r7mr7326453pgs.224.1496739221653; Tue, 06 Jun 2017 01:53:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496739221; cv=none; d=google.com; s=arc-20160816; b=HnBMmp1pHRb0TPa6HPnO6SRMNOMnOqR8mabffVtQSofQo/eFhm943AyzM6ghfZ44WB OdFFIIM9ztYs5EWBCj7lE+kc5O9ll8Kxn6BbeshCqL5BdoevsoucOdGlaALUnlzvlTom aQ82vsdzQlSQn/pWxSLayK13IP4SHrxSL7Yqm6Mq0lGxaWG/ObQ0hvbMLuwdSDPKo7A5 On70G8S7otVIpQMfCCuV+lknYhfWFOjDCtNg4C/qwUhSDgW5XR2/yvggloJ3ki95He/e 2JU+7yraexhuAOnqFxVn0Bq81os9ioTU8GkTCLTBCCoh/c3LNwcJ/KsOWLWc/lpJxECO X+rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=wZ9O1F8Th0ohgkio0+Cn+PrpHKYMmRvqtp6KSShI8Vo=; b=DIxwTyf56xTlTzyldbSjTT1nHmn+S4ogUhs5HN1u1BNiqE9fdAxPUELVWTlSCFAWwG /9xE7JaNZwYXhHLdyolFaT4SbwCnPGSWsCa0jr55IjyjdUYOE4CIadjU1Ahn+P2omJZ8 ews7s7rKRP091NiMfNgp0wn8U8H+XxIOKokdlPK6uxWQgQD3kV1d0PqKjLOtn2P5tp1Y bL2ORPXdPbmDUOln+r+kXQLgHRE7R8d8zQgf8CbKQ48/0lOTJhUXazMY/11Lu9Iwh7sF mrfkGQlE8PPWMVDepyckj7OjsXYJt7+7l4EIIs+tXSSCQetN85qqvLPHNvCL8M2O2Gzf 6sLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k7si7388164pln.414.2017.06.06.01.53.41; Tue, 06 Jun 2017 01:53:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751557AbdFFIxU (ORCPT + 25 others); Tue, 6 Jun 2017 04:53:20 -0400 Received: from mail-pg0-f42.google.com ([74.125.83.42]:34424 "EHLO mail-pg0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751537AbdFFIxR (ORCPT ); Tue, 6 Jun 2017 04:53:17 -0400 Received: by mail-pg0-f42.google.com with SMTP id v18so22816822pgb.1 for ; Tue, 06 Jun 2017 01:53:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=wZ9O1F8Th0ohgkio0+Cn+PrpHKYMmRvqtp6KSShI8Vo=; b=gYPd0juhp/d7IPVmuvoGFAdH+pK5TcK8AmHas1oc2pE8NOUlSX492v19my+IZEQyIi 2hv4GtNn10/rZeYvMVI6EMihcowi8lZNDO8O1lWNtj/SWLRHMwUKa6ADu3qwja3MMh5n mtKz74PfKINdK4N5ZcvvwjOkhswYDtXgIqTWM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=wZ9O1F8Th0ohgkio0+Cn+PrpHKYMmRvqtp6KSShI8Vo=; b=ZJ1qCKFvFwAMZWN+FkW8iz/mrBCMeKgJCBwr5C2ca2zxWS9LTvAafcI1+hfQW5PINN AT5+hVAtozRDIiQzA4C0z69oY7iYx6x+hxb1Vfjd7FKuc8eMZh8r1PP0k8YY9wLU9UeZ Hz+78uOCT6rcovfDq8aLaePWyJtUBFizcYpZMp12DcjmfKZOtErBr0CYr9kORqV31gtm Rzr703fouUxB2Hw1a83Oyy3Dxs8iOssdVSE7NaKkJA0xnMzZCQ/+V2AWihXIdPyu4fZN KhY3jKxT6FrgeRb44CkaBToBszYtoCuWaOmlcCgj8NAGenbQuS3ieZNYXY5yP7C/jttN cVMw== X-Gm-Message-State: AODbwcBAUCNDEUwnukVlpk0fNYSvcS5NR8WHbQEUbrm0qSDJLXC3a5qW QkeFiZlACJxDxQlS X-Received: by 10.98.25.19 with SMTP id 19mr24893631pfz.146.1496739191399; Tue, 06 Jun 2017 01:53:11 -0700 (PDT) Received: from docularxu-ThinkPad-T440p.219.146.1.66 ([45.56.159.173]) by smtp.gmail.com with ESMTPSA id b14sm49851988pga.12.2017.06.06.01.53.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 06 Jun 2017 01:53:10 -0700 (PDT) From: Guodong Xu To: lee.jones@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, xuwei5@hisilicon.com, catalin.marinas@arm.com, will.deacon@arm.com, lgirdwood@gmail.com, broonie@kernel.org, khilman@baylibre.com, arnd@arndb.de, gregory.clement@free-electrons.com, horms+renesas@verge.net.au, olof@lixom.net, thomas.petazzoni@free-electrons.com, yamada.masahiro@socionext.com, riku.voipio@linaro.org, treding@nvidia.com, krzk@kernel.org, eric@anholt.net, damm+renesas@opensource.se, ard.biesheuvel@linaro.org, linus.walleij@linaro.org, geert+renesas@glider.be Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, hw.wangxiaoyin@hisilicon.com, Guodong Xu , Jeremy Linton Subject: [PATCH v4 6/8] regulator: hi6421: Describe consumed platform device Date: Tue, 6 Jun 2017 16:51:41 +0800 Message-Id: <20170606085143.13154-7-guodong.xu@linaro.org> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20170606085143.13154-1-guodong.xu@linaro.org> References: <20170606085143.13154-1-guodong.xu@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The hi6421-regulator driver consumes a similarly named platform device. Adding that to the module device table, allows modprobe to locate this driver once the device is created. Cc: Jeremy Linton Cc: Mark Brown Signed-off-by: Guodong Xu --- drivers/regulator/hi6421-regulator.c | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.10.2 diff --git a/drivers/regulator/hi6421-regulator.c b/drivers/regulator/hi6421-regulator.c index 62c5f54..259c3a8 100644 --- a/drivers/regulator/hi6421-regulator.c +++ b/drivers/regulator/hi6421-regulator.c @@ -621,7 +621,14 @@ static int hi6421_regulator_probe(struct platform_device *pdev) return 0; } +static const struct platform_device_id hi6421_regulator_table[] = { + { .name = "hi6421-regulator" }, + {}, +}; +MODULE_DEVICE_TABLE(platform, hi6421_regulator_table); + static struct platform_driver hi6421_regulator_driver = { + .id_table = hi6421_regulator_table, .driver = { .name = "hi6421-regulator", }, From patchwork Tue Jun 6 08:51:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guodong Xu X-Patchwork-Id: 103134 Delivered-To: patch@linaro.org Received: by 10.182.29.35 with SMTP id g3csp1163332obh; Tue, 6 Jun 2017 01:53:42 -0700 (PDT) X-Received: by 10.99.185.65 with SMTP id v1mr21881175pgo.189.1496739222023; Tue, 06 Jun 2017 01:53:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496739222; cv=none; d=google.com; s=arc-20160816; b=gomfWuGJGpDCSDYOK2aRM1wncTzo//YpQ+jIGme84/aurMA5YpuCrNbC92+jn6L8W9 lu9+vvWAIE8gu6y+zd86+S78Ul8SscK6oKW6/kqVxv7wBBApTZnzeMihgZsU5ctBGjRw rhax2JlBNnTqlJWnEaR1J2t0l9LkgBoxXp5hVX1/0nqH58POYKfGCVGfCjaBmtg/Utpw KgPG+PZWF4gTQIpS/bkD0QI9DfndBmujQ99FXfWtJt9WCxCBVmkU92B1h6mZmgIu0ohw b0SQxdh7+Q734J+/nIHgrRMK6YdopoqV2RoCs7m3+1FrmsdQ5b8XIssejSrCHhjeyM+8 HLXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=8PV3QUvE4/KsHx+LrJUzAofvvlExf85kZV20f2X9des=; b=fRAVBXXqkJ3Xgds7bHWIoQaEAsqwujO1d9Me3lmVyWqary3m7avr4o6xH52wwlMpql 0dUufyZGRUhrdB/Lc85MPyf6RmpxIt6jwoQEOHluHIVpzZgVmhLy+rqdUGDdIuZQafT1 wnl6frKdneZ2+jMPCV0W2r3eh6abcGf37xpPsx7zbdioIiXqpBS9lwHncHaORTJHbNL0 AOxVBXPhag09rK/+HzqGYa1PqDlfT3dfPKwDLVct+HPAoP8Zwv5nT5cDtn7mHe2WLfei VdYgO5PLbl6tgdDnY8XLrap4v5dxBrRals50Eulj1P2IBAulZT2cVEuA06CaqSzexyIh HZTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k7si7388164pln.414.2017.06.06.01.53.41; Tue, 06 Jun 2017 01:53:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751584AbdFFIx3 (ORCPT + 25 others); Tue, 6 Jun 2017 04:53:29 -0400 Received: from mail-pg0-f45.google.com ([74.125.83.45]:33657 "EHLO mail-pg0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751566AbdFFIx1 (ORCPT ); Tue, 6 Jun 2017 04:53:27 -0400 Received: by mail-pg0-f45.google.com with SMTP id f185so32375842pgc.0 for ; Tue, 06 Jun 2017 01:53:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=8PV3QUvE4/KsHx+LrJUzAofvvlExf85kZV20f2X9des=; b=Vs1YCQFy31NqOcCVPjXTbePMtuKK9xTzawPRwzX6JKZwCtOEKlgo1JQmWRVU47YtuC UoMMFP4J79u/wsMYoNnD8FhSQN8ITioJFvGG85GgKcfGRRMMfXIK+c2SeBwJQOi1JgBJ BVQALJeUGYbxRG6IKSaQM0UwJ1mMrrEBDfL1Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=8PV3QUvE4/KsHx+LrJUzAofvvlExf85kZV20f2X9des=; b=K8Q9IXFmzd5JDkcpSszpoYd157gXe9akV8pxv6w3UFE83u7evfza9ewecUZ9s6Yprl nhsabCbILxBxiGudZHBEVPSnVjnUVgMTghf8myeyNW2M6COIt/Yghe7psyuh+wEql/A0 Tfw46f5tSbacDQ3zwcqI9v55lorFlTzfeN5ZyXqDPb8+nT5skW7tgZ8rxul4IEszd4AD Xhc7WGPVVcmuEFsL1XUwGDkpRMfn9d5CwG83dscI8o4ZN5FtppOfs5eIrhvTyn+6+Sxw HbwvHbHnF4zTLO3pJcQw270J/HaOUktil2DejJ0HO8KE1M7jOgXMJBnhm6AqnJhWBeMu mdYg== X-Gm-Message-State: AODbwcCft6f/kOhUQ9Whgi7xE7GktUiIEQJ/axduzpLSe7/dyiNNiEiw I3iDZp1CGUYU7qce X-Received: by 10.84.236.72 with SMTP id h8mr20585476pln.187.1496739201470; Tue, 06 Jun 2017 01:53:21 -0700 (PDT) Received: from docularxu-ThinkPad-T440p.219.146.1.66 ([45.56.159.173]) by smtp.gmail.com with ESMTPSA id b14sm49851988pga.12.2017.06.06.01.53.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 06 Jun 2017 01:53:21 -0700 (PDT) From: Guodong Xu To: lee.jones@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, xuwei5@hisilicon.com, catalin.marinas@arm.com, will.deacon@arm.com, lgirdwood@gmail.com, broonie@kernel.org, khilman@baylibre.com, arnd@arndb.de, gregory.clement@free-electrons.com, horms+renesas@verge.net.au, olof@lixom.net, thomas.petazzoni@free-electrons.com, yamada.masahiro@socionext.com, riku.voipio@linaro.org, treding@nvidia.com, krzk@kernel.org, eric@anholt.net, damm+renesas@opensource.se, ard.biesheuvel@linaro.org, linus.walleij@linaro.org, geert+renesas@glider.be Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, hw.wangxiaoyin@hisilicon.com, Guodong Xu Subject: [PATCH v4 7/8] arm64: dts: hikey960: add device node for pmic and regulators Date: Tue, 6 Jun 2017 16:51:42 +0800 Message-Id: <20170606085143.13154-8-guodong.xu@linaro.org> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20170606085143.13154-1-guodong.xu@linaro.org> References: <20170606085143.13154-1-guodong.xu@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wang Xiaoyin add device node for hi6421 pmic core and hi6421v530 voltage regulator,include LDO(1,3,9,11,15,16) Signed-off-by: Wang Xiaoyin Signed-off-by: Guodong Xu --- arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dts | 46 +++++++++++++++++++++++ 1 file changed, 46 insertions(+) -- 2.10.2 diff --git a/arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dts b/arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dts index ca448f0..e579333 100644 --- a/arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dts +++ b/arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dts @@ -97,6 +97,52 @@ default-state = "off"; }; }; + + pmic: pmic@fff34000 { + compatible = "hisilicon,hi6421v530-pmic"; + reg = <0x0 0xfff34000 0x0 0x1000>; + interrupt-controller; + #interrupt-cells = <2>; + + regulators { + ldo3: LDO3 { /* HDMI */ + regulator-name = "VOUT3_1V85"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <2200000>; + regulator-enable-ramp-delay = <120>; + }; + + ldo9: LDO9 { /* SDCARD I/O */ + regulator-name = "VOUT9_1V8_2V95"; + regulator-min-microvolt = <1750000>; + regulator-max-microvolt = <3300000>; + regulator-enable-ramp-delay = <240>; + }; + + ldo11: LDO11 { /* Low Speed Connector */ + regulator-name = "VOUT11_1V8_2V95"; + regulator-min-microvolt = <1750000>; + regulator-max-microvolt = <3300000>; + regulator-enable-ramp-delay = <240>; + }; + + ldo15: LDO15 { /* UFS VCC */ + regulator-name = "VOUT15_3V0"; + regulator-min-microvolt = <1750000>; + regulator-max-microvolt = <3000000>; + regulator-boot-on; + regulator-always-on; + regulator-enable-ramp-delay = <120>; + }; + + ldo16: LDO16 { /* SD VDD */ + regulator-name = "VOUT16_2V95"; + regulator-min-microvolt = <1750000>; + regulator-max-microvolt = <3000000>; + regulator-enable-ramp-delay = <360>; + }; + }; + }; }; &i2c0 { From patchwork Tue Jun 6 08:51:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guodong Xu X-Patchwork-Id: 103135 Delivered-To: patch@linaro.org Received: by 10.182.29.35 with SMTP id g3csp1163334obh; Tue, 6 Jun 2017 01:53:42 -0700 (PDT) X-Received: by 10.84.224.72 with SMTP id a8mr19696977plt.207.1496739222407; Tue, 06 Jun 2017 01:53:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496739222; cv=none; d=google.com; s=arc-20160816; b=iTAGAPNS7X33t78bHeSNlgOf7R08vuF+ZdE/Gj976vNBOFZsy1StXJW2R6sJzMKZX5 kPbepzXQ1krIAiJjIoe0x71AuFNNGGycs4gyUHh3PU1DKPX9loJwbyMOIFQYwiIzrxFs jFeRJNPNZPn2rXqFFlipoNRQuB4KdINnTClJQF2ST4tTXt/ifNGFVZc+W5Hvynw4kxoN C1DIl2flDQBuopyH7Kir/vLXwhcqhld6UWn20Bqk94usg6UNRLm+1/KSvqzIOerMX++m Ig8iGE9KqSTIvy9eUYKvb6RfryRPDM46tjVlOp6ku7cqRHOrMc09U2Gy1bz2bKPOBHaY 11Fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=tFo0Wuv7WcLCcKkG/W0NR4++ErJQh3L6voXZiX5zVq4=; b=rU1e64Q4093ZElXHGo4yLZXOszyxrRVnV7C5xmPZvJEe6avQiWroaWUHxsawAFe9C0 bx1j8lnqaiTnzDf3Zzfta0bxXsD8zfX6fFFpztubAe6w08MfaBpnxqbqQMTasbeDRqBj wqSFH0z6dAjacHWeYPmljmb85FhKMG2PV29LZrxy/6jP9xrOCgrV1i3WAqFmMZL64a6d /LHHUKnHB65l8lGtH0dbgP19BXgOsLhahFXLqThqJWIXMSZfZ6XVTWdEq5pD1G0bwtqo nudb89NqGvgWQzLUJdPmn04d9XKCaFJXhvz51PXACiHSOtTHVNGb2tbsFlzPlIfOElKu 7xIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k7si7388164pln.414.2017.06.06.01.53.42; Tue, 06 Jun 2017 01:53:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751611AbdFFIxi (ORCPT + 25 others); Tue, 6 Jun 2017 04:53:38 -0400 Received: from mail-pg0-f54.google.com ([74.125.83.54]:35873 "EHLO mail-pg0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751591AbdFFIxd (ORCPT ); Tue, 6 Jun 2017 04:53:33 -0400 Received: by mail-pg0-f54.google.com with SMTP id a70so25351227pge.3 for ; Tue, 06 Jun 2017 01:53:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=tFo0Wuv7WcLCcKkG/W0NR4++ErJQh3L6voXZiX5zVq4=; b=jA1MAggAw0jIwglALzVx6qn9nV6dq7ZskhS6Y3JvCafo1WnMa3pgVxxjeSm3OSgwLe zPbixn1X60fbWosSwGSlx0fFOimYmao5hHQhsu1/5bBIeAmkwhT8LJne4tdX+jfHpb41 vYTklpdvlsBHCIXLu8cyKRpC9bxn7ouuDAkKA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=tFo0Wuv7WcLCcKkG/W0NR4++ErJQh3L6voXZiX5zVq4=; b=c8QBVKzhhS0Gg/empP6UrxrlN1Q00v5oMtQ+t93PQuwVqA8Ic1GrKcFz6AXhb89hdW KN5V0XveyM7WXSAZs9o52JeqpJzAjnSum6hVT6+EQvxNg18+eYdtsGuQ5kZ1fPBcq0tY dc5s8DKB73f8slFlMeg7A+wDbfL2Q+RA5oDV2vOkvzhLuxunmGT9I71In/XpkhQXce1j UvmdRqQIcnCduoRbP2iZRXlb+/dSOdEdR+rNj79IzZJXbj0XmMKzIW+xFutfaozxObyd FYiBm9Hs7ovmkobiSq/tyI6HbeKA7b3Kn0EnykHnTQGFW7i883qA9jdFtAXwZUlObnbL +Yrg== X-Gm-Message-State: AODbwcB+lR0JsiBRjnWmRvpk1AI0aLrTxbsE0vcUx9kLrnNzhYgVzJyN aU9mW+nQfWvFRL+t X-Received: by 10.84.217.141 with SMTP id p13mr19924374pli.271.1496739212768; Tue, 06 Jun 2017 01:53:32 -0700 (PDT) Received: from docularxu-ThinkPad-T440p.219.146.1.66 ([45.56.159.173]) by smtp.gmail.com with ESMTPSA id b14sm49851988pga.12.2017.06.06.01.53.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 06 Jun 2017 01:53:32 -0700 (PDT) From: Guodong Xu To: lee.jones@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, xuwei5@hisilicon.com, catalin.marinas@arm.com, will.deacon@arm.com, lgirdwood@gmail.com, broonie@kernel.org, khilman@baylibre.com, arnd@arndb.de, gregory.clement@free-electrons.com, horms+renesas@verge.net.au, olof@lixom.net, thomas.petazzoni@free-electrons.com, yamada.masahiro@socionext.com, riku.voipio@linaro.org, treding@nvidia.com, krzk@kernel.org, eric@anholt.net, damm+renesas@opensource.se, ard.biesheuvel@linaro.org, linus.walleij@linaro.org, geert+renesas@glider.be Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, hw.wangxiaoyin@hisilicon.com, Guodong Xu Subject: [PATCH v4 8/8] arm64: defconfig: enable support hi6421v530 PMIC Date: Tue, 6 Jun 2017 16:51:43 +0800 Message-Id: <20170606085143.13154-9-guodong.xu@linaro.org> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20170606085143.13154-1-guodong.xu@linaro.org> References: <20170606085143.13154-1-guodong.xu@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Enable configs for hi6421v530 mfd and regulator driver + CONFIG_MFD_HI6421_PMIC=y + CONFIG_REGULATOR_HI6421V530=y Signed-off-by: Guodong Xu --- arch/arm64/configs/defconfig | 2 ++ 1 file changed, 2 insertions(+) -- 2.10.2 diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig index ce07285..867d68c 100644 --- a/arch/arm64/configs/defconfig +++ b/arch/arm64/configs/defconfig @@ -305,6 +305,7 @@ CONFIG_S3C2410_WATCHDOG=y CONFIG_MESON_GXBB_WATCHDOG=m CONFIG_MESON_WATCHDOG=m CONFIG_MFD_EXYNOS_LPASS=m +CONFIG_MFD_HI6421_PMIC=y CONFIG_MFD_MAX77620=y CONFIG_MFD_RK808=y CONFIG_MFD_SPMI_PMIC=y @@ -315,6 +316,7 @@ CONFIG_MFD_CROS_EC=y CONFIG_MFD_CROS_EC_I2C=y CONFIG_REGULATOR_FIXED_VOLTAGE=y CONFIG_REGULATOR_GPIO=y +CONFIG_REGULATOR_HI6421V530=y CONFIG_REGULATOR_HI655X=y CONFIG_REGULATOR_MAX77620=y CONFIG_REGULATOR_PWM=y