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
a6833e90
Commit
a6833e90
authored
Oct 18, 2017
by
Ashish Syal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated bq24296 driver for mangOH Red
parent
b049a36f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
23 deletions
+38
-23
0-bq24296.mdef
linux_kernel_modules/bq24296/0-bq24296.mdef
+4
-0
bq24190-charger.c
linux_kernel_modules/bq24296/bq24190-charger.c
+31
-20
bq24190-platform-data.h
linux_kernel_modules/bq24296/bq24190-platform-data.h
+3
-3
No files found.
linux_kernel_modules/bq24296/0-bq24296.mdef
0 → 100644
View file @
a6833e90
sources:
{
bq24190-charger.c
}
linux_kernel_modules/bq24296/bq24190
_
charger.c
→
linux_kernel_modules/bq24296/bq24190
-
charger.c
View file @
a6833e90
...
...
@@ -18,7 +18,7 @@
#include <linux/gpio.h>
#include <linux/i2c.h>
#include
<linux/power/bq24190_charger.h>
#include
"bq24190-platform-data.h"
#define BQ24190_MANUFACTURER "Texas Instruments"
...
...
@@ -129,9 +129,9 @@
#define BQ24190_REG_F_NTC_FAULT_SHIFT 0
#define BQ24190_REG_VPRS 0x0A
/* Vendor/Part/Revision Status */
#define BQ24190_REG_VPRS_PN_MASK (BIT(
5) | BIT(4) | BIT(3
))
#define BQ24190_REG_VPRS_PN_SHIFT
3
#define BQ24190_REG_VPRS_PN_24190 0x
4
#define BQ24190_REG_VPRS_PN_MASK (BIT(
7) | BIT(6) | BIT(5
))
#define BQ24190_REG_VPRS_PN_SHIFT
5
#define BQ24190_REG_VPRS_PN_24190 0x
1
#define BQ24190_REG_VPRS_PN_24192 0x5
/* Also 24193 */
#define BQ24190_REG_VPRS_PN_24192I 0x3
#define BQ24190_REG_VPRS_TS_PROFILE_MASK BIT(2)
...
...
@@ -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,40 +1364,50 @@ 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
);
if
(
dev
->
of_node
)
ret
=
bq24190_setup_dt
(
bdi
);
else
ret
=
bq24190_setup_pdata
(
bdi
,
pdata
);
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
(
ret
)
{
dev_err
(
dev
,
"Can't get irq info
\n
"
);
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
,
...
...
@@ -1415,7 +1425,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
);
...
...
@@ -1431,8 +1441,9 @@ 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/bq24296/bq24190
_charger
.h
→
linux_kernel_modules/bq24296/bq24190
-platform-data
.h
View file @
a6833e90
...
...
@@ -6,11 +6,11 @@
* published by the Free Software Foundation.
*/
#ifndef
_BQ24190_CHARGER
_H_
#define
_BQ24190_CHARGER
_H_
#ifndef
BQ24190_PLATFORM_DATA
_H_
#define
BQ24190_PLATFORM_DATA
_H_
struct
bq24190_platform_data
{
unsigned
int
gpio_int
;
/* GPIO pin that's connected to INT# */
int
gpio_int
;
/* GPIO pin that's connected to INT# */
};
#endif
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