All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] regulator: 88pm800: Add 88pm860 regulator support
@ 2015-07-16 18:16 ` Vaibhav Hiremath
  0 siblings, 0 replies; 38+ messages in thread
From: Vaibhav Hiremath @ 2015-07-16 18:16 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: broonie, lgirdwood, sameo, lee.jones, linux-kernel, Vaibhav Hiremath

88PM860 falls under 88pm800 family of devices, with additional feature
enhancements, like,
  - 88pm860 had additional BUCK regulator (BUCK6 and BUCK1B)
  - Additional LDO (LDO20)
  - different voltage and current capability

This patch adds 88PM860 related buck/ldo voltage/current data to
the driver, and creates the regulator_desc table.

With addition of new device to the driver, couple of unavoidable
changes,

  - Fixes the code for indentation issue while defining data structures
  - Updated the driver to use devm_regulator_register() fn
  - The table gets referenced using regulator ID (PM800_ID_xxx),
    so table also needs to be created using ID.
  - The naming convention of voltage tables would no longer be
    mapped to respective ldos/bucks, so this patch also renames
    to more generic name.
  - And adds dual phase enable support based on max current constraint,
    resulting in supporting set_current_limit() call back.

V1 => V1:
=========
Please __note__ that, I am starting patch-series all over again, as
only one patch is getting carry-forwarded into this series. All other patches
are newly implemented and 1 patch got already merged to upstream.

Testing:
  - Boot tested on PXA1928 based platform, where all BUCK's and LDO's got
    registered successfully 
  - Verified that MMC driver is getting regulator successfully
  - Printed all LDO and BUCK resgiter before and after regulator registration,
    early boot and late boot, where based on consumer regulator is either enabled
    or disabled.

TODO:
  - Validation on 88PM800 device, looking for some help here, as I do
    not have any platform with 88PM800 device.


Vaibhav Hiremath (5):
  regulator: 88pm800: Fix indentation of assignments of data structures
  regulator: 88pm800: Update driver to use devm_regulator_register fn
  regulator: 88pm800: Use regulator_nodes/of_match in the descriptor
  regulator: 88pm800: Add 88pm860 regulator support
  regulator: 88pm800: Add support for configuration of dual phase on
    BUCK1

 drivers/regulator/88pm800.c | 339 +++++++++++++++++++++++---------------------
 include/linux/mfd/88pm80x.h |   6 +
 2 files changed, 184 insertions(+), 161 deletions(-)

-- 
1.9.1


^ permalink raw reply	[flat|nested] 38+ messages in thread

* [PATCH 0/5] regulator: 88pm800: Add 88pm860 regulator support
@ 2015-07-16 18:16 ` Vaibhav Hiremath
  0 siblings, 0 replies; 38+ messages in thread
From: Vaibhav Hiremath @ 2015-07-16 18:16 UTC (permalink / raw)
  To: linux-arm-kernel

88PM860 falls under 88pm800 family of devices, with additional feature
enhancements, like,
  - 88pm860 had additional BUCK regulator (BUCK6 and BUCK1B)
  - Additional LDO (LDO20)
  - different voltage and current capability

This patch adds 88PM860 related buck/ldo voltage/current data to
the driver, and creates the regulator_desc table.

With addition of new device to the driver, couple of unavoidable
changes,

  - Fixes the code for indentation issue while defining data structures
  - Updated the driver to use devm_regulator_register() fn
  - The table gets referenced using regulator ID (PM800_ID_xxx),
    so table also needs to be created using ID.
  - The naming convention of voltage tables would no longer be
    mapped to respective ldos/bucks, so this patch also renames
    to more generic name.
  - And adds dual phase enable support based on max current constraint,
    resulting in supporting set_current_limit() call back.

V1 => V1:
=========
Please __note__ that, I am starting patch-series all over again, as
only one patch is getting carry-forwarded into this series. All other patches
are newly implemented and 1 patch got already merged to upstream.

Testing:
  - Boot tested on PXA1928 based platform, where all BUCK's and LDO's got
    registered successfully 
  - Verified that MMC driver is getting regulator successfully
  - Printed all LDO and BUCK resgiter before and after regulator registration,
    early boot and late boot, where based on consumer regulator is either enabled
    or disabled.

TODO:
  - Validation on 88PM800 device, looking for some help here, as I do
    not have any platform with 88PM800 device.


Vaibhav Hiremath (5):
  regulator: 88pm800: Fix indentation of assignments of data structures
  regulator: 88pm800: Update driver to use devm_regulator_register fn
  regulator: 88pm800: Use regulator_nodes/of_match in the descriptor
  regulator: 88pm800: Add 88pm860 regulator support
  regulator: 88pm800: Add support for configuration of dual phase on
    BUCK1

 drivers/regulator/88pm800.c | 339 +++++++++++++++++++++++---------------------
 include/linux/mfd/88pm80x.h |   6 +
 2 files changed, 184 insertions(+), 161 deletions(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [PATCH 1/5] regulator: 88pm800: Fix indentation of assignments of data structures
  2015-07-16 18:16 ` Vaibhav Hiremath
@ 2015-07-16 18:16   ` Vaibhav Hiremath
  -1 siblings, 0 replies; 38+ messages in thread
From: Vaibhav Hiremath @ 2015-07-16 18:16 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: broonie, lgirdwood, sameo, lee.jones, linux-kernel, Vaibhav Hiremath

This patch makes code more clean from readability point of view,
make all assignments of LDO, BUCk and regulator_ops structure
at the same indentation.

Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
---
 drivers/regulator/88pm800.c | 68 ++++++++++++++++++++++-----------------------
 1 file changed, 34 insertions(+), 34 deletions(-)

diff --git a/drivers/regulator/88pm800.c b/drivers/regulator/88pm800.c
index 832932b..11f7ab2 100644
--- a/drivers/regulator/88pm800.c
+++ b/drivers/regulator/88pm800.c
@@ -95,11 +95,11 @@ struct pm800_regulators {
 #define PM800_BUCK(vreg, ereg, ebit, amax, volt_ranges, n_volt)		\
 {									\
 	.desc	= {							\
-		.name	= #vreg,					\
-		.ops	= &pm800_volt_range_ops,			\
-		.type	= REGULATOR_VOLTAGE,				\
-		.id	= PM800_ID_##vreg,				\
-		.owner	= THIS_MODULE,					\
+		.name			= #vreg,			\
+		.ops			= &pm800_volt_range_ops,	\
+		.type			= REGULATOR_VOLTAGE,		\
+		.id			= PM800_ID_##vreg,		\
+		.owner			= THIS_MODULE,			\
 		.n_voltages		= n_volt,			\
 		.linear_ranges		= volt_ranges,			\
 		.n_linear_ranges	= ARRAY_SIZE(volt_ranges),	\
@@ -108,7 +108,7 @@ struct pm800_regulators {
 		.enable_reg		= PM800_##ereg,			\
 		.enable_mask		= 1 << (ebit),			\
 	},								\
-	.max_ua		= (amax),					\
+	.max_ua	= (amax),						\
 }
 
 /*
@@ -123,19 +123,19 @@ struct pm800_regulators {
 #define PM800_LDO(vreg, ereg, ebit, amax, ldo_volt_table)		\
 {									\
 	.desc	= {							\
-		.name	= #vreg,					\
-		.ops	= &pm800_volt_table_ops,			\
-		.type	= REGULATOR_VOLTAGE,				\
-		.id	= PM800_ID_##vreg,				\
-		.owner	= THIS_MODULE,					\
-		.n_voltages = ARRAY_SIZE(ldo_volt_table),		\
-		.vsel_reg	= PM800_##vreg##_VOUT,			\
-		.vsel_mask	= 0x1f,					\
-		.enable_reg	= PM800_##ereg,				\
-		.enable_mask	= 1 << (ebit),				\
-		.volt_table	= ldo_volt_table,			\
+		.name			= #vreg,			\
+		.ops			= &pm800_volt_table_ops,	\
+		.type			= REGULATOR_VOLTAGE,		\
+		.id			= PM800_ID_##vreg,		\
+		.owner			= THIS_MODULE,			\
+		.n_voltages		= ARRAY_SIZE(ldo_volt_table),	\
+		.vsel_reg		= PM800_##vreg##_VOUT,		\
+		.vsel_mask		= 0x1f,				\
+		.enable_reg		= PM800_##ereg,			\
+		.enable_mask		= 1 << (ebit),			\
+		.volt_table		= ldo_volt_table,		\
 	},								\
-	.max_ua		= (amax),					\
+	.max_ua	= (amax),						\
 }
 
 /* Ranges are sorted in ascending order. */
@@ -178,25 +178,25 @@ static int pm800_get_current_limit(struct regulator_dev *rdev)
 }
 
 static struct regulator_ops pm800_volt_range_ops = {
-	.list_voltage = regulator_list_voltage_linear_range,
-	.map_voltage = regulator_map_voltage_linear_range,
-	.set_voltage_sel = regulator_set_voltage_sel_regmap,
-	.get_voltage_sel = regulator_get_voltage_sel_regmap,
-	.enable = regulator_enable_regmap,
-	.disable = regulator_disable_regmap,
-	.is_enabled = regulator_is_enabled_regmap,
-	.get_current_limit = pm800_get_current_limit,
+	.list_voltage		= regulator_list_voltage_linear_range,
+	.map_voltage		= regulator_map_voltage_linear_range,
+	.set_voltage_sel	= regulator_set_voltage_sel_regmap,
+	.get_voltage_sel	= regulator_get_voltage_sel_regmap,
+	.enable			= regulator_enable_regmap,
+	.disable		= regulator_disable_regmap,
+	.is_enabled		= regulator_is_enabled_regmap,
+	.get_current_limit	= pm800_get_current_limit,
 };
 
 static struct regulator_ops pm800_volt_table_ops = {
-	.list_voltage = regulator_list_voltage_table,
-	.map_voltage = regulator_map_voltage_iterate,
-	.set_voltage_sel = regulator_set_voltage_sel_regmap,
-	.get_voltage_sel = regulator_get_voltage_sel_regmap,
-	.enable = regulator_enable_regmap,
-	.disable = regulator_disable_regmap,
-	.is_enabled = regulator_is_enabled_regmap,
-	.get_current_limit = pm800_get_current_limit,
+	.list_voltage		= regulator_list_voltage_table,
+	.map_voltage		= regulator_map_voltage_iterate,
+	.set_voltage_sel	= regulator_set_voltage_sel_regmap,
+	.get_voltage_sel	= regulator_get_voltage_sel_regmap,
+	.enable			= regulator_enable_regmap,
+	.disable		= regulator_disable_regmap,
+	.is_enabled		= regulator_is_enabled_regmap,
+	.get_current_limit	= pm800_get_current_limit,
 };
 
 /* The array is indexed by id(PM800_ID_XXX) */
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH 1/5] regulator: 88pm800: Fix indentation of assignments of data structures
@ 2015-07-16 18:16   ` Vaibhav Hiremath
  0 siblings, 0 replies; 38+ messages in thread
From: Vaibhav Hiremath @ 2015-07-16 18:16 UTC (permalink / raw)
  To: linux-arm-kernel

This patch makes code more clean from readability point of view,
make all assignments of LDO, BUCk and regulator_ops structure
at the same indentation.

Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
---
 drivers/regulator/88pm800.c | 68 ++++++++++++++++++++++-----------------------
 1 file changed, 34 insertions(+), 34 deletions(-)

diff --git a/drivers/regulator/88pm800.c b/drivers/regulator/88pm800.c
index 832932b..11f7ab2 100644
--- a/drivers/regulator/88pm800.c
+++ b/drivers/regulator/88pm800.c
@@ -95,11 +95,11 @@ struct pm800_regulators {
 #define PM800_BUCK(vreg, ereg, ebit, amax, volt_ranges, n_volt)		\
 {									\
 	.desc	= {							\
-		.name	= #vreg,					\
-		.ops	= &pm800_volt_range_ops,			\
-		.type	= REGULATOR_VOLTAGE,				\
-		.id	= PM800_ID_##vreg,				\
-		.owner	= THIS_MODULE,					\
+		.name			= #vreg,			\
+		.ops			= &pm800_volt_range_ops,	\
+		.type			= REGULATOR_VOLTAGE,		\
+		.id			= PM800_ID_##vreg,		\
+		.owner			= THIS_MODULE,			\
 		.n_voltages		= n_volt,			\
 		.linear_ranges		= volt_ranges,			\
 		.n_linear_ranges	= ARRAY_SIZE(volt_ranges),	\
@@ -108,7 +108,7 @@ struct pm800_regulators {
 		.enable_reg		= PM800_##ereg,			\
 		.enable_mask		= 1 << (ebit),			\
 	},								\
-	.max_ua		= (amax),					\
+	.max_ua	= (amax),						\
 }
 
 /*
@@ -123,19 +123,19 @@ struct pm800_regulators {
 #define PM800_LDO(vreg, ereg, ebit, amax, ldo_volt_table)		\
 {									\
 	.desc	= {							\
-		.name	= #vreg,					\
-		.ops	= &pm800_volt_table_ops,			\
-		.type	= REGULATOR_VOLTAGE,				\
-		.id	= PM800_ID_##vreg,				\
-		.owner	= THIS_MODULE,					\
-		.n_voltages = ARRAY_SIZE(ldo_volt_table),		\
-		.vsel_reg	= PM800_##vreg##_VOUT,			\
-		.vsel_mask	= 0x1f,					\
-		.enable_reg	= PM800_##ereg,				\
-		.enable_mask	= 1 << (ebit),				\
-		.volt_table	= ldo_volt_table,			\
+		.name			= #vreg,			\
+		.ops			= &pm800_volt_table_ops,	\
+		.type			= REGULATOR_VOLTAGE,		\
+		.id			= PM800_ID_##vreg,		\
+		.owner			= THIS_MODULE,			\
+		.n_voltages		= ARRAY_SIZE(ldo_volt_table),	\
+		.vsel_reg		= PM800_##vreg##_VOUT,		\
+		.vsel_mask		= 0x1f,				\
+		.enable_reg		= PM800_##ereg,			\
+		.enable_mask		= 1 << (ebit),			\
+		.volt_table		= ldo_volt_table,		\
 	},								\
-	.max_ua		= (amax),					\
+	.max_ua	= (amax),						\
 }
 
 /* Ranges are sorted in ascending order. */
@@ -178,25 +178,25 @@ static int pm800_get_current_limit(struct regulator_dev *rdev)
 }
 
 static struct regulator_ops pm800_volt_range_ops = {
-	.list_voltage = regulator_list_voltage_linear_range,
-	.map_voltage = regulator_map_voltage_linear_range,
-	.set_voltage_sel = regulator_set_voltage_sel_regmap,
-	.get_voltage_sel = regulator_get_voltage_sel_regmap,
-	.enable = regulator_enable_regmap,
-	.disable = regulator_disable_regmap,
-	.is_enabled = regulator_is_enabled_regmap,
-	.get_current_limit = pm800_get_current_limit,
+	.list_voltage		= regulator_list_voltage_linear_range,
+	.map_voltage		= regulator_map_voltage_linear_range,
+	.set_voltage_sel	= regulator_set_voltage_sel_regmap,
+	.get_voltage_sel	= regulator_get_voltage_sel_regmap,
+	.enable			= regulator_enable_regmap,
+	.disable		= regulator_disable_regmap,
+	.is_enabled		= regulator_is_enabled_regmap,
+	.get_current_limit	= pm800_get_current_limit,
 };
 
 static struct regulator_ops pm800_volt_table_ops = {
-	.list_voltage = regulator_list_voltage_table,
-	.map_voltage = regulator_map_voltage_iterate,
-	.set_voltage_sel = regulator_set_voltage_sel_regmap,
-	.get_voltage_sel = regulator_get_voltage_sel_regmap,
-	.enable = regulator_enable_regmap,
-	.disable = regulator_disable_regmap,
-	.is_enabled = regulator_is_enabled_regmap,
-	.get_current_limit = pm800_get_current_limit,
+	.list_voltage		= regulator_list_voltage_table,
+	.map_voltage		= regulator_map_voltage_iterate,
+	.set_voltage_sel	= regulator_set_voltage_sel_regmap,
+	.get_voltage_sel	= regulator_get_voltage_sel_regmap,
+	.enable			= regulator_enable_regmap,
+	.disable		= regulator_disable_regmap,
+	.is_enabled		= regulator_is_enabled_regmap,
+	.get_current_limit	= pm800_get_current_limit,
 };
 
 /* The array is indexed by id(PM800_ID_XXX) */
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH 2/5] regulator: 88pm800: Update driver to use devm_regulator_register fn
  2015-07-16 18:16 ` Vaibhav Hiremath
@ 2015-07-16 18:16   ` Vaibhav Hiremath
  -1 siblings, 0 replies; 38+ messages in thread
From: Vaibhav Hiremath @ 2015-07-16 18:16 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: broonie, lgirdwood, sameo, lee.jones, linux-kernel, Vaibhav Hiremath

This patch replaces standard regulator_register with
devm_regulator_register() fn, as using devm_regulator_register() fn
simplifies the driver return/exit path.

As part of this update, patch also cleanups up all unnecessary changes
which is result of this patch -

  - Remove _remove() fn, as devm_ variant takes care of it.
  - Remove pm800_regulators.regulators[] field, as it was only
    needed during cleanup, so we no longer need this.
    This also saved some amount of memory.

Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
---
 drivers/regulator/88pm800.c | 27 ++++++---------------------
 1 file changed, 6 insertions(+), 21 deletions(-)

diff --git a/drivers/regulator/88pm800.c b/drivers/regulator/88pm800.c
index 11f7ab2..3b37170 100644
--- a/drivers/regulator/88pm800.c
+++ b/drivers/regulator/88pm800.c
@@ -78,7 +78,6 @@ struct pm800_regulator_info {
 };
 
 struct pm800_regulators {
-	struct regulator_dev *regulators[PM800_ID_RG_MAX];
 	struct pm80x_chip *chip;
 	struct regmap *map;
 };
@@ -318,6 +317,8 @@ static int pm800_regulator_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, pm800_data);
 
 	for (i = 0; i < PM800_ID_RG_MAX; i++) {
+		struct regulator_dev *regulator;
+
 		if (!pdata || pdata->num_regulators == 0)
 			init_data = pm800_regulator_matches[i].init_data;
 		else
@@ -331,16 +332,12 @@ static int pm800_regulator_probe(struct platform_device *pdev)
 		config.regmap = pm800_data->map;
 		config.of_node = pm800_regulator_matches[i].of_node;
 
-		pm800_data->regulators[i] =
-				regulator_register(&info->desc, &config);
-		if (IS_ERR(pm800_data->regulators[i])) {
-			ret = PTR_ERR(pm800_data->regulators[i]);
+		regulator = devm_regulator_register(&pdev->dev,
+					&info->desc, &config);
+		if (IS_ERR(regulator)) {
+			ret = PTR_ERR(regulator);
 			dev_err(&pdev->dev, "Failed to register %s\n",
 				info->desc.name);
-
-			while (--i >= 0)
-				regulator_unregister(pm800_data->regulators[i]);
-
 			return ret;
 		}
 	}
@@ -348,23 +345,11 @@ static int pm800_regulator_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int pm800_regulator_remove(struct platform_device *pdev)
-{
-	struct pm800_regulators *pm800_data = platform_get_drvdata(pdev);
-	int i;
-
-	for (i = 0; i < PM800_ID_RG_MAX; i++)
-		regulator_unregister(pm800_data->regulators[i]);
-
-	return 0;
-}
-
 static struct platform_driver pm800_regulator_driver = {
 	.driver		= {
 		.name	= "88pm80x-regulator",
 	},
 	.probe		= pm800_regulator_probe,
-	.remove		= pm800_regulator_remove,
 };
 
 module_platform_driver(pm800_regulator_driver);
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH 2/5] regulator: 88pm800: Update driver to use devm_regulator_register fn
@ 2015-07-16 18:16   ` Vaibhav Hiremath
  0 siblings, 0 replies; 38+ messages in thread
From: Vaibhav Hiremath @ 2015-07-16 18:16 UTC (permalink / raw)
  To: linux-arm-kernel

This patch replaces standard regulator_register with
devm_regulator_register() fn, as using devm_regulator_register() fn
simplifies the driver return/exit path.

As part of this update, patch also cleanups up all unnecessary changes
which is result of this patch -

  - Remove _remove() fn, as devm_ variant takes care of it.
  - Remove pm800_regulators.regulators[] field, as it was only
    needed during cleanup, so we no longer need this.
    This also saved some amount of memory.

Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
---
 drivers/regulator/88pm800.c | 27 ++++++---------------------
 1 file changed, 6 insertions(+), 21 deletions(-)

diff --git a/drivers/regulator/88pm800.c b/drivers/regulator/88pm800.c
index 11f7ab2..3b37170 100644
--- a/drivers/regulator/88pm800.c
+++ b/drivers/regulator/88pm800.c
@@ -78,7 +78,6 @@ struct pm800_regulator_info {
 };
 
 struct pm800_regulators {
-	struct regulator_dev *regulators[PM800_ID_RG_MAX];
 	struct pm80x_chip *chip;
 	struct regmap *map;
 };
@@ -318,6 +317,8 @@ static int pm800_regulator_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, pm800_data);
 
 	for (i = 0; i < PM800_ID_RG_MAX; i++) {
+		struct regulator_dev *regulator;
+
 		if (!pdata || pdata->num_regulators == 0)
 			init_data = pm800_regulator_matches[i].init_data;
 		else
@@ -331,16 +332,12 @@ static int pm800_regulator_probe(struct platform_device *pdev)
 		config.regmap = pm800_data->map;
 		config.of_node = pm800_regulator_matches[i].of_node;
 
-		pm800_data->regulators[i] =
-				regulator_register(&info->desc, &config);
-		if (IS_ERR(pm800_data->regulators[i])) {
-			ret = PTR_ERR(pm800_data->regulators[i]);
+		regulator = devm_regulator_register(&pdev->dev,
+					&info->desc, &config);
+		if (IS_ERR(regulator)) {
+			ret = PTR_ERR(regulator);
 			dev_err(&pdev->dev, "Failed to register %s\n",
 				info->desc.name);
-
-			while (--i >= 0)
-				regulator_unregister(pm800_data->regulators[i]);
-
 			return ret;
 		}
 	}
@@ -348,23 +345,11 @@ static int pm800_regulator_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int pm800_regulator_remove(struct platform_device *pdev)
-{
-	struct pm800_regulators *pm800_data = platform_get_drvdata(pdev);
-	int i;
-
-	for (i = 0; i < PM800_ID_RG_MAX; i++)
-		regulator_unregister(pm800_data->regulators[i]);
-
-	return 0;
-}
-
 static struct platform_driver pm800_regulator_driver = {
 	.driver		= {
 		.name	= "88pm80x-regulator",
 	},
 	.probe		= pm800_regulator_probe,
-	.remove		= pm800_regulator_remove,
 };
 
 module_platform_driver(pm800_regulator_driver);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH 3/5] regulator: 88pm800: Use regulator_nodes/of_match in the descriptor
  2015-07-16 18:16 ` Vaibhav Hiremath
@ 2015-07-16 18:16   ` Vaibhav Hiremath
  -1 siblings, 0 replies; 38+ messages in thread
From: Vaibhav Hiremath @ 2015-07-16 18:16 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: broonie, lgirdwood, sameo, lee.jones, linux-kernel, Vaibhav Hiremath

This patch is add regulator_nodes/of_match in the regulator
descriptor for using information from DT instead of specific codes.

With this patch, driver gets simplified,

  - No need to maintain "struct of_regulator_match" table
    and call of_regulator_match() fn.
  - No need for pm800_regulator_dt_init() fn, as it was only
    used for of_regulator_match().
  - probe() fn got simplified around regulator_config and regulator_desc
    initialization.

Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
---
 drivers/regulator/88pm800.c | 143 ++++++++++++++------------------------------
 1 file changed, 44 insertions(+), 99 deletions(-)

diff --git a/drivers/regulator/88pm800.c b/drivers/regulator/88pm800.c
index 3b37170..26c277f 100644
--- a/drivers/regulator/88pm800.c
+++ b/drivers/regulator/88pm800.c
@@ -91,10 +91,12 @@ struct pm800_regulators {
  * not the constant voltage table.
  * n_volt - Number of available selectors
  */
-#define PM800_BUCK(vreg, ereg, ebit, amax, volt_ranges, n_volt)		\
+#define PM800_BUCK(match, vreg, ereg, ebit, amax, volt_ranges, n_volt)	\
 {									\
 	.desc	= {							\
 		.name			= #vreg,			\
+		.of_match		= of_match_ptr(#match),		\
+		.regulators_node	= of_match_ptr("regulators"),	\
 		.ops			= &pm800_volt_range_ops,	\
 		.type			= REGULATOR_VOLTAGE,		\
 		.id			= PM800_ID_##vreg,		\
@@ -119,10 +121,12 @@ struct pm800_regulators {
  * For all the LDOes, there are too many ranges. Using volt_table will be
  * simpler and faster.
  */
-#define PM800_LDO(vreg, ereg, ebit, amax, ldo_volt_table)		\
+#define PM800_LDO(match, vreg, ereg, ebit, amax, ldo_volt_table)	\
 {									\
 	.desc	= {							\
 		.name			= #vreg,			\
+		.of_match		= of_match_ptr(#match),		\
+		.regulators_node	= of_match_ptr("regulators"),	\
 		.ops			= &pm800_volt_table_ops,	\
 		.type			= REGULATOR_VOLTAGE,		\
 		.id			= PM800_ID_##vreg,		\
@@ -200,99 +204,43 @@ static struct regulator_ops pm800_volt_table_ops = {
 
 /* The array is indexed by id(PM800_ID_XXX) */
 static struct pm800_regulator_info pm800_regulator_info[] = {
-	PM800_BUCK(BUCK1, BUCK_ENA, 0, 3000000, buck1_volt_range, 0x55),
-	PM800_BUCK(BUCK2, BUCK_ENA, 1, 1200000, buck2_5_volt_range, 0x73),
-	PM800_BUCK(BUCK3, BUCK_ENA, 2, 1200000, buck2_5_volt_range, 0x73),
-	PM800_BUCK(BUCK4, BUCK_ENA, 3, 1200000, buck2_5_volt_range, 0x73),
-	PM800_BUCK(BUCK5, BUCK_ENA, 4, 1200000, buck2_5_volt_range, 0x73),
-
-	PM800_LDO(LDO1, LDO_ENA1_1, 0, 200000, ldo1_volt_table),
-	PM800_LDO(LDO2, LDO_ENA1_1, 1, 10000, ldo2_volt_table),
-	PM800_LDO(LDO3, LDO_ENA1_1, 2, 300000, ldo3_17_volt_table),
-	PM800_LDO(LDO4, LDO_ENA1_1, 3, 300000, ldo3_17_volt_table),
-	PM800_LDO(LDO5, LDO_ENA1_1, 4, 300000, ldo3_17_volt_table),
-	PM800_LDO(LDO6, LDO_ENA1_1, 5, 300000, ldo3_17_volt_table),
-	PM800_LDO(LDO7, LDO_ENA1_1, 6, 300000, ldo3_17_volt_table),
-	PM800_LDO(LDO8, LDO_ENA1_1, 7, 300000, ldo3_17_volt_table),
-	PM800_LDO(LDO9, LDO_ENA1_2, 0, 300000, ldo3_17_volt_table),
-	PM800_LDO(LDO10, LDO_ENA1_2, 1, 300000, ldo3_17_volt_table),
-	PM800_LDO(LDO11, LDO_ENA1_2, 2, 300000, ldo3_17_volt_table),
-	PM800_LDO(LDO12, LDO_ENA1_2, 3, 300000, ldo3_17_volt_table),
-	PM800_LDO(LDO13, LDO_ENA1_2, 4, 300000, ldo3_17_volt_table),
-	PM800_LDO(LDO14, LDO_ENA1_2, 5, 300000, ldo3_17_volt_table),
-	PM800_LDO(LDO15, LDO_ENA1_2, 6, 300000, ldo3_17_volt_table),
-	PM800_LDO(LDO16, LDO_ENA1_2, 7, 300000, ldo3_17_volt_table),
-	PM800_LDO(LDO17, LDO_ENA1_3, 0, 300000, ldo3_17_volt_table),
-	PM800_LDO(LDO18, LDO_ENA1_3, 1, 200000, ldo18_19_volt_table),
-	PM800_LDO(LDO19, LDO_ENA1_3, 2, 200000, ldo18_19_volt_table),
+	PM800_BUCK(buck1, BUCK1, BUCK_ENA, 0, 3000000, buck1_volt_range, 0x55),
+	PM800_BUCK(buck2, BUCK2, BUCK_ENA, 1, 1200000, buck2_5_volt_range, 0x73),
+	PM800_BUCK(buck3, BUCK3, BUCK_ENA, 2, 1200000, buck2_5_volt_range, 0x73),
+	PM800_BUCK(buck4, BUCK4, BUCK_ENA, 3, 1200000, buck2_5_volt_range, 0x73),
+	PM800_BUCK(buck5, BUCK5, BUCK_ENA, 4, 1200000, buck2_5_volt_range, 0x73),
+
+	PM800_LDO(ldo1, LDO1, LDO_ENA1_1, 0, 200000, ldo1_volt_table),
+	PM800_LDO(ldo2, LDO2, LDO_ENA1_1, 1, 10000, ldo2_volt_table),
+	PM800_LDO(ldo3, LDO3, LDO_ENA1_1, 2, 300000, ldo3_17_volt_table),
+	PM800_LDO(ldo4, LDO4, LDO_ENA1_1, 3, 300000, ldo3_17_volt_table),
+	PM800_LDO(ldo5, LDO5, LDO_ENA1_1, 4, 300000, ldo3_17_volt_table),
+	PM800_LDO(ldo6, LDO6, LDO_ENA1_1, 5, 300000, ldo3_17_volt_table),
+	PM800_LDO(ldo7, LDO7, LDO_ENA1_1, 6, 300000, ldo3_17_volt_table),
+	PM800_LDO(ldo8, LDO8, LDO_ENA1_1, 7, 300000, ldo3_17_volt_table),
+	PM800_LDO(ldo9, LDO9, LDO_ENA1_2, 0, 300000, ldo3_17_volt_table),
+	PM800_LDO(ldo10, LDO10, LDO_ENA1_2, 1, 300000, ldo3_17_volt_table),
+	PM800_LDO(ldo11, LDO11, LDO_ENA1_2, 2, 300000, ldo3_17_volt_table),
+	PM800_LDO(ldo12, LDO12, LDO_ENA1_2, 3, 300000, ldo3_17_volt_table),
+	PM800_LDO(ldo13, LDO13, LDO_ENA1_2, 4, 300000, ldo3_17_volt_table),
+	PM800_LDO(ldo14, LDO14, LDO_ENA1_2, 5, 300000, ldo3_17_volt_table),
+	PM800_LDO(ldo15, LDO15, LDO_ENA1_2, 6, 300000, ldo3_17_volt_table),
+	PM800_LDO(ldo16, LDO16, LDO_ENA1_2, 7, 300000, ldo3_17_volt_table),
+	PM800_LDO(ldo17, LDO17, LDO_ENA1_3, 0, 300000, ldo3_17_volt_table),
+	PM800_LDO(ldo18, LDO18, LDO_ENA1_3, 1, 200000, ldo18_19_volt_table),
+	PM800_LDO(ldo19, LDO19, LDO_ENA1_3, 2, 200000, ldo18_19_volt_table),
 };
 
-#define PM800_REGULATOR_OF_MATCH(_name, _id)				\
-	[PM800_ID_##_id] = {						\
-		.name = #_name,						\
-		.driver_data = &pm800_regulator_info[PM800_ID_##_id],	\
-	}
-
-static struct of_regulator_match pm800_regulator_matches[] = {
-	PM800_REGULATOR_OF_MATCH(buck1, BUCK1),
-	PM800_REGULATOR_OF_MATCH(buck2, BUCK2),
-	PM800_REGULATOR_OF_MATCH(buck3, BUCK3),
-	PM800_REGULATOR_OF_MATCH(buck4, BUCK4),
-	PM800_REGULATOR_OF_MATCH(buck5, BUCK5),
-	PM800_REGULATOR_OF_MATCH(ldo1, LDO1),
-	PM800_REGULATOR_OF_MATCH(ldo2, LDO2),
-	PM800_REGULATOR_OF_MATCH(ldo3, LDO3),
-	PM800_REGULATOR_OF_MATCH(ldo4, LDO4),
-	PM800_REGULATOR_OF_MATCH(ldo5, LDO5),
-	PM800_REGULATOR_OF_MATCH(ldo6, LDO6),
-	PM800_REGULATOR_OF_MATCH(ldo7, LDO7),
-	PM800_REGULATOR_OF_MATCH(ldo8, LDO8),
-	PM800_REGULATOR_OF_MATCH(ldo9, LDO9),
-	PM800_REGULATOR_OF_MATCH(ldo10, LDO10),
-	PM800_REGULATOR_OF_MATCH(ldo11, LDO11),
-	PM800_REGULATOR_OF_MATCH(ldo12, LDO12),
-	PM800_REGULATOR_OF_MATCH(ldo13, LDO13),
-	PM800_REGULATOR_OF_MATCH(ldo14, LDO14),
-	PM800_REGULATOR_OF_MATCH(ldo15, LDO15),
-	PM800_REGULATOR_OF_MATCH(ldo16, LDO16),
-	PM800_REGULATOR_OF_MATCH(ldo17, LDO17),
-	PM800_REGULATOR_OF_MATCH(ldo18, LDO18),
-	PM800_REGULATOR_OF_MATCH(ldo19, LDO19),
-};
-
-static int pm800_regulator_dt_init(struct platform_device *pdev)
-{
-	struct device_node *np = pdev->dev.of_node;
-	int ret;
-
-	ret = of_regulator_match(&pdev->dev, np,
-				 pm800_regulator_matches,
-				 ARRAY_SIZE(pm800_regulator_matches));
-	if (ret < 0)
-		return ret;
-
-	return 0;
-}
-
 static int pm800_regulator_probe(struct platform_device *pdev)
 {
 	struct pm80x_chip *chip = dev_get_drvdata(pdev->dev.parent);
 	struct pm80x_platform_data *pdata = dev_get_platdata(pdev->dev.parent);
 	struct pm800_regulators *pm800_data;
-	struct pm800_regulator_info *info;
 	struct regulator_config config = { };
 	struct regulator_init_data *init_data;
 	int i, ret;
 
-	if (!pdata || pdata->num_regulators == 0) {
-		if (IS_ENABLED(CONFIG_OF)) {
-			ret = pm800_regulator_dt_init(pdev);
-			if (ret)
-				return ret;
-		} else {
-			return -ENODEV;
-		}
-	} else if (pdata->num_regulators) {
+	if (pdata && pdata->num_regulators) {
 		unsigned int count = 0;
 
 		/* Check whether num_regulator is valid. */
@@ -302,8 +250,6 @@ static int pm800_regulator_probe(struct platform_device *pdev)
 		}
 		if (count != pdata->num_regulators)
 			return -EINVAL;
-	} else {
-		return -EINVAL;
 	}
 
 	pm800_data = devm_kzalloc(&pdev->dev, sizeof(*pm800_data),
@@ -316,28 +262,27 @@ static int pm800_regulator_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, pm800_data);
 
+	config.dev = chip->dev;
+	config.regmap = pm800_data->map;
 	for (i = 0; i < PM800_ID_RG_MAX; i++) {
 		struct regulator_dev *regulator;
 
-		if (!pdata || pdata->num_regulators == 0)
-			init_data = pm800_regulator_matches[i].init_data;
-		else
+		if (pdata && pdata->num_regulators) {
 			init_data = pdata->regulators[i];
-		if (!init_data)
-			continue;
-		info = pm800_regulator_matches[i].driver_data;
-		config.dev = &pdev->dev;
-		config.init_data = init_data;
-		config.driver_data = info;
-		config.regmap = pm800_data->map;
-		config.of_node = pm800_regulator_matches[i].of_node;
+			if (!init_data)
+				continue;
+
+			config.init_data = init_data;
+		}
+
+		config.driver_data = &pm800_regulator_info[i];
 
 		regulator = devm_regulator_register(&pdev->dev,
-					&info->desc, &config);
+				&pm800_regulator_info[i].desc, &config);
 		if (IS_ERR(regulator)) {
 			ret = PTR_ERR(regulator);
 			dev_err(&pdev->dev, "Failed to register %s\n",
-				info->desc.name);
+					pm800_regulator_info[i].desc.name);
 			return ret;
 		}
 	}
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH 3/5] regulator: 88pm800: Use regulator_nodes/of_match in the descriptor
@ 2015-07-16 18:16   ` Vaibhav Hiremath
  0 siblings, 0 replies; 38+ messages in thread
From: Vaibhav Hiremath @ 2015-07-16 18:16 UTC (permalink / raw)
  To: linux-arm-kernel

This patch is add regulator_nodes/of_match in the regulator
descriptor for using information from DT instead of specific codes.

With this patch, driver gets simplified,

  - No need to maintain "struct of_regulator_match" table
    and call of_regulator_match() fn.
  - No need for pm800_regulator_dt_init() fn, as it was only
    used for of_regulator_match().
  - probe() fn got simplified around regulator_config and regulator_desc
    initialization.

Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
---
 drivers/regulator/88pm800.c | 143 ++++++++++++++------------------------------
 1 file changed, 44 insertions(+), 99 deletions(-)

diff --git a/drivers/regulator/88pm800.c b/drivers/regulator/88pm800.c
index 3b37170..26c277f 100644
--- a/drivers/regulator/88pm800.c
+++ b/drivers/regulator/88pm800.c
@@ -91,10 +91,12 @@ struct pm800_regulators {
  * not the constant voltage table.
  * n_volt - Number of available selectors
  */
-#define PM800_BUCK(vreg, ereg, ebit, amax, volt_ranges, n_volt)		\
+#define PM800_BUCK(match, vreg, ereg, ebit, amax, volt_ranges, n_volt)	\
 {									\
 	.desc	= {							\
 		.name			= #vreg,			\
+		.of_match		= of_match_ptr(#match),		\
+		.regulators_node	= of_match_ptr("regulators"),	\
 		.ops			= &pm800_volt_range_ops,	\
 		.type			= REGULATOR_VOLTAGE,		\
 		.id			= PM800_ID_##vreg,		\
@@ -119,10 +121,12 @@ struct pm800_regulators {
  * For all the LDOes, there are too many ranges. Using volt_table will be
  * simpler and faster.
  */
-#define PM800_LDO(vreg, ereg, ebit, amax, ldo_volt_table)		\
+#define PM800_LDO(match, vreg, ereg, ebit, amax, ldo_volt_table)	\
 {									\
 	.desc	= {							\
 		.name			= #vreg,			\
+		.of_match		= of_match_ptr(#match),		\
+		.regulators_node	= of_match_ptr("regulators"),	\
 		.ops			= &pm800_volt_table_ops,	\
 		.type			= REGULATOR_VOLTAGE,		\
 		.id			= PM800_ID_##vreg,		\
@@ -200,99 +204,43 @@ static struct regulator_ops pm800_volt_table_ops = {
 
 /* The array is indexed by id(PM800_ID_XXX) */
 static struct pm800_regulator_info pm800_regulator_info[] = {
-	PM800_BUCK(BUCK1, BUCK_ENA, 0, 3000000, buck1_volt_range, 0x55),
-	PM800_BUCK(BUCK2, BUCK_ENA, 1, 1200000, buck2_5_volt_range, 0x73),
-	PM800_BUCK(BUCK3, BUCK_ENA, 2, 1200000, buck2_5_volt_range, 0x73),
-	PM800_BUCK(BUCK4, BUCK_ENA, 3, 1200000, buck2_5_volt_range, 0x73),
-	PM800_BUCK(BUCK5, BUCK_ENA, 4, 1200000, buck2_5_volt_range, 0x73),
-
-	PM800_LDO(LDO1, LDO_ENA1_1, 0, 200000, ldo1_volt_table),
-	PM800_LDO(LDO2, LDO_ENA1_1, 1, 10000, ldo2_volt_table),
-	PM800_LDO(LDO3, LDO_ENA1_1, 2, 300000, ldo3_17_volt_table),
-	PM800_LDO(LDO4, LDO_ENA1_1, 3, 300000, ldo3_17_volt_table),
-	PM800_LDO(LDO5, LDO_ENA1_1, 4, 300000, ldo3_17_volt_table),
-	PM800_LDO(LDO6, LDO_ENA1_1, 5, 300000, ldo3_17_volt_table),
-	PM800_LDO(LDO7, LDO_ENA1_1, 6, 300000, ldo3_17_volt_table),
-	PM800_LDO(LDO8, LDO_ENA1_1, 7, 300000, ldo3_17_volt_table),
-	PM800_LDO(LDO9, LDO_ENA1_2, 0, 300000, ldo3_17_volt_table),
-	PM800_LDO(LDO10, LDO_ENA1_2, 1, 300000, ldo3_17_volt_table),
-	PM800_LDO(LDO11, LDO_ENA1_2, 2, 300000, ldo3_17_volt_table),
-	PM800_LDO(LDO12, LDO_ENA1_2, 3, 300000, ldo3_17_volt_table),
-	PM800_LDO(LDO13, LDO_ENA1_2, 4, 300000, ldo3_17_volt_table),
-	PM800_LDO(LDO14, LDO_ENA1_2, 5, 300000, ldo3_17_volt_table),
-	PM800_LDO(LDO15, LDO_ENA1_2, 6, 300000, ldo3_17_volt_table),
-	PM800_LDO(LDO16, LDO_ENA1_2, 7, 300000, ldo3_17_volt_table),
-	PM800_LDO(LDO17, LDO_ENA1_3, 0, 300000, ldo3_17_volt_table),
-	PM800_LDO(LDO18, LDO_ENA1_3, 1, 200000, ldo18_19_volt_table),
-	PM800_LDO(LDO19, LDO_ENA1_3, 2, 200000, ldo18_19_volt_table),
+	PM800_BUCK(buck1, BUCK1, BUCK_ENA, 0, 3000000, buck1_volt_range, 0x55),
+	PM800_BUCK(buck2, BUCK2, BUCK_ENA, 1, 1200000, buck2_5_volt_range, 0x73),
+	PM800_BUCK(buck3, BUCK3, BUCK_ENA, 2, 1200000, buck2_5_volt_range, 0x73),
+	PM800_BUCK(buck4, BUCK4, BUCK_ENA, 3, 1200000, buck2_5_volt_range, 0x73),
+	PM800_BUCK(buck5, BUCK5, BUCK_ENA, 4, 1200000, buck2_5_volt_range, 0x73),
+
+	PM800_LDO(ldo1, LDO1, LDO_ENA1_1, 0, 200000, ldo1_volt_table),
+	PM800_LDO(ldo2, LDO2, LDO_ENA1_1, 1, 10000, ldo2_volt_table),
+	PM800_LDO(ldo3, LDO3, LDO_ENA1_1, 2, 300000, ldo3_17_volt_table),
+	PM800_LDO(ldo4, LDO4, LDO_ENA1_1, 3, 300000, ldo3_17_volt_table),
+	PM800_LDO(ldo5, LDO5, LDO_ENA1_1, 4, 300000, ldo3_17_volt_table),
+	PM800_LDO(ldo6, LDO6, LDO_ENA1_1, 5, 300000, ldo3_17_volt_table),
+	PM800_LDO(ldo7, LDO7, LDO_ENA1_1, 6, 300000, ldo3_17_volt_table),
+	PM800_LDO(ldo8, LDO8, LDO_ENA1_1, 7, 300000, ldo3_17_volt_table),
+	PM800_LDO(ldo9, LDO9, LDO_ENA1_2, 0, 300000, ldo3_17_volt_table),
+	PM800_LDO(ldo10, LDO10, LDO_ENA1_2, 1, 300000, ldo3_17_volt_table),
+	PM800_LDO(ldo11, LDO11, LDO_ENA1_2, 2, 300000, ldo3_17_volt_table),
+	PM800_LDO(ldo12, LDO12, LDO_ENA1_2, 3, 300000, ldo3_17_volt_table),
+	PM800_LDO(ldo13, LDO13, LDO_ENA1_2, 4, 300000, ldo3_17_volt_table),
+	PM800_LDO(ldo14, LDO14, LDO_ENA1_2, 5, 300000, ldo3_17_volt_table),
+	PM800_LDO(ldo15, LDO15, LDO_ENA1_2, 6, 300000, ldo3_17_volt_table),
+	PM800_LDO(ldo16, LDO16, LDO_ENA1_2, 7, 300000, ldo3_17_volt_table),
+	PM800_LDO(ldo17, LDO17, LDO_ENA1_3, 0, 300000, ldo3_17_volt_table),
+	PM800_LDO(ldo18, LDO18, LDO_ENA1_3, 1, 200000, ldo18_19_volt_table),
+	PM800_LDO(ldo19, LDO19, LDO_ENA1_3, 2, 200000, ldo18_19_volt_table),
 };
 
-#define PM800_REGULATOR_OF_MATCH(_name, _id)				\
-	[PM800_ID_##_id] = {						\
-		.name = #_name,						\
-		.driver_data = &pm800_regulator_info[PM800_ID_##_id],	\
-	}
-
-static struct of_regulator_match pm800_regulator_matches[] = {
-	PM800_REGULATOR_OF_MATCH(buck1, BUCK1),
-	PM800_REGULATOR_OF_MATCH(buck2, BUCK2),
-	PM800_REGULATOR_OF_MATCH(buck3, BUCK3),
-	PM800_REGULATOR_OF_MATCH(buck4, BUCK4),
-	PM800_REGULATOR_OF_MATCH(buck5, BUCK5),
-	PM800_REGULATOR_OF_MATCH(ldo1, LDO1),
-	PM800_REGULATOR_OF_MATCH(ldo2, LDO2),
-	PM800_REGULATOR_OF_MATCH(ldo3, LDO3),
-	PM800_REGULATOR_OF_MATCH(ldo4, LDO4),
-	PM800_REGULATOR_OF_MATCH(ldo5, LDO5),
-	PM800_REGULATOR_OF_MATCH(ldo6, LDO6),
-	PM800_REGULATOR_OF_MATCH(ldo7, LDO7),
-	PM800_REGULATOR_OF_MATCH(ldo8, LDO8),
-	PM800_REGULATOR_OF_MATCH(ldo9, LDO9),
-	PM800_REGULATOR_OF_MATCH(ldo10, LDO10),
-	PM800_REGULATOR_OF_MATCH(ldo11, LDO11),
-	PM800_REGULATOR_OF_MATCH(ldo12, LDO12),
-	PM800_REGULATOR_OF_MATCH(ldo13, LDO13),
-	PM800_REGULATOR_OF_MATCH(ldo14, LDO14),
-	PM800_REGULATOR_OF_MATCH(ldo15, LDO15),
-	PM800_REGULATOR_OF_MATCH(ldo16, LDO16),
-	PM800_REGULATOR_OF_MATCH(ldo17, LDO17),
-	PM800_REGULATOR_OF_MATCH(ldo18, LDO18),
-	PM800_REGULATOR_OF_MATCH(ldo19, LDO19),
-};
-
-static int pm800_regulator_dt_init(struct platform_device *pdev)
-{
-	struct device_node *np = pdev->dev.of_node;
-	int ret;
-
-	ret = of_regulator_match(&pdev->dev, np,
-				 pm800_regulator_matches,
-				 ARRAY_SIZE(pm800_regulator_matches));
-	if (ret < 0)
-		return ret;
-
-	return 0;
-}
-
 static int pm800_regulator_probe(struct platform_device *pdev)
 {
 	struct pm80x_chip *chip = dev_get_drvdata(pdev->dev.parent);
 	struct pm80x_platform_data *pdata = dev_get_platdata(pdev->dev.parent);
 	struct pm800_regulators *pm800_data;
-	struct pm800_regulator_info *info;
 	struct regulator_config config = { };
 	struct regulator_init_data *init_data;
 	int i, ret;
 
-	if (!pdata || pdata->num_regulators == 0) {
-		if (IS_ENABLED(CONFIG_OF)) {
-			ret = pm800_regulator_dt_init(pdev);
-			if (ret)
-				return ret;
-		} else {
-			return -ENODEV;
-		}
-	} else if (pdata->num_regulators) {
+	if (pdata && pdata->num_regulators) {
 		unsigned int count = 0;
 
 		/* Check whether num_regulator is valid. */
@@ -302,8 +250,6 @@ static int pm800_regulator_probe(struct platform_device *pdev)
 		}
 		if (count != pdata->num_regulators)
 			return -EINVAL;
-	} else {
-		return -EINVAL;
 	}
 
 	pm800_data = devm_kzalloc(&pdev->dev, sizeof(*pm800_data),
@@ -316,28 +262,27 @@ static int pm800_regulator_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, pm800_data);
 
+	config.dev = chip->dev;
+	config.regmap = pm800_data->map;
 	for (i = 0; i < PM800_ID_RG_MAX; i++) {
 		struct regulator_dev *regulator;
 
-		if (!pdata || pdata->num_regulators == 0)
-			init_data = pm800_regulator_matches[i].init_data;
-		else
+		if (pdata && pdata->num_regulators) {
 			init_data = pdata->regulators[i];
-		if (!init_data)
-			continue;
-		info = pm800_regulator_matches[i].driver_data;
-		config.dev = &pdev->dev;
-		config.init_data = init_data;
-		config.driver_data = info;
-		config.regmap = pm800_data->map;
-		config.of_node = pm800_regulator_matches[i].of_node;
+			if (!init_data)
+				continue;
+
+			config.init_data = init_data;
+		}
+
+		config.driver_data = &pm800_regulator_info[i];
 
 		regulator = devm_regulator_register(&pdev->dev,
-					&info->desc, &config);
+				&pm800_regulator_info[i].desc, &config);
 		if (IS_ERR(regulator)) {
 			ret = PTR_ERR(regulator);
 			dev_err(&pdev->dev, "Failed to register %s\n",
-				info->desc.name);
+					pm800_regulator_info[i].desc.name);
 			return ret;
 		}
 	}
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH 4/5] regulator: 88pm800: Add 88pm860 regulator support
  2015-07-16 18:16 ` Vaibhav Hiremath
@ 2015-07-16 18:16   ` Vaibhav Hiremath
  -1 siblings, 0 replies; 38+ messages in thread
From: Vaibhav Hiremath @ 2015-07-16 18:16 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: broonie, lgirdwood, sameo, lee.jones, linux-kernel, Vaibhav Hiremath

88PM860 falls under 88pm800 family of devices, with
additional feature enhancements, like,
  - 88pm860 had additional BUCK regulator (BUCK6 and BUCK1B)
  - Additional LDO (LDO20)
  - different voltage and current capability

This patch adds 88PM860 related buck/ldo voltage/current data to
the driver, and creates the regulator_desc table.

With addition of new device to the driver, couple of unavoidable
changes,

  - The table gets referenced using regulator ID (PM800_ID_xxx),
    so table also needs to be created using ID.

   - The naming convention of voltage tables would no longer be
     mapped to respective ldos/bucks, so this patch also renames
     to more generic name.

TODO:
  - Validation on 88PM800 device, looking for some help here, as I do
    not have any platform with 88PM800 device.

Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
---
 drivers/regulator/88pm800.c | 125 ++++++++++++++++++++++++++++++--------------
 include/linux/mfd/88pm80x.h |   3 ++
 2 files changed, 90 insertions(+), 38 deletions(-)

diff --git a/drivers/regulator/88pm800.c b/drivers/regulator/88pm800.c
index 26c277f..e846e4c 100644
--- a/drivers/regulator/88pm800.c
+++ b/drivers/regulator/88pm800.c
@@ -44,6 +44,7 @@
 #define PM800_LDO17_VOUT	(0x1A)
 #define PM800_LDO18_VOUT	(0x1B)
 #define PM800_LDO19_VOUT	(0x1C)
+#define PM800_LDO20_VOUT	(0x1D)
 
 /* BUCK1 with DVC[0..3] */
 #define PM800_BUCK1		(0x3C)
@@ -57,6 +58,8 @@
 #define PM800_BUCK4_2		(0x44)
 #define PM800_BUCK4_3		(0x45)
 #define PM800_BUCK5		(0x46)
+#define PM800_BUCK6		(0x4A)
+#define PM800_BUCK1B		(0x4B)
 
 #define PM800_BUCK_ENA		(0x50)
 #define PM800_LDO_ENA1_1	(0x51)
@@ -92,7 +95,7 @@ struct pm800_regulators {
  * n_volt - Number of available selectors
  */
 #define PM800_BUCK(match, vreg, ereg, ebit, amax, volt_ranges, n_volt)	\
-{									\
+[PM800_ID_##vreg] = {							\
 	.desc	= {							\
 		.name			= #vreg,			\
 		.of_match		= of_match_ptr(#match),		\
@@ -122,7 +125,7 @@ struct pm800_regulators {
  * simpler and faster.
  */
 #define PM800_LDO(match, vreg, ereg, ebit, amax, ldo_volt_table)	\
-{									\
+[PM800_ID_##vreg] = {							\
 	.desc	= {							\
 		.name			= #vreg,			\
 		.of_match		= of_match_ptr(#match),		\
@@ -142,34 +145,36 @@ struct pm800_regulators {
 }
 
 /* Ranges are sorted in ascending order. */
-static const struct regulator_linear_range buck1_volt_range[] = {
+static const struct regulator_linear_range buck_volt_range1[] = {
 	REGULATOR_LINEAR_RANGE(600000, 0, 0x4f, 12500),
 	REGULATOR_LINEAR_RANGE(1600000, 0x50, 0x54, 50000),
 };
 
 /* BUCK 2~5 have same ranges. */
-static const struct regulator_linear_range buck2_5_volt_range[] = {
+static const struct regulator_linear_range buck_volt_range2[] = {
 	REGULATOR_LINEAR_RANGE(600000, 0, 0x4f, 12500),
 	REGULATOR_LINEAR_RANGE(1600000, 0x50, 0x72, 50000),
 };
 
-static const unsigned int ldo1_volt_table[] = {
+/* 88pm800: LDO1, 88pm860: LDO19  */
+static const unsigned int ldo_volt_table1[] = {
 	600000,  650000,  700000,  750000,  800000,  850000,  900000,  950000,
 	1000000, 1050000, 1100000, 1150000, 1200000, 1300000, 1400000, 1500000,
 };
 
-static const unsigned int ldo2_volt_table[] = {
+/* 88pm800: LDO2, 88pm860: LDO20 */
+static const unsigned int ldo_volt_table2[] = {
 	1700000, 1800000, 1900000, 2000000, 2100000, 2500000, 2700000, 2800000,
 };
 
-/* LDO 3~17 have same voltage table. */
-static const unsigned int ldo3_17_volt_table[] = {
+/* 88pm800: LDO 3~17, 88pm860: LDO 4~18 */
+static const unsigned int ldo_volt_table3[] = {
 	1200000, 1250000, 1700000, 1800000, 1850000, 1900000, 2500000, 2600000,
 	2700000, 2750000, 2800000, 2850000, 2900000, 3000000, 3100000, 3300000,
 };
 
-/* LDO 18~19 have same voltage table. */
-static const unsigned int ldo18_19_volt_table[] = {
+/* LDO 18~19, 88pm860: 1~3 */
+static const unsigned int ldo_volt_table4[] = {
 	1700000, 1800000, 1900000, 2500000, 2800000, 2900000, 3100000, 3300000,
 };
 
@@ -204,31 +209,62 @@ static struct regulator_ops pm800_volt_table_ops = {
 
 /* The array is indexed by id(PM800_ID_XXX) */
 static struct pm800_regulator_info pm800_regulator_info[] = {
-	PM800_BUCK(buck1, BUCK1, BUCK_ENA, 0, 3000000, buck1_volt_range, 0x55),
-	PM800_BUCK(buck2, BUCK2, BUCK_ENA, 1, 1200000, buck2_5_volt_range, 0x73),
-	PM800_BUCK(buck3, BUCK3, BUCK_ENA, 2, 1200000, buck2_5_volt_range, 0x73),
-	PM800_BUCK(buck4, BUCK4, BUCK_ENA, 3, 1200000, buck2_5_volt_range, 0x73),
-	PM800_BUCK(buck5, BUCK5, BUCK_ENA, 4, 1200000, buck2_5_volt_range, 0x73),
-
-	PM800_LDO(ldo1, LDO1, LDO_ENA1_1, 0, 200000, ldo1_volt_table),
-	PM800_LDO(ldo2, LDO2, LDO_ENA1_1, 1, 10000, ldo2_volt_table),
-	PM800_LDO(ldo3, LDO3, LDO_ENA1_1, 2, 300000, ldo3_17_volt_table),
-	PM800_LDO(ldo4, LDO4, LDO_ENA1_1, 3, 300000, ldo3_17_volt_table),
-	PM800_LDO(ldo5, LDO5, LDO_ENA1_1, 4, 300000, ldo3_17_volt_table),
-	PM800_LDO(ldo6, LDO6, LDO_ENA1_1, 5, 300000, ldo3_17_volt_table),
-	PM800_LDO(ldo7, LDO7, LDO_ENA1_1, 6, 300000, ldo3_17_volt_table),
-	PM800_LDO(ldo8, LDO8, LDO_ENA1_1, 7, 300000, ldo3_17_volt_table),
-	PM800_LDO(ldo9, LDO9, LDO_ENA1_2, 0, 300000, ldo3_17_volt_table),
-	PM800_LDO(ldo10, LDO10, LDO_ENA1_2, 1, 300000, ldo3_17_volt_table),
-	PM800_LDO(ldo11, LDO11, LDO_ENA1_2, 2, 300000, ldo3_17_volt_table),
-	PM800_LDO(ldo12, LDO12, LDO_ENA1_2, 3, 300000, ldo3_17_volt_table),
-	PM800_LDO(ldo13, LDO13, LDO_ENA1_2, 4, 300000, ldo3_17_volt_table),
-	PM800_LDO(ldo14, LDO14, LDO_ENA1_2, 5, 300000, ldo3_17_volt_table),
-	PM800_LDO(ldo15, LDO15, LDO_ENA1_2, 6, 300000, ldo3_17_volt_table),
-	PM800_LDO(ldo16, LDO16, LDO_ENA1_2, 7, 300000, ldo3_17_volt_table),
-	PM800_LDO(ldo17, LDO17, LDO_ENA1_3, 0, 300000, ldo3_17_volt_table),
-	PM800_LDO(ldo18, LDO18, LDO_ENA1_3, 1, 200000, ldo18_19_volt_table),
-	PM800_LDO(ldo19, LDO19, LDO_ENA1_3, 2, 200000, ldo18_19_volt_table),
+	PM800_BUCK(buck1, BUCK1, BUCK_ENA, 0, 3000000, buck_volt_range1, 0x55),
+	PM800_BUCK(buck2, BUCK2, BUCK_ENA, 1, 1200000, buck_volt_range2, 0x73),
+	PM800_BUCK(buck3, BUCK3, BUCK_ENA, 2, 1200000, buck_volt_range2, 0x73),
+	PM800_BUCK(buck4, BUCK4, BUCK_ENA, 3, 1200000, buck_volt_range2, 0x73),
+	PM800_BUCK(buck5, BUCK5, BUCK_ENA, 4, 1200000, buck_volt_range2, 0x73),
+
+	PM800_LDO(ldo1, LDO1, LDO_ENA1_1, 0, 200000, ldo_volt_table1),
+	PM800_LDO(ldo2, LDO2, LDO_ENA1_1, 1, 10000, ldo_volt_table2),
+	PM800_LDO(ldo3, LDO3, LDO_ENA1_1, 2, 300000, ldo_volt_table3),
+	PM800_LDO(ldo4, LDO4, LDO_ENA1_1, 3, 300000, ldo_volt_table3),
+	PM800_LDO(ldo5, LDO5, LDO_ENA1_1, 4, 300000, ldo_volt_table3),
+	PM800_LDO(ldo6, LDO6, LDO_ENA1_1, 5, 300000, ldo_volt_table3),
+	PM800_LDO(ldo7, LDO7, LDO_ENA1_1, 6, 300000, ldo_volt_table3),
+	PM800_LDO(ldo8, LDO8, LDO_ENA1_1, 7, 300000, ldo_volt_table3),
+	PM800_LDO(ldo9, LDO9, LDO_ENA1_2, 0, 300000, ldo_volt_table3),
+	PM800_LDO(ldo10, LDO10, LDO_ENA1_2, 1, 300000, ldo_volt_table3),
+	PM800_LDO(ldo11, LDO11, LDO_ENA1_2, 2, 300000, ldo_volt_table3),
+	PM800_LDO(ldo12, LDO12, LDO_ENA1_2, 3, 300000, ldo_volt_table3),
+	PM800_LDO(ldo13, LDO13, LDO_ENA1_2, 4, 300000, ldo_volt_table3),
+	PM800_LDO(ldo14, LDO14, LDO_ENA1_2, 5, 300000, ldo_volt_table3),
+	PM800_LDO(ldo15, LDO15, LDO_ENA1_2, 6, 300000, ldo_volt_table3),
+	PM800_LDO(ldo16, LDO16, LDO_ENA1_2, 7, 300000, ldo_volt_table3),
+	PM800_LDO(ldo17, LDO17, LDO_ENA1_3, 0, 300000, ldo_volt_table3),
+	PM800_LDO(ldo18, LDO18, LDO_ENA1_3, 1, 200000, ldo_volt_table4),
+	PM800_LDO(ldo19, LDO19, LDO_ENA1_3, 2, 200000, ldo_volt_table4),
+};
+
+static struct pm800_regulator_info pm860_regulator_info[] = {
+	PM800_BUCK(buck1, BUCK1, BUCK_ENA, 0, 3000000, buck_volt_range1, 0x55),
+	PM800_BUCK(buck2, BUCK2, BUCK_ENA, 1, 750000, buck_volt_range2, 0x73),
+	PM800_BUCK(buck3, BUCK3, BUCK_ENA, 2, 1500000, buck_volt_range2, 0x73),
+	PM800_BUCK(buck4, BUCK4, BUCK_ENA, 3, 750000, buck_volt_range2, 0x73),
+	PM800_BUCK(buck5, BUCK5, BUCK_ENA, 4, 1500000, buck_volt_range2, 0x73),
+	PM800_BUCK(buck6, BUCK6, BUCK_ENA, 5, 800000, buck_volt_range2, 0x73),
+	PM800_BUCK(buck1b, BUCK1B, BUCK_ENA, 6, 3000000, buck_volt_range2, 0x55),
+
+	PM800_LDO(ldo1, LDO1, LDO_ENA1_1, 0, 100000, ldo_volt_table4),
+	PM800_LDO(ldo2, LDO2, LDO_ENA1_1, 1, 100000, ldo_volt_table4),
+	PM800_LDO(ldo3, LDO3, LDO_ENA1_1, 2, 100000, ldo_volt_table4),
+	PM800_LDO(ldo4, LDO4, LDO_ENA1_1, 3, 400000, ldo_volt_table3),
+	PM800_LDO(ldo5, LDO5, LDO_ENA1_1, 4, 400000, ldo_volt_table3),
+	PM800_LDO(ldo6, LDO6, LDO_ENA1_1, 5, 400000, ldo_volt_table3),
+	PM800_LDO(ldo7, LDO7, LDO_ENA1_1, 6, 400000, ldo_volt_table3),
+	PM800_LDO(ldo8, LDO8, LDO_ENA1_1, 7, 400000, ldo_volt_table3),
+	PM800_LDO(ldo9, LDO9, LDO_ENA1_2, 0, 400000, ldo_volt_table3),
+	PM800_LDO(ldo10, LDO10, LDO_ENA1_2, 1, 200000, ldo_volt_table3),
+	PM800_LDO(ldo11, LDO11, LDO_ENA1_2, 2, 200000, ldo_volt_table3),
+	PM800_LDO(ldo12, LDO12, LDO_ENA1_2, 3, 200000, ldo_volt_table3),
+	PM800_LDO(ldo13, LDO13, LDO_ENA1_2, 4, 200000, ldo_volt_table3),
+	PM800_LDO(ldo14, LDO14, LDO_ENA1_2, 5, 200000, ldo_volt_table3),
+	PM800_LDO(ldo15, LDO15, LDO_ENA1_2, 6, 200000, ldo_volt_table3),
+	PM800_LDO(ldo16, LDO16, LDO_ENA1_2, 7, 200000, ldo_volt_table3),
+	PM800_LDO(ldo17, LDO17, LDO_ENA1_3, 0, 200000, ldo_volt_table3),
+	PM800_LDO(ldo18, LDO18, LDO_ENA1_3, 1, 200000, ldo_volt_table3),
+	PM800_LDO(ldo19, LDO19, LDO_ENA1_3, 2, 400000, ldo_volt_table1),
+	PM800_LDO(ldo20, LDO20, LDO_ENA1_3, 3, 10000, ldo_volt_table2),
 };
 
 static int pm800_regulator_probe(struct platform_device *pdev)
@@ -238,6 +274,7 @@ static int pm800_regulator_probe(struct platform_device *pdev)
 	struct pm800_regulators *pm800_data;
 	struct regulator_config config = { };
 	struct regulator_init_data *init_data;
+	struct pm800_regulator_info *info = NULL;
 	int i, ret;
 
 	if (pdata && pdata->num_regulators) {
@@ -262,6 +299,18 @@ static int pm800_regulator_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, pm800_data);
 
+	switch (chip->type) {
+	case CHIP_PM800:
+	case CHIP_PM805:
+		info = pm800_regulator_info;
+		break;
+	case CHIP_PM860:
+		info = pm860_regulator_info;
+		break;
+	default:
+		return -ENODEV;
+	}
+
 	config.dev = chip->dev;
 	config.regmap = pm800_data->map;
 	for (i = 0; i < PM800_ID_RG_MAX; i++) {
@@ -275,14 +324,14 @@ static int pm800_regulator_probe(struct platform_device *pdev)
 			config.init_data = init_data;
 		}
 
-		config.driver_data = &pm800_regulator_info[i];
+		config.driver_data = &info[i];
 
 		regulator = devm_regulator_register(&pdev->dev,
-				&pm800_regulator_info[i].desc, &config);
+				&info[i].desc, &config);
 		if (IS_ERR(regulator)) {
 			ret = PTR_ERR(regulator);
 			dev_err(&pdev->dev, "Failed to register %s\n",
-					pm800_regulator_info[i].desc.name);
+					info[i].desc.name);
 			return ret;
 		}
 	}
diff --git a/include/linux/mfd/88pm80x.h b/include/linux/mfd/88pm80x.h
index 2ef62af..a92d173 100644
--- a/include/linux/mfd/88pm80x.h
+++ b/include/linux/mfd/88pm80x.h
@@ -31,6 +31,8 @@ enum {
 	PM800_ID_BUCK3,
 	PM800_ID_BUCK4,
 	PM800_ID_BUCK5,
+	PM800_ID_BUCK6,
+	PM800_ID_BUCK1B,
 
 	PM800_ID_LDO1,
 	PM800_ID_LDO2,
@@ -51,6 +53,7 @@ enum {
 	PM800_ID_LDO17,
 	PM800_ID_LDO18,
 	PM800_ID_LDO19,
+	PM800_ID_LDO20,
 
 	PM800_ID_RG_MAX,
 };
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH 4/5] regulator: 88pm800: Add 88pm860 regulator support
@ 2015-07-16 18:16   ` Vaibhav Hiremath
  0 siblings, 0 replies; 38+ messages in thread
From: Vaibhav Hiremath @ 2015-07-16 18:16 UTC (permalink / raw)
  To: linux-arm-kernel

88PM860 falls under 88pm800 family of devices, with
additional feature enhancements, like,
  - 88pm860 had additional BUCK regulator (BUCK6 and BUCK1B)
  - Additional LDO (LDO20)
  - different voltage and current capability

This patch adds 88PM860 related buck/ldo voltage/current data to
the driver, and creates the regulator_desc table.

With addition of new device to the driver, couple of unavoidable
changes,

  - The table gets referenced using regulator ID (PM800_ID_xxx),
    so table also needs to be created using ID.

   - The naming convention of voltage tables would no longer be
     mapped to respective ldos/bucks, so this patch also renames
     to more generic name.

TODO:
  - Validation on 88PM800 device, looking for some help here, as I do
    not have any platform with 88PM800 device.

Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
---
 drivers/regulator/88pm800.c | 125 ++++++++++++++++++++++++++++++--------------
 include/linux/mfd/88pm80x.h |   3 ++
 2 files changed, 90 insertions(+), 38 deletions(-)

diff --git a/drivers/regulator/88pm800.c b/drivers/regulator/88pm800.c
index 26c277f..e846e4c 100644
--- a/drivers/regulator/88pm800.c
+++ b/drivers/regulator/88pm800.c
@@ -44,6 +44,7 @@
 #define PM800_LDO17_VOUT	(0x1A)
 #define PM800_LDO18_VOUT	(0x1B)
 #define PM800_LDO19_VOUT	(0x1C)
+#define PM800_LDO20_VOUT	(0x1D)
 
 /* BUCK1 with DVC[0..3] */
 #define PM800_BUCK1		(0x3C)
@@ -57,6 +58,8 @@
 #define PM800_BUCK4_2		(0x44)
 #define PM800_BUCK4_3		(0x45)
 #define PM800_BUCK5		(0x46)
+#define PM800_BUCK6		(0x4A)
+#define PM800_BUCK1B		(0x4B)
 
 #define PM800_BUCK_ENA		(0x50)
 #define PM800_LDO_ENA1_1	(0x51)
@@ -92,7 +95,7 @@ struct pm800_regulators {
  * n_volt - Number of available selectors
  */
 #define PM800_BUCK(match, vreg, ereg, ebit, amax, volt_ranges, n_volt)	\
-{									\
+[PM800_ID_##vreg] = {							\
 	.desc	= {							\
 		.name			= #vreg,			\
 		.of_match		= of_match_ptr(#match),		\
@@ -122,7 +125,7 @@ struct pm800_regulators {
  * simpler and faster.
  */
 #define PM800_LDO(match, vreg, ereg, ebit, amax, ldo_volt_table)	\
-{									\
+[PM800_ID_##vreg] = {							\
 	.desc	= {							\
 		.name			= #vreg,			\
 		.of_match		= of_match_ptr(#match),		\
@@ -142,34 +145,36 @@ struct pm800_regulators {
 }
 
 /* Ranges are sorted in ascending order. */
-static const struct regulator_linear_range buck1_volt_range[] = {
+static const struct regulator_linear_range buck_volt_range1[] = {
 	REGULATOR_LINEAR_RANGE(600000, 0, 0x4f, 12500),
 	REGULATOR_LINEAR_RANGE(1600000, 0x50, 0x54, 50000),
 };
 
 /* BUCK 2~5 have same ranges. */
-static const struct regulator_linear_range buck2_5_volt_range[] = {
+static const struct regulator_linear_range buck_volt_range2[] = {
 	REGULATOR_LINEAR_RANGE(600000, 0, 0x4f, 12500),
 	REGULATOR_LINEAR_RANGE(1600000, 0x50, 0x72, 50000),
 };
 
-static const unsigned int ldo1_volt_table[] = {
+/* 88pm800: LDO1, 88pm860: LDO19  */
+static const unsigned int ldo_volt_table1[] = {
 	600000,  650000,  700000,  750000,  800000,  850000,  900000,  950000,
 	1000000, 1050000, 1100000, 1150000, 1200000, 1300000, 1400000, 1500000,
 };
 
-static const unsigned int ldo2_volt_table[] = {
+/* 88pm800: LDO2, 88pm860: LDO20 */
+static const unsigned int ldo_volt_table2[] = {
 	1700000, 1800000, 1900000, 2000000, 2100000, 2500000, 2700000, 2800000,
 };
 
-/* LDO 3~17 have same voltage table. */
-static const unsigned int ldo3_17_volt_table[] = {
+/* 88pm800: LDO 3~17, 88pm860: LDO 4~18 */
+static const unsigned int ldo_volt_table3[] = {
 	1200000, 1250000, 1700000, 1800000, 1850000, 1900000, 2500000, 2600000,
 	2700000, 2750000, 2800000, 2850000, 2900000, 3000000, 3100000, 3300000,
 };
 
-/* LDO 18~19 have same voltage table. */
-static const unsigned int ldo18_19_volt_table[] = {
+/* LDO 18~19, 88pm860: 1~3 */
+static const unsigned int ldo_volt_table4[] = {
 	1700000, 1800000, 1900000, 2500000, 2800000, 2900000, 3100000, 3300000,
 };
 
@@ -204,31 +209,62 @@ static struct regulator_ops pm800_volt_table_ops = {
 
 /* The array is indexed by id(PM800_ID_XXX) */
 static struct pm800_regulator_info pm800_regulator_info[] = {
-	PM800_BUCK(buck1, BUCK1, BUCK_ENA, 0, 3000000, buck1_volt_range, 0x55),
-	PM800_BUCK(buck2, BUCK2, BUCK_ENA, 1, 1200000, buck2_5_volt_range, 0x73),
-	PM800_BUCK(buck3, BUCK3, BUCK_ENA, 2, 1200000, buck2_5_volt_range, 0x73),
-	PM800_BUCK(buck4, BUCK4, BUCK_ENA, 3, 1200000, buck2_5_volt_range, 0x73),
-	PM800_BUCK(buck5, BUCK5, BUCK_ENA, 4, 1200000, buck2_5_volt_range, 0x73),
-
-	PM800_LDO(ldo1, LDO1, LDO_ENA1_1, 0, 200000, ldo1_volt_table),
-	PM800_LDO(ldo2, LDO2, LDO_ENA1_1, 1, 10000, ldo2_volt_table),
-	PM800_LDO(ldo3, LDO3, LDO_ENA1_1, 2, 300000, ldo3_17_volt_table),
-	PM800_LDO(ldo4, LDO4, LDO_ENA1_1, 3, 300000, ldo3_17_volt_table),
-	PM800_LDO(ldo5, LDO5, LDO_ENA1_1, 4, 300000, ldo3_17_volt_table),
-	PM800_LDO(ldo6, LDO6, LDO_ENA1_1, 5, 300000, ldo3_17_volt_table),
-	PM800_LDO(ldo7, LDO7, LDO_ENA1_1, 6, 300000, ldo3_17_volt_table),
-	PM800_LDO(ldo8, LDO8, LDO_ENA1_1, 7, 300000, ldo3_17_volt_table),
-	PM800_LDO(ldo9, LDO9, LDO_ENA1_2, 0, 300000, ldo3_17_volt_table),
-	PM800_LDO(ldo10, LDO10, LDO_ENA1_2, 1, 300000, ldo3_17_volt_table),
-	PM800_LDO(ldo11, LDO11, LDO_ENA1_2, 2, 300000, ldo3_17_volt_table),
-	PM800_LDO(ldo12, LDO12, LDO_ENA1_2, 3, 300000, ldo3_17_volt_table),
-	PM800_LDO(ldo13, LDO13, LDO_ENA1_2, 4, 300000, ldo3_17_volt_table),
-	PM800_LDO(ldo14, LDO14, LDO_ENA1_2, 5, 300000, ldo3_17_volt_table),
-	PM800_LDO(ldo15, LDO15, LDO_ENA1_2, 6, 300000, ldo3_17_volt_table),
-	PM800_LDO(ldo16, LDO16, LDO_ENA1_2, 7, 300000, ldo3_17_volt_table),
-	PM800_LDO(ldo17, LDO17, LDO_ENA1_3, 0, 300000, ldo3_17_volt_table),
-	PM800_LDO(ldo18, LDO18, LDO_ENA1_3, 1, 200000, ldo18_19_volt_table),
-	PM800_LDO(ldo19, LDO19, LDO_ENA1_3, 2, 200000, ldo18_19_volt_table),
+	PM800_BUCK(buck1, BUCK1, BUCK_ENA, 0, 3000000, buck_volt_range1, 0x55),
+	PM800_BUCK(buck2, BUCK2, BUCK_ENA, 1, 1200000, buck_volt_range2, 0x73),
+	PM800_BUCK(buck3, BUCK3, BUCK_ENA, 2, 1200000, buck_volt_range2, 0x73),
+	PM800_BUCK(buck4, BUCK4, BUCK_ENA, 3, 1200000, buck_volt_range2, 0x73),
+	PM800_BUCK(buck5, BUCK5, BUCK_ENA, 4, 1200000, buck_volt_range2, 0x73),
+
+	PM800_LDO(ldo1, LDO1, LDO_ENA1_1, 0, 200000, ldo_volt_table1),
+	PM800_LDO(ldo2, LDO2, LDO_ENA1_1, 1, 10000, ldo_volt_table2),
+	PM800_LDO(ldo3, LDO3, LDO_ENA1_1, 2, 300000, ldo_volt_table3),
+	PM800_LDO(ldo4, LDO4, LDO_ENA1_1, 3, 300000, ldo_volt_table3),
+	PM800_LDO(ldo5, LDO5, LDO_ENA1_1, 4, 300000, ldo_volt_table3),
+	PM800_LDO(ldo6, LDO6, LDO_ENA1_1, 5, 300000, ldo_volt_table3),
+	PM800_LDO(ldo7, LDO7, LDO_ENA1_1, 6, 300000, ldo_volt_table3),
+	PM800_LDO(ldo8, LDO8, LDO_ENA1_1, 7, 300000, ldo_volt_table3),
+	PM800_LDO(ldo9, LDO9, LDO_ENA1_2, 0, 300000, ldo_volt_table3),
+	PM800_LDO(ldo10, LDO10, LDO_ENA1_2, 1, 300000, ldo_volt_table3),
+	PM800_LDO(ldo11, LDO11, LDO_ENA1_2, 2, 300000, ldo_volt_table3),
+	PM800_LDO(ldo12, LDO12, LDO_ENA1_2, 3, 300000, ldo_volt_table3),
+	PM800_LDO(ldo13, LDO13, LDO_ENA1_2, 4, 300000, ldo_volt_table3),
+	PM800_LDO(ldo14, LDO14, LDO_ENA1_2, 5, 300000, ldo_volt_table3),
+	PM800_LDO(ldo15, LDO15, LDO_ENA1_2, 6, 300000, ldo_volt_table3),
+	PM800_LDO(ldo16, LDO16, LDO_ENA1_2, 7, 300000, ldo_volt_table3),
+	PM800_LDO(ldo17, LDO17, LDO_ENA1_3, 0, 300000, ldo_volt_table3),
+	PM800_LDO(ldo18, LDO18, LDO_ENA1_3, 1, 200000, ldo_volt_table4),
+	PM800_LDO(ldo19, LDO19, LDO_ENA1_3, 2, 200000, ldo_volt_table4),
+};
+
+static struct pm800_regulator_info pm860_regulator_info[] = {
+	PM800_BUCK(buck1, BUCK1, BUCK_ENA, 0, 3000000, buck_volt_range1, 0x55),
+	PM800_BUCK(buck2, BUCK2, BUCK_ENA, 1, 750000, buck_volt_range2, 0x73),
+	PM800_BUCK(buck3, BUCK3, BUCK_ENA, 2, 1500000, buck_volt_range2, 0x73),
+	PM800_BUCK(buck4, BUCK4, BUCK_ENA, 3, 750000, buck_volt_range2, 0x73),
+	PM800_BUCK(buck5, BUCK5, BUCK_ENA, 4, 1500000, buck_volt_range2, 0x73),
+	PM800_BUCK(buck6, BUCK6, BUCK_ENA, 5, 800000, buck_volt_range2, 0x73),
+	PM800_BUCK(buck1b, BUCK1B, BUCK_ENA, 6, 3000000, buck_volt_range2, 0x55),
+
+	PM800_LDO(ldo1, LDO1, LDO_ENA1_1, 0, 100000, ldo_volt_table4),
+	PM800_LDO(ldo2, LDO2, LDO_ENA1_1, 1, 100000, ldo_volt_table4),
+	PM800_LDO(ldo3, LDO3, LDO_ENA1_1, 2, 100000, ldo_volt_table4),
+	PM800_LDO(ldo4, LDO4, LDO_ENA1_1, 3, 400000, ldo_volt_table3),
+	PM800_LDO(ldo5, LDO5, LDO_ENA1_1, 4, 400000, ldo_volt_table3),
+	PM800_LDO(ldo6, LDO6, LDO_ENA1_1, 5, 400000, ldo_volt_table3),
+	PM800_LDO(ldo7, LDO7, LDO_ENA1_1, 6, 400000, ldo_volt_table3),
+	PM800_LDO(ldo8, LDO8, LDO_ENA1_1, 7, 400000, ldo_volt_table3),
+	PM800_LDO(ldo9, LDO9, LDO_ENA1_2, 0, 400000, ldo_volt_table3),
+	PM800_LDO(ldo10, LDO10, LDO_ENA1_2, 1, 200000, ldo_volt_table3),
+	PM800_LDO(ldo11, LDO11, LDO_ENA1_2, 2, 200000, ldo_volt_table3),
+	PM800_LDO(ldo12, LDO12, LDO_ENA1_2, 3, 200000, ldo_volt_table3),
+	PM800_LDO(ldo13, LDO13, LDO_ENA1_2, 4, 200000, ldo_volt_table3),
+	PM800_LDO(ldo14, LDO14, LDO_ENA1_2, 5, 200000, ldo_volt_table3),
+	PM800_LDO(ldo15, LDO15, LDO_ENA1_2, 6, 200000, ldo_volt_table3),
+	PM800_LDO(ldo16, LDO16, LDO_ENA1_2, 7, 200000, ldo_volt_table3),
+	PM800_LDO(ldo17, LDO17, LDO_ENA1_3, 0, 200000, ldo_volt_table3),
+	PM800_LDO(ldo18, LDO18, LDO_ENA1_3, 1, 200000, ldo_volt_table3),
+	PM800_LDO(ldo19, LDO19, LDO_ENA1_3, 2, 400000, ldo_volt_table1),
+	PM800_LDO(ldo20, LDO20, LDO_ENA1_3, 3, 10000, ldo_volt_table2),
 };
 
 static int pm800_regulator_probe(struct platform_device *pdev)
@@ -238,6 +274,7 @@ static int pm800_regulator_probe(struct platform_device *pdev)
 	struct pm800_regulators *pm800_data;
 	struct regulator_config config = { };
 	struct regulator_init_data *init_data;
+	struct pm800_regulator_info *info = NULL;
 	int i, ret;
 
 	if (pdata && pdata->num_regulators) {
@@ -262,6 +299,18 @@ static int pm800_regulator_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, pm800_data);
 
+	switch (chip->type) {
+	case CHIP_PM800:
+	case CHIP_PM805:
+		info = pm800_regulator_info;
+		break;
+	case CHIP_PM860:
+		info = pm860_regulator_info;
+		break;
+	default:
+		return -ENODEV;
+	}
+
 	config.dev = chip->dev;
 	config.regmap = pm800_data->map;
 	for (i = 0; i < PM800_ID_RG_MAX; i++) {
@@ -275,14 +324,14 @@ static int pm800_regulator_probe(struct platform_device *pdev)
 			config.init_data = init_data;
 		}
 
-		config.driver_data = &pm800_regulator_info[i];
+		config.driver_data = &info[i];
 
 		regulator = devm_regulator_register(&pdev->dev,
-				&pm800_regulator_info[i].desc, &config);
+				&info[i].desc, &config);
 		if (IS_ERR(regulator)) {
 			ret = PTR_ERR(regulator);
 			dev_err(&pdev->dev, "Failed to register %s\n",
-					pm800_regulator_info[i].desc.name);
+					info[i].desc.name);
 			return ret;
 		}
 	}
diff --git a/include/linux/mfd/88pm80x.h b/include/linux/mfd/88pm80x.h
index 2ef62af..a92d173 100644
--- a/include/linux/mfd/88pm80x.h
+++ b/include/linux/mfd/88pm80x.h
@@ -31,6 +31,8 @@ enum {
 	PM800_ID_BUCK3,
 	PM800_ID_BUCK4,
 	PM800_ID_BUCK5,
+	PM800_ID_BUCK6,
+	PM800_ID_BUCK1B,
 
 	PM800_ID_LDO1,
 	PM800_ID_LDO2,
@@ -51,6 +53,7 @@ enum {
 	PM800_ID_LDO17,
 	PM800_ID_LDO18,
 	PM800_ID_LDO19,
+	PM800_ID_LDO20,
 
 	PM800_ID_RG_MAX,
 };
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH 5/5] regulator: 88pm800: Add support for configuration of dual phase on BUCK1
  2015-07-16 18:16 ` Vaibhav Hiremath
@ 2015-07-16 18:16   ` Vaibhav Hiremath
  -1 siblings, 0 replies; 38+ messages in thread
From: Vaibhav Hiremath @ 2015-07-16 18:16 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: broonie, lgirdwood, sameo, lee.jones, linux-kernel, Vaibhav Hiremath

88PM860 device supports dual phase mode on BUCK1 output.
In normal usecase, BUCK1A and BUCK1B operates independently with 3A
capacity. And they both can work as a dual phase providing 6A capacity.

This patch adds support for regulator_ops.set_current_limit() callback fn,
in turn enabling support for current min and max supply constraint on BUCK1
(and optionally on BUCK1B). Based on that driver enables dual-phase mode.

Note that, if max current supply constraint is > 3A on BUCK1(A) then driver
enables the dual-phase mode, irrespective of BUCK1B constraint.

Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
---
 drivers/regulator/88pm800.c | 38 ++++++++++++++++++++++++++++++++++++++
 include/linux/mfd/88pm80x.h |  3 +++
 2 files changed, 41 insertions(+)

diff --git a/drivers/regulator/88pm800.c b/drivers/regulator/88pm800.c
index e846e4c..1da18fa 100644
--- a/drivers/regulator/88pm800.c
+++ b/drivers/regulator/88pm800.c
@@ -185,6 +185,43 @@ static int pm800_get_current_limit(struct regulator_dev *rdev)
 	return info->max_ua;
 }
 
+/*
+ * 88pm860 device supports dual-phase mode on BUCK1, where BUCK1A and BUCK1B can
+ * be used together to supply 6A current.  Note that, independently, they can
+ * source 3A each.
+ *
+ * So, this function checks for max_uA for BUCK1 (only), and if it is more than
+ * 3A, then enable dual-phase mode.
+ */
+static int pm800_set_current_limit(struct regulator_dev *rdev,
+				int min_uA, int max_uA)
+{
+	struct pm800_regulators *pm800_data =
+				dev_get_drvdata(rdev_get_dev(rdev)->parent);
+	struct pm80x_chip *chip = pm800_data->chip;
+	int ret;
+
+	/* Currently only supported on 88pm860 device */
+	if (chip->type != CHIP_PM860)
+		return 0;
+
+	if (rdev->desc->id == PM800_ID_BUCK1) {
+		/* If max_uA is greater that 3A, enable dual-phase on BUCK1 */
+		if (max_uA > 3000000) {
+			ret = regmap_update_bits(chip->subchip->regmap_power,
+					PM860_BUCK1_MISC,
+					BUCK1_DUAL_PHASE_SEL,
+					BUCK1_DUAL_PHASE_SEL);
+			if (ret) {
+				dev_err(chip->dev, "failed to access registers\n");
+				return ret;
+			}
+		}
+	}
+
+	return 0;
+}
+
 static struct regulator_ops pm800_volt_range_ops = {
 	.list_voltage		= regulator_list_voltage_linear_range,
 	.map_voltage		= regulator_map_voltage_linear_range,
@@ -194,6 +231,7 @@ static struct regulator_ops pm800_volt_range_ops = {
 	.disable		= regulator_disable_regmap,
 	.is_enabled		= regulator_is_enabled_regmap,
 	.get_current_limit	= pm800_get_current_limit,
+	.set_current_limit	= pm800_set_current_limit,
 };
 
 static struct regulator_ops pm800_volt_table_ops = {
diff --git a/include/linux/mfd/88pm80x.h b/include/linux/mfd/88pm80x.h
index a92d173..05d9bad 100644
--- a/include/linux/mfd/88pm80x.h
+++ b/include/linux/mfd/88pm80x.h
@@ -295,6 +295,9 @@ enum {
 #define PM860_BUCK4_MISC2		(0x82)
 #define PM860_BUCK4_FULL_DRV		BIT(2)
 
+#define PM860_BUCK1_MISC		(0x8E)
+#define BUCK1_DUAL_PHASE_SEL		BIT(2)
+
 struct pm80x_rtc_pdata {
 	int		vrtc;
 	int		rtc_wakeup;
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH 5/5] regulator: 88pm800: Add support for configuration of dual phase on BUCK1
@ 2015-07-16 18:16   ` Vaibhav Hiremath
  0 siblings, 0 replies; 38+ messages in thread
From: Vaibhav Hiremath @ 2015-07-16 18:16 UTC (permalink / raw)
  To: linux-arm-kernel

88PM860 device supports dual phase mode on BUCK1 output.
In normal usecase, BUCK1A and BUCK1B operates independently with 3A
capacity. And they both can work as a dual phase providing 6A capacity.

This patch adds support for regulator_ops.set_current_limit() callback fn,
in turn enabling support for current min and max supply constraint on BUCK1
(and optionally on BUCK1B). Based on that driver enables dual-phase mode.

Note that, if max current supply constraint is > 3A on BUCK1(A) then driver
enables the dual-phase mode, irrespective of BUCK1B constraint.

Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
---
 drivers/regulator/88pm800.c | 38 ++++++++++++++++++++++++++++++++++++++
 include/linux/mfd/88pm80x.h |  3 +++
 2 files changed, 41 insertions(+)

diff --git a/drivers/regulator/88pm800.c b/drivers/regulator/88pm800.c
index e846e4c..1da18fa 100644
--- a/drivers/regulator/88pm800.c
+++ b/drivers/regulator/88pm800.c
@@ -185,6 +185,43 @@ static int pm800_get_current_limit(struct regulator_dev *rdev)
 	return info->max_ua;
 }
 
+/*
+ * 88pm860 device supports dual-phase mode on BUCK1, where BUCK1A and BUCK1B can
+ * be used together to supply 6A current.  Note that, independently, they can
+ * source 3A each.
+ *
+ * So, this function checks for max_uA for BUCK1 (only), and if it is more than
+ * 3A, then enable dual-phase mode.
+ */
+static int pm800_set_current_limit(struct regulator_dev *rdev,
+				int min_uA, int max_uA)
+{
+	struct pm800_regulators *pm800_data =
+				dev_get_drvdata(rdev_get_dev(rdev)->parent);
+	struct pm80x_chip *chip = pm800_data->chip;
+	int ret;
+
+	/* Currently only supported on 88pm860 device */
+	if (chip->type != CHIP_PM860)
+		return 0;
+
+	if (rdev->desc->id == PM800_ID_BUCK1) {
+		/* If max_uA is greater that 3A, enable dual-phase on BUCK1 */
+		if (max_uA > 3000000) {
+			ret = regmap_update_bits(chip->subchip->regmap_power,
+					PM860_BUCK1_MISC,
+					BUCK1_DUAL_PHASE_SEL,
+					BUCK1_DUAL_PHASE_SEL);
+			if (ret) {
+				dev_err(chip->dev, "failed to access registers\n");
+				return ret;
+			}
+		}
+	}
+
+	return 0;
+}
+
 static struct regulator_ops pm800_volt_range_ops = {
 	.list_voltage		= regulator_list_voltage_linear_range,
 	.map_voltage		= regulator_map_voltage_linear_range,
@@ -194,6 +231,7 @@ static struct regulator_ops pm800_volt_range_ops = {
 	.disable		= regulator_disable_regmap,
 	.is_enabled		= regulator_is_enabled_regmap,
 	.get_current_limit	= pm800_get_current_limit,
+	.set_current_limit	= pm800_set_current_limit,
 };
 
 static struct regulator_ops pm800_volt_table_ops = {
diff --git a/include/linux/mfd/88pm80x.h b/include/linux/mfd/88pm80x.h
index a92d173..05d9bad 100644
--- a/include/linux/mfd/88pm80x.h
+++ b/include/linux/mfd/88pm80x.h
@@ -295,6 +295,9 @@ enum {
 #define PM860_BUCK4_MISC2		(0x82)
 #define PM860_BUCK4_FULL_DRV		BIT(2)
 
+#define PM860_BUCK1_MISC		(0x8E)
+#define BUCK1_DUAL_PHASE_SEL		BIT(2)
+
 struct pm80x_rtc_pdata {
 	int		vrtc;
 	int		rtc_wakeup;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* Re: [PATCH 5/5] regulator: 88pm800: Add support for configuration of dual phase on BUCK1
  2015-07-16 18:16   ` Vaibhav Hiremath
@ 2015-07-16 20:32     ` Mark Brown
  -1 siblings, 0 replies; 38+ messages in thread
From: Mark Brown @ 2015-07-16 20:32 UTC (permalink / raw)
  To: Vaibhav Hiremath
  Cc: linux-arm-kernel, lgirdwood, sameo, lee.jones, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 594 bytes --]

On Thu, Jul 16, 2015 at 11:46:58PM +0530, Vaibhav Hiremath wrote:

>  	.disable		= regulator_disable_regmap,
>  	.is_enabled		= regulator_is_enabled_regmap,
>  	.get_current_limit	= pm800_get_current_limit,
> +	.set_current_limit	= pm800_set_current_limit,

set_current_limit() isn't the right interface to use for this, this is
something that depends on the physical design of the system rather than
something that limits the current.  It should be a DT property of its
own.  There are some other PMICs with similar functions but it's not
clear yet how generic the configuration mechanism is.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [PATCH 5/5] regulator: 88pm800: Add support for configuration of dual phase on BUCK1
@ 2015-07-16 20:32     ` Mark Brown
  0 siblings, 0 replies; 38+ messages in thread
From: Mark Brown @ 2015-07-16 20:32 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jul 16, 2015 at 11:46:58PM +0530, Vaibhav Hiremath wrote:

>  	.disable		= regulator_disable_regmap,
>  	.is_enabled		= regulator_is_enabled_regmap,
>  	.get_current_limit	= pm800_get_current_limit,
> +	.set_current_limit	= pm800_set_current_limit,

set_current_limit() isn't the right interface to use for this, this is
something that depends on the physical design of the system rather than
something that limits the current.  It should be a DT property of its
own.  There are some other PMICs with similar functions but it's not
clear yet how generic the configuration mechanism is.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150716/b5a98a6e/attachment.sig>

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 4/5] regulator: 88pm800: Add 88pm860 regulator support
  2015-07-16 18:16   ` Vaibhav Hiremath
@ 2015-07-16 21:34     ` Mark Brown
  -1 siblings, 0 replies; 38+ messages in thread
From: Mark Brown @ 2015-07-16 21:34 UTC (permalink / raw)
  To: Vaibhav Hiremath
  Cc: linux-arm-kernel, lgirdwood, sameo, lee.jones, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 381 bytes --]

On Thu, Jul 16, 2015 at 11:46:57PM +0530, Vaibhav Hiremath wrote:
> 88PM860 falls under 88pm800 family of devices, with
> additional feature enhancements, like,
>   - 88pm860 had additional BUCK regulator (BUCK6 and BUCK1B)
>   - Additional LDO (LDO20)
>   - different voltage and current capability

...and reverted since this doesn't build as the kbuild test robot
reported.  :(

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [PATCH 4/5] regulator: 88pm800: Add 88pm860 regulator support
@ 2015-07-16 21:34     ` Mark Brown
  0 siblings, 0 replies; 38+ messages in thread
From: Mark Brown @ 2015-07-16 21:34 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jul 16, 2015 at 11:46:57PM +0530, Vaibhav Hiremath wrote:
> 88PM860 falls under 88pm800 family of devices, with
> additional feature enhancements, like,
>   - 88pm860 had additional BUCK regulator (BUCK6 and BUCK1B)
>   - Additional LDO (LDO20)
>   - different voltage and current capability

...and reverted since this doesn't build as the kbuild test robot
reported.  :(
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150716/2a0a1808/attachment.sig>

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 5/5] regulator: 88pm800: Add support for configuration of dual phase on BUCK1
  2015-07-16 20:32     ` Mark Brown
@ 2015-07-17  5:38       ` Vaibhav Hiremath
  -1 siblings, 0 replies; 38+ messages in thread
From: Vaibhav Hiremath @ 2015-07-17  5:38 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-arm-kernel, lgirdwood, sameo, lee.jones, linux-kernel



On Friday 17 July 2015 02:02 AM, Mark Brown wrote:
> On Thu, Jul 16, 2015 at 11:46:58PM +0530, Vaibhav Hiremath wrote:
>
>>   	.disable		= regulator_disable_regmap,
>>   	.is_enabled		= regulator_is_enabled_regmap,
>>   	.get_current_limit	= pm800_get_current_limit,
>> +	.set_current_limit	= pm800_set_current_limit,
>
> set_current_limit() isn't the right interface to use for this, this is
> something that depends on the physical design of the system rather than
> something that limits the current.  It should be a DT property of its
> own.  There are some other PMICs with similar functions but it's not
> clear yet how generic the configuration mechanism is.
>

Hmmm,
Yeah, right. This is depends on physical design. And not the regulator
current limit.

Earlier, I had submitted DT based approach, but was MFD DT property.
Which is not correct, do you think regulator DT property is the right
approach?

Below is going to be my approach -

pmic1: 88pm860@30 {
	compatible = "marvell,88pm800";
	...
	regulators {
		compatible = "marvell,88pm80x-regulator";

		marvell,88pm860-buck1-dualphase-en;

		buck1: buck1 {
			...
		};
		...
	};
};


Thanks,
Vaibhav

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [PATCH 5/5] regulator: 88pm800: Add support for configuration of dual phase on BUCK1
@ 2015-07-17  5:38       ` Vaibhav Hiremath
  0 siblings, 0 replies; 38+ messages in thread
From: Vaibhav Hiremath @ 2015-07-17  5:38 UTC (permalink / raw)
  To: linux-arm-kernel



On Friday 17 July 2015 02:02 AM, Mark Brown wrote:
> On Thu, Jul 16, 2015 at 11:46:58PM +0530, Vaibhav Hiremath wrote:
>
>>   	.disable		= regulator_disable_regmap,
>>   	.is_enabled		= regulator_is_enabled_regmap,
>>   	.get_current_limit	= pm800_get_current_limit,
>> +	.set_current_limit	= pm800_set_current_limit,
>
> set_current_limit() isn't the right interface to use for this, this is
> something that depends on the physical design of the system rather than
> something that limits the current.  It should be a DT property of its
> own.  There are some other PMICs with similar functions but it's not
> clear yet how generic the configuration mechanism is.
>

Hmmm,
Yeah, right. This is depends on physical design. And not the regulator
current limit.

Earlier, I had submitted DT based approach, but was MFD DT property.
Which is not correct, do you think regulator DT property is the right
approach?

Below is going to be my approach -

pmic1: 88pm860 at 30 {
	compatible = "marvell,88pm800";
	...
	regulators {
		compatible = "marvell,88pm80x-regulator";

		marvell,88pm860-buck1-dualphase-en;

		buck1: buck1 {
			...
		};
		...
	};
};


Thanks,
Vaibhav

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 4/5] regulator: 88pm800: Add 88pm860 regulator support
  2015-07-16 21:34     ` Mark Brown
@ 2015-07-17  5:42       ` Vaibhav Hiremath
  -1 siblings, 0 replies; 38+ messages in thread
From: Vaibhav Hiremath @ 2015-07-17  5:42 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-arm-kernel, lgirdwood, sameo, lee.jones, linux-kernel



On Friday 17 July 2015 03:04 AM, Mark Brown wrote:
> On Thu, Jul 16, 2015 at 11:46:57PM +0530, Vaibhav Hiremath wrote:
>> 88PM860 falls under 88pm800 family of devices, with
>> additional feature enhancements, like,
>>    - 88pm860 had additional BUCK regulator (BUCK6 and BUCK1B)
>>    - Additional LDO (LDO20)
>>    - different voltage and current capability
>
> ...and reverted since this doesn't build as the kbuild test robot
> reported.  :(
>

How do you suggest to handle dependency between MFD patch and this
patch?

Can you merge this into regulator tree?

Link to MFD - https://lkml.org/lkml/2015/7/16/704

Thanks,
Vaibhav

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [PATCH 4/5] regulator: 88pm800: Add 88pm860 regulator support
@ 2015-07-17  5:42       ` Vaibhav Hiremath
  0 siblings, 0 replies; 38+ messages in thread
From: Vaibhav Hiremath @ 2015-07-17  5:42 UTC (permalink / raw)
  To: linux-arm-kernel



On Friday 17 July 2015 03:04 AM, Mark Brown wrote:
> On Thu, Jul 16, 2015 at 11:46:57PM +0530, Vaibhav Hiremath wrote:
>> 88PM860 falls under 88pm800 family of devices, with
>> additional feature enhancements, like,
>>    - 88pm860 had additional BUCK regulator (BUCK6 and BUCK1B)
>>    - Additional LDO (LDO20)
>>    - different voltage and current capability
>
> ...and reverted since this doesn't build as the kbuild test robot
> reported.  :(
>

How do you suggest to handle dependency between MFD patch and this
patch?

Can you merge this into regulator tree?

Link to MFD - https://lkml.org/lkml/2015/7/16/704

Thanks,
Vaibhav

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 4/5] regulator: 88pm800: Add 88pm860 regulator support
  2015-07-17  5:42       ` Vaibhav Hiremath
@ 2015-07-17 11:17         ` Mark Brown
  -1 siblings, 0 replies; 38+ messages in thread
From: Mark Brown @ 2015-07-17 11:17 UTC (permalink / raw)
  To: Vaibhav Hiremath
  Cc: linux-arm-kernel, lgirdwood, sameo, lee.jones, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 197 bytes --]

On Fri, Jul 17, 2015 at 11:12:04AM +0530, Vaibhav Hiremath wrote:

> Can you merge this into regulator tree?

> Link to MFD - https://lkml.org/lkml/2015/7/16/704

I need a tag I can pull from Lee.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [PATCH 4/5] regulator: 88pm800: Add 88pm860 regulator support
@ 2015-07-17 11:17         ` Mark Brown
  0 siblings, 0 replies; 38+ messages in thread
From: Mark Brown @ 2015-07-17 11:17 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Jul 17, 2015 at 11:12:04AM +0530, Vaibhav Hiremath wrote:

> Can you merge this into regulator tree?

> Link to MFD - https://lkml.org/lkml/2015/7/16/704

I need a tag I can pull from Lee.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150717/9ceda05a/attachment.sig>

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 4/5] regulator: 88pm800: Add 88pm860 regulator support
  2015-07-17 11:17         ` Mark Brown
@ 2015-07-17 12:43           ` Vaibhav Hiremath
  -1 siblings, 0 replies; 38+ messages in thread
From: Vaibhav Hiremath @ 2015-07-17 12:43 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-arm-kernel, lgirdwood, sameo, lee.jones, linux-kernel



On Friday 17 July 2015 04:47 PM, Mark Brown wrote:
> On Fri, Jul 17, 2015 at 11:12:04AM +0530, Vaibhav Hiremath wrote:
>
>> Can you merge this into regulator tree?
>
>> Link to MFD - https://lkml.org/lkml/2015/7/16/704
>
> I need a tag I can pull from Lee.
>
Great.

Lee,
It would be helpful, if you could ack below patch,

https://lkml.org/lkml/2015/7/16/704

Thanks,
Vaibhav

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [PATCH 4/5] regulator: 88pm800: Add 88pm860 regulator support
@ 2015-07-17 12:43           ` Vaibhav Hiremath
  0 siblings, 0 replies; 38+ messages in thread
From: Vaibhav Hiremath @ 2015-07-17 12:43 UTC (permalink / raw)
  To: linux-arm-kernel



On Friday 17 July 2015 04:47 PM, Mark Brown wrote:
> On Fri, Jul 17, 2015 at 11:12:04AM +0530, Vaibhav Hiremath wrote:
>
>> Can you merge this into regulator tree?
>
>> Link to MFD - https://lkml.org/lkml/2015/7/16/704
>
> I need a tag I can pull from Lee.
>
Great.

Lee,
It would be helpful, if you could ack below patch,

https://lkml.org/lkml/2015/7/16/704

Thanks,
Vaibhav

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 4/5] regulator: 88pm800: Add 88pm860 regulator support
  2015-07-17 12:43           ` Vaibhav Hiremath
@ 2015-07-20  7:30             ` Lee Jones
  -1 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2015-07-20  7:30 UTC (permalink / raw)
  To: Vaibhav Hiremath
  Cc: Mark Brown, linux-arm-kernel, lgirdwood, sameo, linux-kernel

On Fri, 17 Jul 2015, Vaibhav Hiremath wrote:

> 
> 
> On Friday 17 July 2015 04:47 PM, Mark Brown wrote:
> >On Fri, Jul 17, 2015 at 11:12:04AM +0530, Vaibhav Hiremath wrote:
> >
> >>Can you merge this into regulator tree?
> >
> >>Link to MFD - https://lkml.org/lkml/2015/7/16/704
> >
> >I need a tag I can pull from Lee.
> >
> Great.
> 
> Lee,
> It would be helpful, if you could ack below patch,
> 
> https://lkml.org/lkml/2015/7/16/704

These patches are yet to be reviewed.  I will unmark those patches as
important (meaning they will not be reviewed during this iteration).
Please resubmit a single patch-set containing all of the
dependencies and Mark and I will work it out between us.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [PATCH 4/5] regulator: 88pm800: Add 88pm860 regulator support
@ 2015-07-20  7:30             ` Lee Jones
  0 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2015-07-20  7:30 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, 17 Jul 2015, Vaibhav Hiremath wrote:

> 
> 
> On Friday 17 July 2015 04:47 PM, Mark Brown wrote:
> >On Fri, Jul 17, 2015 at 11:12:04AM +0530, Vaibhav Hiremath wrote:
> >
> >>Can you merge this into regulator tree?
> >
> >>Link to MFD - https://lkml.org/lkml/2015/7/16/704
> >
> >I need a tag I can pull from Lee.
> >
> Great.
> 
> Lee,
> It would be helpful, if you could ack below patch,
> 
> https://lkml.org/lkml/2015/7/16/704

These patches are yet to be reviewed.  I will unmark those patches as
important (meaning they will not be reviewed during this iteration).
Please resubmit a single patch-set containing all of the
dependencies and Mark and I will work it out between us.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 4/5] regulator: 88pm800: Add 88pm860 regulator support
  2015-07-20  7:30             ` Lee Jones
@ 2015-07-20 12:01               ` Vaibhav Hiremath
  -1 siblings, 0 replies; 38+ messages in thread
From: Vaibhav Hiremath @ 2015-07-20 12:01 UTC (permalink / raw)
  To: Lee Jones; +Cc: Mark Brown, linux-arm-kernel, lgirdwood, sameo, linux-kernel



On Monday 20 July 2015 01:00 PM, Lee Jones wrote:
> On Fri, 17 Jul 2015, Vaibhav Hiremath wrote:
>
>>
>>
>> On Friday 17 July 2015 04:47 PM, Mark Brown wrote:
>>> On Fri, Jul 17, 2015 at 11:12:04AM +0530, Vaibhav Hiremath wrote:
>>>
>>>> Can you merge this into regulator tree?
>>>
>>>> Link to MFD - https://lkml.org/lkml/2015/7/16/704
>>>
>>> I need a tag I can pull from Lee.
>>>
>> Great.
>>
>> Lee,
>> It would be helpful, if you could ack below patch,
>>
>> https://lkml.org/lkml/2015/7/16/704
>
> These patches are yet to be reviewed.  I will unmark those patches as
> important (meaning they will not be reviewed during this iteration).
> Please resubmit a single patch-set containing all of the
> dependencies and Mark and I will work it out between us.
>

Ok,

I have just sent single patch, which has dependency on regulator
changes. Please review, ack and queue up.


[PATCH-v3] mfd: 88pm80x: Add 88pm860 chip type support
https://patchwork.kernel.org/patch/6826531/


Thanks,
Vaibhav


^ permalink raw reply	[flat|nested] 38+ messages in thread

* [PATCH 4/5] regulator: 88pm800: Add 88pm860 regulator support
@ 2015-07-20 12:01               ` Vaibhav Hiremath
  0 siblings, 0 replies; 38+ messages in thread
From: Vaibhav Hiremath @ 2015-07-20 12:01 UTC (permalink / raw)
  To: linux-arm-kernel



On Monday 20 July 2015 01:00 PM, Lee Jones wrote:
> On Fri, 17 Jul 2015, Vaibhav Hiremath wrote:
>
>>
>>
>> On Friday 17 July 2015 04:47 PM, Mark Brown wrote:
>>> On Fri, Jul 17, 2015 at 11:12:04AM +0530, Vaibhav Hiremath wrote:
>>>
>>>> Can you merge this into regulator tree?
>>>
>>>> Link to MFD - https://lkml.org/lkml/2015/7/16/704
>>>
>>> I need a tag I can pull from Lee.
>>>
>> Great.
>>
>> Lee,
>> It would be helpful, if you could ack below patch,
>>
>> https://lkml.org/lkml/2015/7/16/704
>
> These patches are yet to be reviewed.  I will unmark those patches as
> important (meaning they will not be reviewed during this iteration).
> Please resubmit a single patch-set containing all of the
> dependencies and Mark and I will work it out between us.
>

Ok,

I have just sent single patch, which has dependency on regulator
changes. Please review, ack and queue up.


[PATCH-v3] mfd: 88pm80x: Add 88pm860 chip type support
https://patchwork.kernel.org/patch/6826531/


Thanks,
Vaibhav

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 4/5] regulator: 88pm800: Add 88pm860 regulator support
  2015-07-20 12:01               ` Vaibhav Hiremath
@ 2015-07-21  9:21                 ` Lee Jones
  -1 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2015-07-21  9:21 UTC (permalink / raw)
  To: Vaibhav Hiremath
  Cc: Mark Brown, linux-arm-kernel, lgirdwood, sameo, linux-kernel

On Mon, 20 Jul 2015, Vaibhav Hiremath wrote:

> 
> 
> On Monday 20 July 2015 01:00 PM, Lee Jones wrote:
> >On Fri, 17 Jul 2015, Vaibhav Hiremath wrote:
> >
> >>
> >>
> >>On Friday 17 July 2015 04:47 PM, Mark Brown wrote:
> >>>On Fri, Jul 17, 2015 at 11:12:04AM +0530, Vaibhav Hiremath wrote:
> >>>
> >>>>Can you merge this into regulator tree?
> >>>
> >>>>Link to MFD - https://lkml.org/lkml/2015/7/16/704
> >>>
> >>>I need a tag I can pull from Lee.
> >>>
> >>Great.
> >>
> >>Lee,
> >>It would be helpful, if you could ack below patch,
> >>
> >>https://lkml.org/lkml/2015/7/16/704
> >
> >These patches are yet to be reviewed.  I will unmark those patches as
> >important (meaning they will not be reviewed during this iteration).
> >Please resubmit a single patch-set containing all of the
> >dependencies and Mark and I will work it out between us.
> >
> 
> Ok,
> 
> I have just sent single patch, which has dependency on regulator
> changes. Please review, ack and queue up.

A little presumptuous, don't you think? ;)

> [PATCH-v3] mfd: 88pm80x: Add 88pm860 chip type support
> https://patchwork.kernel.org/patch/6826531/

So nothing depends on this anymore, right?

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [PATCH 4/5] regulator: 88pm800: Add 88pm860 regulator support
@ 2015-07-21  9:21                 ` Lee Jones
  0 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2015-07-21  9:21 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, 20 Jul 2015, Vaibhav Hiremath wrote:

> 
> 
> On Monday 20 July 2015 01:00 PM, Lee Jones wrote:
> >On Fri, 17 Jul 2015, Vaibhav Hiremath wrote:
> >
> >>
> >>
> >>On Friday 17 July 2015 04:47 PM, Mark Brown wrote:
> >>>On Fri, Jul 17, 2015 at 11:12:04AM +0530, Vaibhav Hiremath wrote:
> >>>
> >>>>Can you merge this into regulator tree?
> >>>
> >>>>Link to MFD - https://lkml.org/lkml/2015/7/16/704
> >>>
> >>>I need a tag I can pull from Lee.
> >>>
> >>Great.
> >>
> >>Lee,
> >>It would be helpful, if you could ack below patch,
> >>
> >>https://lkml.org/lkml/2015/7/16/704
> >
> >These patches are yet to be reviewed.  I will unmark those patches as
> >important (meaning they will not be reviewed during this iteration).
> >Please resubmit a single patch-set containing all of the
> >dependencies and Mark and I will work it out between us.
> >
> 
> Ok,
> 
> I have just sent single patch, which has dependency on regulator
> changes. Please review, ack and queue up.

A little presumptuous, don't you think? ;)

> [PATCH-v3] mfd: 88pm80x: Add 88pm860 chip type support
> https://patchwork.kernel.org/patch/6826531/

So nothing depends on this anymore, right?

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 4/5] regulator: 88pm800: Add 88pm860 regulator support
  2015-07-21  9:21                 ` Lee Jones
@ 2015-07-21 11:15                   ` Vaibhav Hiremath
  -1 siblings, 0 replies; 38+ messages in thread
From: Vaibhav Hiremath @ 2015-07-21 11:15 UTC (permalink / raw)
  To: Lee Jones; +Cc: Mark Brown, linux-arm-kernel, lgirdwood, sameo, linux-kernel



On Tuesday 21 July 2015 02:51 PM, Lee Jones wrote:
> On Mon, 20 Jul 2015, Vaibhav Hiremath wrote:
>
>>
>>
>> On Monday 20 July 2015 01:00 PM, Lee Jones wrote:
>>> On Fri, 17 Jul 2015, Vaibhav Hiremath wrote:
>>>
>>>>
>>>>
>>>> On Friday 17 July 2015 04:47 PM, Mark Brown wrote:
>>>>> On Fri, Jul 17, 2015 at 11:12:04AM +0530, Vaibhav Hiremath wrote:
>>>>>
>>>>>> Can you merge this into regulator tree?
>>>>>
>>>>>> Link to MFD - https://lkml.org/lkml/2015/7/16/704
>>>>>
>>>>> I need a tag I can pull from Lee.
>>>>>
>>>> Great.
>>>>
>>>> Lee,
>>>> It would be helpful, if you could ack below patch,
>>>>
>>>> https://lkml.org/lkml/2015/7/16/704
>>>
>>> These patches are yet to be reviewed.  I will unmark those patches as
>>> important (meaning they will not be reviewed during this iteration).
>>> Please resubmit a single patch-set containing all of the
>>> dependencies and Mark and I will work it out between us.
>>>
>>
>> Ok,
>>
>> I have just sent single patch, which has dependency on regulator
>> changes. Please review, ack and queue up.
>
> A little presumptuous, don't you think? ;)
>
>> [PATCH-v3] mfd: 88pm80x: Add 88pm860 chip type support
>> https://patchwork.kernel.org/patch/6826531/
>
> So nothing depends on this anymore, right?
>

No, regulato patch depends on this.
Mark needs your tag in order to take above patch through regulator tree.


Just to clarify more,

I have regulator patch which adds support for 88PM860
https://lkml.org/lkml/2015/7/16/719

which depends on above patch
https://patchwork.kernel.org/patch/6826531/

Thanks,
Vaibhav


^ permalink raw reply	[flat|nested] 38+ messages in thread

* [PATCH 4/5] regulator: 88pm800: Add 88pm860 regulator support
@ 2015-07-21 11:15                   ` Vaibhav Hiremath
  0 siblings, 0 replies; 38+ messages in thread
From: Vaibhav Hiremath @ 2015-07-21 11:15 UTC (permalink / raw)
  To: linux-arm-kernel



On Tuesday 21 July 2015 02:51 PM, Lee Jones wrote:
> On Mon, 20 Jul 2015, Vaibhav Hiremath wrote:
>
>>
>>
>> On Monday 20 July 2015 01:00 PM, Lee Jones wrote:
>>> On Fri, 17 Jul 2015, Vaibhav Hiremath wrote:
>>>
>>>>
>>>>
>>>> On Friday 17 July 2015 04:47 PM, Mark Brown wrote:
>>>>> On Fri, Jul 17, 2015 at 11:12:04AM +0530, Vaibhav Hiremath wrote:
>>>>>
>>>>>> Can you merge this into regulator tree?
>>>>>
>>>>>> Link to MFD - https://lkml.org/lkml/2015/7/16/704
>>>>>
>>>>> I need a tag I can pull from Lee.
>>>>>
>>>> Great.
>>>>
>>>> Lee,
>>>> It would be helpful, if you could ack below patch,
>>>>
>>>> https://lkml.org/lkml/2015/7/16/704
>>>
>>> These patches are yet to be reviewed.  I will unmark those patches as
>>> important (meaning they will not be reviewed during this iteration).
>>> Please resubmit a single patch-set containing all of the
>>> dependencies and Mark and I will work it out between us.
>>>
>>
>> Ok,
>>
>> I have just sent single patch, which has dependency on regulator
>> changes. Please review, ack and queue up.
>
> A little presumptuous, don't you think? ;)
>
>> [PATCH-v3] mfd: 88pm80x: Add 88pm860 chip type support
>> https://patchwork.kernel.org/patch/6826531/
>
> So nothing depends on this anymore, right?
>

No, regulato patch depends on this.
Mark needs your tag in order to take above patch through regulator tree.


Just to clarify more,

I have regulator patch which adds support for 88PM860
https://lkml.org/lkml/2015/7/16/719

which depends on above patch
https://patchwork.kernel.org/patch/6826531/

Thanks,
Vaibhav

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 4/5] regulator: 88pm800: Add 88pm860 regulator support
  2015-07-21 11:15                   ` Vaibhav Hiremath
@ 2015-07-21 15:13                     ` Lee Jones
  -1 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2015-07-21 15:13 UTC (permalink / raw)
  To: Vaibhav Hiremath
  Cc: Mark Brown, linux-arm-kernel, lgirdwood, sameo, linux-kernel

On Tue, 21 Jul 2015, Vaibhav Hiremath wrote:

> 
> 
> On Tuesday 21 July 2015 02:51 PM, Lee Jones wrote:
> >On Mon, 20 Jul 2015, Vaibhav Hiremath wrote:
> >
> >>
> >>
> >>On Monday 20 July 2015 01:00 PM, Lee Jones wrote:
> >>>On Fri, 17 Jul 2015, Vaibhav Hiremath wrote:
> >>>
> >>>>
> >>>>
> >>>>On Friday 17 July 2015 04:47 PM, Mark Brown wrote:
> >>>>>On Fri, Jul 17, 2015 at 11:12:04AM +0530, Vaibhav Hiremath wrote:
> >>>>>
> >>>>>>Can you merge this into regulator tree?
> >>>>>
> >>>>>>Link to MFD - https://lkml.org/lkml/2015/7/16/704
> >>>>>
> >>>>>I need a tag I can pull from Lee.
> >>>>>
> >>>>Great.
> >>>>
> >>>>Lee,
> >>>>It would be helpful, if you could ack below patch,
> >>>>
> >>>>https://lkml.org/lkml/2015/7/16/704
> >>>
> >>>These patches are yet to be reviewed.  I will unmark those patches as
> >>>important (meaning they will not be reviewed during this iteration).
> >>>Please resubmit a single patch-set containing all of the
> >>>dependencies and Mark and I will work it out between us.
> >>>
> >>
> >>Ok,
> >>
> >>I have just sent single patch, which has dependency on regulator
> >>changes. Please review, ack and queue up.
> >
> >A little presumptuous, don't you think? ;)
> >
> >>[PATCH-v3] mfd: 88pm80x: Add 88pm860 chip type support
> >>https://patchwork.kernel.org/patch/6826531/
> >
> >So nothing depends on this anymore, right?
> >
> 
> No, regulato patch depends on this.
> Mark needs your tag in order to take above patch through regulator tree.

That's not how we usually do things.

However, as this patch is a very simple one, it shouldn't cause too
many issues if it were to go in via the Regulator tree.

> Just to clarify more,
> 
> I have regulator patch which adds support for 88PM860
> https://lkml.org/lkml/2015/7/16/719
> 
> which depends on above patch
> https://patchwork.kernel.org/patch/6826531/
> 
> Thanks,
> Vaibhav
> 

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [PATCH 4/5] regulator: 88pm800: Add 88pm860 regulator support
@ 2015-07-21 15:13                     ` Lee Jones
  0 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2015-07-21 15:13 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, 21 Jul 2015, Vaibhav Hiremath wrote:

> 
> 
> On Tuesday 21 July 2015 02:51 PM, Lee Jones wrote:
> >On Mon, 20 Jul 2015, Vaibhav Hiremath wrote:
> >
> >>
> >>
> >>On Monday 20 July 2015 01:00 PM, Lee Jones wrote:
> >>>On Fri, 17 Jul 2015, Vaibhav Hiremath wrote:
> >>>
> >>>>
> >>>>
> >>>>On Friday 17 July 2015 04:47 PM, Mark Brown wrote:
> >>>>>On Fri, Jul 17, 2015 at 11:12:04AM +0530, Vaibhav Hiremath wrote:
> >>>>>
> >>>>>>Can you merge this into regulator tree?
> >>>>>
> >>>>>>Link to MFD - https://lkml.org/lkml/2015/7/16/704
> >>>>>
> >>>>>I need a tag I can pull from Lee.
> >>>>>
> >>>>Great.
> >>>>
> >>>>Lee,
> >>>>It would be helpful, if you could ack below patch,
> >>>>
> >>>>https://lkml.org/lkml/2015/7/16/704
> >>>
> >>>These patches are yet to be reviewed.  I will unmark those patches as
> >>>important (meaning they will not be reviewed during this iteration).
> >>>Please resubmit a single patch-set containing all of the
> >>>dependencies and Mark and I will work it out between us.
> >>>
> >>
> >>Ok,
> >>
> >>I have just sent single patch, which has dependency on regulator
> >>changes. Please review, ack and queue up.
> >
> >A little presumptuous, don't you think? ;)
> >
> >>[PATCH-v3] mfd: 88pm80x: Add 88pm860 chip type support
> >>https://patchwork.kernel.org/patch/6826531/
> >
> >So nothing depends on this anymore, right?
> >
> 
> No, regulato patch depends on this.
> Mark needs your tag in order to take above patch through regulator tree.

That's not how we usually do things.

However, as this patch is a very simple one, it shouldn't cause too
many issues if it were to go in via the Regulator tree.

> Just to clarify more,
> 
> I have regulator patch which adds support for 88PM860
> https://lkml.org/lkml/2015/7/16/719
> 
> which depends on above patch
> https://patchwork.kernel.org/patch/6826531/
> 
> Thanks,
> Vaibhav
> 

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 4/5] regulator: 88pm800: Add 88pm860 regulator support
  2015-07-21 15:13                     ` Lee Jones
@ 2015-07-21 15:19                       ` Vaibhav Hiremath
  -1 siblings, 0 replies; 38+ messages in thread
From: Vaibhav Hiremath @ 2015-07-21 15:19 UTC (permalink / raw)
  To: Lee Jones; +Cc: Mark Brown, linux-arm-kernel, lgirdwood, sameo, linux-kernel



On Tuesday 21 July 2015 08:43 PM, Lee Jones wrote:
> On Tue, 21 Jul 2015, Vaibhav Hiremath wrote:
>
>>
>>
>> On Tuesday 21 July 2015 02:51 PM, Lee Jones wrote:
>>> On Mon, 20 Jul 2015, Vaibhav Hiremath wrote:
>>>
>>>>
>>>>
>>>> On Monday 20 July 2015 01:00 PM, Lee Jones wrote:
>>>>> On Fri, 17 Jul 2015, Vaibhav Hiremath wrote:
>>>>>
>>>>>>
>>>>>>
>>>>>> On Friday 17 July 2015 04:47 PM, Mark Brown wrote:
>>>>>>> On Fri, Jul 17, 2015 at 11:12:04AM +0530, Vaibhav Hiremath wrote:
>>>>>>>
>>>>>>>> Can you merge this into regulator tree?
>>>>>>>
>>>>>>>> Link to MFD - https://lkml.org/lkml/2015/7/16/704
>>>>>>>
>>>>>>> I need a tag I can pull from Lee.
>>>>>>>
>>>>>> Great.
>>>>>>
>>>>>> Lee,
>>>>>> It would be helpful, if you could ack below patch,
>>>>>>
>>>>>> https://lkml.org/lkml/2015/7/16/704
>>>>>
>>>>> These patches are yet to be reviewed.  I will unmark those patches as
>>>>> important (meaning they will not be reviewed during this iteration).
>>>>> Please resubmit a single patch-set containing all of the
>>>>> dependencies and Mark and I will work it out between us.
>>>>>
>>>>
>>>> Ok,
>>>>
>>>> I have just sent single patch, which has dependency on regulator
>>>> changes. Please review, ack and queue up.
>>>
>>> A little presumptuous, don't you think? ;)
>>>
>>>> [PATCH-v3] mfd: 88pm80x: Add 88pm860 chip type support
>>>> https://patchwork.kernel.org/patch/6826531/
>>>
>>> So nothing depends on this anymore, right?
>>>
>>
>> No, regulato patch depends on this.
>> Mark needs your tag in order to take above patch through regulator tree.
>
> That's not how we usually do things.
>
> However, as this patch is a very simple one, it shouldn't cause too
> many issues if it were to go in via the Regulator tree.
>

Thanks for your ack.

And I understand your concern, but not sure how would you solve such
dependency?

Another point which keeps bugging me is, git-bisect.

Thanks,
Vaibhav

>> Just to clarify more,
>>
>> I have regulator patch which adds support for 88PM860
>> https://lkml.org/lkml/2015/7/16/719
>>
>> which depends on above patch
>> https://patchwork.kernel.org/patch/6826531/
>>
>> Thanks,
>> Vaibhav
>>
>

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [PATCH 4/5] regulator: 88pm800: Add 88pm860 regulator support
@ 2015-07-21 15:19                       ` Vaibhav Hiremath
  0 siblings, 0 replies; 38+ messages in thread
From: Vaibhav Hiremath @ 2015-07-21 15:19 UTC (permalink / raw)
  To: linux-arm-kernel



On Tuesday 21 July 2015 08:43 PM, Lee Jones wrote:
> On Tue, 21 Jul 2015, Vaibhav Hiremath wrote:
>
>>
>>
>> On Tuesday 21 July 2015 02:51 PM, Lee Jones wrote:
>>> On Mon, 20 Jul 2015, Vaibhav Hiremath wrote:
>>>
>>>>
>>>>
>>>> On Monday 20 July 2015 01:00 PM, Lee Jones wrote:
>>>>> On Fri, 17 Jul 2015, Vaibhav Hiremath wrote:
>>>>>
>>>>>>
>>>>>>
>>>>>> On Friday 17 July 2015 04:47 PM, Mark Brown wrote:
>>>>>>> On Fri, Jul 17, 2015 at 11:12:04AM +0530, Vaibhav Hiremath wrote:
>>>>>>>
>>>>>>>> Can you merge this into regulator tree?
>>>>>>>
>>>>>>>> Link to MFD - https://lkml.org/lkml/2015/7/16/704
>>>>>>>
>>>>>>> I need a tag I can pull from Lee.
>>>>>>>
>>>>>> Great.
>>>>>>
>>>>>> Lee,
>>>>>> It would be helpful, if you could ack below patch,
>>>>>>
>>>>>> https://lkml.org/lkml/2015/7/16/704
>>>>>
>>>>> These patches are yet to be reviewed.  I will unmark those patches as
>>>>> important (meaning they will not be reviewed during this iteration).
>>>>> Please resubmit a single patch-set containing all of the
>>>>> dependencies and Mark and I will work it out between us.
>>>>>
>>>>
>>>> Ok,
>>>>
>>>> I have just sent single patch, which has dependency on regulator
>>>> changes. Please review, ack and queue up.
>>>
>>> A little presumptuous, don't you think? ;)
>>>
>>>> [PATCH-v3] mfd: 88pm80x: Add 88pm860 chip type support
>>>> https://patchwork.kernel.org/patch/6826531/
>>>
>>> So nothing depends on this anymore, right?
>>>
>>
>> No, regulato patch depends on this.
>> Mark needs your tag in order to take above patch through regulator tree.
>
> That's not how we usually do things.
>
> However, as this patch is a very simple one, it shouldn't cause too
> many issues if it were to go in via the Regulator tree.
>

Thanks for your ack.

And I understand your concern, but not sure how would you solve such
dependency?

Another point which keeps bugging me is, git-bisect.

Thanks,
Vaibhav

>> Just to clarify more,
>>
>> I have regulator patch which adds support for 88PM860
>> https://lkml.org/lkml/2015/7/16/719
>>
>> which depends on above patch
>> https://patchwork.kernel.org/patch/6826531/
>>
>> Thanks,
>> Vaibhav
>>
>

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 4/5] regulator: 88pm800: Add 88pm860 regulator support
  2015-07-21 15:19                       ` Vaibhav Hiremath
@ 2015-07-21 15:55                         ` Lee Jones
  -1 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2015-07-21 15:55 UTC (permalink / raw)
  To: Vaibhav Hiremath
  Cc: Mark Brown, linux-arm-kernel, lgirdwood, sameo, linux-kernel

> >>>>I have just sent single patch, which has dependency on regulator
> >>>>changes. Please review, ack and queue up.
> >>>
> >>>A little presumptuous, don't you think? ;)
> >>>
> >>>>[PATCH-v3] mfd: 88pm80x: Add 88pm860 chip type support
> >>>>https://patchwork.kernel.org/patch/6826531/
> >>>
> >>>So nothing depends on this anymore, right?
> >>>
> >>
> >>No, regulato patch depends on this.
> >>Mark needs your tag in order to take above patch through regulator tree.
> >
> >That's not how we usually do things.
> >
> >However, as this patch is a very simple one, it shouldn't cause too
> >many issues if it were to go in via the Regulator tree.
> >
> 
> Thanks for your ack.
> 
> And I understand your concern, but not sure how would you solve such
> dependency?

We usually share immutable branches, which contain all of the patches
in the correct order.

> Another point which keeps bugging me is, git-bisect.

... which also mitigates bisect issues.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [PATCH 4/5] regulator: 88pm800: Add 88pm860 regulator support
@ 2015-07-21 15:55                         ` Lee Jones
  0 siblings, 0 replies; 38+ messages in thread
From: Lee Jones @ 2015-07-21 15:55 UTC (permalink / raw)
  To: linux-arm-kernel

> >>>>I have just sent single patch, which has dependency on regulator
> >>>>changes. Please review, ack and queue up.
> >>>
> >>>A little presumptuous, don't you think? ;)
> >>>
> >>>>[PATCH-v3] mfd: 88pm80x: Add 88pm860 chip type support
> >>>>https://patchwork.kernel.org/patch/6826531/
> >>>
> >>>So nothing depends on this anymore, right?
> >>>
> >>
> >>No, regulato patch depends on this.
> >>Mark needs your tag in order to take above patch through regulator tree.
> >
> >That's not how we usually do things.
> >
> >However, as this patch is a very simple one, it shouldn't cause too
> >many issues if it were to go in via the Regulator tree.
> >
> 
> Thanks for your ack.
> 
> And I understand your concern, but not sure how would you solve such
> dependency?

We usually share immutable branches, which contain all of the patches
in the correct order.

> Another point which keeps bugging me is, git-bisect.

... which also mitigates bisect issues.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 38+ messages in thread

end of thread, other threads:[~2015-07-21 15:55 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-16 18:16 [PATCH 0/5] regulator: 88pm800: Add 88pm860 regulator support Vaibhav Hiremath
2015-07-16 18:16 ` Vaibhav Hiremath
2015-07-16 18:16 ` [PATCH 1/5] regulator: 88pm800: Fix indentation of assignments of data structures Vaibhav Hiremath
2015-07-16 18:16   ` Vaibhav Hiremath
2015-07-16 18:16 ` [PATCH 2/5] regulator: 88pm800: Update driver to use devm_regulator_register fn Vaibhav Hiremath
2015-07-16 18:16   ` Vaibhav Hiremath
2015-07-16 18:16 ` [PATCH 3/5] regulator: 88pm800: Use regulator_nodes/of_match in the descriptor Vaibhav Hiremath
2015-07-16 18:16   ` Vaibhav Hiremath
2015-07-16 18:16 ` [PATCH 4/5] regulator: 88pm800: Add 88pm860 regulator support Vaibhav Hiremath
2015-07-16 18:16   ` Vaibhav Hiremath
2015-07-16 21:34   ` Mark Brown
2015-07-16 21:34     ` Mark Brown
2015-07-17  5:42     ` Vaibhav Hiremath
2015-07-17  5:42       ` Vaibhav Hiremath
2015-07-17 11:17       ` Mark Brown
2015-07-17 11:17         ` Mark Brown
2015-07-17 12:43         ` Vaibhav Hiremath
2015-07-17 12:43           ` Vaibhav Hiremath
2015-07-20  7:30           ` Lee Jones
2015-07-20  7:30             ` Lee Jones
2015-07-20 12:01             ` Vaibhav Hiremath
2015-07-20 12:01               ` Vaibhav Hiremath
2015-07-21  9:21               ` Lee Jones
2015-07-21  9:21                 ` Lee Jones
2015-07-21 11:15                 ` Vaibhav Hiremath
2015-07-21 11:15                   ` Vaibhav Hiremath
2015-07-21 15:13                   ` Lee Jones
2015-07-21 15:13                     ` Lee Jones
2015-07-21 15:19                     ` Vaibhav Hiremath
2015-07-21 15:19                       ` Vaibhav Hiremath
2015-07-21 15:55                       ` Lee Jones
2015-07-21 15:55                         ` Lee Jones
2015-07-16 18:16 ` [PATCH 5/5] regulator: 88pm800: Add support for configuration of dual phase on BUCK1 Vaibhav Hiremath
2015-07-16 18:16   ` Vaibhav Hiremath
2015-07-16 20:32   ` Mark Brown
2015-07-16 20:32     ` Mark Brown
2015-07-17  5:38     ` Vaibhav Hiremath
2015-07-17  5:38       ` Vaibhav Hiremath

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.