Skip to content

Commit

Permalink
Merge branch 'plus'
Browse files Browse the repository at this point in the history
  • Loading branch information
bigbearishappy committed Apr 11, 2023
2 parents 0e5767e + 6a36114 commit 9c29365
Show file tree
Hide file tree
Showing 14 changed files with 3,258 additions and 36 deletions.
22 changes: 11 additions & 11 deletions modules/bq24179_charger/bq25790_charger.c
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,7 @@ static int bq25790_hw_init(struct bq25790_device *bq)
int wd_reg_val = BQ25790_WATCHDOG_DIS;
int i;

struct power_supply_battery_info bat_info = { };
struct power_supply_battery_info *bat_info;

if (bq->watchdog_timer) {
for (i = 0; i < BQ25790_NUM_WD_VAL; i++) {
Expand All @@ -1006,16 +1006,16 @@ static int bq25790_hw_init(struct bq25790_device *bq)
if (ret) {
dev_warn(bq->dev, "battery info missing, default values will be applied\n");

bat_info.constant_charge_current_max_ua =
bat_info->constant_charge_current_max_ua =
BQ25790_ICHRG_I_DEF_uA;

bat_info.constant_charge_voltage_max_uv =
bat_info->constant_charge_voltage_max_uv =
BQ25790_VREG_V_DEF_uV;

bat_info.precharge_current_ua =
bat_info->precharge_current_ua =
BQ25790_PRECHRG_I_DEF_uA;

bat_info.charge_term_current_ua =
bat_info->charge_term_current_ua =
BQ25790_TERMCHRG_I_DEF_uA;

bq->init_data.max_ichg =
Expand All @@ -1025,26 +1025,26 @@ static int bq25790_hw_init(struct bq25790_device *bq)
BQ25790_VREG_V_MAX_uV;
} else {
bq->init_data.max_ichg =
bat_info.constant_charge_current_max_ua;
bat_info->constant_charge_current_max_ua;
bq->init_data.max_vreg =
bat_info.constant_charge_voltage_max_uv;
bat_info->constant_charge_voltage_max_uv;
}

ret = bq25790_set_ichrg_curr(bq,
bat_info.constant_charge_current_max_ua);
bat_info->constant_charge_current_max_ua);
if (ret)
goto err_out;

ret = bq25790_set_prechrg_curr(bq, bat_info.precharge_current_ua);
ret = bq25790_set_prechrg_curr(bq, bat_info->precharge_current_ua);
if (ret)
goto err_out;

ret = bq25790_set_chrg_volt(bq,
bat_info.constant_charge_voltage_max_uv);
bat_info->constant_charge_voltage_max_uv);
if (ret)
goto err_out;

ret = bq25790_set_term_curr(bq, bat_info.charge_term_current_ua);
ret = bq25790_set_term_curr(bq, bat_info->charge_term_current_ua);
if (ret)
goto err_out;

Expand Down
19 changes: 19 additions & 0 deletions modules/ch34x/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#
# Bbear <953308023@qq.com>
# Copyright (c) 2023 Seeed Studio
#
# MIT License
#
KVERSION ?= $(shell uname -r)

obj-m := ch34x.o
ch34x-objs := ch343.o

all:
$(MAKE) -C /lib/modules/$(KVERSION)/build M=$(PWD) modules

install:
$(MAKE) -C /lib/modules/$(KVERSION)/build M=$(shell pwd) modules_install

clean:
$(MAKE) -C /lib/modules/$(KVERSION)/build M=$(PWD) clean
Loading

0 comments on commit 9c29365

Please sign in to comment.