Skip to contentSkip to conversation

adp5061: New driver for ADP5061 I2C battery charger

PATCH Superseded Stefan Popa 3 participants 7 messages Apr 4, 2018 – Apr 13, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 adp5061: New driver for ADP5061 I2C battery charger

This patch adds basic support for Analog Devices I2C programmable linear battery charger.

With this driver, some parameters can be read and configured such as:
* trickle charge current level
* trickle charge voltage threshold
* weak charge threshold
* constant current
* constant charge voltage limit
* battery full
* input current limit
* charger status
* battery status
* termination current

Datasheet:
http://www.analog.com/media/en/technical-documentation/data-sheets/ADP5061.pdf

---
 .../devicetree/bindings/power/supply/adp5061.txt   |  17 +
 MAINTAINERS                                        |   8 +
 drivers/power/supply/Kconfig                       |  11 +
 drivers/power/supply/Makefile                      |   1 +
 drivers/power/supply/adp5061.c                     | 745 +++++++++++++++++++++
 5 files changed, 782 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/power/supply/adp5061.txt
 create mode 100644 drivers/power/supply/adp5061.c
Documentation/devicetree/bindings/power/supply/adp5061.txt new file +17 -0
new file mode 100644
index 0000000..7447446
@@ -0,0 +1,17 @@
+Analog Devices ADP5061 Programmable Linear Battery Charger Driver
+
+Required properties:
+  - compatible:		should be "adi,adp5061"
+  - reg:		i2c address of the device
+
+The node for this driver must be a child node of a I2C controller, hence
+all mandatory properties described in
+Documentation/devicetree/bindings/i2c/i2c.txt
+must be specified.
+
+Example:
+
+	adp5061@14 {
+		    compatible = "adi,adp5061";
+		    reg = <0x14>;
+	};
MAINTAINERS +8 -0
index 3bdc260..a9ca73b 100644
@@ -797,6 +797,14 @@ L:	[email protected]
 S:	Maintained
 F:	drivers/media/i2c/ad9389b*
 
+ANALOG DEVICES INC ADP5061 DRIVER
+M:	Stefan Popa <[email protected]>
+L:	[email protected]
+W:	http://ez.analog.com/community/linux-device-drivers
+S:	Supported
+F:	Documentation/devicetree/bindings/power/supply/adp5061.txt
+F:	drivers/power/supply/adp5061.c
+
 ANALOG DEVICES INC ADV7180 DRIVER
 M:	Lars-Peter Clausen <[email protected]>
 L:	[email protected]
drivers/power/supply/Kconfig +11 -0
index 428b426..761cc52 100644
@@ -75,6 +75,17 @@ config BATTERY_88PM860X
 	help
 	  Say Y here to enable battery monitor for Marvell 88PM860x chip.
 
+config CHARGER_ADP5061
+	tristate "ADP5061 battery charger driver"
+	depends on I2C
+	select REGMAP_I2C
+	help
+	  Say Y here to enable support for the ADP5061 standalone battery
+	  charger.
+
+	  This driver can be build as a module. If so, the module will be
+	  called adp5061.
+
 config BATTERY_ACT8945A
 	tristate "Active-semi ACT8945A charger driver"
 	depends on MFD_ACT8945A || COMPILE_TEST
drivers/power/supply/Makefile +1 -0
index e83aa84..71b1398 100644
@@ -18,6 +18,7 @@ obj-$(CONFIG_WM8350_POWER)	+= wm8350_power.o
 obj-$(CONFIG_TEST_POWER)	+= test_power.o
 
 obj-$(CONFIG_BATTERY_88PM860X)	+= 88pm860x_battery.o
+obj-$(CONFIG_CHARGER_ADP5061)	+= adp5061.o
 obj-$(CONFIG_BATTERY_ACT8945A)	+= act8945a_charger.o
 obj-$(CONFIG_BATTERY_AXP20X)	+= axp20x_battery.o
 obj-$(CONFIG_CHARGER_AXP20X)	+= axp20x_ac_power.o
drivers/power/supply/adp5061.c new file +745 -0

745 lines not on this page · raw message

Signature · 1 line
2.7.4
#1 lore raw

Hi,
one small typo below:

Quoted 7 lines · Stefan Popa
drivers/power/supply/Kconfig +0 -0
index 428b426..761cc52 100644
@@ -75,6 +75,17 @@ config BATTERY_88PM860X
 	help
 	  Say Y here to enable battery monitor for Marvell 88PM860x chip.

drivers/power/supply/Kconfig config BATTERY_88PM860X · line 86

Quoted 10 lines
drivers/power/supply/Kconfig +9 -0
 
+config CHARGER_ADP5061
+	tristate "ADP5061 battery charger driver"
+	depends on I2C
+	select REGMAP_I2C
+	help
+	  Say Y here to enable support for the ADP5061 standalone battery
+	  charger.
+
+	  This driver can be build as a module. If so, the module will be

built

Quoted 5 lines
drivers/power/supply/Kconfig +2 -0
+	  called adp5061.
+
 config BATTERY_ACT8945A
 	tristate "Active-semi ACT8945A charger driver"
 	depends on MFD_ACT8945A || COMPILE_TEST
Signature · 1 line
~Randy
#2 lore raw

PATCH v2 1/3 adp5061: New driver for ADP5061 I2C battery charger

In reply to Stefan Popa

This patch adds basic support for Analog Devices I2C programmable linear battery charger.

With this driver, some parameters can be read and configured such as:
* trickle charge current level
* trickle charge voltage threshold
* weak charge threshold
* constant current
* constant charge voltage limit
* battery full
* input current limit
* charger status
* battery status
* termination current

Datasheet:
http://www.analog.com/media/en/technical-documentation/data-sheets/ADP5061.pdf

---
Changes in v2:
- Fixed typo in Kconfig file: build -> built

 .../devicetree/bindings/power/supply/adp5061.txt   |  17 +
 MAINTAINERS                                        |   8 +
 drivers/power/supply/Kconfig                       |  11 +
 drivers/power/supply/Makefile                      |   1 +
 drivers/power/supply/adp5061.c                     | 745 +++++++++++++++++++++
 5 files changed, 782 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/power/supply/adp5061.txt
 create mode 100644 drivers/power/supply/adp5061.c
Documentation/devicetree/bindings/power/supply/adp5061.txt new file +17 -0
new file mode 100644
index 0000000..7447446
@@ -0,0 +1,17 @@
+Analog Devices ADP5061 Programmable Linear Battery Charger Driver
+
+Required properties:
+  - compatible:		should be "adi,adp5061"
+  - reg:		i2c address of the device
+
+The node for this driver must be a child node of a I2C controller, hence
+all mandatory properties described in
+Documentation/devicetree/bindings/i2c/i2c.txt
+must be specified.
+
+Example:
+
+	adp5061@14 {
+		    compatible = "adi,adp5061";
+		    reg = <0x14>;
+	};
MAINTAINERS +8 -0
index 3bdc260..a9ca73b 100644
@@ -797,6 +797,14 @@ L:	[email protected]
 S:	Maintained
 F:	drivers/media/i2c/ad9389b*
 
+ANALOG DEVICES INC ADP5061 DRIVER
+M:	Stefan Popa <[email protected]>
+L:	[email protected]
+W:	http://ez.analog.com/community/linux-device-drivers
+S:	Supported
+F:	Documentation/devicetree/bindings/power/supply/adp5061.txt
+F:	drivers/power/supply/adp5061.c
+
 ANALOG DEVICES INC ADV7180 DRIVER
 M:	Lars-Peter Clausen <[email protected]>
 L:	[email protected]
drivers/power/supply/Kconfig +11 -0
index 428b426..4cc9aa9 100644
@@ -75,6 +75,17 @@ config BATTERY_88PM860X
 	help
 	  Say Y here to enable battery monitor for Marvell 88PM860x chip.
 
+config CHARGER_ADP5061
+	tristate "ADP5061 battery charger driver"
+	depends on I2C
+	select REGMAP_I2C
+	help
+	  Say Y here to enable support for the ADP5061 standalone battery
+	  charger.
+
+	  This driver can be built as a module. If so, the module will be
+	  called adp5061.
+
 config BATTERY_ACT8945A
 	tristate "Active-semi ACT8945A charger driver"
 	depends on MFD_ACT8945A || COMPILE_TEST
drivers/power/supply/Makefile +1 -0
index e83aa84..71b1398 100644
@@ -18,6 +18,7 @@ obj-$(CONFIG_WM8350_POWER)	+= wm8350_power.o
 obj-$(CONFIG_TEST_POWER)	+= test_power.o
 
 obj-$(CONFIG_BATTERY_88PM860X)	+= 88pm860x_battery.o
+obj-$(CONFIG_CHARGER_ADP5061)	+= adp5061.o
 obj-$(CONFIG_BATTERY_ACT8945A)	+= act8945a_charger.o
 obj-$(CONFIG_BATTERY_AXP20X)	+= axp20x_battery.o
 obj-$(CONFIG_CHARGER_AXP20X)	+= axp20x_ac_power.o
drivers/power/supply/adp5061.c new file +745 -0

745 lines not on this page · raw message

Signature · 1 line
2.7.4
maintainer
#3 lore raw
In reply to Stefan Popa
Quoted 14 lines · Stefan Popa

This patch adds basic support for Analog Devices I2C programmable linear battery charger.

With this driver, some parameters can be read and configured such as:
* trickle charge current level
* trickle charge voltage threshold
* weak charge threshold
* constant current
* constant charge voltage limit
* battery full
* input current limit
* charger status
* battery status
* termination current

Don't you need to describe all these parameters of the battery used? Charger bindings are never this simple.

Quoted 7 lines

Datasheet:
http://www.analog.com/media/en/technical-documentation/data-sheets/ADP5061.pdf

---
 .../devicetree/bindings/power/supply/adp5061.txt   |  17 +

Please split bindings to a separate patch.

Quoted 31 lines
 MAINTAINERS                                        |   8 +
 drivers/power/supply/Kconfig                       |  11 +
 drivers/power/supply/Makefile                      |   1 +
 drivers/power/supply/adp5061.c                     | 745 +++++++++++++++++++++
 5 files changed, 782 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/power/supply/adp5061.txt
 create mode 100644 drivers/power/supply/adp5061.c
Documentation/devicetree/bindings/power/supply/adp5061.txt new file +17 -0
new file mode 100644
index 0000000..7447446
@@ -0,0 +1,17 @@
+Analog Devices ADP5061 Programmable Linear Battery Charger Driver
+
+Required properties:
+  - compatible:		should be "adi,adp5061"
+  - reg:		i2c address of the device
+
+The node for this driver must be a child node of a I2C controller, hence
+all mandatory properties described in
+Documentation/devicetree/bindings/i2c/i2c.txt
+must be specified.
+
+Example:
+
+	adp5061@14 {
+		    compatible = "adi,adp5061";
+		    reg = <0x14>;
+	};
#4 lore raw

PATCH v3 1/4 adp5061: New driver for ADP5061 I2C battery charger

In reply to Stefan Popa

This patch adds basic support for Analog Devices I2C programmable linear battery charger.

With this driver, some parameters can be read and configured such as:
* trickle charge current level (PRECHARGE_CURRENT)
* trickle charge voltage threshold (VOLTAGE_MIN)
* weak charge threshold (VOLTAGE_AVG)
* constant current (CONSTANT_CHARGE_CURRENT)
* constant charge voltage limit (CONSTANT_CHARGE_VOLTAGE_MAX)
* battery full (CAPACITY_LEVEL)
* input current limit (INPUT_CURRENT_LIMIT)
* charger status (STATUS)
* battery status (CAPACITY_LEVEL)
* termination current (CHARGE_TERM_CURRENT)

Datasheet:
http://www.analog.com/media/en/technical-documentation/data-sheets/ADP5061.pdf

---
Changes in v2:
- Fixed typo in Kconfig file: build -> built.
Changes in v3:
- Described the commit message parameters with bindings to power-supply properties.

 MAINTAINERS                    |   7 +
 drivers/power/supply/Kconfig   |  11 +
 drivers/power/supply/Makefile  |   1 +
 drivers/power/supply/adp5061.c | 745 +++++++++++++++++++++++++++++++++++++++++
 4 files changed, 764 insertions(+)
 create mode 100644 drivers/power/supply/adp5061.c
MAINTAINERS +7 -0
index 3bdc260..60cd6db 100644
@@ -797,6 +797,13 @@ L:	[email protected]
 S:	Maintained
 F:	drivers/media/i2c/ad9389b*
 
+ANALOG DEVICES INC ADP5061 DRIVER
+M:	Stefan Popa <[email protected]>
+L:	[email protected]
+W:	http://ez.analog.com/community/linux-device-drivers
+S:	Supported
+F:	drivers/power/supply/adp5061.c
+
 ANALOG DEVICES INC ADV7180 DRIVER
 M:	Lars-Peter Clausen <[email protected]>
 L:	[email protected]
drivers/power/supply/Kconfig +11 -0
index 428b426..4cc9aa9 100644
@@ -75,6 +75,17 @@ config BATTERY_88PM860X
 	help
 	  Say Y here to enable battery monitor for Marvell 88PM860x chip.
 
+config CHARGER_ADP5061
+	tristate "ADP5061 battery charger driver"
+	depends on I2C
+	select REGMAP_I2C
+	help
+	  Say Y here to enable support for the ADP5061 standalone battery
+	  charger.
+
+	  This driver can be built as a module. If so, the module will be
+	  called adp5061.
+
 config BATTERY_ACT8945A
 	tristate "Active-semi ACT8945A charger driver"
 	depends on MFD_ACT8945A || COMPILE_TEST
drivers/power/supply/Makefile +1 -0
index e83aa84..71b1398 100644
@@ -18,6 +18,7 @@ obj-$(CONFIG_WM8350_POWER)	+= wm8350_power.o
 obj-$(CONFIG_TEST_POWER)	+= test_power.o
 
 obj-$(CONFIG_BATTERY_88PM860X)	+= 88pm860x_battery.o
+obj-$(CONFIG_CHARGER_ADP5061)	+= adp5061.o
 obj-$(CONFIG_BATTERY_ACT8945A)	+= act8945a_charger.o
 obj-$(CONFIG_BATTERY_AXP20X)	+= axp20x_battery.o
 obj-$(CONFIG_CHARGER_AXP20X)	+= axp20x_ac_power.o
drivers/power/supply/adp5061.c new file +745 -0

745 lines not on this page · raw message

Signature · 1 line
2.7.4
#5 lore raw

PATCH v3 2/4 dt-bindings:power:supply: Add docs for ADP5061 battery charger

In reply to Stefan Popa

Document adi,adp5061 properties.

---
Changes in v3:
- Split devicetree bindings into a separate patch.

 .../devicetree/bindings/power/supply/adp5061.txt        | 17 +++++++++++++++++
 MAINTAINERS                                             |  1 +
 2 files changed, 18 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/power/supply/adp5061.txt
Documentation/devicetree/bindings/power/supply/adp5061.txt new file +17 -0
new file mode 100644
index 0000000..7447446
@@ -0,0 +1,17 @@
+Analog Devices ADP5061 Programmable Linear Battery Charger Driver
+
+Required properties:
+  - compatible:		should be "adi,adp5061"
+  - reg:		i2c address of the device
+
+The node for this driver must be a child node of a I2C controller, hence
+all mandatory properties described in
+Documentation/devicetree/bindings/i2c/i2c.txt
+must be specified.
+
+Example:
+
+	adp5061@14 {
+		    compatible = "adi,adp5061";
+		    reg = <0x14>;
+	};
MAINTAINERS +1 -0
index 60cd6db..a9ca73b 100644
@@ -802,6 +802,7 @@ M:	Stefan Popa <[email protected]>
 L:	[email protected]
 W:	http://ez.analog.com/community/linux-device-drivers
 S:	Supported
+F:	Documentation/devicetree/bindings/power/supply/adp5061.txt
 F:	drivers/power/supply/adp5061.c
 
 ANALOG DEVICES INC ADV7180 DRIVER
Signature · 1 line
2.7.4
maintainer
#6 lore raw

Re: [PATCH v3 2/4] dt-bindings:power:supply: Add docs for ADP5061 battery charger

Quoted 24 lines · Stefan Popa

Document adi,adp5061 properties.

---
Changes in v3:
- Split devicetree bindings into a separate patch.

 .../devicetree/bindings/power/supply/adp5061.txt        | 17 +++++++++++++++++
 MAINTAINERS                                             |  1 +
 2 files changed, 18 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/power/supply/adp5061.txt
Documentation/devicetree/bindings/power/supply/adp5061.txt new file +6 -0
new file mode 100644
index 0000000..7447446
@@ -0,0 +1,17 @@
+Analog Devices ADP5061 Programmable Linear Battery Charger Driver
+
+Required properties:
+  - compatible:		should be "adi,adp5061"
+  - reg:		i2c address of the device
+

Documentation/devicetree/bindings/power/supply/adp5061.txt line 16

Quoted 10 lines
Documentation/devicetree/bindings/power/supply/adp5061.txt new file +10 -0
+The node for this driver must be a child node of a I2C controller, hence
+all mandatory properties described in
+Documentation/devicetree/bindings/i2c/i2c.txt
+must be specified.
+
+Example:
+
+	adp5061@14 {
+		    compatible = "adi,adp5061";
+		    reg = <0x14>;

Same question as the last version. This seems awfully simple for a charger. Don't you need to know and describe battery parameters.

Rob