diff mbox

[3/4] MFD: Palmas: Add SMPS10_BOOST feature

Message ID 1371470954-9124-4-git-send-email-j-keerthy@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

J, KEERTHY June 17, 2013, 12:09 p.m. UTC
The SMPS10 regulator is not presesnt in all the variants
of the PALMAS PMIC family. Hence adding a feature to distingush
between them.

Signed-off-by: J Keerthy <j-keerthy@ti.com>
---
 drivers/mfd/palmas.c                 |    3 ++-
 drivers/regulator/palmas-regulator.c |    3 +++
 include/linux/mfd/palmas.h           |    4 ++++
 3 files changed, 9 insertions(+), 1 deletions(-)
diff mbox

Patch

diff --git a/drivers/mfd/palmas.c b/drivers/mfd/palmas.c
index 261beb5..ad00c18 100644
--- a/drivers/mfd/palmas.c
+++ b/drivers/mfd/palmas.c
@@ -231,7 +231,8 @@  static void palmas_dt_to_pdata(struct i2c_client *i2c,
 		palmas_set_pdata_irq_flag(i2c, pdata);
 }
 
-static unsigned int palmas_features = PALMAS_PMIC_FEATURE_INTERRUPT;
+static unsigned int palmas_features = PALMAS_PMIC_FEATURE_INTERRUPT |
+					PALMAS_PMIC_FEATURE_SMPS10_BOOST;
 
 static unsigned int tps659038_features;
 
diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c
index 3ae44ac..1ae1e83 100644
--- a/drivers/regulator/palmas-regulator.c
+++ b/drivers/regulator/palmas-regulator.c
@@ -838,6 +838,9 @@  static int palmas_regulators_probe(struct platform_device *pdev)
 				continue;
 			ramp_delay_support = true;
 			break;
+		case PALMAS_REG_SMPS10:
+			if (!PALMAS_PMIC_HAS(palmas, SMPS10_BOOST))
+				continue;
 		}
 
 		if ((id == PALMAS_REG_SMPS6) || (id == PALMAS_REG_SMPS8))
diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h
index 1b5b5f3..2a9f4d6 100644
--- a/include/linux/mfd/palmas.h
+++ b/include/linux/mfd/palmas.h
@@ -38,10 +38,14 @@ 
  * PALMAS_PMIC_FEATURE_INTERRUPT - used when the PMIC has Interrupt line going
  *	to an application processor.
  *
+ * PALMAS_PMIC_FEATURE_SMPS10_BOOST - used when the PMIC provides SMPS10 boost
+ *	voltage supply.
+ *
  * PALMAS_PMIC_HAS(b, f) - macro to check if a bandgap device is capable of a
  *	specific feature (above) or not. Return non-zero, if yes.
  */
 #define PALMAS_PMIC_FEATURE_INTERRUPT	BIT(0)
+#define PALMAS_PMIC_FEATURE_SMPS10_BOOST	BIT(1)
 #define PALMAS_PMIC_HAS(b, f)			\
 			((b)->features & PALMAS_PMIC_FEATURE_ ## f)