* [PATCH 0/3] DT support for bq2415x
@ 2013-11-24 16:49 Sebastian Reichel
2013-11-24 16:49 ` [PATCH 1/3] power_supply: add power_supply_get_by_phandle Sebastian Reichel
` (3 more replies)
0 siblings, 4 replies; 11+ messages in thread
From: Sebastian Reichel @ 2013-11-24 16:49 UTC (permalink / raw)
To: Sebastian Reichel, Anton Vorontsov, David Woodhouse
Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
Ian Campbell, Rob Landley, linux-kernel, linux-omap, devicetree,
Pali Rohár, freemangordon, aaro.koskinen, pavel,
Sebastian Reichel
Hi,
This patchset adds DT support for the bq2415x charger, which is used in the
Nokia N900. The changes depend on Pali Rohár's "[PATCH v2 0/3] Add support for
charging battery in Nokia RX-51" patchset [0].
[0] https://lkml.org/lkml/2013/11/19/106
-- Sebastian
Sebastian Reichel (3):
power_supply: add power_supply_get_by_phandle
bq2415x_charger: add DT support
dt: binding documentation for bq2415x charger
.../devicetree/bindings/power/bq2415x.txt | 43 +++++++++++++
drivers/power/bq2415x_charger.c | 72 ++++++++++++++++------
drivers/power/power_supply_core.c | 24 ++++++++
include/linux/power_supply.h | 2 +
4 files changed, 121 insertions(+), 20 deletions(-)
create mode 100644 Documentation/devicetree/bindings/power/bq2415x.txt
--
1.8.4.3
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 1/3] power_supply: add power_supply_get_by_phandle
2013-11-24 16:49 [PATCH 0/3] DT support for bq2415x Sebastian Reichel
@ 2013-11-24 16:49 ` Sebastian Reichel
2013-11-25 12:32 ` Pavel Machek
[not found] ` <1385311771-447-2-git-send-email-sre-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org>
2013-11-24 16:49 ` [PATCH 2/3] bq2415x_charger: add DT support Sebastian Reichel
` (2 subsequent siblings)
3 siblings, 2 replies; 11+ messages in thread
From: Sebastian Reichel @ 2013-11-24 16:49 UTC (permalink / raw)
To: Sebastian Reichel, Anton Vorontsov, David Woodhouse
Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
Ian Campbell, Rob Landley, linux-kernel, linux-omap, devicetree,
Pali Rohár, freemangordon, aaro.koskinen, pavel,
Sebastian Reichel
Add method to get power supply by device tree phandle.
Signed-off-by: Sebastian Reichel <sre@debian.org>
---
drivers/power/power_supply_core.c | 24 ++++++++++++++++++++++++
include/linux/power_supply.h | 2 ++
2 files changed, 26 insertions(+)
diff --git a/drivers/power/power_supply_core.c b/drivers/power/power_supply_core.c
index 08bce22..99e4b41 100644
--- a/drivers/power/power_supply_core.c
+++ b/drivers/power/power_supply_core.c
@@ -340,6 +340,30 @@ struct power_supply *power_supply_get_by_name(const char *name)
}
EXPORT_SYMBOL_GPL(power_supply_get_by_name);
+static int power_supply_match_device_node(struct device *dev, const void *data)
+{
+ return dev->parent && dev->parent->of_node == data;
+}
+
+struct power_supply *power_supply_get_by_phandle(struct device_node *np,
+ const char *property)
+{
+ struct device_node *power_supply_np;
+ struct device *dev;
+
+ power_supply_np = of_parse_phandle(np, property, 0);
+ if (!power_supply_np)
+ return ERR_PTR(-ENODEV);
+
+ dev = class_find_device(power_supply_class, NULL, power_supply_np,
+ power_supply_match_device_node);
+
+ of_node_put(power_supply_np);
+
+ return dev ? dev_get_drvdata(dev) : NULL;
+}
+EXPORT_SYMBOL_GPL(power_supply_get_by_phandle);
+
int power_supply_powers(struct power_supply *psy, struct device *dev)
{
return sysfs_create_link(&psy->dev->kobj, &dev->kobj, "powers");
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index c6f52c0..4d0e0b4 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -246,6 +246,8 @@ extern struct atomic_notifier_head power_supply_notifier;
extern int power_supply_reg_notifier(struct notifier_block *nb);
extern void power_supply_unreg_notifier(struct notifier_block *nb);
extern struct power_supply *power_supply_get_by_name(const char *name);
+extern struct power_supply *power_supply_get_by_phandle(struct device_node *np,
+ const char *property);
extern void power_supply_changed(struct power_supply *psy);
extern int power_supply_am_i_supplied(struct power_supply *psy);
extern int power_supply_set_battery_charged(struct power_supply *psy);
--
1.8.4.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 2/3] bq2415x_charger: add DT support
2013-11-24 16:49 [PATCH 0/3] DT support for bq2415x Sebastian Reichel
2013-11-24 16:49 ` [PATCH 1/3] power_supply: add power_supply_get_by_phandle Sebastian Reichel
@ 2013-11-24 16:49 ` Sebastian Reichel
2013-11-25 12:39 ` Pavel Machek
2013-11-24 16:49 ` [PATCH 3/3] dt: binding documentation for bq2415x charger Sebastian Reichel
2013-12-24 2:20 ` [PATCH 0/3] DT support for bq2415x Anton Vorontsov
3 siblings, 1 reply; 11+ messages in thread
From: Sebastian Reichel @ 2013-11-24 16:49 UTC (permalink / raw)
To: Sebastian Reichel, Anton Vorontsov, David Woodhouse
Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
Ian Campbell, Rob Landley, linux-kernel, linux-omap, devicetree,
Pali Rohár, freemangordon, aaro.koskinen, pavel,
Sebastian Reichel
This adds DT support to the bq2415x driver.
Signed-off-by: Sebastian Reichel <sre@debian.org>
---
drivers/power/bq2415x_charger.c | 72 +++++++++++++++++++++++++++++------------
1 file changed, 52 insertions(+), 20 deletions(-)
diff --git a/drivers/power/bq2415x_charger.c b/drivers/power/bq2415x_charger.c
index d89583d..76a140c 100644
--- a/drivers/power/bq2415x_charger.c
+++ b/drivers/power/bq2415x_charger.c
@@ -170,6 +170,7 @@ struct bq2415x_device {
struct bq2415x_platform_data init_data;
struct power_supply charger;
struct delayed_work work;
+ struct power_supply *notify_psy;
struct notifier_block nb;
enum bq2415x_mode reported_mode;/* mode reported by hook function */
enum bq2415x_mode mode; /* current configured mode */
@@ -806,7 +807,7 @@ static int bq2415x_notifier_call(struct notifier_block *nb,
if (val != PSY_EVENT_PROP_CHANGED)
return NOTIFY_OK;
- if (strcmp(psy->name, bq->init_data.notify_device) != 0)
+ if (psy != bq->notify_psy)
return NOTIFY_OK;
dev_dbg(bq->dev, "notifier call was called\n");
@@ -1538,10 +1539,11 @@ static int bq2415x_probe(struct i2c_client *client,
int num;
char *name;
struct bq2415x_device *bq;
- struct power_supply *psy;
+ struct device_node *np = client->dev.of_node;
+ struct bq2415x_platform_data *pdata = client->dev.platform_data;
- if (!client->dev.platform_data) {
- dev_err(&client->dev, "platform data not set\n");
+ if (!np && !pdata) {
+ dev_err(&client->dev, "platform data missing\n");
return -ENODEV;
}
@@ -1566,6 +1568,17 @@ static int bq2415x_probe(struct i2c_client *client,
goto error_2;
}
+ if (np) {
+ bq->notify_psy = power_supply_get_by_phandle(np, "ti,usb-charger-detection");
+
+ if (!bq->notify_psy)
+ return -EPROBE_DEFER;
+ }
+ else if (pdata->notify_device)
+ bq->notify_psy = power_supply_get_by_name(pdata->notify_device);
+ else
+ bq->notify_psy = NULL;
+
i2c_set_clientdata(client, bq);
bq->id = num;
@@ -1577,8 +1590,34 @@ static int bq2415x_probe(struct i2c_client *client,
bq->autotimer = 0;
bq->automode = 0;
- memcpy(&bq->init_data, client->dev.platform_data,
- sizeof(bq->init_data));
+ if (np) {
+ ret = of_property_read_u32(np, "ti,current-limit",
+ &bq->init_data.current_limit);
+ if (ret)
+ return ret;
+ ret = of_property_read_u32(np, "ti,weak-battery-voltage",
+ &bq->init_data.weak_battery_voltage);
+ if (ret)
+ return ret;
+ ret = of_property_read_u32(np, "ti,battery-regulation-voltage",
+ &bq->init_data.battery_regulation_voltage);
+ if (ret)
+ return ret;
+ ret = of_property_read_u32(np, "ti,charge-current",
+ &bq->init_data.charge_current);
+ if (ret)
+ return ret;
+ ret = of_property_read_u32(np, "ti,termination-current",
+ &bq->init_data.termination_current);
+ if (ret)
+ return ret;
+ ret = of_property_read_u32(np, "ti,resistor-sense",
+ &bq->init_data.resistor_sense);
+ if (ret)
+ return ret;
+ } else {
+ memcpy(&bq->init_data, pdata, sizeof(bq->init_data));
+ }
bq2415x_reset_chip(bq);
@@ -1600,25 +1639,18 @@ static int bq2415x_probe(struct i2c_client *client,
goto error_4;
}
- if (bq->init_data.notify_device) {
+ if (bq->notify_psy) {
bq->nb.notifier_call = bq2415x_notifier_call;
ret = power_supply_reg_notifier(&bq->nb);
if (ret) {
dev_err(bq->dev, "failed to reg notifier: %d\n", ret);
goto error_5;
}
- psy = power_supply_get_by_name(bq->init_data.notify_device);
- if (psy) {
- /* Query for initial reported_mode and set it */
- bq2415x_notifier_call(&bq->nb,
- PSY_EVENT_PROP_CHANGED, psy);
- bq2415x_set_mode(bq, bq->reported_mode);
- } else {
- dev_info(bq->dev, "notifier power supply device (%s) "
- "for automode is not registred yet... "
- "automode will not work without that device\n",
- bq->init_data.notify_device);
- }
+
+ /* Query for initial reported_mode and set it */
+ bq2415x_notifier_call(&bq->nb, PSY_EVENT_PROP_CHANGED, bq->notify_psy);
+ bq2415x_set_mode(bq, bq->reported_mode);
+
bq->automode = 1;
dev_info(bq->dev, "automode enabled\n");
} else {
@@ -1653,7 +1685,7 @@ static int bq2415x_remove(struct i2c_client *client)
{
struct bq2415x_device *bq = i2c_get_clientdata(client);
- if (bq->init_data.notify_device)
+ if (bq->notify_psy)
power_supply_unreg_notifier(&bq->nb);
bq2415x_sysfs_exit(bq);
--
1.8.4.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 3/3] dt: binding documentation for bq2415x charger
2013-11-24 16:49 [PATCH 0/3] DT support for bq2415x Sebastian Reichel
2013-11-24 16:49 ` [PATCH 1/3] power_supply: add power_supply_get_by_phandle Sebastian Reichel
2013-11-24 16:49 ` [PATCH 2/3] bq2415x_charger: add DT support Sebastian Reichel
@ 2013-11-24 16:49 ` Sebastian Reichel
2013-11-25 13:07 ` Pavel Machek
2013-12-24 2:20 ` [PATCH 0/3] DT support for bq2415x Anton Vorontsov
3 siblings, 1 reply; 11+ messages in thread
From: Sebastian Reichel @ 2013-11-24 16:49 UTC (permalink / raw)
To: Sebastian Reichel, Anton Vorontsov, David Woodhouse
Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
Ian Campbell, Rob Landley, linux-kernel, linux-omap, devicetree,
Pali Rohár, freemangordon, aaro.koskinen, pavel,
Sebastian Reichel
Add devicetree binding documentation for bq2415x charger.
Signed-off-by: Sebastian Reichel <sre@debian.org>
---
.../devicetree/bindings/power/bq2415x.txt | 43 ++++++++++++++++++++++
1 file changed, 43 insertions(+)
create mode 100644 Documentation/devicetree/bindings/power/bq2415x.txt
diff --git a/Documentation/devicetree/bindings/power/bq2415x.txt b/Documentation/devicetree/bindings/power/bq2415x.txt
new file mode 100644
index 0000000..cb2e753
--- /dev/null
+++ b/Documentation/devicetree/bindings/power/bq2415x.txt
@@ -0,0 +1,43 @@
+Binding for TI bq2415x Li-Ion Charger
+
+Required properties:
+- compatible: Should contain one of the following:
+ * "ti,bq24150"
+ * "ti,bq24150"
+ * "ti,bq24150a"
+ * "ti,bq24151"
+ * "ti,bq24151a"
+ * "ti,bq24152"
+ * "ti,bq24153"
+ * "ti,bq24153a"
+ * "ti,bq24155"
+ * "ti,bq24156"
+ * "ti,bq24156a"
+ * "ti,bq24158"
+- reg: integer, i2c address of the device
+- ti,current-limit: integer, current limit in mA
+- ti,weak-battery-voltage: integer, weak battery voltage threshold in mV
+- ti,battery-regulation-voltage: integer, battery regulation voltage in mV
+- ti,charge-current: integer, charging current in mA
+- ti,termination-current: integer, termination current in mA
+- ti,resistor-sense: integer, value of sensing resistor in milliohm
+
+Optional properties:
+- ti,usb-charger-detection: phandle to usb charger detection device
+ (required for auto mode)
+
+Example from Nokia N900:
+
+bq24150a {
+ compatible = "ti,bq24150a";
+ reg = <0x6b>;
+
+ ti,current-limit = <100>;
+ ti,weak-battery-voltage = <3400>;
+ ti,battery-regulation-voltage = <4200>;
+ ti,charge-current = <650>;
+ ti,termination-current = <100>;
+ ti,resistor-sense = <68>;
+
+ ti,usb-charger-detection = <&isp1704>;
+};
--
1.8.4.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 1/3] power_supply: add power_supply_get_by_phandle
2013-11-24 16:49 ` [PATCH 1/3] power_supply: add power_supply_get_by_phandle Sebastian Reichel
@ 2013-11-25 12:32 ` Pavel Machek
[not found] ` <1385311771-447-2-git-send-email-sre-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org>
1 sibling, 0 replies; 11+ messages in thread
From: Pavel Machek @ 2013-11-25 12:32 UTC (permalink / raw)
To: Sebastian Reichel
Cc: Sebastian Reichel, Anton Vorontsov, David Woodhouse, Rob Herring,
Pawel Moll, Mark Rutland, Stephen Warren, Ian Campbell,
Rob Landley, linux-kernel, linux-omap, devicetree,
Pali Rohár, freemangordon, aaro.koskinen
On Sun 2013-11-24 17:49:29, Sebastian Reichel wrote:
> Add method to get power supply by device tree phandle.
>
> Signed-off-by: Sebastian Reichel <sre@debian.org>
Reviewed-by: Pavel Machek <pavel@ucw.cz>
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/3] bq2415x_charger: add DT support
2013-11-24 16:49 ` [PATCH 2/3] bq2415x_charger: add DT support Sebastian Reichel
@ 2013-11-25 12:39 ` Pavel Machek
0 siblings, 0 replies; 11+ messages in thread
From: Pavel Machek @ 2013-11-25 12:39 UTC (permalink / raw)
To: Sebastian Reichel
Cc: Sebastian Reichel, Anton Vorontsov, David Woodhouse, Rob Herring,
Pawel Moll, Mark Rutland, Stephen Warren, Ian Campbell,
Rob Landley, linux-kernel, linux-omap, devicetree,
Pali Rohár, freemangordon, aaro.koskinen
On Sun 2013-11-24 17:49:30, Sebastian Reichel wrote:
> This adds DT support to the bq2415x driver.
>
> Signed-off-by: Sebastian Reichel <sre@debian.org>
Reviewed-by: Pavel Machek <pavel@ucw.cz>
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 3/3] dt: binding documentation for bq2415x charger
2013-11-24 16:49 ` [PATCH 3/3] dt: binding documentation for bq2415x charger Sebastian Reichel
@ 2013-11-25 13:07 ` Pavel Machek
0 siblings, 0 replies; 11+ messages in thread
From: Pavel Machek @ 2013-11-25 13:07 UTC (permalink / raw)
To: Sebastian Reichel
Cc: Sebastian Reichel, Anton Vorontsov, David Woodhouse, Rob Herring,
Pawel Moll, Mark Rutland, Stephen Warren, Ian Campbell,
Rob Landley, linux-kernel, linux-omap, devicetree,
Pali Rohár, freemangordon, aaro.koskinen
On Sun 2013-11-24 17:49:31, Sebastian Reichel wrote:
> Add devicetree binding documentation for bq2415x charger.
>
> Signed-off-by: Sebastian Reichel <sre@debian.org>
Thanks!
> +- reg: integer, i2c address of the device
> +- ti,current-limit: integer, current limit in mA
Does this need to be "ti," specific? Most of fields are likely to be
needed for other li-ion chargers....
"Specifies maximum current charger can pull from power supply"
?
> +- ti,charge-current: integer, charging current in mA
...why/how is it different from current-limit? Is the current-limit on
5V, while the charge-current relative to battery voltage... so that
charge-current can be > current-limit when battery voltage is low?
"Maximum current that will be supplied to the battery, as determined
by voltage on current sense resistor"?
> +- ti,weak-battery-voltage: integer, weak battery voltage threshold in mV
It would be good to explain what this threshold means. Voltage so low
that system needs to be shut down?
Hmm, it looks to me like it is "as long as battery is below this
voltage, fast charge is not started. Instead, slow 'precharge' is
performed."
> +- ti,battery-regulation-voltage: integer, battery regulation
> voltage in mV
"Selects maximum voltage for charging."
> +- ti,termination-current: integer, termination current in mA
"When current in constant-voltage phase drops below this value, charge
is terminated".
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/3] power_supply: add power_supply_get_by_phandle
[not found] ` <1385311771-447-2-git-send-email-sre-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org>
@ 2013-12-24 2:20 ` Anton Vorontsov
2013-12-24 3:37 ` Sebastian Reichel
0 siblings, 1 reply; 11+ messages in thread
From: Anton Vorontsov @ 2013-12-24 2:20 UTC (permalink / raw)
To: Sebastian Reichel
Cc: Sebastian Reichel, David Woodhouse, Rob Herring, Pawel Moll,
Mark Rutland, Stephen Warren, Ian Campbell, Rob Landley,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-omap-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA, Pali Rohár,
freemangordon-uiMcrn6V0Vs, aaro.koskinen-X3B1VOXEql0,
pavel-+ZI9xUNit7I
On Sun, Nov 24, 2013 at 05:49:29PM +0100, Sebastian Reichel wrote:
> Add method to get power supply by device tree phandle.
>
> Signed-off-by: Sebastian Reichel <sre-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org>
> ---
> drivers/power/power_supply_core.c | 24 ++++++++++++++++++++++++
> include/linux/power_supply.h | 2 ++
> 2 files changed, 26 insertions(+)
>
> diff --git a/drivers/power/power_supply_core.c b/drivers/power/power_supply_core.c
> index 08bce22..99e4b41 100644
> --- a/drivers/power/power_supply_core.c
> +++ b/drivers/power/power_supply_core.c
> @@ -340,6 +340,30 @@ struct power_supply *power_supply_get_by_name(const char *name)
...
> +
> + dev = class_find_device(power_supply_class, NULL, power_supply_np,
> + power_supply_match_device_node);
> +
> + of_node_put(power_supply_np);
> +
> + return dev ? dev_get_drvdata(dev) : NULL;
> +}
> +EXPORT_SYMBOL_GPL(power_supply_get_by_phandle);
The code had no !CONFIG_OF protection so I had to make the following
changes to this patch:
diff --git a/drivers/power/power_supply_core.c b/drivers/power/power_supply_core.c
index 23cd055..2660664 100644
--- a/drivers/power/power_supply_core.c
+++ b/drivers/power/power_supply_core.c
@@ -341,6 +341,7 @@ struct power_supply *power_supply_get_by_name(const char *name)
}
EXPORT_SYMBOL_GPL(power_supply_get_by_name);
+#ifdef CONFIG_OF
static int power_supply_match_device_node(struct device *dev, const void *data)
{
return dev->parent && dev->parent->of_node == data;
@@ -364,6 +365,7 @@ struct power_supply *power_supply_get_by_phandle(struct device_node *np,
return dev ? dev_get_drvdata(dev) : NULL;
}
EXPORT_SYMBOL_GPL(power_supply_get_by_phandle);
+#endif /* CONFIG_OF */
int power_supply_powers(struct power_supply *psy, struct device *dev)
{
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 8d06537..c9dc4e0 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -244,8 +244,14 @@ extern struct atomic_notifier_head power_supply_notifier;
extern int power_supply_reg_notifier(struct notifier_block *nb);
extern void power_supply_unreg_notifier(struct notifier_block *nb);
extern struct power_supply *power_supply_get_by_name(const char *name);
+#ifdef CONFIG_OF
extern struct power_supply *power_supply_get_by_phandle(struct device_node *np,
const char *property);
+#else /* !CONFIG_OF */
+static inline struct power_supply *
+power_supply_get_by_phandle(struct device_node *np, const char *property)
+{ return NULL; }
+#endif /* CONFIG_OF */
extern void power_supply_changed(struct power_supply *psy);
extern int power_supply_am_i_supplied(struct power_supply *psy);
extern int power_supply_set_battery_charged(struct power_supply *psy);
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 0/3] DT support for bq2415x
2013-11-24 16:49 [PATCH 0/3] DT support for bq2415x Sebastian Reichel
` (2 preceding siblings ...)
2013-11-24 16:49 ` [PATCH 3/3] dt: binding documentation for bq2415x charger Sebastian Reichel
@ 2013-12-24 2:20 ` Anton Vorontsov
2013-12-24 3:39 ` Sebastian Reichel
3 siblings, 1 reply; 11+ messages in thread
From: Anton Vorontsov @ 2013-12-24 2:20 UTC (permalink / raw)
To: Sebastian Reichel
Cc: Sebastian Reichel, David Woodhouse, Rob Herring, Pawel Moll,
Mark Rutland, Stephen Warren, Ian Campbell, Rob Landley,
linux-kernel, linux-omap, devicetree, Pali Rohár,
freemangordon, aaro.koskinen, pavel
On Sun, Nov 24, 2013 at 05:49:28PM +0100, Sebastian Reichel wrote:
> This patchset adds DT support for the bq2415x charger, which is used in the
> Nokia N900. The changes depend on Pali Rohár's "[PATCH v2 0/3] Add support for
> charging battery in Nokia RX-51" patchset [0].
Patches 1/3 and 2/3 applied, thanks a lot!
Anton
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/3] power_supply: add power_supply_get_by_phandle
2013-12-24 2:20 ` Anton Vorontsov
@ 2013-12-24 3:37 ` Sebastian Reichel
0 siblings, 0 replies; 11+ messages in thread
From: Sebastian Reichel @ 2013-12-24 3:37 UTC (permalink / raw)
To: Anton Vorontsov
Cc: David Woodhouse, Rob Herring, Pawel Moll, Mark Rutland,
Stephen Warren, Ian Campbell, Rob Landley, linux-kernel,
linux-omap, devicetree, Pali Rohár, freemangordon,
aaro.koskinen, pavel
[-- Attachment #1: Type: text/plain, Size: 1176 bytes --]
On Mon, Dec 23, 2013 at 06:20:36PM -0800, Anton Vorontsov wrote:
> On Sun, Nov 24, 2013 at 05:49:29PM +0100, Sebastian Reichel wrote:
> > Add method to get power supply by device tree phandle.
> >
> > Signed-off-by: Sebastian Reichel <sre@debian.org>
> > ---
> > drivers/power/power_supply_core.c | 24 ++++++++++++++++++++++++
> > include/linux/power_supply.h | 2 ++
> > 2 files changed, 26 insertions(+)
> >
> > diff --git a/drivers/power/power_supply_core.c b/drivers/power/power_supply_core.c
> > index 08bce22..99e4b41 100644
> > --- a/drivers/power/power_supply_core.c
> > +++ b/drivers/power/power_supply_core.c
> > @@ -340,6 +340,30 @@ struct power_supply *power_supply_get_by_name(const char *name)
> ...
> > +
> > + dev = class_find_device(power_supply_class, NULL, power_supply_np,
> > + power_supply_match_device_node);
> > +
> > + of_node_put(power_supply_np);
> > +
> > + return dev ? dev_get_drvdata(dev) : NULL;
> > +}
> > +EXPORT_SYMBOL_GPL(power_supply_get_by_phandle);
>
> The code had no !CONFIG_OF protection so I had to make the following
> changes to this patch:
Right. Thanks for queuing.
-- Sebastian
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 0/3] DT support for bq2415x
2013-12-24 2:20 ` [PATCH 0/3] DT support for bq2415x Anton Vorontsov
@ 2013-12-24 3:39 ` Sebastian Reichel
0 siblings, 0 replies; 11+ messages in thread
From: Sebastian Reichel @ 2013-12-24 3:39 UTC (permalink / raw)
To: Anton Vorontsov
Cc: David Woodhouse, Rob Herring, Pawel Moll, Mark Rutland,
Stephen Warren, Ian Campbell, Rob Landley, linux-kernel,
linux-omap, devicetree, Pali Rohár, freemangordon,
aaro.koskinen, pavel
[-- Attachment #1: Type: text/plain, Size: 543 bytes --]
On Mon, Dec 23, 2013 at 06:20:48PM -0800, Anton Vorontsov wrote:
> On Sun, Nov 24, 2013 at 05:49:28PM +0100, Sebastian Reichel wrote:
> > This patchset adds DT support for the bq2415x charger, which is used in the
> > Nokia N900. The changes depend on Pali Rohár's "[PATCH v2 0/3] Add support for
> > charging battery in Nokia RX-51" patchset [0].
>
> Patches 1/3 and 2/3 applied, thanks a lot!
Thanks. I will try to update Patch 3 at the weekend. It should be
added to the mainline kernel together with Patch 2 :)
-- Sebastian
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2013-12-24 3:39 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-24 16:49 [PATCH 0/3] DT support for bq2415x Sebastian Reichel
2013-11-24 16:49 ` [PATCH 1/3] power_supply: add power_supply_get_by_phandle Sebastian Reichel
2013-11-25 12:32 ` Pavel Machek
[not found] ` <1385311771-447-2-git-send-email-sre-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org>
2013-12-24 2:20 ` Anton Vorontsov
2013-12-24 3:37 ` Sebastian Reichel
2013-11-24 16:49 ` [PATCH 2/3] bq2415x_charger: add DT support Sebastian Reichel
2013-11-25 12:39 ` Pavel Machek
2013-11-24 16:49 ` [PATCH 3/3] dt: binding documentation for bq2415x charger Sebastian Reichel
2013-11-25 13:07 ` Pavel Machek
2013-12-24 2:20 ` [PATCH 0/3] DT support for bq2415x Anton Vorontsov
2013-12-24 3:39 ` Sebastian Reichel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).