From patchwork Mon Jan 6 21:16:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Reichl X-Patchwork-Id: 11320169 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 390B4139A for ; Mon, 6 Jan 2020 21:17:20 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 139542072C for ; Mon, 6 Jan 2020 21:17:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ZbPy8Kg5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 139542072C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=fivetechno.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FyqTEiRuGPnB/5JBasPcJV1VzPD2RJ741v3LZ/AARDE=; b=ZbPy8Kg5eW2nzy hCFIZ9KUkdreejuYO2OSTqaXdl3J+IzAjqcJ99+8uHrHv9B3S2wuWH3TPjaKFdmXVBoUjckt0CirG YviTyL9u6uU0xrAqLNSVb9hSjjoARO50qo5DuriATregmayJEC6aU3wpKnY83owdYGtCESvfKRWBY XZMsuOuRRCl/MfQY+d2vf4K5qkBL87tbeOMVU6Q+HQQ393WwUjgcc4wW0MFNl4AfXZy77o6b7TrqS 9d3SbU8DXOyMmTRL+lOD/BnZZYPpKXsE++a+AaAem+RYi8Qwjxey2hmUiyVWh485Hzl/wTquX5nnq 6tKpPXEefai3+m/v1ujw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ioZkV-0007gX-Dh; Mon, 06 Jan 2020 21:17:19 +0000 Received: from wp126.webpack.hosteurope.de ([2a01:488:42:1000:50ed:8485::]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ioZkE-0007Os-Ai; Mon, 06 Jan 2020 21:17:03 +0000 Received: from [2003:a:659:3f00:1e6f:65ff:fe31:d1d5] (helo=hermes.fivetechno.de); authenticated by wp126.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) id 1ioZkB-0001RX-O1; Mon, 06 Jan 2020 22:16:59 +0100 X-Virus-Scanned: by amavisd-new 2.11.1 using newest ClamAV at linuxbbg.five-lan.de Received: from roc-pc (pD9E89450.dip0.t-ipconnect.de [217.232.148.80]) (authenticated bits=0) by hermes.fivetechno.de (8.15.2/8.14.5/SuSE Linux 0.8) with ESMTPSA id 006LGwcr032130 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 6 Jan 2020 22:16:59 +0100 From: Markus Reichl To: linux-rockchip@lists.infradead.org, Liam Girdwood , Mark Brown , Rob Herring , Mark Rutland , Heiko Stuebner Subject: [PATCH 1/5] regulator: mp8859: add driver Date: Mon, 6 Jan 2020 22:16:24 +0100 Message-Id: <20200106211633.2882-2-m.reichl@fivetechno.de> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106211633.2882-1-m.reichl@fivetechno.de> References: <20200106211633.2882-1-m.reichl@fivetechno.de> MIME-Version: 1.0 X-bounce-key: webpack.hosteurope.de; m.reichl@fivetechno.de; 1578345422; c03f6164; X-HE-SMSGID: 1ioZkB-0001RX-O1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200106_131702_513237_F0A95554 X-CRM114-Status: GOOD ( 12.33 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Markus Reichl , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The MP8859 from Monolithic Power Systems is a single output DC/DC converter. The voltage can be controlled via I2C. Signed-off-by: Markus Reichl --- drivers/regulator/mp8859.c | 156 +++++++++++++++++++++++++++++++++++++ 1 file changed, 156 insertions(+) create mode 100644 drivers/regulator/mp8859.c diff --git a/drivers/regulator/mp8859.c b/drivers/regulator/mp8859.c new file mode 100644 index 000000000000..e804a5267301 --- /dev/null +++ b/drivers/regulator/mp8859.c @@ -0,0 +1,156 @@ +// SPDX-License-Identifier: GPL-2.0 +// +// Copyright (c) 2019 five technologies GmbH +// Author: Markus Reichl + +#include +#include +#include +#include +#include + + +#define VOL_MIN_IDX 0x00 +#define VOL_MAX_IDX 0x7ff + +/* Register definitions */ +#define MP8859_VOUT_L_REG 0 //3 lo Bits +#define MP8859_VOUT_H_REG 1 //8 hi Bits +#define MP8859_VOUT_GO_REG 2 +#define MP8859_IOUT_LIM_REG 3 +#define MP8859_CTL1_REG 4 +#define MP8859_CTL2_REG 5 +#define MP8859_RESERVED1_REG 6 +#define MP8859_RESERVED2_REG 7 +#define MP8859_RESERVED3_REG 8 +#define MP8859_STATUS_REG 9 +#define MP8859_INTERRUPT_REG 0x0A +#define MP8859_MASK_REG 0x0B +#define MP8859_ID1_REG 0x0C +#define MP8859_MFR_ID_REG 0x27 +#define MP8859_DEV_ID_REG 0x28 +#define MP8859_IC_REV_REG 0x29 + +#define MP8859_MAX_REG 0x29 + +#define MP8859_GO_BIT 0x01 + + +static int mp8859_set_voltage_sel(struct regulator_dev *rdev, unsigned int sel) +{ + int ret; + + ret = regmap_write(rdev->regmap, MP8859_VOUT_L_REG, sel & 0x7); + + if (ret) + return ret; + ret = regmap_write(rdev->regmap, MP8859_VOUT_H_REG, sel >> 3); + + if (ret) + return ret; + ret = regmap_update_bits(rdev->regmap, MP8859_VOUT_GO_REG, + MP8859_GO_BIT, 1); + return ret; +} + +static int mp8859_get_voltage_sel(struct regulator_dev *rdev) +{ + unsigned int val_tmp; + unsigned int val; + int ret; + + ret = regmap_read(rdev->regmap, MP8859_VOUT_H_REG, &val_tmp); + + if (ret) + return ret; + val = val_tmp << 3; + + ret = regmap_read(rdev->regmap, MP8859_VOUT_L_REG, &val_tmp); + + if (ret) + return ret; + val |= val_tmp & 0x07; + return val; +} + +static const struct regulator_linear_range mp8859_dcdc_ranges[] = { + REGULATOR_LINEAR_RANGE(0, VOL_MIN_IDX, VOL_MAX_IDX, 10000), +}; + +static const struct regmap_config mp8859_regmap = { + .reg_bits = 8, + .val_bits = 8, + .max_register = MP8859_MAX_REG, + .cache_type = REGCACHE_RBTREE, +}; + +static const struct regulator_ops mp8859_ops = { + .set_voltage_sel = mp8859_set_voltage_sel, + .get_voltage_sel = mp8859_get_voltage_sel, + .list_voltage = regulator_list_voltage_linear_range, +}; + +static const struct regulator_desc mp8859_regulators[] = { + { + .id = 0, + .type = REGULATOR_VOLTAGE, + .name = "mp8859_dcdc", + .of_match = of_match_ptr("mp8859_dcdc"), + .n_voltages = VOL_MAX_IDX + 1, + .linear_ranges = mp8859_dcdc_ranges, + .n_linear_ranges = 1, + .ops = &mp8859_ops, + .owner = THIS_MODULE, + }, +}; + +static int mp8859_i2c_probe(struct i2c_client *i2c) +{ + int ret; + struct regulator_config config = {.dev = &i2c->dev}; + struct regmap *regmap = devm_regmap_init_i2c(i2c, &mp8859_regmap); + struct regulator_dev *rdev; + + if (IS_ERR(regmap)) { + ret = PTR_ERR(regmap); + dev_err(&i2c->dev, "regmap init failed: %d\n", ret); + return ret; + } + rdev = devm_regulator_register(&i2c->dev, &mp8859_regulators[0], + &config); + + if (IS_ERR(rdev)) { + ret = PTR_ERR(rdev); + dev_err(&i2c->dev, "failed to register %s: %d\n", + mp8859_regulators[0].name, ret); + return ret; + } + return 0; +} + +static const struct of_device_id mp8859_dt_id[] = { + {.compatible = "mps,mp8859"}, + {}, +}; +MODULE_DEVICE_TABLE(of, mp8859_dt_id); + +static const struct i2c_device_id mp8859_i2c_id[] = { + { "mp8859", }, + { }, +}; +MODULE_DEVICE_TABLE(i2c, mp8859_i2c_id); + +static struct i2c_driver mp8859_regulator_driver = { + .driver = { + .name = "mp8859", + .of_match_table = of_match_ptr(mp8859_dt_id), + }, + .probe_new = mp8859_i2c_probe, + .id_table = mp8859_i2c_id, +}; + +module_i2c_driver(mp8859_regulator_driver); + +MODULE_DESCRIPTION("Monolithic Power Systems MP8859 voltage regulator driver"); +MODULE_AUTHOR("Markus Reichl "); +MODULE_LICENSE("GPL v2"); From patchwork Mon Jan 6 21:16:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Reichl X-Patchwork-Id: 11320171 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EA5D4138C for ; Mon, 6 Jan 2020 21:17:35 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C8FA52072C for ; Mon, 6 Jan 2020 21:17:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="NLzE+YcE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C8FA52072C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=fivetechno.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yZ0W9CdJd/upLZTfe6z0OOHJg6t8pFcsXISf4mluNmI=; b=NLzE+YcE1e+9jJ MjzBc3sBBy+FOYfx6qoahCv8qiqoL/EMmRuZ3Wm8yBU3RlfiEctsHG+SgUwnbChkODhYDKhUtvGcM 7pwQDfhebQOhdwCJ8KuPu7/MVcXB55BYM8e1oXzOEbAux/pyMh98sIsyjMqt0Y2TD3gVg5aCkjLDw e1bkboUY7e3pf/NaedNMnrXwgOnje8n5XSoO16ddh9TdUEHRNGsOjVkQPB9Pplr5BU3V03s5RFsuw w+CI2P6oNiuaOCiK7FH70il7BX5zfWwgWbPejOLP6h9cu7iemKqOHuwar8m7rW4AuVqphr8BhQYgk xA6rt8jEex+pT/fx4IxA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ioZkk-0007wk-Oe; Mon, 06 Jan 2020 21:17:34 +0000 Received: from wp126.webpack.hosteurope.de ([2a01:488:42:1000:50ed:8485::]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ioZkI-0007R7-7i; Mon, 06 Jan 2020 21:17:07 +0000 Received: from [2003:a:659:3f00:1e6f:65ff:fe31:d1d5] (helo=hermes.fivetechno.de); authenticated by wp126.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) id 1ioZkG-0001T2-Jy; Mon, 06 Jan 2020 22:17:04 +0100 X-Virus-Scanned: by amavisd-new 2.11.1 using newest ClamAV at linuxbbg.five-lan.de Received: from roc-pc (pD9E89450.dip0.t-ipconnect.de [217.232.148.80]) (authenticated bits=0) by hermes.fivetechno.de (8.15.2/8.14.5/SuSE Linux 0.8) with ESMTPSA id 006LH35I032137 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 6 Jan 2020 22:17:04 +0100 From: Markus Reichl To: linux-rockchip@lists.infradead.org, Liam Girdwood , Mark Brown , Rob Herring , Mark Rutland , Heiko Stuebner Subject: [PATCH 2/5] regulator: mp8859: add config option and build entry Date: Mon, 6 Jan 2020 22:16:25 +0100 Message-Id: <20200106211633.2882-3-m.reichl@fivetechno.de> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106211633.2882-1-m.reichl@fivetechno.de> References: <20200106211633.2882-1-m.reichl@fivetechno.de> MIME-Version: 1.0 X-bounce-key: webpack.hosteurope.de; m.reichl@fivetechno.de; 1578345426; 511514be; X-HE-SMSGID: 1ioZkG-0001T2-Jy X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200106_131706_477033_AA61F54B X-CRM114-Status: GOOD ( 10.00 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Markus Reichl , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add entries for the mp8859 regulator driver to the build system. Signed-off-by: Markus Reichl --- drivers/regulator/Kconfig | 11 +++++++++++ drivers/regulator/Makefile | 1 + 2 files changed, 12 insertions(+) diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig index 56512748a47d..593733a88a61 100644 --- a/drivers/regulator/Kconfig +++ b/drivers/regulator/Kconfig @@ -612,6 +612,17 @@ config REGULATOR_MCP16502 through the regulator interface. In addition it enables suspend-to-ram/standby transition. +config REGULATOR_MP8859 + tristate "MPS MP8859 regulator driver" + depends on I2C + select REGMAP_I2C + help + Say y here to support the MP8859 voltage regulator. This driver + supports basic operations (get/set voltage) through the regulator + interface. + Say M here if you want to include support for the regulator as a + module. The module will be named "mp8859". + config REGULATOR_MT6311 tristate "MediaTek MT6311 PMIC" depends on I2C diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile index 9eccf93bc3ab..8ba8e5deebbd 100644 --- a/drivers/regulator/Makefile +++ b/drivers/regulator/Makefile @@ -78,6 +78,7 @@ obj-$(CONFIG_REGULATOR_MC13783) += mc13783-regulator.o obj-$(CONFIG_REGULATOR_MC13892) += mc13892-regulator.o obj-$(CONFIG_REGULATOR_MC13XXX_CORE) += mc13xxx-regulator-core.o obj-$(CONFIG_REGULATOR_MCP16502) += mcp16502.o +obj-$(CONFIG_REGULATOR_MP8859) += mp8859.o obj-$(CONFIG_REGULATOR_MT6311) += mt6311-regulator.o obj-$(CONFIG_REGULATOR_MT6323) += mt6323-regulator.o obj-$(CONFIG_REGULATOR_MT6358) += mt6358-regulator.o From patchwork Mon Jan 6 21:16:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Reichl X-Patchwork-Id: 11320175 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D0837138C for ; Mon, 6 Jan 2020 21:17:49 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AE8072072C for ; Mon, 6 Jan 2020 21:17:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="lo/3G0TG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AE8072072C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=fivetechno.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pjreRIalk9vRTnzrzWzpUqcIl2i1sRbsxhh/+a2dg2M=; b=lo/3G0TGjPohqH yy5B9Vtq1mTnz4erZMXcGnD5rVwGkP21TDv68QkzU6PoxgahSKHlhNyycaNH9zs1AR+KP0l6R+xy6 E6JzgIoVB6FRCaMvHrraDT157jFO4WjSwaG+Xh1T7uRtHBPZ8DjXXDBssnfA00Hg1F3nI2AC5y/wB ebkvAoFyNlzcqQvYiJhFhQPfwFg3lYnDg4oUonp8h47/D0eWDe5c4x/OvOmgxgXgCwQXhc2AmjO7B ZWNCviquxJknphC3ljLBvLBnO722SYKEntPMK/dEAXY+wOzcBJ2GklFqFBB7CPobdbZHVX1UbdF2w ubcXAgQ7HRphWnP5iFEw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ioZkz-0008DO-AZ; Mon, 06 Jan 2020 21:17:49 +0000 Received: from wp126.webpack.hosteurope.de ([2a01:488:42:1000:50ed:8485::]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ioZkN-0007Xs-5k; Mon, 06 Jan 2020 21:17:12 +0000 Received: from [2003:a:659:3f00:1e6f:65ff:fe31:d1d5] (helo=hermes.fivetechno.de); authenticated by wp126.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) id 1ioZkL-0001VB-HL; Mon, 06 Jan 2020 22:17:09 +0100 X-Virus-Scanned: by amavisd-new 2.11.1 using newest ClamAV at linuxbbg.five-lan.de Received: from roc-pc (pD9E89450.dip0.t-ipconnect.de [217.232.148.80]) (authenticated bits=0) by hermes.fivetechno.de (8.15.2/8.14.5/SuSE Linux 0.8) with ESMTPSA id 006LH84B032145 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 6 Jan 2020 22:17:08 +0100 From: Markus Reichl To: linux-rockchip@lists.infradead.org, Liam Girdwood , Mark Brown , Rob Herring , Mark Rutland , Heiko Stuebner Subject: [PATCH 3/5] dt-bindings: add vendor Monolithic Power Systems Date: Mon, 6 Jan 2020 22:16:26 +0100 Message-Id: <20200106211633.2882-4-m.reichl@fivetechno.de> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106211633.2882-1-m.reichl@fivetechno.de> References: <20200106211633.2882-1-m.reichl@fivetechno.de> MIME-Version: 1.0 X-bounce-key: webpack.hosteurope.de; m.reichl@fivetechno.de; 1578345431; c4c85a48; X-HE-SMSGID: 1ioZkL-0001VB-HL X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200106_131711_452674_1977F824 X-CRM114-Status: UNSURE ( 7.82 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Markus Reichl , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org MPS produce power regulators like the MP8859. Signed-off-by: Markus Reichl --- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml index fa6aa3c5a500..4fa3bb494745 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml @@ -617,6 +617,8 @@ patternProperties: description: Moxa Inc. "^mpl,.*": description: MPL AG + "^mps,.*": + description: Monolithic Power Systems Inc. "^mqmaker,.*": description: mqmaker Inc. "^mscc,.*": From patchwork Mon Jan 6 21:16:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Reichl X-Patchwork-Id: 11320181 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0173E139A for ; Mon, 6 Jan 2020 21:18:06 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D3F762072C for ; Mon, 6 Jan 2020 21:18:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="sdnAeezR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D3F762072C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=fivetechno.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=RgsGEk29JlBdrmNbd6yp3aXRhWFldb/fQhsbabDaxno=; b=sdnAeezRKzK6K3 k+25JZI7fzOoD2/0J2SGNBnIy3eevGvQd3CwC1pyKlwYt+hHCpstj8wM2/TnrAJhgnUgHy0cLPTmi 8rZChyQ4AT7U2C4KwSL4pg1KlLgR1r/Q9+VsJ5PPCZCek2yWDVkBkhYIs15+zNrg2jh+72T1Kh37g 0FZYvLh7z8ITW64/hRd/i58Ej2VJQM3iBj7yBoB18U/+z4UayTB8Gvcm4X/y2ho3BORyDV7F2rXib DUzF/WNFvovyKuLvwfV6h6nh+ZCGDhthFteQkiGN0WM4ec7eeL7Cu5bMbMYJ667fxE9nGyqf4usOa UJVPLAkcmhD24gGtlcVg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ioZlC-0008TF-Lo; Mon, 06 Jan 2020 21:18:02 +0000 Received: from wp126.webpack.hosteurope.de ([2a01:488:42:1000:50ed:8485::]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ioZkS-0007cT-8j; Mon, 06 Jan 2020 21:17:18 +0000 Received: from [2003:a:659:3f00:1e6f:65ff:fe31:d1d5] (helo=hermes.fivetechno.de); authenticated by wp126.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) id 1ioZkQ-0001XK-Fq; Mon, 06 Jan 2020 22:17:14 +0100 X-Virus-Scanned: by amavisd-new 2.11.1 using newest ClamAV at linuxbbg.five-lan.de Received: from roc-pc (pD9E89450.dip0.t-ipconnect.de [217.232.148.80]) (authenticated bits=0) by hermes.fivetechno.de (8.15.2/8.14.5/SuSE Linux 0.8) with ESMTPSA id 006LHD6u032152 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 6 Jan 2020 22:17:13 +0100 From: Markus Reichl To: linux-rockchip@lists.infradead.org, Liam Girdwood , Mark Brown , Rob Herring , Mark Rutland , Heiko Stuebner Subject: [PATCH 4/5] dt-bindings: regulator: add MPS mp8859 voltage regulator Date: Mon, 6 Jan 2020 22:16:27 +0100 Message-Id: <20200106211633.2882-5-m.reichl@fivetechno.de> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106211633.2882-1-m.reichl@fivetechno.de> References: <20200106211633.2882-1-m.reichl@fivetechno.de> MIME-Version: 1.0 X-bounce-key: webpack.hosteurope.de; m.reichl@fivetechno.de; 1578345436; 06953175; X-HE-SMSGID: 1ioZkQ-0001XK-Fq X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200106_131716_464406_52721433 X-CRM114-Status: UNSURE ( 9.43 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Markus Reichl , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The MP8859 from Monolithic Power Systems is a single output dc/dc converter with voltage control over i2c. Signed-off-by: Markus Reichl --- .../devicetree/bindings/regulator/mp8859.txt | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Documentation/devicetree/bindings/regulator/mp8859.txt diff --git a/Documentation/devicetree/bindings/regulator/mp8859.txt b/Documentation/devicetree/bindings/regulator/mp8859.txt new file mode 100644 index 000000000000..74ad69730989 --- /dev/null +++ b/Documentation/devicetree/bindings/regulator/mp8859.txt @@ -0,0 +1,22 @@ +Monolithic Power Systems MP8859 voltage regulator + +Required properties: +- compatible: "mps,mp8859"; +- reg: I2C slave address. + +Optional subnode for regulator: "mp8859_dcdc", using common regulator +bindings given in . + +Example: + + mp8859: regulator@66 { + compatible = "mps,mp8859"; + reg = <0x66>; + dc_12v: mp8859_dcdc { + regulator-name = "dc_12v"; + regulator-min-microvolt = <12000000>; + regulator-max-microvolt = <12000000>; + regulator-boot-on; + regulator-always-on; + }; + }; From patchwork Mon Jan 6 21:16:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Reichl X-Patchwork-Id: 11320183 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 204AB139A for ; Mon, 6 Jan 2020 21:18:19 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F04E32072C for ; Mon, 6 Jan 2020 21:18:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="JlHDl6Ls" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F04E32072C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=fivetechno.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=obYDB5phLn9qwrK0RRnS6OBxDePx4uGMjSfNAZ4wrXQ=; b=JlHDl6LshdWRNL ygFy8qjRqjlV+zaeaFHMn2ZyXtqlwM+ZDZCGiF7eRLNiBlicBOKJ4sjcNDDLMAvoaQEM6jU4YNvDM MOq4t1UcVQoDc80O+nEZv3vKQNDJrAV1wa+SxkF3uXqU0WZooGfQrqyejGRryYQyu0WeIQaGPS++G 3NQfV7tIS0RzoHDbor+qufrFgu+Yaku0qxBTjXeiy0H09TA3ldZxMSJd0yuOdO8mvh7dNn3oH+CPU AKJ5W3hHIv3D97d9NO1bS+Q4zpGBqIC2rUM/M76qTuvfrlOedDByqy9W1zNmiylisG5UI4cgZv6F9 Zb2z7HeX1ORxXUxz3z9A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ioZlS-0000I1-LR; Mon, 06 Jan 2020 21:18:18 +0000 Received: from wp126.webpack.hosteurope.de ([2a01:488:42:1000:50ed:8485::]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ioZkW-0007ho-Nn; Mon, 06 Jan 2020 21:17:22 +0000 Received: from [2003:a:659:3f00:1e6f:65ff:fe31:d1d5] (helo=hermes.fivetechno.de); authenticated by wp126.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) id 1ioZkV-0001Yf-CK; Mon, 06 Jan 2020 22:17:19 +0100 X-Virus-Scanned: by amavisd-new 2.11.1 using newest ClamAV at linuxbbg.five-lan.de Received: from roc-pc (pD9E89450.dip0.t-ipconnect.de [217.232.148.80]) (authenticated bits=0) by hermes.fivetechno.de (8.15.2/8.14.5/SuSE Linux 0.8) with ESMTPSA id 006LHIt5032161 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 6 Jan 2020 22:17:18 +0100 From: Markus Reichl To: linux-rockchip@lists.infradead.org, Liam Girdwood , Mark Brown , Rob Herring , Mark Rutland , Heiko Stuebner Subject: [PATCH 5/5] arm64: dts: rockchip: Enable mp8859 regulator on rk3399-roc-pc Date: Mon, 6 Jan 2020 22:16:28 +0100 Message-Id: <20200106211633.2882-6-m.reichl@fivetechno.de> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106211633.2882-1-m.reichl@fivetechno.de> References: <20200106211633.2882-1-m.reichl@fivetechno.de> MIME-Version: 1.0 X-bounce-key: webpack.hosteurope.de; m.reichl@fivetechno.de; 1578345440; b43aaf3b; X-HE-SMSGID: 1ioZkV-0001Yf-CK X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200106_131720_932139_199DABE1 X-CRM114-Status: GOOD ( 10.46 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Markus Reichl , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The rk3399-roc-pc uses a MP8859 DC/DC converter for 12V supply. This supplies 5V only in default state after booting. Now we can control the output voltage via I2C interface. Add a node for the driver to reach 12V. Signed-off-by: Markus Reichl --- .../boot/dts/rockchip/rk3399-roc-pc.dtsi | 32 +++++++++++-------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi index 8e01b04144b7..9f225e9c3d54 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi @@ -110,20 +110,6 @@ vcc_vbus_typec0: vcc-vbus-typec0 { regulator-max-microvolt = <5000000>; }; - /* - * should be placed inside mp8859, but not until mp8859 has - * its own dt-binding. - */ - dc_12v: mp8859-dcdc1 { - compatible = "regulator-fixed"; - regulator-name = "dc_12v"; - regulator-always-on; - regulator-boot-on; - regulator-min-microvolt = <12000000>; - regulator-max-microvolt = <12000000>; - vin-supply = <&vcc_vbus_typec0>; - }; - /* switched by pmic_sleep */ vcc1v8_s3: vcca1v8_s3: vcc1v8-s3 { compatible = "regulator-fixed"; @@ -546,6 +532,24 @@ fusb0: usb-typec@22 { vbus-supply = <&vcc_vbus_typec0>; status = "okay"; }; + + mp8859: regulator@66 { + compatible = "mps,mp8859"; + reg = <0x66>; + dc_12v: mp8859_dcdc { + regulator-name = "dc_12v"; + regulator-min-microvolt = <12000000>; + regulator-max-microvolt = <12000000>; + regulator-always-on; + regulator-boot-on; + vin-supply = <&vcc_vbus_typec0>; + + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <12000000>; + }; + }; + }; }; &i2s0 {