BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mangoh-drivers
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
mangoh-drivers
Commits
28823699
Commit
28823699
authored
Oct 19, 2017
by
David Frey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup formatting of battery code
parent
dbe1e4b4
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
20 additions
and
46 deletions
+20
-46
Makefile
Makefile
+1
-1
BatteryService
apps/BatteryService
+1
-1
0-bq24296.mdef
linux_kernel_modules/bq24296/0-bq24296.mdef
+1
-1
bq24190-charger.c
linux_kernel_modules/bq24296/bq24190-charger.c
+11
-26
ltc2941-battery-gauge.c
linux_kernel_modules/ltc294x/ltc2941-battery-gauge.c
+2
-12
ltc294x-platform-data.h
linux_kernel_modules/ltc294x/ltc294x-platform-data.h
+2
-2
9-mangoh_green_dv4.mdef
linux_kernel_modules/mangoh/9-mangoh_green_dv4.mdef
+0
-1
mangOH_Red.sdef
mangOH_Red.sdef
+1
-1
BatteryClient
samples/BatteryClient
+1
-1
No files found.
Makefile
View file @
28823699
...
...
@@ -2,7 +2,7 @@ export MANGOH_ROOT = $(shell pwd)
MKSYS_ARGS_COMMON
=
-s
$(MANGOH_ROOT)
/apps/GpioExpander/gpioExpanderService
MKSYS_ARGS_GREEN
=
MKSYS_ARGS_RED
=
-s
$(MANGOH_ROOT)
/apps/RedSensorToCloud
-i
$(MANGOH_ROOT)
/apps/BatteryService
MKSYS_ARGS_RED
=
-s
$(MANGOH_ROOT)
/apps/RedSensorToCloud
# The comments below are for Developer Studio integration. Do not remove them.
# DS_CLONE_ROOT(MANGOH_ROOT)
...
...
BatteryService
@
cba3d131
Subproject commit
a4e1056b756ea8ef63941b5d3a7f0c917a4fa823
Subproject commit
cba3d131ca6fe030598fb8e2c1684c84ba8177ec
linux_kernel_modules/bq24296/0-bq24296.mdef
View file @
28823699
sources:
{
bq24190-charger.c
bq24190-charger.c
}
linux_kernel_modules/bq24296/bq24190-charger.c
View file @
28823699
...
...
@@ -1289,7 +1289,7 @@ static int bq24190_hw_init(struct bq24190_dev_info *bdi)
pm_runtime_get_sync
(
bdi
->
dev
);
/*
First check that the device really is what its supposed to be */
/*
First check that the device really is what its supposed to be */
ret
=
bq24190_read_mask
(
bdi
,
BQ24190_REG_VPRS
,
BQ24190_REG_VPRS_PN_MASK
,
BQ24190_REG_VPRS_PN_SHIFT
,
...
...
@@ -1301,7 +1301,7 @@ static int bq24190_hw_init(struct bq24190_dev_info *bdi)
ret
=
-
ENODEV
;
goto
out
;
}
ret
=
bq24190_register_reset
(
bdi
);
if
(
ret
<
0
)
goto
out
;
...
...
@@ -1364,50 +1364,37 @@ static int bq24190_probe(struct i2c_client *client,
struct
bq24190_platform_data
*
pdata
=
client
->
dev
.
platform_data
;
struct
bq24190_dev_info
*
bdi
;
int
ret
;
dev_err
(
&
client
->
dev
,
"checking status at %d
\n
"
,
__LINE__
);
if
(
!
i2c_check_functionality
(
adapter
,
I2C_FUNC_SMBUS_BYTE_DATA
))
{
dev_err
(
dev
,
"No support for SMBUS_BYTE_DATA
\n
"
);
return
-
ENODEV
;
}
dev_err
(
&
client
->
dev
,
"checking status at %d
\n
"
,
__LINE__
);
bdi
=
devm_kzalloc
(
dev
,
sizeof
(
*
bdi
),
GFP_KERNEL
);
dev_err
(
&
client
->
dev
,
"checking status at %d
\n
"
,
__LINE__
);
if
(
!
bdi
)
{
dev_err
(
dev
,
"Can't alloc bdi struct
\n
"
);
return
-
ENOMEM
;
}
dev_err
(
&
client
->
dev
,
"checking status at %d
\n
"
,
__LINE__
);
bdi
->
client
=
client
;
bdi
->
dev
=
dev
;
bdi
->
model
=
id
->
driver_data
;
dev_err
(
&
client
->
dev
,
"checking status at %d
\n
"
,
__LINE__
);
strncpy
(
bdi
->
model_name
,
id
->
name
,
I2C_NAME_SIZE
);
dev_err
(
&
client
->
dev
,
"checking status at %d
\n
"
,
__LINE__
);
mutex_init
(
&
bdi
->
f_reg_lock
);
bdi
->
first_time
=
true
;
bdi
->
charger_health_valid
=
false
;
bdi
->
battery_health_valid
=
false
;
bdi
->
battery_status_valid
=
false
;
dev_err
(
&
client
->
dev
,
"checking status at %d
\n
"
,
__LINE__
);
i2c_set_clientdata
(
client
,
bdi
);
dev_err
(
&
client
->
dev
,
"checking status at %d
\n
"
,
__LINE__
);
if
(
dev
->
of_node
){
dev_err
(
&
client
->
dev
,
"checking status at %d
\n
"
,
__LINE__
);
ret
=
bq24190_setup_dt
(
bdi
);}
else
{
dev_err
(
&
client
->
dev
,
"checking status at %d
\n
"
,
__LINE__
);
ret
=
bq24190_setup_pdata
(
bdi
,
pdata
);}
dev_err
(
&
client
->
dev
,
"checking status at %d
\n
"
,
__LINE__
);
if
(
dev
->
of_node
)
{
ret
=
bq24190_setup_dt
(
bdi
);
}
else
{
ret
=
bq24190_setup_pdata
(
bdi
,
pdata
);
}
if
(
ret
)
{
dev_err
(
&
client
->
dev
,
"Can't get irq info
\n
"
);
dev_err
(
&
client
->
dev
,
"checking status at %d
\n
"
,
__LINE__
);
return
-
EINVAL
;
}
dev_err
(
&
client
->
dev
,
"checking status at %d
\n
"
,
__LINE__
);
ret
=
devm_request_threaded_irq
(
dev
,
bdi
->
irq
,
NULL
,
bq24190_irq_handler_thread
,
IRQF_TRIGGER_RISING
|
IRQF_ONESHOT
,
...
...
@@ -1425,7 +1412,7 @@ static int bq24190_probe(struct i2c_client *client,
dev_err
(
dev
,
"Hardware init failed
\n
"
);
goto
out2
;
}
bq24190_charger_init
(
&
bdi
->
charger
);
ret
=
power_supply_register
(
dev
,
&
bdi
->
charger
);
...
...
@@ -1441,9 +1428,7 @@ static int bq24190_probe(struct i2c_client *client,
dev_err
(
dev
,
"Can't register battery
\n
"
);
goto
out3
;
}
dev_err
(
&
client
->
dev
,
"checking status at %d
\n
"
,
__LINE__
);
ret
=
bq24190_sysfs_create_group
(
bdi
);
dev_err
(
&
client
->
dev
,
"checking status at %d
\n
"
,
__LINE__
);
if
(
ret
)
{
dev_err
(
dev
,
"Can't create sysfs entries
\n
"
);
goto
out4
;
...
...
linux_kernel_modules/ltc294x/ltc2941-battery-gauge.c
View file @
28823699
...
...
@@ -423,31 +423,23 @@ static int ltc294x_i2c_probe(struct i2c_client *client,
u32
prescaler_exp
;
u8
status
;
info
=
devm_kzalloc
(
&
client
->
dev
,
sizeof
(
*
info
),
GFP_KERNEL
);
info
=
devm_kzalloc
(
&
client
->
dev
,
sizeof
(
*
info
),
GFP_KERNEL
);
if
(
info
==
NULL
)
return
-
ENOMEM
;
dev_err
(
&
client
->
dev
,
"reached line at %d
\n
"
,
__LINE__
);
i2c_set_clientdata
(
client
,
info
);
dev_err
(
&
client
->
dev
,
"reached line at %d
\n
"
,
__LINE__
);
// DF
platform_data
=
client
->
dev
.
platform_data
;
dev_err
(
&
client
->
dev
,
"reached line at %d
\n
"
,
__LINE__
);
info
->
id
=
platform_data
->
chip_id
;
dev_err
(
&
client
->
dev
,
"reached line at %d
\n
"
,
__LINE__
);
info
->
supply
.
name
=
platform_data
->
name
;
dev_err
(
&
client
->
dev
,
"reached line at %d
\n
"
,
__LINE__
);
/* r_sense can be negative, when sense+ is connected to the battery
* instead of the sense-. This results in reversed measurements. */
info
->
r_sense
=
platform_data
->
r_sense
;
dev_err
(
&
client
->
dev
,
"reached line at %d
\n
"
,
__LINE__
);
prescaler_exp
=
platform_data
->
prescaler_exp
;
dev_err
(
&
client
->
dev
,
"reached line at %d
\n
"
,
__LINE__
);
if
(
info
->
id
==
LTC2943_ID
)
{
if
(
prescaler_exp
>
LTC2943_MAX_PRESCALER_EXP
)
...
...
@@ -461,7 +453,6 @@ static int ltc294x_i2c_probe(struct i2c_client *client,
(
128
/
(
1
<<
prescaler_exp
));
}
dev_err
(
&
client
->
dev
,
"reached line at %d
\n
"
,
__LINE__
);
/* Read status register to check for LTC2942 */
if
(
info
->
id
==
LTC2941_ID
||
info
->
id
==
LTC2942_ID
)
{
ret
=
ltc294x_read_regs
(
client
,
LTC294X_REG_STATUS
,
&
status
,
1
);
...
...
@@ -495,7 +486,6 @@ static int ltc294x_i2c_probe(struct i2c_client *client,
ARRAY_SIZE
(
ltc294x_properties
)
-
3
;
break
;
}
dev_err
(
&
client
->
dev
,
"reached line at %d
\n
"
,
__LINE__
);
info
->
supply
.
get_property
=
ltc294x_get_property
;
info
->
supply
.
set_property
=
ltc294x_set_property
;
info
->
supply
.
property_is_writeable
=
ltc294x_property_is_writeable
;
...
...
linux_kernel_modules/ltc294x/ltc294x-platform-data.h
View file @
28823699
...
...
@@ -12,9 +12,9 @@ enum ltc294x_id {
struct
ltc294x_platform_data
{
enum
ltc294x_id
chip_id
;
int
r_sense
;
int
r_sense
;
u32
prescaler_exp
;
const
char
*
name
;
const
char
*
name
;
};
#endif
/* LTC294X_PLATFORM_DATA_H */
...
...
linux_kernel_modules/mangoh/9-mangoh_green_dv4.mdef
View file @
28823699
...
...
@@ -2,7 +2,6 @@ cflags:
{
// Needed for lsm6ds3 platform data type definition
-I${MANGOH_ROOT}/linux_kernel_modules/lsm6ds3
-I${MANGOH_ROOT}/linux_kernel_modules/ltc294x
}
...
...
mangOH_Red.sdef
View file @
28823699
...
...
@@ -78,6 +78,6 @@ kernelModules:
// Only on mangOH Red DV4
$MANGOH_ROOT/linux_kernel_modules/ltc294x/0-ltc294x.mdef
// Required for BQ24296
// Required for BQ24296
$MANGOH_ROOT/linux_kernel_modules/bq24296/0-bq24296.mdef
}
BatteryClient
@
9fa6a660
Subproject commit
7ace92fdf34d51c58def5883ffd31dca4eef7b1f
Subproject commit
9fa6a660e8bce919e336345069102739674f21c4
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment