Files
kernel_samsung_sdm670/include/uapi/linux/batterydata-interface.h
Arulpandiyan Vadivel cec0f9c0b7 power: vm-bms: Add snapshot of qpnp-vm-bms driver
Initial snapshot of vm-bms device driver is taken from msm-3.18
kernel version @ commit f8b6819d0432d6 ("msm: ipa: Fix to
handle NULL pointer dereference")

Add vm-bms, batterydata-interface, battery-lib support
Change spmi driver framework to platform driver framework in 4.9
kernel. Add support to access spmi register via regmap.

Change-Id: Ic2133fcf8dc73e6c1327a8583ccdaa2f5695cfbe
Signed-off-by: Arulpandiyan Vadivel <avadiv@codeaurora.org>
Signed-off-by: Sundara Vinayagam <sundvi@codeaurora.org>
2018-05-02 17:19:36 +05:30

31 lines
884 B
C

#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