mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 1/2] ARM: dts: exynos: add charger and battery to p4note
@ 2022-02-03 20:29 Martin Jücker
  2022-02-03 20:29 ` [PATCH v2 2/2] ARM: defconfig: add SMB347 charger driver for p4note Martin Jücker
  2022-02-04 15:12 ` [PATCH v2 1/2] ARM: dts: exynos: add charger and battery to p4note Krzysztof Kozlowski
  0 siblings, 2 replies; 3+ messages in thread
From: Martin Jücker @ 2022-02-03 20:29 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Alim Akhtar, Russell King,
	devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel
  Cc: Martin Jücker

Add device tree entry to support the Summit SMB347 charger which is
built into the p4note devices, as well as a simple battery node.

Signed-off-by: Martin Jücker <martin.juecker@gmail.com>
---
Changes in v2:
  - squash charger and battery commits
---
 arch/arm/boot/dts/exynos4412-p4note.dtsi | 35 ++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/arch/arm/boot/dts/exynos4412-p4note.dtsi b/arch/arm/boot/dts/exynos4412-p4note.dtsi
index b386a9b8e188..fcd75cceb877 100644
--- a/arch/arm/boot/dts/exynos4412-p4note.dtsi
+++ b/arch/arm/boot/dts/exynos4412-p4note.dtsi
@@ -16,6 +16,7 @@
 #include <dt-bindings/input/linux-event-codes.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/pinctrl/samsung.h>
+#include <dt-bindings/power/summit,smb347-charger.h>
 
 / {
 	compatible = "samsung,p4note", "samsung,exynos4412", "samsung,exynos4";
@@ -114,6 +115,17 @@ wlan_pwrseq: sdhci3-pwrseq {
 		clock-names = "ext_clock";
 	};
 
+	battery_cell: battery-cell {
+		compatible = "simple-battery";
+		device-chemistry = "lithium-ion";
+		constant-charge-current-max-microamp = <2200000>;
+		precharge-current-microamp = <250000>;
+		charge-term-current-microamp = <250000>;
+		constant-charge-voltage-max-microvolt = <4200000>;
+
+		power-supplies = <&power_supply>;
+	};
+
 	i2c-gpio-1 {
 		compatible = "i2c-gpio";
 		sda-gpios = <&gpy2 4 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
@@ -182,6 +194,29 @@ stmpe_adc {
 			};
 		};
 	};
+
+	i2c-gpio-4 {
+		compatible = "i2c-gpio";
+		sda-gpios = <&gpm2 0 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+		scl-gpios = <&gpm2 1 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+
+		i2c-gpio,delay-us = <2>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		power_supply: charger@6 {
+			compatible = "summit,smb347";
+			reg = <0x6>;
+			summit,enable-usb-charging;
+			summit,enable-charge-control = <SMB3XX_CHG_ENABLE_SW>;
+			summit,fast-voltage-threshold-microvolt = <2600000>;
+			summit,chip-temperature-threshold-celsius = <130>;
+			summit,usb-current-limit-microamp = <1800000>;
+
+			monitored-battery = <&battery_cell>;
+		};
+	};
+
 };
 
 &adc {
-- 
2.25.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v2 2/2] ARM: defconfig: add SMB347 charger driver for p4note
  2022-02-03 20:29 [PATCH v2 1/2] ARM: dts: exynos: add charger and battery to p4note Martin Jücker
@ 2022-02-03 20:29 ` Martin Jücker
  2022-02-04 15:12 ` [PATCH v2 1/2] ARM: dts: exynos: add charger and battery to p4note Krzysztof Kozlowski
  1 sibling, 0 replies; 3+ messages in thread
From: Martin Jücker @ 2022-02-03 20:29 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Alim Akhtar, Russell King,
	devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel
  Cc: Martin Jücker

The Summit SMB347 charger is part of the p4note family of devices,
enable the driver in exynos and multi_v7 defconfigs.

Signed-off-by: Martin Jücker <martin.juecker@gmail.com>
---
Changes in v2:
  - adjusted wording to decouple the patch from the dt changes
---
 arch/arm/configs/exynos_defconfig   | 1 +
 arch/arm/configs/multi_v7_defconfig | 1 +
 2 files changed, 2 insertions(+)

diff --git a/arch/arm/configs/exynos_defconfig b/arch/arm/configs/exynos_defconfig
index c58877cfdc9d..9d3191de96b6 100644
--- a/arch/arm/configs/exynos_defconfig
+++ b/arch/arm/configs/exynos_defconfig
@@ -159,6 +159,7 @@ CONFIG_CHARGER_MAX14577=y
 CONFIG_CHARGER_MAX77693=y
 CONFIG_CHARGER_MAX8997=y
 CONFIG_CHARGER_MAX8998=y
+CONFIG_CHARGER_SMB347=y
 CONFIG_CHARGER_TPS65090=y
 CONFIG_SENSORS_LM90=y
 CONFIG_SENSORS_NTC_THERMISTOR=y
diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig
index 1c2c3e9f0e05..bfbcb57e2083 100644
--- a/arch/arm/configs/multi_v7_defconfig
+++ b/arch/arm/configs/multi_v7_defconfig
@@ -510,6 +510,7 @@ CONFIG_CHARGER_MAX14577=m
 CONFIG_CHARGER_MAX77693=m
 CONFIG_CHARGER_MAX8997=m
 CONFIG_CHARGER_MAX8998=m
+CONFIG_CHARGER_SMB347=m
 CONFIG_CHARGER_TPS65090=y
 CONFIG_SENSORS_ARM_SCMI=y
 CONFIG_SENSORS_ASPEED=m
-- 
2.25.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2 1/2] ARM: dts: exynos: add charger and battery to p4note
  2022-02-03 20:29 [PATCH v2 1/2] ARM: dts: exynos: add charger and battery to p4note Martin Jücker
  2022-02-03 20:29 ` [PATCH v2 2/2] ARM: defconfig: add SMB347 charger driver for p4note Martin Jücker
@ 2022-02-04 15:12 ` Krzysztof Kozlowski
  1 sibling, 0 replies; 3+ messages in thread
From: Krzysztof Kozlowski @ 2022-02-04 15:12 UTC (permalink / raw)
  To: linux-kernel, devicetree, Martin Jücker, Rob Herring,
	Russell King, Alim Akhtar, linux-samsung-soc, linux-arm-kernel
  Cc: Krzysztof Kozlowski

On Thu, 3 Feb 2022 21:29:47 +0100, Martin Jücker wrote:
> Add device tree entry to support the Summit SMB347 charger which is
> built into the p4note devices, as well as a simple battery node.
> 
> 

Applied, thanks!

[1/2] ARM: dts: exynos: add charger and battery to p4note
      commit: 38dfe352b5a56df9cdf3e40ec5a09bb539757352
[2/2] ARM: defconfig: add SMB347 charger driver for p4note
      commit: 300ccbb25491b4d4aa67098161a953ff7652d650

Best regards,
-- 
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-02-04 15:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-03 20:29 [PATCH v2 1/2] ARM: dts: exynos: add charger and battery to p4note Martin Jücker
2022-02-03 20:29 ` [PATCH v2 2/2] ARM: defconfig: add SMB347 charger driver for p4note Martin Jücker
2022-02-04 15:12 ` [PATCH v2 1/2] ARM: dts: exynos: add charger and battery to p4note Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®