From b77e60c6a2797ada240b1d42b896b70853e2b1af Mon Sep 17 00:00:00 2001
From: Quentin Schulz <quentin.schulz@free-electrons.com>
Date: Thu, 10 Aug 2017 09:40:21 +0200
Subject: [PATCH 24/82] mfd: axp20x: add regulator-userspace-consumer to mfd
 cells of AXP813

Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com>
---
 drivers/mfd/axp20x.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
index ac8da970bdfe..95f36a7e3cd4 100644
--- a/drivers/mfd/axp20x.c
+++ b/drivers/mfd/axp20x.c
@@ -24,6 +24,7 @@
 #include <linux/pm_runtime.h>
 #include <linux/regmap.h>
 #include <linux/regulator/consumer.h>
+#include <linux/regulator/userspace-consumer.h>
 #include <linux/mfd/axp20x.h>
 #include <linux/mfd/core.h>
 #include <linux/of_device.h>
@@ -771,6 +772,16 @@ static const struct mfd_cell axp809_cells[] = {
 	},
 };
 
+static struct regulator_bulk_data vcc_vb = {
+	.supply = "vcc-vb",
+};
+
+static struct regulator_userspace_consumer_data vcc_vb_data = {
+	.name = "vcc-vb",
+	.num_supplies = 1,
+	.supplies = &vcc_vb,
+};
+
 static const struct mfd_cell axp813_cells[] = {
 	{
 		.name		= "axp221-pek",
@@ -790,6 +801,10 @@ static const struct mfd_cell axp813_cells[] = {
 	}, {
 		.name			= "axp20x-usb-power-supply",
 		.of_compatible		= "x-powers,axp813-usb-power-supply",
+	}, {
+		.name			= "reg-userspace-consumer",
+		.platform_data		= &vcc_vb_data,
+		.pdata_size		= sizeof(vcc_vb_data),
 	}, {
 		.name		= "axp20x-ac-power-supply",
 		.of_compatible	= "x-powers,axp813-ac-power-supply",
-- 
2.20.1

