From 9c4b746e39616413edc918022df7abdd2e207551 Mon Sep 17 00:00:00 2001 From: "Angus Ainslie (Purism)" Date: Sun, 5 May 2019 12:07:03 -0600 Subject: [PATCH 1/3] dts: fsl: librem5: Don't set i2c clock above 200 kHz NXP errata e7805 says that setting the i2c bus clock to 400 kHz violates the SCL clock low period on the imx8mq and recommends setting 384 kHz. At 384 kHz errors were still seen with devices on i2c-0. At 200 kHz no errors were seen. Signed-off-by: Angus Ainslie (Purism) --- arch/arm64/boot/dts/freescale/librem5-evk.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/freescale/librem5-evk.dtsi b/arch/arm64/boot/dts/freescale/librem5-evk.dtsi index aa577bbe0efb..d012ab2c79df 100644 --- a/arch/arm64/boot/dts/freescale/librem5-evk.dtsi +++ b/arch/arm64/boot/dts/freescale/librem5-evk.dtsi @@ -639,7 +639,7 @@ }; &i2c1 { - clock-frequency = <400000>; + clock-frequency = <200000>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_i2c1>; status = "okay"; -- GitLab From 5b18965c758abfd869a81828aa7f57f65dd9f2ed Mon Sep 17 00:00:00 2001 From: Eric Kuzmenko Date: Tue, 7 May 2019 17:45:45 -0400 Subject: [PATCH 2/3] power: supply: bq25890: Add support for setting bq25890 and bq25896's VINDPM The bq25890 has low voltage protection on VIN. Allow the register to be set from the device tree. Signed-off-by: Eric Kuzmenko Signed-off-by: Angus Ainslie (Purism) --- drivers/power/supply/bq25890_charger.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/power/supply/bq25890_charger.c b/drivers/power/supply/bq25890_charger.c index f9843da0ad08..3a2386485e62 100644 --- a/drivers/power/supply/bq25890_charger.c +++ b/drivers/power/supply/bq25890_charger.c @@ -75,6 +75,8 @@ struct bq25890_init_data { u8 boosti; /* boost current limit */ u8 boostf; /* boost frequency */ u8 ilim_en; /* enable ILIM pin */ + u8 force_vindpm;/* force vinmin threshold */ + u8 vindpm; /* vinmin threshold */ u8 treg; /* thermal regulation threshold */ }; @@ -253,6 +255,8 @@ enum bq25890_table_ids { TBL_VCLAMP, TBL_BOOSTV, TBL_SYSVMIN, + TBL_FORCE_VINDPM, + TBL_VINDPM, /* lookup tables */ TBL_TREG, @@ -294,6 +298,8 @@ static const union { [TBL_VCLAMP] = { .rt = {0, 224000, 32000} }, /* uV */ [TBL_BOOSTV] = { .rt = {4550000, 5510000, 64000} }, /* uV */ [TBL_SYSVMIN] = { .rt = {3000000, 3700000, 100000} }, /* uV */ + [TBL_FORCE_VINDPM] = { .rt = {0, 1, 1} }, /* on/off */ + [TBL_VINDPM] = { .rt = {2600000, 15300000, 100000} }, /* uV */ /* lookup tables */ [TBL_TREG] = { .lt = {bq25890_treg_tbl, BQ25890_TREG_TBL_SIZE} }, @@ -628,6 +634,8 @@ static int bq25890_hw_init(struct bq25890_device *bq) {F_BOOSTI, bq->init_data.boosti}, {F_BOOSTF, bq->init_data.boostf}, {F_EN_ILIM, bq->init_data.ilim_en}, + {F_FORCE_VINDPM, bq->init_data.force_vindpm}, + {F_VINDPM, bq->init_data.vindpm}, {F_TREG, bq->init_data.treg} }; @@ -791,6 +799,8 @@ static int bq25890_fw_read_u32_props(struct bq25890_device *bq) {"ti,minimum-sys-voltage", false, TBL_SYSVMIN, &init->sysvmin}, {"ti,boost-voltage", false, TBL_BOOSTV, &init->boostv}, {"ti,boost-max-current", false, TBL_BOOSTI, &init->boosti}, + {"ti,use-vinmin-threshold", false, TBL_FORCE_VINDPM, &init->force_vindpm}, + {"ti,vinmin-threshold", false, TBL_VINDPM, &init->vindpm}, /* optional properties */ {"ti,thermal-regulation-threshold", true, TBL_TREG, &init->treg} -- GitLab From d910c0d11c44ea80901df77a3b0cf11c456f6340 Mon Sep 17 00:00:00 2001 From: "Angus Ainslie (Purism)" Date: Wed, 8 May 2019 09:11:46 -0600 Subject: [PATCH 3/3] arm64: dts: fsl: librem5: Add set VINDPM Due to current spikes during boot the USB-C VBUS can get drawn down too low causing the bq25890 to reset the board. Allow VBUS to drop a bit further to make allowance for thses spikes. Signed-off-by: Eric Kuzmenko Signed-off-by: Angus Ainslie (Purism) --- arch/arm64/boot/dts/freescale/librem5-evk.dtsi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/librem5-evk.dtsi b/arch/arm64/boot/dts/freescale/librem5-evk.dtsi index d012ab2c79df..3ca6f5191116 100644 --- a/arch/arm64/boot/dts/freescale/librem5-evk.dtsi +++ b/arch/arm64/boot/dts/freescale/librem5-evk.dtsi @@ -860,6 +860,8 @@ ti,minimum-sys-voltage = <2750000>; // 2.75V ti,boost-voltage = <5000000>; // 5V ti,boost-max-current = <50000>; // 50mA + ti,use-vinmin-threshold = <1>; /* enable VINDPM */ + ti,vinmin-threshold = <3900000>; /* 3.9V */ }; rtc@68 { -- GitLab