From nobody Thu Apr 2 11:41:46 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3B1CEFA3741 for ; Mon, 31 Oct 2022 23:37:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229944AbiJaXhc (ORCPT ); Mon, 31 Oct 2022 19:37:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229502AbiJaXhX (ORCPT ); Mon, 31 Oct 2022 19:37:23 -0400 Received: from thorn.bewilderbeest.net (thorn.bewilderbeest.net [IPv6:2605:2700:0:5::4713:9cab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8AB4F1408D; Mon, 31 Oct 2022 16:37:22 -0700 (PDT) Received: from hatter.bewilderbeest.net (97-113-250-99.tukw.qwest.net [97.113.250.99]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: zev) by thorn.bewilderbeest.net (Postfix) with ESMTPSA id 09B8438B; Mon, 31 Oct 2022 16:37:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bewilderbeest.net; s=thorn; t=1667259442; bh=hab4TlWaUtHoMs16vVHspyHBFQ2Xuuf4vi6qvj/vYW0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C5vg/+Dk5cgdmfjIg193YdCDPaB+QYLhR2DZyhOOvfYDGeYG0Hpfl2gJ7gpW2UOlu zPbVd86aEUad496mjX1oOxpNblauO7IMWfXaPprYtdMcWJcBeaUKTdK4XOLAfI9bkU 9Gs3iQYMt1WvQsDR6oMg0jOb0ujM2aiMWzVeBWCg= From: Zev Weiss To: Mark Brown , Liam Girdwood Cc: Zev Weiss , linux-kernel@vger.kernel.org, Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, Naresh Solanki , Patrick Rudolph , Laxman Dewangan , openbmc@lists.ozlabs.org Subject: [PATCH v2 1/3] regulator: devres: Add devm_regulator_bulk_get_exclusive() Date: Mon, 31 Oct 2022 16:37:02 -0700 Message-Id: <20221031233704.22575-2-zev@bewilderbeest.net> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221031233704.22575-1-zev@bewilderbeest.net> References: <20221031233704.22575-1-zev@bewilderbeest.net> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" We had an exclusive variant of the devm_regulator_get() API, but no corresponding variant for the bulk API; let's add one now. We add a generalized version of the existing regulator_bulk_get() function that additionally takes a get_type parameter and redefine regulator_bulk_get() in terms of it, then do similarly with devm_regulator_bulk_get(), and finally add the new devm_regulator_bulk_get_exclusive(). Signed-off-by: Zev Weiss --- drivers/regulator/core.c | 42 +++++++++++-------- drivers/regulator/devres.c | 66 ++++++++++++++++++++++-------- drivers/regulator/internal.h | 2 + include/linux/regulator/consumer.h | 2 + 4 files changed, 76 insertions(+), 36 deletions(-) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index bcccad8f7516..704f91720dfe 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -4778,22 +4778,8 @@ static int _notifier_call_chain(struct regulator_dev= *rdev, return blocking_notifier_call_chain(&rdev->notifier, event, data); } =20 -/** - * regulator_bulk_get - get multiple regulator consumers - * - * @dev: Device to supply - * @num_consumers: Number of consumers to register - * @consumers: Configuration of consumers; clients are stored here. - * - * @return 0 on success, an errno on failure. - * - * This helper function allows drivers to get several regulator - * consumers in one operation. If any of the regulators cannot be - * acquired then any regulators that were allocated will be freed - * before returning to the caller. - */ -int regulator_bulk_get(struct device *dev, int num_consumers, - struct regulator_bulk_data *consumers) +int _regulator_bulk_get(struct device *dev, int num_consumers, + struct regulator_bulk_data *consumers, enum regulator_get_type get_type) { int i; int ret; @@ -4802,8 +4788,8 @@ int regulator_bulk_get(struct device *dev, int num_co= nsumers, consumers[i].consumer =3D NULL; =20 for (i =3D 0; i < num_consumers; i++) { - consumers[i].consumer =3D regulator_get(dev, - consumers[i].supply); + consumers[i].consumer =3D _regulator_get(dev, + consumers[i].supply, get_type); if (IS_ERR(consumers[i].consumer)) { ret =3D dev_err_probe(dev, PTR_ERR(consumers[i].consumer), "Failed to get supply '%s'", @@ -4830,6 +4816,26 @@ int regulator_bulk_get(struct device *dev, int num_c= onsumers, =20 return ret; } + +/** + * regulator_bulk_get - get multiple regulator consumers + * + * @dev: Device to supply + * @num_consumers: Number of consumers to register + * @consumers: Configuration of consumers; clients are stored here. + * + * @return 0 on success, an errno on failure. + * + * This helper function allows drivers to get several regulator + * consumers in one operation. If any of the regulators cannot be + * acquired then any regulators that were allocated will be freed + * before returning to the caller. + */ +int regulator_bulk_get(struct device *dev, int num_consumers, + struct regulator_bulk_data *consumers) +{ + return _regulator_bulk_get(dev, num_consumers, consumers, NORMAL_GET); +} EXPORT_SYMBOL_GPL(regulator_bulk_get); =20 static void regulator_bulk_enable_async(void *data, async_cookie_t cookie) diff --git a/drivers/regulator/devres.c b/drivers/regulator/devres.c index 3265e75e97ab..fec0398d98b0 100644 --- a/drivers/regulator/devres.c +++ b/drivers/regulator/devres.c @@ -186,23 +186,9 @@ static void devm_regulator_bulk_release(struct device = *dev, void *res) regulator_bulk_free(devres->num_consumers, devres->consumers); } =20 -/** - * devm_regulator_bulk_get - managed get multiple regulator consumers - * - * @dev: device to supply - * @num_consumers: number of consumers to register - * @consumers: configuration of consumers; clients are stored here. - * - * @return 0 on success, an errno on failure. - * - * This helper function allows drivers to get several regulator - * consumers in one operation with management, the regulators will - * automatically be freed when the device is unbound. If any of the - * regulators cannot be acquired then any regulators that were - * allocated will be freed before returning to the caller. - */ -int devm_regulator_bulk_get(struct device *dev, int num_consumers, - struct regulator_bulk_data *consumers) +static int _devm_regulator_bulk_get(struct device *dev, int num_consumers, + struct regulator_bulk_data *consumers, + enum regulator_get_type get_type) { struct regulator_bulk_devres *devres; int ret; @@ -212,7 +198,7 @@ int devm_regulator_bulk_get(struct device *dev, int num= _consumers, if (!devres) return -ENOMEM; =20 - ret =3D regulator_bulk_get(dev, num_consumers, consumers); + ret =3D _regulator_bulk_get(dev, num_consumers, consumers, get_type); if (!ret) { devres->consumers =3D consumers; devres->num_consumers =3D num_consumers; @@ -223,8 +209,52 @@ int devm_regulator_bulk_get(struct device *dev, int nu= m_consumers, =20 return ret; } + +/** + * devm_regulator_bulk_get - managed get multiple regulator consumers + * + * @dev: device to supply + * @num_consumers: number of consumers to register + * @consumers: configuration of consumers; clients are stored here. + * + * @return 0 on success, an errno on failure. + * + * This helper function allows drivers to get several regulator + * consumers in one operation with management, the regulators will + * automatically be freed when the device is unbound. If any of the + * regulators cannot be acquired then any regulators that were + * allocated will be freed before returning to the caller. + */ +int devm_regulator_bulk_get(struct device *dev, int num_consumers, + struct regulator_bulk_data *consumers) +{ + return _devm_regulator_bulk_get(dev, num_consumers, consumers, NORMAL_GET= ); +} EXPORT_SYMBOL_GPL(devm_regulator_bulk_get); =20 +/** + * devm_regulator_bulk_get_exclusive - managed exclusive get of multiple + * regulator consumers + * + * @dev: device to supply + * @num_consumers: number of consumers to register + * @consumers: configuration of consumers; clients are stored here. + * + * @return 0 on success, an errno on failure. + * + * This helper function allows drivers to exclusively get several + * regulator consumers in one operation with management, the regulators + * will automatically be freed when the device is unbound. If any of + * the regulators cannot be acquired then any regulators that were + * allocated will be freed before returning to the caller. + */ +int devm_regulator_bulk_get_exclusive(struct device *dev, int num_consumer= s, + struct regulator_bulk_data *consumers) +{ + return _devm_regulator_bulk_get(dev, num_consumers, consumers, EXCLUSIVE_= GET); +} +EXPORT_SYMBOL_GPL(devm_regulator_bulk_get_exclusive); + /** * devm_regulator_bulk_get_const - devm_regulator_bulk_get() w/ const data * diff --git a/drivers/regulator/internal.h b/drivers/regulator/internal.h index 1e9c71642143..fb4433068d29 100644 --- a/drivers/regulator/internal.h +++ b/drivers/regulator/internal.h @@ -122,4 +122,6 @@ enum regulator_get_type { =20 struct regulator *_regulator_get(struct device *dev, const char *id, enum regulator_get_type get_type); +int _regulator_bulk_get(struct device *dev, int num_consumers, + struct regulator_bulk_data *consumers, enum regulator_get_type get_type= ); #endif diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/c= onsumer.h index ee3b4a014611..628a52b8e63f 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h @@ -247,6 +247,8 @@ int __must_check regulator_bulk_get(struct device *dev,= int num_consumers, int __must_check devm_regulator_bulk_get(struct device *dev, int num_consu= mers, struct regulator_bulk_data *consumers); void devm_regulator_bulk_put(struct regulator_bulk_data *consumers); +int __must_check devm_regulator_bulk_get_exclusive(struct device *dev, int= num_consumers, + struct regulator_bulk_data *consumers); int __must_check devm_regulator_bulk_get_const( struct device *dev, int num_consumers, const struct regulator_bulk_data *in_consumers, --=20 2.38.1 From nobody Thu Apr 2 11:41:46 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9FA18ECAAA1 for ; Mon, 31 Oct 2022 23:37:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229993AbiJaXhf (ORCPT ); Mon, 31 Oct 2022 19:37:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229870AbiJaXhX (ORCPT ); Mon, 31 Oct 2022 19:37:23 -0400 Received: from thorn.bewilderbeest.net (thorn.bewilderbeest.net [71.19.156.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD9F914090; Mon, 31 Oct 2022 16:37:22 -0700 (PDT) Received: from hatter.bewilderbeest.net (97-113-250-99.tukw.qwest.net [97.113.250.99]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: zev) by thorn.bewilderbeest.net (Postfix) with ESMTPSA id 5F4AC38F; Mon, 31 Oct 2022 16:37:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bewilderbeest.net; s=thorn; t=1667259442; bh=mAt3dJv3CrFnTWTFOnC00xngHdYd38jgqzgqlMa3X3Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W9mxgPoNctOPHVKdqhq+FDTPFhvxVsgcLKfoArULQ/KpFNwT1nJ1ZOmJpVUE1sByd nU+fHubbQCe0LdKXnKrCE400swgRu0uuQn55C+Tvu6Qo6z4XaXl5yBm4fbGbSzEzuT oBh/WkLVhcc+ldLpZJe/3UgYyztTAgPo1hD8ooLM= From: Zev Weiss To: Mark Brown , Liam Girdwood , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org Cc: Zev Weiss , linux-kernel@vger.kernel.org, Naresh Solanki , Patrick Rudolph , Laxman Dewangan , openbmc@lists.ozlabs.org Subject: [PATCH v2 2/3] dt-bindings: regulator: Add regulator-output binding Date: Mon, 31 Oct 2022 16:37:03 -0700 Message-Id: <20221031233704.22575-3-zev@bewilderbeest.net> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221031233704.22575-1-zev@bewilderbeest.net> References: <20221031233704.22575-1-zev@bewilderbeest.net> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" This describes a power output supplied by a regulator, such as a power outlet on a power distribution unit (PDU). Signed-off-by: Zev Weiss Reviewed-by: Rob Herring --- Changes since v1: - removed 'regulator-leave-on' property .../bindings/regulator/regulator-output.yaml | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 Documentation/devicetree/bindings/regulator/regulator-o= utput.yaml diff --git a/Documentation/devicetree/bindings/regulator/regulator-output.y= aml b/Documentation/devicetree/bindings/regulator/regulator-output.yaml new file mode 100644 index 000000000000..078b37a1a71a --- /dev/null +++ b/Documentation/devicetree/bindings/regulator/regulator-output.yaml @@ -0,0 +1,39 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- + +$id: http://devicetree.org/schemas/regulator/regulator-output.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Regulator output connector + +maintainers: + - Zev Weiss + +description: | + This describes a power output connector supplied by a regulator, + such as a power outlet on a power distribution unit (PDU). The + connector may be standalone or merely one channel or set of pins + within a ganged physical connector carrying multiple independent + power outputs. + +properties: + compatible: + const: regulator-output + + vout-supply: + description: + Phandle of the regulator supplying the output. + +required: + - compatible + - vout-supply + +additionalProperties: false + +examples: + - | + output { + compatible =3D "regulator-output"; + vout-supply =3D <&output_reg>; + }; --=20 2.38.1 From nobody Thu Apr 2 11:41:46 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 632EBECAAA1 for ; Mon, 31 Oct 2022 23:37:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229494AbiJaXhj (ORCPT ); Mon, 31 Oct 2022 19:37:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229880AbiJaXhY (ORCPT ); Mon, 31 Oct 2022 19:37:24 -0400 Received: from thorn.bewilderbeest.net (thorn.bewilderbeest.net [71.19.156.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B823B14091; Mon, 31 Oct 2022 16:37:23 -0700 (PDT) Received: from hatter.bewilderbeest.net (97-113-250-99.tukw.qwest.net [97.113.250.99]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: zev) by thorn.bewilderbeest.net (Postfix) with ESMTPSA id B6F643F9; Mon, 31 Oct 2022 16:37:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bewilderbeest.net; s=thorn; t=1667259443; bh=elF8316zFSe4EfpL/QQF0WnD0i/ruhxqBXkJwaA32cY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EwCB7WtqeyThaYYP5+CY5GzVluwTsWjnhg5OIF13CzJTW3DEgGv7hTUrVZ4czZ44d fGCfuCePV3k3ZPQCINSVf2b2nVaAgYOPkTjNhycY5tjMYZKEENF6Dcaonz0132rjgc qfolae8ENoSLEASJOsKIldIr8/Xh+hQXKqexmnu0= From: Zev Weiss To: Mark Brown , Liam Girdwood Cc: Zev Weiss , linux-kernel@vger.kernel.org, Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, Naresh Solanki , Patrick Rudolph , Laxman Dewangan , openbmc@lists.ozlabs.org Subject: [PATCH v2 3/3] regulator: userspace-consumer: Handle regulator-output DT nodes Date: Mon, 31 Oct 2022 16:37:04 -0700 Message-Id: <20221031233704.22575-4-zev@bewilderbeest.net> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221031233704.22575-1-zev@bewilderbeest.net> References: <20221031233704.22575-1-zev@bewilderbeest.net> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" In addition to adding some fairly simple OF support code, we make some slight adjustments to the userspace-consumer driver to properly support use with regulator-output hardware: - We now do an exclusive get of the supply regulators so as to prevent regulator_init_complete_work from automatically disabling them. - Instead of assuming that the supply is initially disabled, we now query its state to determine the initial value of drvdata->enabled. Signed-off-by: Zev Weiss --- Changes since v1: - removed 'regulator-leave-on' support, instead just setting .no_autoswitch if instantiated via DT - added .is_visible method to hide 'name' sysfs attribute when it's not set drivers/regulator/userspace-consumer.c | 60 +++++++++++++++++--- include/linux/regulator/userspace-consumer.h | 1 + 2 files changed, 54 insertions(+), 7 deletions(-) diff --git a/drivers/regulator/userspace-consumer.c b/drivers/regulator/use= rspace-consumer.c index 8ca28664776e..402c8037cf39 100644 --- a/drivers/regulator/userspace-consumer.c +++ b/drivers/regulator/userspace-consumer.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -24,6 +25,7 @@ struct userspace_consumer_data { =20 struct mutex lock; bool enabled; + bool no_autoswitch; =20 int num_supplies; struct regulator_bulk_data *supplies; @@ -96,19 +98,50 @@ static struct attribute *attributes[] =3D { NULL, }; =20 +static umode_t attr_visible(struct kobject *kobj, struct attribute *attr, = int idx) +{ + struct device *dev =3D kobj_to_dev(kobj); + struct userspace_consumer_data *data =3D dev_get_drvdata(dev); + + /* If a name hasn't been set, don't bother with the attribute */ + if (attr =3D=3D &dev_attr_name.attr && !data->name) + return 0; + + return attr->mode; +} + static const struct attribute_group attr_group =3D { .attrs =3D attributes, + .is_visible =3D attr_visible, }; =20 static int regulator_userspace_consumer_probe(struct platform_device *pdev) { + struct regulator_userspace_consumer_data tmpdata; struct regulator_userspace_consumer_data *pdata; struct userspace_consumer_data *drvdata; int ret; =20 pdata =3D dev_get_platdata(&pdev->dev); - if (!pdata) + if (!pdata) { + if (!pdev->dev.of_node) + return -EINVAL; + + pdata =3D &tmpdata; + memset(pdata, 0, sizeof(*pdata)); + + pdata->no_autoswitch =3D true; + pdata->num_supplies =3D 1; + pdata->supplies =3D devm_kzalloc(&pdev->dev, sizeof(*pdata->supplies), G= FP_KERNEL); + if (!pdata->supplies) + return -ENOMEM; + pdata->supplies[0].supply =3D "vout"; + } + + if (pdata->num_supplies < 1) { + dev_err(&pdev->dev, "At least one supply required\n"); return -EINVAL; + } =20 drvdata =3D devm_kzalloc(&pdev->dev, sizeof(struct userspace_consumer_data), @@ -119,21 +152,24 @@ static int regulator_userspace_consumer_probe(struct = platform_device *pdev) drvdata->name =3D pdata->name; drvdata->num_supplies =3D pdata->num_supplies; drvdata->supplies =3D pdata->supplies; + drvdata->no_autoswitch =3D pdata->no_autoswitch; =20 mutex_init(&drvdata->lock); =20 - ret =3D devm_regulator_bulk_get(&pdev->dev, drvdata->num_supplies, - drvdata->supplies); + ret =3D devm_regulator_bulk_get_exclusive(&pdev->dev, drvdata->num_suppli= es, + drvdata->supplies); if (ret) { dev_err(&pdev->dev, "Failed to get supplies: %d\n", ret); return ret; } =20 + platform_set_drvdata(pdev, drvdata); + ret =3D sysfs_create_group(&pdev->dev.kobj, &attr_group); if (ret !=3D 0) return ret; =20 - if (pdata->init_on) { + if (pdata->init_on && !pdata->no_autoswitch) { ret =3D regulator_bulk_enable(drvdata->num_supplies, drvdata->supplies); if (ret) { @@ -143,8 +179,12 @@ static int regulator_userspace_consumer_probe(struct p= latform_device *pdev) } } =20 - drvdata->enabled =3D pdata->init_on; - platform_set_drvdata(pdev, drvdata); + ret =3D regulator_is_enabled(pdata->supplies[0].consumer); + if (ret < 0) { + dev_err(&pdev->dev, "Failed to get regulator status\n"); + goto err_enable; + } + drvdata->enabled =3D !!ret; =20 return 0; =20 @@ -160,17 +200,23 @@ static int regulator_userspace_consumer_remove(struct= platform_device *pdev) =20 sysfs_remove_group(&pdev->dev.kobj, &attr_group); =20 - if (data->enabled) + if (data->enabled && !data->no_autoswitch) regulator_bulk_disable(data->num_supplies, data->supplies); =20 return 0; } =20 +static const struct of_device_id regulator_userspace_consumer_of_match[] = =3D { + { .compatible =3D "regulator-output", }, + {}, +}; + static struct platform_driver regulator_userspace_consumer_driver =3D { .probe =3D regulator_userspace_consumer_probe, .remove =3D regulator_userspace_consumer_remove, .driver =3D { .name =3D "reg-userspace-consumer", + .of_match_table =3D regulator_userspace_consumer_of_match, }, }; =20 diff --git a/include/linux/regulator/userspace-consumer.h b/include/linux/r= egulator/userspace-consumer.h index b5dba0628951..2249ee697f8b 100644 --- a/include/linux/regulator/userspace-consumer.h +++ b/include/linux/regulator/userspace-consumer.h @@ -21,6 +21,7 @@ struct regulator_userspace_consumer_data { struct regulator_bulk_data *supplies; =20 bool init_on; + bool no_autoswitch; }; =20 #endif /* __REGULATOR_PLATFORM_CONSUMER_H_ */ --=20 2.38.1