Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1338926 > unrolled thread
| Started by | Pali Rohár <pali.rohar@gmail.com> |
|---|---|
| First post | 2016-02-21 19:20 +0100 |
| Last post | 2016-02-21 20:50 +0100 |
| Articles | 9 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH 0/6] Small fixes for Nokia N900 power supply drivers Pali Rohár <pali.rohar@gmail.com> - 2016-02-21 19:20 +0100
Re: [PATCH 3/6] power_supply: bq2415x_charger: Do not add acpi modalias when CONFIG_ACPI is not enabled Pavel Machek <pavel@ucw.cz> - 2016-02-21 19:20 +0100
Re: [PATCH 1/6] power_supply: isp1704_charger: Error messages when probe fail Pavel Machek <pavel@ucw.cz> - 2016-02-21 19:30 +0100
[PATCH 6/6] ARM: dts: n900: Rename isp1704 to isp1707 to match correct name Pali Rohár <pali.rohar@gmail.com> - 2016-02-21 19:30 +0100
[PATCH 5/6] power_supply: bq27xxx_battery: Add of modalias and match table when CONFIG_OF is enabled Pali Rohár <pali.rohar@gmail.com> - 2016-02-21 19:40 +0100
[PATCH 1/6] power_supply: isp1704_charger: Error messages when probe fail Pali Rohár <pali.rohar@gmail.com> - 2016-02-21 19:40 +0100
[PATCH 3/6] power_supply: bq2415x_charger: Do not add acpi modalias when CONFIG_ACPI is not enabled Pali Rohár <pali.rohar@gmail.com> - 2016-02-21 19:50 +0100
[PATCH 4/6] power_supply: bq2415x_charger: Add of modalias and match table when CONFIG_OF is enabled Pali Rohár <pali.rohar@gmail.com> - 2016-02-21 19:50 +0100
Re: [PATCH 0/6] Small fixes for Nokia N900 power supply drivers Sebastian Reichel <sre@kernel.org> - 2016-02-21 20:50 +0100
| From | Pali Rohár <pali.rohar@gmail.com> |
|---|---|
| Date | 2016-02-21 19:20 +0100 |
| Subject | [PATCH 0/6] Small fixes for Nokia N900 power supply drivers |
| Message-ID | <r4GiS-12G-3@gated-at.bofh.it> |
This patch series add debug error output for isp1704 driver and fix
module aliases for power supply drivers uses on Nokia N900.
Pali Rohár (6):
power_supply: isp1704_charger: Error messages when probe fail
power_supply: isp1704_charger: Add compatible of match for
nxp,isp1707
power_supply: bq2415x_charger: Do not add acpi modalias when
CONFIG_ACPI is not enabled
power_supply: bq2415x_charger: Add of modalias and match table when
CONFIG_OF is enabled
power_supply: bq27xxx_battery: Add of modalias and match table when
CONFIG_OF is enabled
ARM: dts: n900: Rename isp1704 to isp1707 to match correct name
arch/arm/boot/dts/omap3-n900.dts | 6 +++---
drivers/power/bq2415x_charger.c | 22 ++++++++++++++++++++++
drivers/power/bq27xxx_battery.c | 12 ++++++++++++
drivers/power/bq27xxx_battery_i2c.c | 24 ++++++++++++++++++++++++
drivers/power/isp1704_charger.c | 19 +++++++++++++++----
5 files changed, 76 insertions(+), 7 deletions(-)
--
1.7.9.5
[toc] | [next] | [standalone]
| From | Pavel Machek <pavel@ucw.cz> |
|---|---|
| Date | 2016-02-21 19:20 +0100 |
| Subject | Re: [PATCH 3/6] power_supply: bq2415x_charger: Do not add acpi modalias when CONFIG_ACPI is not enabled |
| Message-ID | <r4GLU-1wb-25@gated-at.bofh.it> |
| In reply to | #1338926 |
On Sun 2016-02-21 12:28:20, Pali Rohár wrote:
> Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
> @@ -1759,6 +1759,7 @@ static const struct i2c_device_id bq2415x_i2c_id_table[] = {
> };
> MODULE_DEVICE_TABLE(i2c, bq2415x_i2c_id_table);
>
> +#ifdef CONFIG_ACPI
> static const struct acpi_device_id bq2415x_i2c_acpi_match[] = {
> { "BQ2415X", BQUNKNOWN },
> { "BQ241500", BQ24150 },
> @@ -1776,6 +1777,7 @@ static const struct acpi_device_id bq2415x_i2c_acpi_match[] = {
> {},
> };
> MODULE_DEVICE_TABLE(acpi, bq2415x_i2c_acpi_match);
> +#endif
>
> static struct i2c_driver bq2415x_driver = {
> .driver = {
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
[toc] | [prev] | [next] | [standalone]
| From | Pavel Machek <pavel@ucw.cz> |
|---|---|
| Date | 2016-02-21 19:30 +0100 |
| Subject | Re: [PATCH 1/6] power_supply: isp1704_charger: Error messages when probe fail |
| Message-ID | <r4GVA-1CR-17@gated-at.bofh.it> |
| In reply to | #1338926 |
Hi! > This patch adds more detailed error messages when probe function > fail. ...fails. > It is useful for debbuging why driver refuse to register charger device. ...why the driver refuses to register... Acked-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
[toc] | [prev] | [next] | [standalone]
| From | Pali Rohár <pali.rohar@gmail.com> |
|---|---|
| Date | 2016-02-21 19:30 +0100 |
| Subject | [PATCH 6/6] ARM: dts: n900: Rename isp1704 to isp1707 to match correct name |
| Message-ID | <r4GiS-12G-5@gated-at.bofh.it> |
| In reply to | #1338926 |
This change does not break existing userspace or Maemo software because
isp1704_charger.c always export power supply device under isp1704 name.
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
---
arch/arm/boot/dts/omap3-n900.dts | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/arm/boot/dts/omap3-n900.dts b/arch/arm/boot/dts/omap3-n900.dts
index 82df643..e0443cd 100644
--- a/arch/arm/boot/dts/omap3-n900.dts
+++ b/arch/arm/boot/dts/omap3-n900.dts
@@ -107,8 +107,8 @@
};
};
- isp1704: isp1704 {
- compatible = "nxp,isp1704";
+ isp1707: isp1707 {
+ compatible = "nxp,isp1707";
nxp,enable-gpio = <&gpio3 3 GPIO_ACTIVE_HIGH>;
usb-phy = <&usb2_phy>;
};
@@ -735,7 +735,7 @@
ti,termination-current = <100>;
ti,resistor-sense = <68>;
- ti,usb-charger-detection = <&isp1704>;
+ ti,usb-charger-detection = <&isp1707>;
};
};
--
1.7.9.5
[toc] | [prev] | [next] | [standalone]
| From | Pali Rohár <pali.rohar@gmail.com> |
|---|---|
| Date | 2016-02-21 19:40 +0100 |
| Subject | [PATCH 5/6] power_supply: bq27xxx_battery: Add of modalias and match table when CONFIG_OF is enabled |
| Message-ID | <r4H5g-1GU-5@gated-at.bofh.it> |
| In reply to | #1338926 |
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
---
drivers/power/bq27xxx_battery.c | 12 ++++++++++++
drivers/power/bq27xxx_battery_i2c.c | 24 ++++++++++++++++++++++++
2 files changed, 36 insertions(+)
diff --git a/drivers/power/bq27xxx_battery.c b/drivers/power/bq27xxx_battery.c
index 6b027a4..45f6ebf 100644
--- a/drivers/power/bq27xxx_battery.c
+++ b/drivers/power/bq27xxx_battery.c
@@ -46,6 +46,7 @@
#include <linux/platform_device.h>
#include <linux/power_supply.h>
#include <linux/slab.h>
+#include <linux/of.h>
#include <linux/power/bq27xxx_battery.h>
@@ -1090,16 +1091,27 @@ static const struct platform_device_id bq27xxx_battery_platform_id_table[] = {
};
MODULE_DEVICE_TABLE(platform, bq27xxx_battery_platform_id_table);
+#ifdef CONFIG_OF
+static const struct of_device_id bq27xxx_battery_platform_of_match_table[] = {
+ { .compatible = "ti,bq27000" },
+ {},
+};
+MODULE_DEVICE_TABLE(of, bq27xxx_battery_platform_of_match_table);
+#endif
+
static struct platform_driver bq27xxx_battery_platform_driver = {
.probe = bq27xxx_battery_platform_probe,
.remove = bq27xxx_battery_platform_remove,
.driver = {
.name = "bq27000-battery",
+ .of_match_table = of_match_ptr(bq27xxx_battery_platform_of_match_table),
},
.id_table = bq27xxx_battery_platform_id_table,
};
module_platform_driver(bq27xxx_battery_platform_driver);
+MODULE_ALIAS("platform:bq27000-battery");
+
MODULE_AUTHOR("Rodolfo Giometti <giometti@linux.it>");
MODULE_DESCRIPTION("BQ27xxx battery monitor driver");
MODULE_LICENSE("GPL");
diff --git a/drivers/power/bq27xxx_battery_i2c.c b/drivers/power/bq27xxx_battery_i2c.c
index 9429e66..b810e08 100644
--- a/drivers/power/bq27xxx_battery_i2c.c
+++ b/drivers/power/bq27xxx_battery_i2c.c
@@ -135,9 +135,33 @@ static const struct i2c_device_id bq27xxx_i2c_id_table[] = {
};
MODULE_DEVICE_TABLE(i2c, bq27xxx_i2c_id_table);
+#ifdef CONFIG_OF
+static const struct of_device_id bq27xxx_battery_i2c_of_match_table[] = {
+ { .compatible = "ti,bq27200" },
+ { .compatible = "ti,bq27210" },
+ { .compatible = "ti,bq27500" },
+ { .compatible = "ti,bq27510" },
+ { .compatible = "ti,bq27520" },
+ { .compatible = "ti,bq27530" },
+ { .compatible = "ti,bq27531" },
+ { .compatible = "ti,bq27541" },
+ { .compatible = "ti,bq27542" },
+ { .compatible = "ti,bq27546" },
+ { .compatible = "ti,bq27742" },
+ { .compatible = "ti,bq27545" },
+ { .compatible = "ti,bq27421" },
+ { .compatible = "ti,bq27425" },
+ { .compatible = "ti,bq27441" },
+ { .compatible = "ti,bq27621" },
+ {},
+};
+MODULE_DEVICE_TABLE(of, bq27xxx_battery_i2c_of_match_table);
+#endif
+
static struct i2c_driver bq27xxx_battery_i2c_driver = {
.driver = {
.name = "bq27xxx-battery",
+ .of_match_table = of_match_ptr(bq27xxx_battery_i2c_of_match_table),
},
.probe = bq27xxx_battery_i2c_probe,
.remove = bq27xxx_battery_i2c_remove,
--
1.7.9.5
[toc] | [prev] | [next] | [standalone]
| From | Pali Rohár <pali.rohar@gmail.com> |
|---|---|
| Date | 2016-02-21 19:40 +0100 |
| Subject | [PATCH 1/6] power_supply: isp1704_charger: Error messages when probe fail |
| Message-ID | <r4GVA-1CR-19@gated-at.bofh.it> |
| In reply to | #1338926 |
This patch adds more detailed error messages when probe function fail.
It is useful for debbuging why driver refuse to register charger device.
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
---
drivers/power/isp1704_charger.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/drivers/power/isp1704_charger.c b/drivers/power/isp1704_charger.c
index 46a292a..acaf7cf 100644
--- a/drivers/power/isp1704_charger.c
+++ b/drivers/power/isp1704_charger.c
@@ -411,8 +411,10 @@ static int isp1704_charger_probe(struct platform_device *pdev)
if (np) {
int gpio = of_get_named_gpio(np, "nxp,enable-gpio", 0);
- if (gpio < 0)
+ if (gpio < 0) {
+ dev_err(&pdev->dev, "missing DT GPIO nxp,enable-gpio\n");
return gpio;
+ }
pdata = devm_kzalloc(&pdev->dev,
sizeof(struct isp1704_charger_data), GFP_KERNEL);
@@ -422,8 +424,10 @@ static int isp1704_charger_probe(struct platform_device *pdev)
ret = devm_gpio_request_one(&pdev->dev, pdata->enable_gpio,
GPIOF_OUT_INIT_HIGH, "isp1704_reset");
- if (ret)
+ if (ret) {
+ dev_err(&pdev->dev, "gpio request failed\n");
goto fail0;
+ }
}
if (!pdata) {
@@ -443,6 +447,7 @@ static int isp1704_charger_probe(struct platform_device *pdev)
if (IS_ERR(isp->phy)) {
ret = PTR_ERR(isp->phy);
+ dev_err(&pdev->dev, "usb_get_phy failed\n");
goto fail0;
}
@@ -452,8 +457,10 @@ static int isp1704_charger_probe(struct platform_device *pdev)
isp1704_charger_set_power(isp, 1);
ret = isp1704_test_ulpi(isp);
- if (ret < 0)
+ if (ret < 0) {
+ dev_err(&pdev->dev, "isp1704_test_ulpi failed\n");
goto fail1;
+ }
isp->psy_desc.name = "isp1704";
isp->psy_desc.type = POWER_SUPPLY_TYPE_USB;
@@ -466,6 +473,7 @@ static int isp1704_charger_probe(struct platform_device *pdev)
isp->psy = power_supply_register(isp->dev, &isp->psy_desc, &psy_cfg);
if (IS_ERR(isp->psy)) {
ret = PTR_ERR(isp->psy);
+ dev_err(&pdev->dev, "power_supply_register failed\n");
goto fail1;
}
@@ -478,8 +486,10 @@ static int isp1704_charger_probe(struct platform_device *pdev)
isp->nb.notifier_call = isp1704_notifier_call;
ret = usb_register_notifier(isp->phy, &isp->nb);
- if (ret)
+ if (ret) {
+ dev_err(&pdev->dev, "usb_register_notifier failed\n");
goto fail2;
+ }
dev_info(isp->dev, "registered with product id %s\n", isp->model);
--
1.7.9.5
[toc] | [prev] | [next] | [standalone]
| From | Pali Rohár <pali.rohar@gmail.com> |
|---|---|
| Date | 2016-02-21 19:50 +0100 |
| Subject | [PATCH 3/6] power_supply: bq2415x_charger: Do not add acpi modalias when CONFIG_ACPI is not enabled |
| Message-ID | <r4GLU-1wb-27@gated-at.bofh.it> |
| In reply to | #1338926 |
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
---
drivers/power/bq2415x_charger.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/power/bq2415x_charger.c b/drivers/power/bq2415x_charger.c
index 27e8953..b0863f4 100644
--- a/drivers/power/bq2415x_charger.c
+++ b/drivers/power/bq2415x_charger.c
@@ -1759,6 +1759,7 @@ static const struct i2c_device_id bq2415x_i2c_id_table[] = {
};
MODULE_DEVICE_TABLE(i2c, bq2415x_i2c_id_table);
+#ifdef CONFIG_ACPI
static const struct acpi_device_id bq2415x_i2c_acpi_match[] = {
{ "BQ2415X", BQUNKNOWN },
{ "BQ241500", BQ24150 },
@@ -1776,6 +1777,7 @@ static const struct acpi_device_id bq2415x_i2c_acpi_match[] = {
{},
};
MODULE_DEVICE_TABLE(acpi, bq2415x_i2c_acpi_match);
+#endif
static struct i2c_driver bq2415x_driver = {
.driver = {
--
1.7.9.5
[toc] | [prev] | [next] | [standalone]
| From | Pali Rohár <pali.rohar@gmail.com> |
|---|---|
| Date | 2016-02-21 19:50 +0100 |
| Subject | [PATCH 4/6] power_supply: bq2415x_charger: Add of modalias and match table when CONFIG_OF is enabled |
| Message-ID | <r4HeW-1KO-27@gated-at.bofh.it> |
| In reply to | #1338926 |
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
---
drivers/power/bq2415x_charger.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/drivers/power/bq2415x_charger.c b/drivers/power/bq2415x_charger.c
index b0863f4..73e2f0b 100644
--- a/drivers/power/bq2415x_charger.c
+++ b/drivers/power/bq2415x_charger.c
@@ -1779,9 +1779,29 @@ static const struct acpi_device_id bq2415x_i2c_acpi_match[] = {
MODULE_DEVICE_TABLE(acpi, bq2415x_i2c_acpi_match);
#endif
+#ifdef CONFIG_OF
+static const struct of_device_id bq2415x_of_match_table[] = {
+ { .compatible = "ti,bq24150" },
+ { .compatible = "ti,bq24150a" },
+ { .compatible = "ti,bq24151" },
+ { .compatible = "ti,bq24151a" },
+ { .compatible = "ti,bq24152" },
+ { .compatible = "ti,bq24153" },
+ { .compatible = "ti,bq24153a" },
+ { .compatible = "ti,bq24155" },
+ { .compatible = "ti,bq24156" },
+ { .compatible = "ti,bq24156a" },
+ { .compatible = "ti,bq24157s" },
+ { .compatible = "ti,bq24158" },
+ {},
+};
+MODULE_DEVICE_TABLE(of, bq2415x_of_match_table);
+#endif
+
static struct i2c_driver bq2415x_driver = {
.driver = {
.name = "bq2415x-charger",
+ .of_match_table = of_match_ptr(bq2415x_of_match_table),
.acpi_match_table = ACPI_PTR(bq2415x_i2c_acpi_match),
},
.probe = bq2415x_probe,
--
1.7.9.5
[toc] | [prev] | [next] | [standalone]
| From | Sebastian Reichel <sre@kernel.org> |
|---|---|
| Date | 2016-02-21 20:50 +0100 |
| Message-ID | <r4Ib0-2um-25@gated-at.bofh.it> |
| In reply to | #1338926 |
[Multipart message — attachments visible in raw view] — view raw
Hi, On Sun, Feb 21, 2016 at 12:28:17PM +0100, Pali Rohár wrote: > This patch series add debug error output for isp1704 driver and > fix module aliases for power supply drivers uses on Nokia N900. > > Pali Rohár (6): > power_supply: isp1704_charger: Error messages when probe fail > power_supply: isp1704_charger: Add compatible of match for nxp,isp1707 > power_supply: bq2415x_charger: Do not add acpi modalias when CONFIG_ACPI is not enabled > power_supply: bq2415x_charger: Add of modalias and match table when CONFIG_OF is enabled > power_supply: bq27xxx_battery: Add of modalias and match table when CONFIG_OF is enabled > ARM: dts: n900: Rename isp1704 to isp1707 to match correct name I queued the power-supply patches for 4.6 applying Pavel's commit message changes and his Acked-By. -- Sebastian
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web