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 <sbsure@codeaurora.org>
This commit is contained in:
Shilpa Suresh 2021-03-31 13:35:37 +05:30
parent a5eb56f58a
commit 84905217ec
5 changed files with 77 additions and 0 deletions

View file

@ -148,6 +148,7 @@ gen_headers_out_arm = [
"linux/b1lli.h",
"linux/batadv_packet.h",
"linux/batman_adv.h",
"linux/batterydata-interface.h",
"linux/baycom.h",
"linux/bcache.h",
"linux/bcm933xx_hcs.h",
@ -623,6 +624,7 @@ gen_headers_out_arm = [
"linux/virtio_scsi.h",
"linux/virtio_types.h",
"linux/virtio_vsock.h",
"linux/vm_bms.h",
"linux/vm_sockets.h",
"linux/vm_sockets_diag.h",
"linux/vmcore.h",

View file

@ -143,6 +143,7 @@ gen_headers_out_arm64 = [
"linux/b1lli.h",
"linux/batadv_packet.h",
"linux/batman_adv.h",
"linux/batterydata-interface.h",
"linux/baycom.h",
"linux/bcache.h",
"linux/bcm933xx_hcs.h",
@ -617,6 +618,7 @@ gen_headers_out_arm64 = [
"linux/virtio_scsi.h",
"linux/virtio_types.h",
"linux/virtio_vsock.h",
"linux/vm_bms.h",
"linux/vm_sockets.h",
"linux/vm_sockets_diag.h",
"linux/vmcore.h",

View file

@ -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);

View file

@ -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

View file

@ -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__ */