Skip to contentSkip to conversation

mfd: s2mps11: Add samsung s2mps11 pmic

PATCH Superseded Sangbeom Kim 3 participants 3 messages Jun 18, 2012 – Jul 2, 2012

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 7/7 mfd: s2mps11: Add samsung s2mps11 pmic

This patch support Samsung s2mps11 mfd driver. S2MPS11 can support 10 Bucks and 38 LDOs and RTC. By this patch, s2m and s5m mfd series can be supported. Especially, S2MPS11 is designed for high performance Samsung application processor.

---
 drivers/mfd/sec-core.c          |   10 +
 drivers/mfd/sec-irq.c           |  377 ++++++++++++++++++---------------------
 include/linux/mfd/samsung/irq.h |   47 +++++
 3 files changed, 231 insertions(+), 203 deletions(-)
drivers/mfd/sec-core.c +10 -0
index 5bf33cd..a77c7cb 100644
@@ -54,6 +54,12 @@ static struct mfd_cell s5m8767_devs[] = {
 	},
 };
 
+static struct mfd_cell s2mps11_devs[] = {
+	{
+		.name = "s2mps11-pmic",
+	},
+};
+
 int sec_reg_read(struct sec_pmic_dev *sec_pmic, u8 reg, void *dest)
 {
 	return regmap_read(sec_pmic->regmap, reg, dest);
@@ -145,6 +151,10 @@ static int sec_pmic_probe(struct i2c_client *i2c,
 		ret = mfd_add_devices(sec_pmic->dev, -1, s5m8767_devs,
 					ARRAY_SIZE(s5m8767_devs), NULL, 0);
 		break;
+	case S2MPS11X:
+		ret = mfd_add_devices(sec_pmic->dev, -1, s2mps11_devs,
+					ARRAY_SIZE(s2mps11_devs), NULL, 0);
+		break;
 	default:
 		/* If this happens the probe function is problem */
 		BUG();
drivers/mfd/sec-irq.c +174 -203

471 lines not on this page · raw message

include/linux/mfd/samsung/irq.h +47 -0

53 lines not on this page · raw message

Signature · 1 line
1.7.1
#1 lore raw

drivers/mfd/sec-irq.c line 27

Quoted 8 lines · Sangbeom Kim
drivers/mfd/sec-irq.c +5 -3
-struct sec_irq_data {
-	int reg;
-	int mask;
+static struct sec_irq_data s2mps11_irqs[] = {
+	[S2MPS11_IRQ_PWRONF] = {
+		.reg = 1,
+		.mask = S2MPS11_IRQ_PWRONF_MASK,
+	},

This looks like you should be able to factor this code out into regmap_irq? Might be worth doing that first before all the renames so that adding the new PMIC would just be adding some more data.

#2 lore raw

Hi Sangbeom,

Quoted 14 lines · Mark Brown

drivers/mfd/sec-irq.c line 27

Quoted 8 lines · Sangbeom Kim
drivers/mfd/sec-irq.c +5 -3
-struct sec_irq_data {
-	int reg;
-	int mask;
+static struct sec_irq_data s2mps11_irqs[] = {
+	[S2MPS11_IRQ_PWRONF] = {
+		.reg = 1,
+		.mask = S2MPS11_IRQ_PWRONF_MASK,
+	},

This looks like you should be able to factor this code out into regmap_irq? Might be worth doing that first before all the renames so that adding the new PMIC would just be adding some more data.

Would you mind looking into that ? I'm ok with the renaming parts of this patchset, but I think addressing Mark comment here would make the last patch look better (and smaller).

Cheers,
Samuel.

Signature · 2 lines
Intel Open Source Technology Centre
http://oss.intel.com/