From patchwork Mon Oct 14 10:43:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dragan Simic X-Patchwork-Id: 13834614 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id A7834CF2594 for ; Mon, 14 Oct 2024 10:47:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Rx71Hi2K/bVCQbk7BKcjYJShsMksuU5H09l8NQcyJJU=; b=kox0INYVo+s13J MYkMQzHN0kXtYpqEaqRAPjPy46PaFldMPuDipX/s/OnPi9HeZRAU8aAYWK9hKsh9+qs6MRRDQ6yAg qwcJQzCL4NYLb+u1Dx7ZpriIoZUHHFmCAfdkdnukTeOOneTGt9YdLEAOm/Uja0o8Xo2zF67jQbMHc M/2ysLchpM7KCdl6bsEAGWeVyM/FM8BvTQC/4gRTMDYOUvDFy6KRwxv2s49oEnUcdomGWS+U9aLra sRlCl1k5EyfTAtW39FxHaMm8WLWwAq60+yOwEvgyJylV/iU72oYi3cGe3aHZPSms4j6+i/3+kK2xx q+wu3ellz1yLbxDWX7yw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t0Ic2-00000004kAh-0NC8; Mon, 14 Oct 2024 10:47:42 +0000 Received: from mail.manjaro.org ([2a01:4f8:c0c:51f3::1]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t0IYK-00000004jD6-0K33; Mon, 14 Oct 2024 10:43:55 +0000 From: Dragan Simic DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=manjaro.org; s=2021; t=1728902629; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5ZNAPlbASWAkNDdmTnghKvANDJ6bL58Kr9lbnrNo7dk=; b=dOvYlM1iWj/jRzuKuXPGVNVZ0ULQJeOK1G2ZF2LevpQIm8/+GUQsG24gWbUs+RBCl0uVA1 5ggpUrY6Uqa9AU4k76TzkrUFegOLNz1/gzwr//G/gmflZ9DRkAODZJeFAQMltqdqEZX90o 9xGnjrFFQkvrNbjKZ+uQ7fJe2dVDkv018I/16Ktr3CZ3XGNReR4U5T66wSSYJjosSoLwYh O0aHCfCS1TQpYte5bT8c9rz/NksjCblApv0pzdZ5OlXi2qPZg2y8NPzoYZxyqhV8wTDsHF /Ocn5KA2TqMy9YUJzhg9u8t/jr9onaFIaXYYip0vrtxoo1OySaOixI3rDLXvdQ== To: lgirdwood@gmail.com, broonie@kernel.org Cc: linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] regulator: rk808: Perform trivial code cleanups Date: Mon, 14 Oct 2024 12:43:39 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 Authentication-Results: ORIGINATING; auth=pass smtp.auth=dsimic@manjaro.org smtp.mailfrom=dsimic@manjaro.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241014_034352_458548_F784D022 X-CRM114-Status: GOOD ( 12.38 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org Perform a few trivial code cleanups, to improve the accuracy and wording of a couple of comments and the module description, and to avoid line wrapping in a few places by using the 100-column width a bit better. No intended functional changes are introduced by these code cleanups. Signed-off-by: Dragan Simic --- drivers/regulator/rk808-regulator.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/drivers/regulator/rk808-regulator.c b/drivers/regulator/rk808-regulator.c index 14b60abd6afc..e81dbb14a29e 100644 --- a/drivers/regulator/rk808-regulator.c +++ b/drivers/regulator/rk808-regulator.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Regulator driver for Rockchip RK805/RK808/RK818 + * Regulator driver for Rockchip RK80x and RK81x PMIC series * * Copyright (c) 2014, Fuzhou Rockchip Electronics Co., Ltd * Copyright (c) 2021 Rockchip Electronics Co., Ltd. @@ -23,7 +23,7 @@ #include #include -/* Field Definitions */ +/* Field definitions */ #define RK808_BUCK_VSEL_MASK 0x3f #define RK808_BUCK4_VSEL_MASK 0xf #define RK808_LDO_VSEL_MASK 0x1f @@ -1829,36 +1829,33 @@ static const struct regulator_desc rk818_reg[] = { RK818_DCDC_EN_REG, BIT(7)), }; -static int rk808_regulator_dt_parse_pdata(struct device *dev, - struct regmap *map, - struct rk808_regulator_data *pdata) +static int rk808_regulator_dt_parse_pdata(struct device *dev, struct regmap *map, + struct rk808_regulator_data *pdata) { struct device_node *np; int tmp, ret = 0, i; np = of_get_child_by_name(dev->of_node, "regulators"); if (!np) return -ENXIO; for (i = 0; i < ARRAY_SIZE(pdata->dvs_gpio); i++) { pdata->dvs_gpio[i] = - devm_gpiod_get_index_optional(dev, "dvs", i, - GPIOD_OUT_LOW); + devm_gpiod_get_index_optional(dev, "dvs", i, GPIOD_OUT_LOW); if (IS_ERR(pdata->dvs_gpio[i])) { ret = PTR_ERR(pdata->dvs_gpio[i]); dev_err(dev, "failed to get dvs%d gpio (%d)\n", i, ret); goto dt_parse_end; } if (!pdata->dvs_gpio[i]) { dev_info(dev, "there is no dvs%d gpio\n", i); continue; } tmp = i ? RK808_DVS2_POL : RK808_DVS1_POL; ret = regmap_update_bits(map, RK808_IO_POL_REG, tmp, - gpiod_is_active_low(pdata->dvs_gpio[i]) ? - 0 : tmp); + gpiod_is_active_low(pdata->dvs_gpio[i]) ? 0 : tmp); } dt_parse_end: @@ -1954,7 +1951,7 @@ static struct platform_driver rk808_regulator_driver = { module_platform_driver(rk808_regulator_driver); -MODULE_DESCRIPTION("regulator driver for the RK805/RK808/RK818 series PMICs"); +MODULE_DESCRIPTION("Rockchip RK80x/RK81x PMIC series regulator driver"); MODULE_AUTHOR("Tony xie "); MODULE_AUTHOR("Chris Zhong "); MODULE_AUTHOR("Zhang Qing "); From patchwork Mon Oct 14 10:43:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dragan Simic X-Patchwork-Id: 13834615 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 6BA05CF2594 for ; Mon, 14 Oct 2024 10:49:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=31S20U3gWq6wi4Ef4eNeU9nPe/VQB9ow/HYZhoWCFi8=; b=3XT/k87QhOvjBF DYk+gArI1oAWcFf1mAMxhX/9nxCG4nJQcp1hziz3iehQA9JjsRVRVz76BehEKlTtwvt6Meo+aJ/4q CgqZJYntjBzoSkJwANMbz6EMplLwHg9PVwumHv6Xg/o8ryc2fY/j2+m3FsKOKULVutxEvmp8lPwW6 TD+qFVPpFv2AACoo7rQ2HUUxv+V5Cp4Fb5nilTHTevJn11PBKgcaGlqYFO8Lps2PmcFZZF3BNgyqU 6+TyO31lQplylBQBofNsLmT8wdZlYu5gOt2taIT94lOr5sBXyXSqGGPmKyd4YSH1Qm7KB19tw6jtC X447VZNbzqIxqMJYZM7A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t0IdO-00000004kU2-3qMG; Mon, 14 Oct 2024 10:49:06 +0000 Received: from mail.manjaro.org ([2a01:4f8:c0c:51f3::1]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t0IYK-00000004jD7-0JmS; Mon, 14 Oct 2024 10:43:55 +0000 From: Dragan Simic DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=manjaro.org; s=2021; t=1728902630; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WJylQnN6elbJzXOZExAonx34GilCjnyToPejoTdekBk=; b=JqfXECaOZIjE2sclZRG6A8LJFcdwPCzB1g0gmiv7dUGa+bRa95TvU6P8YPwi4qdaGxlVTi jkL2+S2jkcNBNlBxYbPQuxQlLQgIeGlinByjHqL/50Mfu8PQd+UnvPIS81Q0ryx2zSLvlI cHKYOSl0JRWMRej2bHRGEjkITD/xx8WNMDNogJ0hJca8I9XbaApd1xpdFwPpcf4BGk7zZL H1gvpZOwKPy6lbnFn8jS86A8BWb69DfMJZwZCcLPssX2+qvm3bGIE65FgR1xTSz1h3q2MC rYrC/5togOejEuuWDXXHqERGKHBmpcqk0xM2evIVkeRyra3GTWzqDv7F2UlQOQ== To: lgirdwood@gmail.com, broonie@kernel.org Cc: linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] regulator: rk808: Use dev_err_probe() in the probe path Date: Mon, 14 Oct 2024 12:43:40 +0200 Message-Id: <2bfd889a35b1b0454952ec8180a53143bd860192.1728902488.git.dsimic@manjaro.org> In-Reply-To: References: MIME-Version: 1.0 Authentication-Results: ORIGINATING; auth=pass smtp.auth=dsimic@manjaro.org smtp.mailfrom=dsimic@manjaro.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241014_034352_296168_9BBCC972 X-CRM114-Status: UNSURE ( 9.27 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org Improve error handling in the probe path by using function dev_err_probe() instead of function dev_err(), where appropriate. Signed-off-by: Dragan Simic --- drivers/regulator/rk808-regulator.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/regulator/rk808-regulator.c b/drivers/regulator/rk808-regulator.c index e81dbb14a29e..f241bb538e27 100644 --- a/drivers/regulator/rk808-regulator.c +++ b/drivers/regulator/rk808-regulator.c @@ -1843,8 +1843,8 @@ static int rk808_regulator_dt_parse_pdata(struct device *dev, struct regmap *map pdata->dvs_gpio[i] = devm_gpiod_get_index_optional(dev, "dvs", i, GPIOD_OUT_LOW); if (IS_ERR(pdata->dvs_gpio[i])) { - ret = PTR_ERR(pdata->dvs_gpio[i]); - dev_err(dev, "failed to get dvs%d gpio (%d)\n", i, ret); + ret = dev_err_probe(dev, PTR_ERR(pdata->dvs_gpio[i]), + "failed to get dvs%d gpio\n", i); goto dt_parse_end; } @@ -1920,9 +1920,8 @@ static int rk808_regulator_probe(struct platform_device *pdev) nregulators = RK818_NUM_REGULATORS; break; default: - dev_err(&pdev->dev, "unsupported RK8XX ID %lu\n", - rk808->variant); - return -EINVAL; + return dev_err_probe(&pdev->dev, -EINVAL, + "unsupported RK8xx ID %lu\n", rk808->variant); } config.dev = &pdev->dev; From patchwork Mon Oct 14 10:43:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dragan Simic X-Patchwork-Id: 13834616 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 254D5CF2594 for ; Mon, 14 Oct 2024 10:50:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=IEWO28FQhF2TaA9Qkgcag6t5AmpSmXwMzmjmzNxe8gE=; b=TQ6Iys3EEjKdfW eGPjKWoMZ3gTnvkuHdq0Wq3Gf1zca/3d+Rpw+AihvUfbVQQ90eiUiUz/V6bbpd8u4Y2Ws9SGh+rDp 9XXXx8I3OLX8bDCuCVQCY3vWrBN7SpsVRJhOIlnJERAIW+p5qtKd3QUMW/yuLc1/7l142cUlczxQH 44euKPCAZxQHSrSrkHhw3yO/qEBscA5GiXc663T3tP15LlrPDxgbL9Z1jAYe1AvLVFqRHvqvUu5CA fHUTbl1s3OaI9M4Hx3bj+drlGQyCrIpGyrvTCHUypOwVrJvDTPkr6la547xIeptXFuFmmJJYgVBZq h0+kN1sQ0ExGZaHIpeXQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t0Iel-00000004ke9-1tmt; Mon, 14 Oct 2024 10:50:31 +0000 Received: from mail.manjaro.org ([116.203.91.91]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t0IYL-00000004jDL-2VF3; Mon, 14 Oct 2024 10:43:56 +0000 From: Dragan Simic DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=manjaro.org; s=2021; t=1728902630; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OJI6FD5j4PqYdR+2XIK8jcifYw4g5S3Dr/YL2YwHxD4=; b=Mr8Ee5t8sx6kRSTgiFM3BtvBUTDxC51GCurWp9W93+pKAq6KG8nzlm6mPhUa5OrV1rCtG6 dpk2BMbXgu0JcWi2nyAl5QiZQABzH1qYoMtSHGsBz31dPHf64j8UjJwYzNAMm6E6ERkkpF nlEd+WWCv5ts0rz3umF1Mwxx666/PYHMW6hKSpBTJq5ALfmAOA+cVJkIFTpp8hY2vI1uG2 X2yeNohSwe59Qltilf2REvwAogWNnjWa9abaw5D22K6AsHmvuiwGmzw/oMVlvJidsHyMwe PCyRibFpVeFlIJLUGPEIUNJtveg0eD28vF2sDCGyhoIm7YJPuZUIlCuK6gBRFQ== To: lgirdwood@gmail.com, broonie@kernel.org Cc: linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Diederik de Haas Subject: [PATCH 3/3] regulator: rk808: Restrict DVS GPIOs to the RK808 variant only Date: Mon, 14 Oct 2024 12:43:41 +0200 Message-Id: <9a415c59699e76fc7b88a2552520a4ca2538f44e.1728902488.git.dsimic@manjaro.org> In-Reply-To: References: MIME-Version: 1.0 Authentication-Results: ORIGINATING; auth=pass smtp.auth=dsimic@manjaro.org smtp.mailfrom=dsimic@manjaro.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241014_034354_837601_7FED04AF X-CRM114-Status: GOOD ( 18.58 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org The rk808-regulator driver supports multiple PMIC variants from the Rockckip RK80x and RK81x series, but the DVS GPIOs are supported on the RK808 variant only, according to the DT bindings [1][2][3][4][5][6] and the datasheets for the supported PMIC variants. [7][8][9][10][11][12] Thus, change the probe path so the "dvs-gpios" property is checked for and its value possibly used only when the handled PMIC variant is RK808. There's no point in doing that on the other PMIC variants, because they don't support the DVS GPIOs, and it goes against the DT bindings to allow a possible out- of-place "dvs-gpios" property to actually be handled in the driver. This eliminates the following messages, emitted when the "dvs-gpios" property isn't found in the DT, from the kernel log on boards that actually don't use the RK808 variant, which may have provided a source of confusion: rk808-regulator rk808-regulator.2.auto: there is no dvs0 gpio rk808-regulator rk808-regulator.2.auto: there is no dvs1 gpio Furthermore, demote these kernel messages to debug messages, because they are useful during the board bringup phase only. Emitting them afterwards, on the boards that use the RK808 variant, but actually don't use the DVS0/1 GPIOs, clutters the kernel log a bit, while they provide no value and may actually cause false impression that some PMIC-related issues are present. [1] Documentation/devicetree/bindings/mfd/rockchip,rk805.yaml [2] Documentation/devicetree/bindings/mfd/rockchip,rk806.yaml [3] Documentation/devicetree/bindings/mfd/rockchip,rk808.yaml [4] Documentation/devicetree/bindings/mfd/rockchip,rk816.yaml [5] Documentation/devicetree/bindings/mfd/rockchip,rk817.yaml [6] Documentation/devicetree/bindings/mfd/rockchip,rk818.yaml [7] https://rockchip.fr/RK805%20datasheet%20V1.2.pdf [8] https://wmsc.lcsc.com/wmsc/upload/file/pdf/v2/lcsc/2401261533_Rockchip-RK806-1_C5156483.pdf [9] https://rockchip.fr/RK808%20datasheet%20V1.4.pdf [10] https://rockchip.fr/RK816%20datasheet%20V1.3.pdf [11] https://rockchip.fr/RK817%20datasheet%20V1.01.pdf [12] https://rockchip.fr/RK818%20datasheet%20V1.0.pdf Fixes: 11375293530b ("regulator: rk808: Add regulator driver for RK818") Reported-by: Diederik de Haas Signed-off-by: Dragan Simic --- drivers/regulator/rk808-regulator.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/regulator/rk808-regulator.c b/drivers/regulator/rk808-regulator.c index f241bb538e27..76f9a426450d 100644 --- a/drivers/regulator/rk808-regulator.c +++ b/drivers/regulator/rk808-regulator.c @@ -1849,7 +1849,7 @@ static int rk808_regulator_dt_parse_pdata(struct device *dev, struct regmap *map } if (!pdata->dvs_gpio[i]) { - dev_info(dev, "there is no dvs%d gpio\n", i); + dev_dbg(dev, "there is no dvs%d gpio\n", i); continue; } @@ -1884,22 +1884,21 @@ static int rk808_regulator_probe(struct platform_device *pdev) if (!pdata) return -ENOMEM; - ret = rk808_regulator_dt_parse_pdata(&pdev->dev, regmap, pdata); - if (ret < 0) - return ret; - - platform_set_drvdata(pdev, pdata); - switch (rk808->variant) { case RK805_ID: regulators = rk805_reg; nregulators = RK805_NUM_REGULATORS; break; case RK806_ID: regulators = rk806_reg; nregulators = ARRAY_SIZE(rk806_reg); break; case RK808_ID: + /* DVS0/1 GPIOs are supported on the RK808 only */ + ret = rk808_regulator_dt_parse_pdata(&pdev->dev, regmap, pdata); + if (ret < 0) + return ret; + regulators = rk808_reg; nregulators = RK808_NUM_REGULATORS; break; @@ -1924,6 +1923,8 @@ static int rk808_regulator_probe(struct platform_device *pdev) "unsupported RK8xx ID %lu\n", rk808->variant); } + platform_set_drvdata(pdev, pdata); + config.dev = &pdev->dev; config.driver_data = pdata; config.regmap = regmap;