-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
include: uapi: Add charger specific headers for QM215
Add all the header files required for the charger/fg/bms drivers for QM215 target. Add snapshots of the new files as of msm-4.9 commit 0848b3af1d2f ("ARM: dts: qcom: disabled wled bl type for sim_vid panel"). Change-Id: Idd1485908488f5eddcee17bb536411abfc4ff6e6 Signed-off-by: Shilpa Suresh <[email protected]>
- Loading branch information
Shilpa Suresh
committed
Apr 1, 2021
1 parent
a5eb56f
commit 8490521
Showing
5 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* SPDX-License-Identifier: GPL-2.0-only */ | ||
/* Copyright (c) 2014-2015, 2018, 2021, The Linux Foundation. All rights reserved. | ||
*/ | ||
|
||
#include <uapi/linux/batterydata-interface.h> | ||
|
||
int config_battery_data(struct bms_battery_data *profile); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */ | ||
#ifndef __BATTERYDATA_LIB_H__ | ||
#define __BATTERYDATA_LIB_H__ | ||
|
||
#include <linux/ioctl.h> | ||
|
||
/** | ||
* struct battery_params - Battery profile data to be exchanged. | ||
* @soc: SOC (state of charge) of the battery | ||
* @ocv_uv: OCV (open circuit voltage) of the battery | ||
* @rbatt_sf: RBATT scaling factor | ||
* @batt_temp: Battery temperature in deci-degree. | ||
* @slope: Slope of the OCV-SOC curve. | ||
* @fcc_mah: FCC (full charge capacity) of the battery. | ||
*/ | ||
struct battery_params { | ||
int soc; | ||
int ocv_uv; | ||
int rbatt_sf; | ||
int batt_temp; | ||
int slope; | ||
int fcc_mah; | ||
}; | ||
|
||
/* IOCTLs to query battery profile data */ | ||
#define BPIOCXSOC _IOWR('B', 0x01, struct battery_params) /* SOC */ | ||
#define BPIOCXRBATT _IOWR('B', 0x02, struct battery_params) /* RBATT SF */ | ||
#define BPIOCXSLOPE _IOWR('B', 0x03, struct battery_params) /* SLOPE */ | ||
#define BPIOCXFCC _IOWR('B', 0x04, struct battery_params) /* FCC */ | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */ | ||
#ifndef __VM_BMS_H__ | ||
#define __VM_BMS_H__ | ||
|
||
#define VM_BMS_DEVICE "/dev/vm_bms" | ||
#define MAX_FIFO_REGS 8 | ||
|
||
/** | ||
* struct qpnp_vm_bms_data - vm-bms data (passed to usersapce) | ||
* @data_type: type of data filled up | ||
* @num_fifo: count of valid fifo averages | ||
* @fifo_uv: array of fifo averages in uv | ||
* @sample_interval sample interval of the fifo data in ms | ||
* @sample_count total samples in one fifo | ||
* @acc_uv averaged accumulator value in uv | ||
* @acc_count num of accumulated samples | ||
* @seq_num sequence number of the data | ||
*/ | ||
struct qpnp_vm_bms_data { | ||
unsigned int num_fifo; | ||
unsigned int fifo_uv[MAX_FIFO_REGS]; | ||
unsigned int sample_interval_ms; | ||
unsigned int sample_count; | ||
unsigned int acc_uv; | ||
unsigned int acc_count; | ||
unsigned int seq_num; | ||
}; | ||
|
||
enum vmbms_power_usecase { | ||
VMBMS_IGNORE_ALL_BIT = 1, | ||
VMBMS_VOICE_CALL_BIT = (1 << 4), | ||
VMBMS_STATIC_DISPLAY_BIT = (1 << 5), | ||
}; | ||
|
||
#endif /* __VM_BMS_H__ */ |