Skip to contentSkip to conversation

Add support for DA9150 Fuel-Gauge

PATCH Superseded Adam Thomson 3 participants 12 messages Jun 18, 2015 – Jun 25, 2015

Subsystems (3)

v1 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

cover Add support for DA9150 Fuel-Gauge

This patch set adds support for the Dialog DA9150 Fuel-Gauge.

In this patch set the following is provided:
- MFD Core and DT bindings updates.
- Power Supply Fuel-Gauge support and DT bindings documentation.

Adam Thomson (4):
mfd: da9150: Add support for Fuel-Gauge
mfd: da9150: Update DT bindings for Fuel-Gauge support
power: Add support for DA9150 Fuel-Gauge
power: da9150: Add DT bindings documentation for Fuel-Gauge

 Documentation/devicetree/bindings/mfd/da9150.txt   |   6 +
 .../devicetree/bindings/power/da9150-fg.txt        |  23 +
 drivers/mfd/da9150-core.c                          | 162 +++++-
 drivers/power/Kconfig                              |  10 +
 drivers/power/Makefile                             |   1 +
 drivers/power/da9150-fg.c                          | 589 +++++++++++++++++++++
 include/linux/mfd/da9150/core.h                    |  19 +
 include/linux/mfd/da9150/fg.h                      |  39 ++
 8 files changed, 841 insertions(+), 8 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/power/da9150-fg.txt
 create mode 100644 drivers/power/da9150-fg.c
 create mode 100644 include/linux/mfd/da9150/fg.h

--
1.9.3

#1 lore raw

PATCH 1/4 mfd: da9150: Add support for Fuel-Gauge

---
 drivers/mfd/da9150-core.c       | 162 ++++++++++++++++++++++++++++++++++++++--
 include/linux/mfd/da9150/core.h |  19 +++++
 include/linux/mfd/da9150/fg.h   |  39 ++++++++++
 3 files changed, 212 insertions(+), 8 deletions(-)
 create mode 100644 include/linux/mfd/da9150/fg.h
drivers/mfd/da9150-core.c +154 -8
index 5549817..8feb75d 100644
@@ -21,8 +21,80 @@
 #include <linux/interrupt.h>
 #include <linux/mfd/core.h>
 #include <linux/mfd/da9150/core.h>
+#include <linux/mfd/da9150/fg.h>
 #include <linux/mfd/da9150/registers.h>
 
+/* Raw device access, used for QIF */
+static int da9150_i2c_read_device(struct i2c_client *client, u8 addr, int count,
+				  u8 *buf)
+{
+	struct i2c_msg xfer;
+	int ret;
+
+	/*
+	 * Read is split into two transfers as device expects STOP/START rather
+	 * than repeated start to carry out this kind of access.
+	 */
+
+	/* Write address */
+	xfer.addr = client->addr;
+	xfer.flags = 0;
+	xfer.len = 1;
+	xfer.buf = &addr;
+
+	ret = i2c_transfer(client->adapter, &xfer, 1);
+	if (ret != 1) {
+		if (ret < 0)
+			return ret;
+		else
+			return -EIO;
+	}
+
+	/* Read data */
+	xfer.addr = client->addr;
+	xfer.flags = I2C_M_RD;
+	xfer.len = count;
+	xfer.buf = buf;
+
+	ret = i2c_transfer(client->adapter, &xfer, 1);
+	if (ret == 1)
+		return 0;
+	else if (ret < 0)
+		return ret;
+	else
+		return -EIO;
+}
+
+static int da9150_i2c_write_device(struct i2c_client *client, u8 addr,
+				   int count, const u8 *buf)
+{
+	struct i2c_msg xfer;
+	u8 *reg_data;
+	int ret;
+
+	reg_data = kzalloc(1 + count, GFP_KERNEL);
+	if (!reg_data)
+		return -ENOMEM;
+
+	reg_data[0] = addr;
+	memcpy(&reg_data[1], buf, count);
+
+	/* Write address & data */
+	xfer.addr = client->addr;
+	xfer.flags = 0;
+	xfer.len = 1 + count;
+	xfer.buf = reg_data;
+
+	ret = i2c_transfer(client->adapter, &xfer, 1);
+	kfree(reg_data);
+	if (ret == 1)
+		return 0;
+	else if (ret < 0)
+		return ret;
+	else
+		return -EIO;
+}
+
 static bool da9150_volatile_reg(struct device *dev, unsigned int reg)
 {
 	switch (reg) {
@@ -107,6 +179,28 @@ static const struct regmap_config da9150_regmap_config = {
 	.volatile_reg = da9150_volatile_reg,
 };
 
+void da9150_read_qif(struct da9150 *da9150, u8 addr, int count, u8 *buf)
+{
+	int ret;
+
+	ret = da9150->read_dev(da9150->core_qif, addr, count, buf);
+	if (ret < 0)
+		dev_err(da9150->dev, "Failed to read from QIF 0x%x: %d\n",
+			addr, ret);
+}
+EXPORT_SYMBOL_GPL(da9150_read_qif);
+
+void da9150_write_qif(struct da9150 *da9150, u8 addr, int count, const u8 *buf)
+{
+	int ret;
+
+	ret = da9150->write_dev(da9150->core_qif, addr, count, buf);
+	if (ret < 0)
+		dev_err(da9150->dev, "Failed to write to QIF 0x%x: %d\n",
+			addr, ret);
+}
+EXPORT_SYMBOL_GPL(da9150_write_qif);
+
 u8 da9150_reg_read(struct da9150 *da9150, u16 reg)
 {
 	int val, ret;
@@ -297,6 +391,15 @@ static struct resource da9150_charger_resources[] = {
 	},
 };
 
+static struct resource da9150_fg_resources[] = {
+	{
+		.name = "FG",
+		.start = DA9150_IRQ_FG,
+		.end = DA9150_IRQ_FG,
+		.flags = IORESOURCE_IRQ,
+	},
+};
+
 static struct mfd_cell da9150_devs[] = {
 	{
 		.name = "da9150-gpadc",
@@ -310,6 +413,12 @@ static struct mfd_cell da9150_devs[] = {
 		.resources = da9150_charger_resources,
 		.num_resources = ARRAY_SIZE(da9150_charger_resources),
 	},
+	{
+		.name = "da9150-fuelgauge",
+		.of_compatible = "dlg,da9150-fg",
+		.resources = da9150_fg_resources,
+		.num_resources = ARRAY_SIZE(da9150_fg_resources),
+	},
 };
 
 static int da9150_probe(struct i2c_client *client,
@@ -317,11 +426,14 @@ static int da9150_probe(struct i2c_client *client,
 {
 	struct da9150 *da9150;
 	struct da9150_pdata *pdata = dev_get_platdata(&client->dev);
+	int qif_addr;
 	int ret;
 
 	da9150 = devm_kzalloc(&client->dev, sizeof(*da9150), GFP_KERNEL);
-	if (!da9150)
-		return -ENOMEM;
+	if (!da9150) {
+		ret = -ENOMEM;
+		goto fail;
+	}
 
 	da9150->dev = &client->dev;
 	da9150->irq = client->irq;
@@ -332,19 +444,46 @@ static int da9150_probe(struct i2c_client *client,
 		ret = PTR_ERR(da9150->regmap);
 		dev_err(da9150->dev, "Failed to allocate register map: %d\n",
 			ret);
-		return ret;
+		goto fail;
+	}
+
+	/* Setup secondary I2C interface for QIF access */
+	qif_addr = da9150_reg_read(da9150, DA9150_CORE2WIRE_CTRL_A);
+	qif_addr = (qif_addr & DA9150_CORE_BASE_ADDR_MASK) >> 1;
+	qif_addr |= DA9150_QIF_I2C_ADDR_LSB;
+	da9150->core_qif = i2c_new_dummy(client->adapter, qif_addr);
+	if (!da9150->core_qif) {
+		dev_err(da9150->dev, "Failed to attach QIF client\n");
+		ret = -ENODEV;
+		goto fail;
 	}
 
-	da9150->irq_base = pdata ? pdata->irq_base : -1;
+	i2c_set_clientdata(da9150->core_qif, da9150);
+	da9150->read_dev = (read_dev_t) da9150_i2c_read_device;
+	da9150->write_dev = (write_dev_t) da9150_i2c_write_device;
+
+	if (pdata) {
+		da9150->irq_base = pdata->irq_base;
+
+		da9150_devs[2].platform_data = pdata->fg_pdata;
+		da9150_devs[2].pdata_size = sizeof(struct da9150_fg_pdata);
+	} else {
+		da9150->irq_base = -1;
+	}
 
 	ret = regmap_add_irq_chip(da9150->regmap, da9150->irq,
 				  IRQF_TRIGGER_LOW | IRQF_ONESHOT,
 				  da9150->irq_base, &da9150_regmap_irq_chip,
 				  &da9150->regmap_irq_data);
-	if (ret)
-		return ret;
+	if (ret) {
+		dev_err(da9150->dev, "Failed to add regmap irq chip: %d\n",
+			ret);
+		goto regmap_irq_fail;
+	}
+
 
 	da9150->irq_base = regmap_irq_chip_get_base(da9150->regmap_irq_data);
+
 	enable_irq_wake(da9150->irq);
 
 	ret = mfd_add_devices(da9150->dev, -1, da9150_devs,
@@ -352,11 +491,17 @@ static int da9150_probe(struct i2c_client *client,
 			      da9150->irq_base, NULL);
 	if (ret) {
 		dev_err(da9150->dev, "Failed to add child devices: %d\n", ret);
-		regmap_del_irq_chip(da9150->irq, da9150->regmap_irq_data);
-		return ret;
+		goto mfd_fail;
 	}
 
 	return 0;
+
+mfd_fail:
+	regmap_del_irq_chip(da9150->irq, da9150->regmap_irq_data);
+regmap_irq_fail:
+	i2c_unregister_device(da9150->core_qif);
+fail:
+	return ret;
 }
 
 static int da9150_remove(struct i2c_client *client)
@@ -365,6 +510,7 @@ static int da9150_remove(struct i2c_client *client)
 
 	regmap_del_irq_chip(da9150->irq, da9150->regmap_irq_data);
 	mfd_remove_devices(da9150->dev);
+	i2c_unregister_device(da9150->core_qif);
 
 	return 0;
 }
include/linux/mfd/da9150/core.h +19 -0
index 76e6689..98ecfea 100644
@@ -15,9 +15,11 @@
 #define __DA9150_CORE_H
 
 #include <linux/device.h>
+#include <linux/i2c.h>
 #include <linux/interrupt.h>
 #include <linux/regmap.h>
 
+
 /* I2C address paging */
 #define DA9150_REG_PAGE_SHIFT	8
 #define DA9150_REG_PAGE_MASK	0xFF
@@ -46,23 +48,40 @@
 #define DA9150_IRQ_GPADC	19
 #define DA9150_IRQ_WKUP		20
 
+/* Platform Data */
+struct da9150_fg_pdata;
+
 struct da9150_pdata {
 	int irq_base;
+	struct da9150_fg_pdata *fg_pdata;
 };
 
+/* I/O function typedefs for raw access */
+typedef int (*read_dev_t)(void *client, u8 addr, int count, u8 *buf);
+typedef int (*write_dev_t)(void *client, u8 addr, int count, const u8 *buf);
+
 struct da9150 {
 	struct device *dev;
 	struct regmap *regmap;
+	struct i2c_client *core_qif;
+
+	read_dev_t read_dev;
+	write_dev_t write_dev;
+
 	struct regmap_irq_chip_data *regmap_irq_data;
 	int irq;
 	int irq_base;
 };
 
 /* Device I/O */
+void da9150_read_qif(struct da9150 *da9150, u8 addr, int count, u8 *buf);
+void da9150_write_qif(struct da9150 *da9150, u8 addr, int count, const u8 *buf);
+
 u8 da9150_reg_read(struct da9150 *da9150, u16 reg);
 void da9150_reg_write(struct da9150 *da9150, u16 reg, u8 val);
 void da9150_set_bits(struct da9150 *da9150, u16 reg, u8 mask, u8 val);
 
 void da9150_bulk_read(struct da9150 *da9150, u16 reg, int count, u8 *buf);
 void da9150_bulk_write(struct da9150 *da9150, u16 reg, int count, const u8 *buf);
+
 #endif /* __DA9150_CORE_H */
include/linux/mfd/da9150/fg.h new file +39 -0
new file mode 100644
index 0000000..2cff203
@@ -0,0 +1,39 @@
+/*
+ * DA9150 MFD Driver - Fuel Gauge Data
+ *
+ * Copyright (c) 2015 Dialog Semiconductor
+ *
+ * Author: Adam Thomson <[email protected]>
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+
+#ifndef __DA9150_FG_H
+#define __DA9150_FG_H
+
+#include <linux/power_supply.h>
+
+/* I2C sub-device address */
+#define DA9150_QIF_I2C_ADDR_LSB		0x5
+
+/* Platform data */
+struct da9150_fg_pdata {
+	u32 update_interval;	/* msecs */
+	u8 warn_soc_lvl;	/* % value */
+	u8 crit_soc_lvl;	/* % value */
+};
+
+/*
+ * Function template to provide battery temperature. Should provide
+ * 0.1 degrees C resolution return values.
+ */
+typedef int (*da9150_read_temp_t)(void *context);
+
+/* Register temp callback function */
+void da9150_fg_register_temp_cb(struct power_supply *psy, da9150_read_temp_t cb,
+				void *cb_context);
+
+#endif /* __DA9150_FG_H */
Signature · 1 line
1.9.3
#7 lore raw

PATCH 2/4 mfd: da9150: Update DT bindings for Fuel-Gauge support

In reply to Adam Thomson
---
 Documentation/devicetree/bindings/mfd/da9150.txt | 6 ++++++
 1 file changed, 6 insertions(+)
Documentation/devicetree/bindings/mfd/da9150.txt +6 -0
index d0588ea..8bf1a20 100644
@@ -6,6 +6,7 @@ Device			 Description
 ------			 -----------
 da9150-gpadc		: General Purpose ADC
 da9150-charger		: Battery Charger
+da9150-fg		: Battery Fuel-Gauge
 
 ======
 
@@ -22,6 +23,7 @@ Required properties:
 Sub-devices:
 - da9150-gpadc: See Documentation/devicetree/bindings/iio/adc/da9150-gpadc.txt
 - da9150-charger: See Documentation/devicetree/bindings/power/da9150-charger.txt
+- da9150-fg: See Documentation/devicetree/bindings/power/da9150-fg.txt
 
 
 Example:
@@ -40,4 +42,8 @@ Example:
 		da9150-charger {
 			...
 		};
+
+		da9150-fg {
+			...
+		};
 	};
Signature · 1 line
1.9.3
#8 lore raw

PATCH 3/4 power: Add support for DA9150 Fuel-Gauge

In reply to Adam Thomson
---
 drivers/power/Kconfig     |  10 +
 drivers/power/Makefile    |   1 +
 drivers/power/da9150-fg.c | 589 ++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 600 insertions(+)
 create mode 100644 drivers/power/da9150-fg.c
drivers/power/Kconfig +10 -0
index 4091fb0..8054f1a 100644
@@ -204,6 +204,16 @@ config CHARGER_DA9150
 	  This driver can also be built as a module. If so, the module will be
 	  called da9150-charger.
 
+config FG_DA9150
+	tristate "Dialog Semiconductor DA9150 Fuel Gauge support"
+	depends on CHARGER_DA9150
+	help
+	  Say Y here to enable support for the Fuel-Gauge unit of the DA9150
+	  Integrated Charger & Fuel-Gauge IC
+
+	  This driver can also be built as a module. If so, the module will be
+	  called da9150-fg.
+
 config AXP288_FUEL_GAUGE
 	tristate "X-Powers AXP288 Fuel Gauge"
 	depends on MFD_AXP20X && IIO
drivers/power/Makefile +1 -0
index b7b0181..b421b54 100644
@@ -33,6 +33,7 @@ obj-$(CONFIG_BATTERY_BQ27x00)	+= bq27x00_battery.o
 obj-$(CONFIG_BATTERY_DA9030)	+= da9030_battery.o
 obj-$(CONFIG_BATTERY_DA9052)	+= da9052-battery.o
 obj-$(CONFIG_CHARGER_DA9150)	+= da9150-charger.o
+obj-$(CONFIG_FG_DA9150)		+= da9150-fg.o
 obj-$(CONFIG_BATTERY_MAX17040)	+= max17040_battery.o
 obj-$(CONFIG_BATTERY_MAX17042)	+= max17042_battery.o
 obj-$(CONFIG_BATTERY_Z2)	+= z2_battery.o
drivers/power/da9150-fg.c new file +589 -0

589 lines not on this page · raw message

Signature · 1 line
1.9.3
#11 lore raw

PATCH 4/4 power: da9150: Add DT bindings documentation for Fuel-Gauge

In reply to Adam Thomson
---
 .../devicetree/bindings/power/da9150-fg.txt        | 23 ++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/power/da9150-fg.txt
Documentation/devicetree/bindings/power/da9150-fg.txt new file +23 -0
new file mode 100644
index 0000000..c3c76eb
@@ -0,0 +1,23 @@
+Dialog Semiconductor DA9150 Fuel-Gauge Power Supply bindings
+
+Required properties:
+- compatible: "dlg,da9150-fg" for DA9150 Fuel-Gauge Power Supply
+
+Optional properties:
+- dlg,update-interval: Interval time (milliseconds) between battery level checks.
+- dlg,warn-soc-level: Battery discharge level (%) where warning event raised.
+      [1 - 100]
+- dlg,crit-soc-level: Battery discharge level (%) where critical event raised.
+  This value should be lower than the warning level.
+      [1 - 100]
+
+
+Example:
+
+	da9150-fg {
+		compatible = "dlg,da9150-fg";
+
+		dlg,update-interval = <10000>;
+		dlg,warn-soc-level = /bits/ 8 <15>;
+		dlg,crit-soc-level = /bits/ 8 <5>;
+	};
Signature · 1 line
1.9.3
#2 lore raw

Re: [PATCH 1/4] mfd: da9150: Add support for Fuel-Gauge

In reply to Adam Thomson

include/linux/mfd/da9150/fg.h line 37

Quoted 12 lines · Adam Thomson
include/linux/mfd/da9150/fg.h new file +9 -0
 
+/*
+ * Function template to provide battery temperature. Should provide
+ * 0.1 degrees C resolution return values.
+ */
+typedef int (*da9150_read_temp_t)(void *context);
+
+/* Register temp callback function */
+void da9150_fg_register_temp_cb(struct power_supply *psy, da9150_read_temp_t cb,
+				void *cb_context);

The pedant in me noticed that this function is actually added in 3/4. So this chunk might be moved to 3/4, if you like to entertain pedantry like that, that is. (But see my remark on 3/4 too.)

Paul Bolle

--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in

#9 lore raw

Re: [PATCH 3/4] power: Add support for DA9150 Fuel-Gauge

In reply to Adam Thomson

drivers/power/da9150-fg.c line 376

Quoted 13 lines · Adam Thomson
drivers/power/da9150-fg.c new file +10 -0
 
+/* Register external function to give battery temperature */
+void da9150_fg_register_temp_cb(struct power_supply *psy, da9150_read_temp_t cb,
+				void *cb_context)
+{
+	struct da9150_fg *fg = dev_get_drvdata(psy->dev.parent);
+
+	fg->read_bat_temp = cb;
+	fg->bat_temp_context = cb_context;
+}
+EXPORT_SYMBOL_GPL(da9150_fg_register_temp_cb);

This series doesn't add a user of this export. Actually, it doesn't even add a local caller of this function. Is a patch that adds a user of this function queued somewhere?

Paul Bolle

--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in

#10 lore raw

RE: [PATCH 3/4] power: Add support for DA9150 Fuel-Gauge

Quoted 7 lines · Paul Bolle

drivers/power/da9150-fg.c

Quoted 5 lines · Adam Thomson
drivers/power/da9150-fg.c new file +2 -0
 
+/* Register external function to give battery temperature */
+void da9150_fg_register_temp_cb(struct power_supply *psy,

da9150_read_temp_t cb,

Quoted 12 lines

drivers/power/da9150-fg.c line 376

Quoted 8 lines
drivers/power/da9150-fg.c new file +8 -0
+				void *cb_context)
+{
+	struct da9150_fg *fg = dev_get_drvdata(psy->dev.parent);
+
+	fg->read_bat_temp = cb;
+	fg->bat_temp_context = cb_context;
+}
+EXPORT_SYMBOL_GPL(da9150_fg_register_temp_cb);

This series doesn't add a user of this export. Actually, it doesn't even add a local caller of this function. Is a patch that adds a user of this function queued somewhere?

The device relies on the battery providing temperature through a dedicated pin, but that isn't always the case. I added this function as a means to handle the scenarios where the battery being used didn't provide such a feature so this allows for an alternative method of giving the battery temperature. At present there is no patch lined up to use this.

#3 lore raw

RE: [PATCH 1/4] mfd: da9150: Add support for Fuel-Gauge

In reply to Paul Bolle

T24gSnVuZSAxOSwgMjAxNSAxNzo0OCwgUGF1bCBCb2xsZSB3cm90ZToNCg0KPiBPbiBUaHUsIDIw MTUtMDYtMTggYXQgMTc6MDYgKzAxMDAsIEFkYW0gVGhvbXNvbiB3cm90ZToNCj4gPiAtLS0gL2Rl di9udWxsDQo+ID4gKysrIGIvaW5jbHVkZS9saW51eC9tZmQvZGE5MTUwL2ZnLmgNCj4gDQo+ID4g Ky8qDQo+ID4gKyAqIEZ1bmN0aW9uIHRlbXBsYXRlIHRvIHByb3ZpZGUgYmF0dGVyeSB0ZW1wZXJh dHVyZS4gU2hvdWxkIHByb3ZpZGUNCj4gPiArICogMC4xIGRlZ3JlZXMgQyByZXNvbHV0aW9uIHJl dHVybiB2YWx1ZXMuDQo+ID4gKyAqLw0KPiA+ICt0eXBlZGVmIGludCAoKmRhOTE1MF9yZWFkX3Rl bXBfdCkodm9pZCAqY29udGV4dCk7DQo+ID4gKw0KPiA+ICsvKiBSZWdpc3RlciB0ZW1wIGNhbGxi YWNrIGZ1bmN0aW9uICovDQo+ID4gK3ZvaWQgZGE5MTUwX2ZnX3JlZ2lzdGVyX3RlbXBfY2Ioc3Ry dWN0IHBvd2VyX3N1cHBseSAqcHN5LA0KPiBkYTkxNTBfcmVhZF90ZW1wX3QgY2IsDQo+ID4gKwkJ CQl2b2lkICpjYl9jb250ZXh0KTsNCj4gDQo+IFRoZSBwZWRhbnQgaW4gbWUgbm90aWNlZCB0aGF0 IHRoaXMgZnVuY3Rpb24gaXMgYWN0dWFsbHkgYWRkZWQgaW4gMy80LiBTbw0KPiB0aGlzIGNodW5r IG1pZ2h0IGJlIG1vdmVkIHRvIDMvNCwgaWYgeW91IGxpa2UgdG8gZW50ZXJ0YWluIHBlZGFudHJ5 IGxpa2UNCj4gdGhhdCwgdGhhdCBpcy4gKEJ1dCBzZWUgbXkgcmVtYXJrIG9uIDMvNCB0b28uKQ0K DQpUaGlzIGlzIHRydWUsIGJ1dCBhcyB0aGUgaGVhZGVyIGlzIHBhcnQgb2YgTUZELCBJIGluY2x1 ZGVkIGl0IGFzIHBhcnQgb2YgdGhhdA0KcGF0Y2ggYXMgSSB0aG91Z2h0IHRoaXMgbWFkZSBtb3Jl IHNlbnNlLiBJIGd1ZXNzIExlZSB3aWxsIGNvbW1lbnQgYXMgdG8gd2hldGhlcg0KdGhhdCB3YXMg Y29ycmVjdCBvciBub3QuIDopDQo=
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in

#4 lore raw

Re: [PATCH 1/4] mfd: da9150: Add support for Fuel-Gauge

Quoted 21 lines · Opensource [Adam Thomson]
Quoted 13 lines · Paul Bolle

include/linux/mfd/da9150/fg.h

Quoted 11 lines · Adam Thomson
include/linux/mfd/da9150/fg.h new file +8 -0
 
+/*
+ * Function template to provide battery temperature. Should provide
+ * 0.1 degrees C resolution return values.
+ */
+typedef int (*da9150_read_temp_t)(void *context);
+
+/* Register temp callback function */
+void da9150_fg_register_temp_cb(struct power_supply *psy,

da9150_read_temp_t cb,

Quoted 5 lines

include/linux/mfd/da9150/fg.h line 37

Quoted 1 line
include/linux/mfd/da9150/fg.h new file +1 -0
+				void *cb_context);

The pedant in me noticed that this function is actually added in 3/4. So this chunk might be moved to 3/4, if you like to entertain pedantry like that, that is. (But see my remark on 3/4 too.)

Quoted 3 lines

This is true, but as the header is part of MFD, I included it as part of that patch as I thought this made more sense. I guess Lee will comment as to whether that was correct or not. :)

Glanced over this (as I still have 240 unread emails to attend to). If the question is whether to submit the prototype at the same time as the associated function, the answer is yes.

Signature · 6 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
#5 lore raw

RE: [PATCH 1/4] mfd: da9150: Add support for Fuel-Gauge

Quoted 11 lines · Lee Jones
Quoted 7 lines
Quoted 3 lines

The pedant in me noticed that this function is actually added in 3/4. So this chunk might be moved to 3/4, if you like to entertain pedantry like that, that is. (But see my remark on 3/4 too.)

This is true, but as the header is part of MFD, I included it as part of that patch as I thought this made more sense. I guess Lee will comment as to whether that was correct or not. :)

Glanced over this (as I still have 240 unread emails to attend to). If the question is whether to submit the prototype at the same time as the associated function, the answer is yes.

Hope you've managed to trawl through the e-mails.

The question was whether or not the function and prototype should be submitted as part of the same individual patch file. Both are submitted as part of the patch set but the prototype resides in the MFD patch, and the function in the power (fuel-gauge) patch. Personally, this seems fine to me but I'm not a maintainer.

#6 lore raw

Re: [PATCH 1/4] mfd: da9150: Add support for Fuel-Gauge

Quoted 14 lines · Opensource [Adam Thomson]
Quoted 11 lines · Lee Jones
Quoted 7 lines
Quoted 3 lines

The pedant in me noticed that this function is actually added in 3/4. So this chunk might be moved to 3/4, if you like to entertain pedantry like that, that is. (But see my remark on 3/4 too.)

This is true, but as the header is part of MFD, I included it as part of that patch as I thought this made more sense. I guess Lee will comment as to whether that was correct or not. :)

Glanced over this (as I still have 240 unread emails to attend to). If the question is whether to submit the prototype at the same time as the associated function, the answer is yes.

Quoted 7 lines

Hope you've managed to trawl through the e-mails.

The question was whether or not the function and prototype should be submitted as part of the same individual patch file. Both are submitted as part of the patch set but the prototype resides in the MFD patch, and the function in the power (fuel-gauge) patch. Personally, this seems fine to me but I'm not a maintainer.

Please move the prototype into the same patch that introduced the function.

Signature · 8 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html