bionic/libc/kernel/common/linux/spi/cpcap.h
Nick Pelly b3765b2ee7 Add clean kernel headers for cpcap and hid.
Change-Id: I83d7395634eea8cb28c2fcf86c6855bb17f9fabb
Signed-off-by: Nick Pelly <npelly@google.com>
2010-08-16 15:31:01 -07:00

562 lines
11 KiB
C

/****************************************************************************
****************************************************************************
***
*** This header was automatically generated from a Linux kernel header
*** of the same name, to make information necessary for userspace to
*** call into the kernel available to libc. It contains only constants,
*** structures, and macros generated from the original header, and thus,
*** contains no copyrightable information.
***
****************************************************************************
****************************************************************************/
#ifndef _LINUX_SPI_CPCAP_H
#define _LINUX_SPI_CPCAP_H
#include <linux/ioctl.h>
#define CPCAP_DEV_NAME "cpcap"
#define CPCAP_NUM_REG_CPCAP (CPCAP_REG_END - CPCAP_REG_START + 1)
#define CPCAP_IRQ_INT1_INDEX 0
#define CPCAP_IRQ_INT2_INDEX 16
#define CPCAP_IRQ_INT3_INDEX 32
#define CPCAP_IRQ_INT4_INDEX 48
#define CPCAP_IRQ_INT5_INDEX 64
#define CPCAP_WHISPER_MODE_PU 0x00000001
#define CPCAP_WHISPER_ENABLE_UART 0x00000002
#define CPCAP_WHISPER_ACCY_MASK 0xF8000000
#define CPCAP_WHISPER_ACCY_SHFT 27
#define CPCAP_WHISPER_ID_SIZE 16
enum cpcap_regulator_id {
CPCAP_SW2,
CPCAP_SW4,
CPCAP_SW5,
CPCAP_VCAM,
CPCAP_VCSI,
CPCAP_VDAC,
CPCAP_VDIG,
CPCAP_VFUSE,
CPCAP_VHVIO,
CPCAP_VSDIO,
CPCAP_VPLL,
CPCAP_VRF1,
CPCAP_VRF2,
CPCAP_VRFREF,
CPCAP_VWLAN1,
CPCAP_VWLAN2,
CPCAP_VSIM,
CPCAP_VSIMCARD,
CPCAP_VVIB,
CPCAP_VUSB,
CPCAP_VAUDIO,
CPCAP_NUM_REGULATORS
};
enum cpcap_reg {
CPCAP_REG_START,
CPCAP_REG_INT1 = CPCAP_REG_START,
CPCAP_REG_INT2,
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PRIMACRO_10,
CPCAP_IRQ_UC_PRIMACRO_11,
CPCAP_IRQ_UC_PRIMACRO_12,
CPCAP_IRQ_UC_PRIMACRO_13,
CPCAP_IRQ_UC_PRIMACRO_14,
CPCAP_IRQ_UC_PRIMACRO_15,
CPCAP_IRQ__NUM
};
enum cpcap_adc_bank0 {
CPCAP_ADC_AD0_BATTDETB,
CPCAP_ADC_BATTP,
CPCAP_ADC_VBUS,
CPCAP_ADC_AD3,
CPCAP_ADC_BPLUS_AD4,
CPCAP_ADC_CHG_ISENSE,
CPCAP_ADC_BATTI_ADC,
CPCAP_ADC_USB_ID,
CPCAP_ADC_BANK0_NUM,
};
enum cpcap_adc_bank1 {
CPCAP_ADC_AD8,
CPCAP_ADC_AD9,
CPCAP_ADC_LICELL,
CPCAP_ADC_HV_BATTP,
CPCAP_ADC_TSX1_AD12,
CPCAP_ADC_TSX2_AD13,
CPCAP_ADC_TSY1_AD14,
CPCAP_ADC_TSY2_AD15,
CPCAP_ADC_BANK1_NUM,
};
enum cpcap_adc_format {
CPCAP_ADC_FORMAT_RAW,
CPCAP_ADC_FORMAT_PHASED,
CPCAP_ADC_FORMAT_CONVERTED,
};
enum cpcap_adc_timing {
CPCAP_ADC_TIMING_IMM,
CPCAP_ADC_TIMING_IN,
CPCAP_ADC_TIMING_OUT,
};
enum cpcap_adc_type {
CPCAP_ADC_TYPE_BANK_0,
CPCAP_ADC_TYPE_BANK_1,
CPCAP_ADC_TYPE_BATT_PI,
};
enum cpcap_macro {
CPCAP_MACRO_ROMR,
CPCAP_MACRO_RAMW,
CPCAP_MACRO_RAMR,
CPCAP_MACRO_USEROFF,
CPCAP_MACRO_4,
CPCAP_MACRO_5,
CPCAP_MACRO_6,
CPCAP_MACRO_7,
CPCAP_MACRO_8,
CPCAP_MACRO_9,
CPCAP_MACRO_10,
CPCAP_MACRO_11,
CPCAP_MACRO_12,
CPCAP_MACRO_13,
CPCAP_MACRO_14,
CPCAP_MACRO_15,
CPCAP_MACRO__END,
};
enum cpcap_vendor {
CPCAP_VENDOR_ST,
CPCAP_VENDOR_TI,
};
enum cpcap_revision {
CPCAP_REVISION_1_0 = 0x08,
CPCAP_REVISION_1_1 = 0x09,
CPCAP_REVISION_2_0 = 0x10,
CPCAP_REVISION_2_1 = 0x11,
};
enum cpcap_batt_usb_model {
CPCAP_BATT_USB_MODEL_NONE,
CPCAP_BATT_USB_MODEL_USB,
CPCAP_BATT_USB_MODEL_FACTORY,
};
struct cpcap_spi_init_data {
enum cpcap_reg reg;
unsigned short data;
};
struct cpcap_adc_ato {
unsigned short ato_in;
unsigned short atox_in;
unsigned short adc_ps_factor_in;
unsigned short atox_ps_factor_in;
unsigned short ato_out;
unsigned short atox_out;
unsigned short adc_ps_factor_out;
unsigned short atox_ps_factor_out;
};
struct cpcap_batt_data {
int status;
int health;
int present;
int capacity;
int batt_volt;
int batt_temp;
};
struct cpcap_batt_ac_data {
int online;
};
struct cpcap_batt_usb_data {
int online;
int current_now;
enum cpcap_batt_usb_model model;
};
struct cpcap_device;
struct cpcap_adc_us_request {
enum cpcap_adc_format format;
enum cpcap_adc_timing timing;
enum cpcap_adc_type type;
int status;
int result[CPCAP_ADC_BANK0_NUM];
};
struct cpcap_adc_phase {
signed char offset_batti;
unsigned char slope_batti;
signed char offset_chrgi;
unsigned char slope_chrgi;
signed char offset_battp;
unsigned char slope_battp;
signed char offset_bp;
unsigned char slope_bp;
signed char offset_battt;
unsigned char slope_battt;
signed char offset_chrgv;
unsigned char slope_chrgv;
};
struct cpcap_regacc {
unsigned short reg;
unsigned short value;
unsigned short mask;
};
struct cpcap_whisper_request {
unsigned int cmd;
char dock_id[CPCAP_WHISPER_ID_SIZE];
};
#define CPCAP_IOCTL_TEST_READ_REG _IOWR(0, CPCAP_IOCTL_NUM_TEST_READ_REG, struct cpcap_regacc*)
#define CPCAP_IOCTL_TEST_WRITE_REG _IOWR(0, CPCAP_IOCTL_NUM_TEST_WRITE_REG, struct cpcap_regacc*)
#define CPCAP_IOCTL_ADC_PHASE _IOWR(0, CPCAP_IOCTL_NUM_ADC_PHASE, struct cpcap_adc_phase*)
#define CPCAP_IOCTL_BATT_DISPLAY_UPDATE _IOW(0, CPCAP_IOCTL_NUM_BATT_DISPLAY_UPDATE, struct cpcap_batt_data*)
#define CPCAP_IOCTL_BATT_ATOD_ASYNC _IOW(0, CPCAP_IOCTL_NUM_BATT_ATOD_ASYNC, struct cpcap_adc_us_request*)
#define CPCAP_IOCTL_BATT_ATOD_SYNC _IOWR(0, CPCAP_IOCTL_NUM_BATT_ATOD_SYNC, struct cpcap_adc_us_request*)
#define CPCAP_IOCTL_BATT_ATOD_READ _IOWR(0, CPCAP_IOCTL_NUM_BATT_ATOD_READ, struct cpcap_adc_us_request*)
#define CPCAP_IOCTL_UC_MACRO_START _IOWR(0, CPCAP_IOCTL_NUM_UC_MACRO_START, enum cpcap_macro)
#define CPCAP_IOCTL_UC_MACRO_STOP _IOWR(0, CPCAP_IOCTL_NUM_UC_MACRO_STOP, enum cpcap_macro)
#define CPCAP_IOCTL_UC_GET_VENDOR _IOWR(0, CPCAP_IOCTL_NUM_UC_GET_VENDOR, enum cpcap_vendor)
#define CPCAP_IOCTL_UC_SET_TURBO_MODE _IOW(0, CPCAP_IOCTL_NUM_UC_SET_TURBO_MODE, unsigned short)
#define CPCAP_IOCTL_ACCY_WHISPER _IOW(0, CPCAP_IOCTL_NUM_ACCY_WHISPER, struct cpcap_whisper_request*)
#endif