1fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#ifndef _LINUX_SPI_CPCAP_H 2fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#define _LINUX_SPI_CPCAP_H 3fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 4fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly/* 5fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly * This program is free software; you can redistribute it and/or modify 6fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly * it under the terms of the GNU General Public License version 2 as 7fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly * published by the Free Software Foundation. 8fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly * 9fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly * This program is distributed in the hope that it will be useful, 10fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly * but WITHOUT ANY WARRANTY; without even the implied warranty of 11fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly * GNU General Public License for more details. 13fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly * 14fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly * You should have received a copy of the GNU General Public License 15fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly * along with this program; if not, write to the Free Software 16fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 17fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly * 02111-1307, USA 18fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly * 19fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly */ 20fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 21fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#include <linux/ioctl.h> 22fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#ifdef __KERNEL__ 23fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#include <linux/workqueue.h> 24fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#include <linux/completion.h> 25fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#include <linux/power_supply.h> 26fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#include <linux/platform_device.h> 27fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#endif 28fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 29fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#ifdef CONFIG_RTC_INTF_CPCAP_SECCLKD 30fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#include <linux/rtc.h> 31fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#endif 32fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 33fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#define CPCAP_DEV_NAME "cpcap" 34fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#define CPCAP_NUM_REG_CPCAP (CPCAP_REG_END - CPCAP_REG_START + 1) 35fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 36fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#define CPCAP_IRQ_INT1_INDEX 0 37fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#define CPCAP_IRQ_INT2_INDEX 16 38fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#define CPCAP_IRQ_INT3_INDEX 32 39fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#define CPCAP_IRQ_INT4_INDEX 48 40fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#define CPCAP_IRQ_INT5_INDEX 64 41fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 425d7191c7ca223b63d192a4915a757125177aa5eeIliyan Malchev#define CPCAP_HWCFG_NUM 2 /* The number of hardware config words. */ 435d7191c7ca223b63d192a4915a757125177aa5eeIliyan Malchev/* 445d7191c7ca223b63d192a4915a757125177aa5eeIliyan Malchev * Tell the uC to setup the secondary standby bits for the regulators used. 455d7191c7ca223b63d192a4915a757125177aa5eeIliyan Malchev */ 465d7191c7ca223b63d192a4915a757125177aa5eeIliyan Malchev#define CPCAP_HWCFG0_SEC_STBY_SW1 0x0001 475d7191c7ca223b63d192a4915a757125177aa5eeIliyan Malchev#define CPCAP_HWCFG0_SEC_STBY_SW2 0x0002 485d7191c7ca223b63d192a4915a757125177aa5eeIliyan Malchev#define CPCAP_HWCFG0_SEC_STBY_SW3 0x0004 495d7191c7ca223b63d192a4915a757125177aa5eeIliyan Malchev#define CPCAP_HWCFG0_SEC_STBY_SW4 0x0008 505d7191c7ca223b63d192a4915a757125177aa5eeIliyan Malchev#define CPCAP_HWCFG0_SEC_STBY_SW5 0x0010 515d7191c7ca223b63d192a4915a757125177aa5eeIliyan Malchev#define CPCAP_HWCFG0_SEC_STBY_VAUDIO 0x0020 525d7191c7ca223b63d192a4915a757125177aa5eeIliyan Malchev#define CPCAP_HWCFG0_SEC_STBY_VCAM 0x0040 535d7191c7ca223b63d192a4915a757125177aa5eeIliyan Malchev#define CPCAP_HWCFG0_SEC_STBY_VCSI 0x0080 545d7191c7ca223b63d192a4915a757125177aa5eeIliyan Malchev#define CPCAP_HWCFG0_SEC_STBY_VDAC 0x0100 555d7191c7ca223b63d192a4915a757125177aa5eeIliyan Malchev#define CPCAP_HWCFG0_SEC_STBY_VDIG 0x0200 565d7191c7ca223b63d192a4915a757125177aa5eeIliyan Malchev#define CPCAP_HWCFG0_SEC_STBY_VHVIO 0x0400 575d7191c7ca223b63d192a4915a757125177aa5eeIliyan Malchev#define CPCAP_HWCFG0_SEC_STBY_VPLL 0x0800 585d7191c7ca223b63d192a4915a757125177aa5eeIliyan Malchev#define CPCAP_HWCFG0_SEC_STBY_VRF1 0x1000 595d7191c7ca223b63d192a4915a757125177aa5eeIliyan Malchev#define CPCAP_HWCFG0_SEC_STBY_VRF2 0x2000 605d7191c7ca223b63d192a4915a757125177aa5eeIliyan Malchev#define CPCAP_HWCFG0_SEC_STBY_VRFREF 0x4000 615d7191c7ca223b63d192a4915a757125177aa5eeIliyan Malchev#define CPCAP_HWCFG0_SEC_STBY_VSDIO 0x8000 625d7191c7ca223b63d192a4915a757125177aa5eeIliyan Malchev 635d7191c7ca223b63d192a4915a757125177aa5eeIliyan Malchev#define CPCAP_HWCFG1_SEC_STBY_VWLAN1 0x0001 645d7191c7ca223b63d192a4915a757125177aa5eeIliyan Malchev#define CPCAP_HWCFG1_SEC_STBY_VWLAN2 0x0002 655d7191c7ca223b63d192a4915a757125177aa5eeIliyan Malchev#define CPCAP_HWCFG1_SEC_STBY_VSIM 0x0004 665d7191c7ca223b63d192a4915a757125177aa5eeIliyan Malchev#define CPCAP_HWCFG1_SEC_STBY_VSIMCARD 0x0008 675d7191c7ca223b63d192a4915a757125177aa5eeIliyan Malchev 68fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#define CPCAP_WHISPER_MODE_PU 0x00000001 69fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#define CPCAP_WHISPER_ENABLE_UART 0x00000002 70fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#define CPCAP_WHISPER_ACCY_MASK 0xF8000000 71fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#define CPCAP_WHISPER_ACCY_SHFT 27 72fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#define CPCAP_WHISPER_ID_SIZE 16 735d7191c7ca223b63d192a4915a757125177aa5eeIliyan Malchev#define CPCAP_WHISPER_PROP_SIZE 7 74fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 75fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellyenum cpcap_regulator_id { 76fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_SW2, 77fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_SW4, 78fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_SW5, 79fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_VCAM, 80fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_VCSI, 81fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_VDAC, 82fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_VDIG, 83fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_VFUSE, 84fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_VHVIO, 85fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_VSDIO, 86fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_VPLL, 87fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_VRF1, 88fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_VRF2, 89fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_VRFREF, 90fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_VWLAN1, 91fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_VWLAN2, 92fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_VSIM, 93fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_VSIMCARD, 94fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_VVIB, 95fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_VUSB, 96fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_VAUDIO, 97fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_NUM_REGULATORS 98fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly}; 99fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 100fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly/* 101fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly * Enumeration of all registers in the cpcap. Note that the register 102fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly * numbers on the CPCAP IC are not contiguous. The values of the enums below 103fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly * are not the actual register numbers. 104fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly */ 105fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellyenum cpcap_reg { 106fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_START, /* Start of CPCAP registers. */ 107fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 108fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_INT1 = CPCAP_REG_START, /* Interrupt 1 */ 109fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_INT2, /* Interrupt 2 */ 110fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_INT3, /* Interrupt 3 */ 111fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_INT4, /* Interrupt 4 */ 112fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_INTM1, /* Interrupt Mask 1 */ 113fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_INTM2, /* Interrupt Mask 2 */ 114fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_INTM3, /* Interrupt Mask 3 */ 115fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_INTM4, /* Interrupt Mask 4 */ 116fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_INTS1, /* Interrupt Sense 1 */ 117fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_INTS2, /* Interrupt Sense 2 */ 118fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_INTS3, /* Interrupt Sense 3 */ 119fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_INTS4, /* Interrupt Sense 4 */ 120fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_ASSIGN1, /* Resource Assignment 1 */ 121fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_ASSIGN2, /* Resource Assignment 2 */ 122fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_ASSIGN3, /* Resource Assignment 3 */ 123fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_ASSIGN4, /* Resource Assignment 4 */ 124fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_ASSIGN5, /* Resource Assignment 5 */ 125fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_ASSIGN6, /* Resource Assignment 6 */ 126fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_VERSC1, /* Version Control 1 */ 127fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_VERSC2, /* Version Control 2 */ 128fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 129fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_MI1, /* Macro Interrupt 1 */ 130fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_MIM1, /* Macro Interrupt Mask 1 */ 131fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_MI2, /* Macro Interrupt 2 */ 132fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_MIM2, /* Macro Interrupt Mask 2 */ 133fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_UCC1, /* UC Control 1 */ 134fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_UCC2, /* UC Control 2 */ 135fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_PC1, /* Power Cut 1 */ 136fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_PC2, /* Power Cut 2 */ 137fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_BPEOL, /* BP and EOL */ 138fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_PGC, /* Power Gate and Control */ 139fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_MT1, /* Memory Transfer 1 */ 140fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_MT2, /* Memory Transfer 2 */ 141fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_MT3, /* Memory Transfer 3 */ 142fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_PF, /* Print Format */ 143fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 144fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_SCC, /* System Clock Control */ 145fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_SW1, /* Stop Watch 1 */ 146fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_SW2, /* Stop Watch 2 */ 147fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_UCTM, /* UC Turbo Mode */ 148fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_TOD1, /* Time of Day 1 */ 149fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_TOD2, /* Time of Day 2 */ 150fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_TODA1, /* Time of Day Alarm 1 */ 151fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_TODA2, /* Time of Day Alarm 2 */ 152fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_DAY, /* Day */ 153fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_DAYA, /* Day Alarm */ 154fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_VAL1, /* Validity 1 */ 155fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_VAL2, /* Validity 2 */ 156fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 157fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_SDVSPLL, /* Switcher DVS and PLL */ 158fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_SI2CC1, /* Switcher I2C Control 1 */ 159fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_Si2CC2, /* Switcher I2C Control 2 */ 160fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_S1C1, /* Switcher 1 Control 1 */ 161fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_S1C2, /* Switcher 1 Control 2 */ 162fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_S2C1, /* Switcher 2 Control 1 */ 163fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_S2C2, /* Switcher 2 Control 2 */ 164fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_S3C, /* Switcher 3 Control */ 165fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_S4C1, /* Switcher 4 Control 1 */ 166fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_S4C2, /* Switcher 4 Control 2 */ 167fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_S5C, /* Switcher 5 Control */ 168fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_S6C, /* Switcher 6 Control */ 169fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_VCAMC, /* VCAM Control */ 170fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_VCSIC, /* VCSI Control */ 171fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_VDACC, /* VDAC Control */ 172fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_VDIGC, /* VDIG Control */ 173fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_VFUSEC, /* VFUSE Control */ 174fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_VHVIOC, /* VHVIO Control */ 175fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_VSDIOC, /* VSDIO Control */ 176fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_VPLLC, /* VPLL Control */ 177fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_VRF1C, /* VRF1 Control */ 178fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_VRF2C, /* VRF2 Control */ 179fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_VRFREFC, /* VRFREF Control */ 180fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_VWLAN1C, /* VWLAN1 Control */ 181fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_VWLAN2C, /* VWLAN2 Control */ 182fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_VSIMC, /* VSIM Control */ 183fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_VVIBC, /* VVIB Control */ 184fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_VUSBC, /* VUSB Control */ 185fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_VUSBINT1C, /* VUSBINT1 Control */ 186fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_VUSBINT2C, /* VUSBINT2 Control */ 187fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_URT, /* Useroff Regulator Trigger */ 188fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_URM1, /* Useroff Regulator Mask 1 */ 189fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_URM2, /* Useroff Regulator Mask 2 */ 190fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 191fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_VAUDIOC, /* VAUDIO Control */ 192fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_CC, /* Codec Control */ 193fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_CDI, /* Codec Digital Interface */ 194fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_SDAC, /* Stereo DAC */ 195fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_SDACDI, /* Stereo DAC Digital Interface */ 196fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_TXI, /* TX Inputs */ 197fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_TXMP, /* TX MIC PGA's */ 198fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_RXOA, /* RX Output Amplifiers */ 199fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_RXVC, /* RX Volume Control */ 200fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_RXCOA, /* RX Codec to Output Amps */ 201fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_RXSDOA, /* RX Stereo DAC to Output Amps */ 202fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_RXEPOA, /* RX External PGA to Output Amps */ 203fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_RXLL, /* RX Low Latency */ 204fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_A2LA, /* A2 Loudspeaker Amplifier */ 205fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_MIPIS1, /* MIPI Slimbus 1 */ 206fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_MIPIS2, /* MIPI Slimbus 2 */ 207fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_MIPIS3, /* MIPI Slimbus 3. */ 208fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_LVAB, /* LMR Volume and A4 Balanced. */ 209fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 210fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_CCC1, /* Coulomb Counter Control 1 */ 211fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_CRM, /* Charger and Reverse Mode */ 212fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_CCCC2, /* Coincell and Coulomb Ctr Ctrl 2 */ 213fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_CCS1, /* Coulomb Counter Sample 1 */ 214fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_CCS2, /* Coulomb Counter Sample 2 */ 215fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_CCA1, /* Coulomb Counter Accumulator 1 */ 216fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_CCA2, /* Coulomb Counter Accumulator 2 */ 217fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_CCM, /* Coulomb Counter Mode */ 218fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_CCO, /* Coulomb Counter Offset */ 219fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_CCI, /* Coulomb Counter Integrator */ 220fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 221fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_ADCC1, /* A/D Converter Configuration 1 */ 222fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_ADCC2, /* A/D Converter Configuration 2 */ 223fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_ADCD0, /* A/D Converter Data 0 */ 224fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_ADCD1, /* A/D Converter Data 1 */ 225fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_ADCD2, /* A/D Converter Data 2 */ 226fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_ADCD3, /* A/D Converter Data 3 */ 227fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_ADCD4, /* A/D Converter Data 4 */ 228fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_ADCD5, /* A/D Converter Data 5 */ 229fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_ADCD6, /* A/D Converter Data 6 */ 230fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_ADCD7, /* A/D Converter Data 7 */ 231fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_ADCAL1, /* A/D Converter Calibration 1 */ 232fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_ADCAL2, /* A/D Converter Calibration 2 */ 233fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 234fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_USBC1, /* USB Control 1 */ 235fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_USBC2, /* USB Control 2 */ 236fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_USBC3, /* USB Control 3 */ 237fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_UVIDL, /* ULPI Vendor ID Low */ 238fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_UVIDH, /* ULPI Vendor ID High */ 239fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_UPIDL, /* ULPI Product ID Low */ 240fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_UPIDH, /* ULPI Product ID High */ 241fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_UFC1, /* ULPI Function Control 1 */ 242fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_UFC2, /* ULPI Function Control 2 */ 243fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_UFC3, /* ULPI Function Control 3 */ 244fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_UIC1, /* ULPI Interface Control 1 */ 245fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_UIC2, /* ULPI Interface Control 2 */ 246fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_UIC3, /* ULPI Interface Control 3 */ 247fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_USBOTG1, /* USB OTG Control 1 */ 248fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_USBOTG2, /* USB OTG Control 2 */ 249fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_USBOTG3, /* USB OTG Control 3 */ 250fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_UIER1, /* USB Interrupt Enable Rising 1 */ 251fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_UIER2, /* USB Interrupt Enable Rising 2 */ 252fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_UIER3, /* USB Interrupt Enable Rising 3 */ 253fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_UIEF1, /* USB Interrupt Enable Falling 1 */ 254fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_UIEF2, /* USB Interrupt Enable Falling 1 */ 255fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_UIEF3, /* USB Interrupt Enable Falling 1 */ 256fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_UIS, /* USB Interrupt Status */ 257fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_UIL, /* USB Interrupt Latch */ 258fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_USBD, /* USB Debug */ 259fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_SCR1, /* Scratch 1 */ 260fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_SCR2, /* Scratch 2 */ 261fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_SCR3, /* Scratch 3 */ 262fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_VMC, /* Video Mux Control */ 263fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_OWDC, /* One Wire Device Control */ 264fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_GPIO0, /* GPIO 0 Control */ 265fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_GPIO1, /* GPIO 1 Control */ 266fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_GPIO2, /* GPIO 2 Control */ 267fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_GPIO3, /* GPIO 3 Control */ 268fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_GPIO4, /* GPIO 4 Control */ 269fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_GPIO5, /* GPIO 5 Control */ 270fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_GPIO6, /* GPIO 6 Control */ 271fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 272fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_MDLC, /* Main Display Lighting Control */ 273fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_KLC, /* Keypad Lighting Control */ 274fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_ADLC, /* Aux Display Lighting Control */ 275fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_REDC, /* Red Triode Control */ 276fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_GREENC, /* Green Triode Control */ 277fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_BLUEC, /* Blue Triode Control */ 278fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_CFC, /* Camera Flash Control */ 279fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_ABC, /* Adaptive Boost Control */ 280fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_BLEDC, /* Bluetooth LED Control */ 281fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_CLEDC, /* Camera Privacy LED Control */ 282fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 283fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_OW1C, /* One Wire 1 Command */ 284fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_OW1D, /* One Wire 1 Data */ 285fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_OW1I, /* One Wire 1 Interrupt */ 286fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_OW1IE, /* One Wire 1 Interrupt Enable */ 287fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_OW1, /* One Wire 1 Control */ 288fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_OW2C, /* One Wire 2 Command */ 289fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_OW2D, /* One Wire 2 Data */ 290fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_OW2I, /* One Wire 2 Interrupt */ 291fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_OW2IE, /* One Wire 2 Interrupt Enable */ 292fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_OW2, /* One Wire 2 Control */ 293fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_OW3C, /* One Wire 3 Command */ 294fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_OW3D, /* One Wire 3 Data */ 295fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_OW3I, /* One Wire 3 Interrupt */ 296fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_OW3IE, /* One Wire 3 Interrupt Enable */ 297fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_OW3, /* One Wire 3 Control */ 298fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_GCAIC, /* GCAI Clock Control */ 299fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_GCAIM, /* GCAI GPIO Mode */ 300fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_LGDIR, /* LMR GCAI GPIO Direction */ 301fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_LGPU, /* LMR GCAI GPIO Pull-up */ 302fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_LGPIN, /* LMR GCAI GPIO Pin */ 303fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_LGMASK, /* LMR GCAI GPIO Mask */ 304fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_LDEB, /* LMR Debounce Settings */ 305fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_LGDET, /* LMR GCAI Detach Detect */ 306fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_LMISC, /* LMR Misc Bits */ 307fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_LMACE, /* LMR Mace IC Support */ 308fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 309fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_END = CPCAP_REG_LMACE, /* End of CPCAP registers. */ 310fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 311fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_MAX /* The largest valid register value. */ 312fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly = CPCAP_REG_END, 313fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 314fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_SIZE = CPCAP_REG_MAX + 1, 315fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REG_UNUSED = CPCAP_REG_MAX + 2, 316fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly}; 317fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 318fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellyenum { 319fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IOCTL_NUM_TEST__START, 320fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IOCTL_NUM_TEST_READ_REG, 321fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IOCTL_NUM_TEST_WRITE_REG, 322fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IOCTL_NUM_TEST__END, 323fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 324fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IOCTL_NUM_ADC__START, 325fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IOCTL_NUM_ADC_PHASE, 326fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IOCTL_NUM_ADC__END, 327fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 328fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IOCTL_NUM_BATT__START, 329fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IOCTL_NUM_BATT_DISPLAY_UPDATE, 330fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IOCTL_NUM_BATT_ATOD_ASYNC, 331fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IOCTL_NUM_BATT_ATOD_SYNC, 332fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IOCTL_NUM_BATT_ATOD_READ, 333fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IOCTL_NUM_BATT__END, 334fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 335fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IOCTL_NUM_UC__START, 336fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IOCTL_NUM_UC_MACRO_START, 337fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IOCTL_NUM_UC_MACRO_STOP, 338fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IOCTL_NUM_UC_GET_VENDOR, 339fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IOCTL_NUM_UC_SET_TURBO_MODE, 340fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IOCTL_NUM_UC__END, 341fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 342fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#ifdef CONFIG_RTC_INTF_CPCAP_SECCLKD 343fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IOCTL_NUM_RTC__START, 344fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IOCTL_NUM_RTC_COUNT, 345fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IOCTL_NUM_RTC__END, 346fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#endif 347fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 348fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IOCTL_NUM_ACCY__START, 349fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IOCTL_NUM_ACCY_WHISPER, 350fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IOCTL_NUM_ACCY__END, 351fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly}; 352fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 353fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellyenum cpcap_irqs { 354fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ__START, /* 1st supported interrupt event */ 355fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_HSCLK = CPCAP_IRQ_INT1_INDEX, /* High Speed Clock */ 356fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_PRIMAC, /* Primary Macro */ 357fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_SECMAC, /* Secondary Macro */ 358fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_LOWBPL, /* Low Battery Low Threshold */ 359fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_SEC2PRI, /* 2nd Macro to Primary Processor */ 360fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_LOWBPH, /* Low Battery High Threshold */ 361fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_EOL, /* End of Life */ 362fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_TS, /* Touchscreen */ 363fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_ADCDONE, /* ADC Conversion Complete */ 364fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_HS, /* Headset */ 365fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_MB2, /* Mic Bias2 */ 366fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_VBUSOV, /* Overvoltage Detected */ 367fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_RVRS_CHRG, /* Reverse Charge */ 368fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_CHRG_DET, /* Charger Detected */ 369fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_IDFLOAT, /* ID Float */ 370fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_IDGND, /* ID Ground */ 371fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 372fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_SE1 = CPCAP_IRQ_INT2_INDEX, /* SE1 Detector */ 373fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_SESSEND, /* Session End */ 374fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_SESSVLD, /* Session Valid */ 375fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_VBUSVLD, /* VBUS Valid */ 376fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_CHRG_CURR1, /* Charge Current Monitor (20mA) */ 377fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_CHRG_CURR2, /* Charge Current Monitor (250mA) */ 378fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_RVRS_MODE, /* Reverse Current Limit */ 379fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_ON, /* On Signal */ 380fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_ON2, /* On 2 Signal */ 381fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_CLK, /* 32k Clock Transition */ 382fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_1HZ, /* 1Hz Tick */ 383fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_PTT, /* Push To Talk */ 384fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_SE0CONN, /* SE0 Condition */ 385fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_CHRG_SE1B, /* CHRG_SE1B Pin */ 386fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_UART_ECHO_OVERRUN, /* UART Buffer Overflow */ 387fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_EXTMEMHD, /* External MEMHOLD */ 388fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 389fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_WARM = CPCAP_IRQ_INT3_INDEX, /* Warm Start */ 390fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_SYSRSTR, /* System Restart */ 391fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_SOFTRST, /* Soft Reset */ 392fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_DIEPWRDWN, /* Die Temperature Powerdown */ 393fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_DIETEMPH, /* Die Temperature High */ 394fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_PC, /* Power Cut */ 395fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_OFLOWSW, /* Stopwatch Overflow */ 396fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_TODA, /* TOD Alarm */ 397fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_OPT_SEL_DTCH, /* Detach Detect */ 398fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_OPT_SEL_STATE, /* State Change */ 399fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_ONEWIRE1, /* Onewire 1 Block */ 400fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_ONEWIRE2, /* Onewire 2 Block */ 401fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_ONEWIRE3, /* Onewire 3 Block */ 402fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_UCRESET, /* Microcontroller Reset */ 403fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_PWRGOOD, /* BP Turn On */ 404fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_USBDPLLCLK, /* USB DPLL Status */ 405fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 406fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_DPI = CPCAP_IRQ_INT4_INDEX, /* DP Line */ 407fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_DMI, /* DM Line */ 408fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_UCBUSY, /* Microcontroller Busy */ 409fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_GCAI_CURR1, /* Charge Current Monitor (65mA) */ 410fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_GCAI_CURR2, /* Charge Current Monitor (600mA) */ 411fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_SB_MAX_RETRANSMIT_ERR,/* SLIMbus Retransmit Error */ 412fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_BATTDETB, /* Battery Presence Detected */ 413fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_PRIHALT, /* Primary Microcontroller Halt */ 414fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_SECHALT, /* Secondary Microcontroller Halt */ 415fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_CC_CAL, /* CC Calibration */ 416fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 417fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_UC_PRIROMR = CPCAP_IRQ_INT5_INDEX, /* Prim ROM Rd Macro Int */ 418fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_UC_PRIRAMW, /* Primary RAM Write Macro Int */ 419fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_UC_PRIRAMR, /* Primary RAM Read Macro Int */ 420fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_UC_USEROFF, /* USEROFF Macro Interrupt */ 421fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_UC_PRIMACRO_4, /* Primary Macro 4 Interrupt */ 422fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_UC_PRIMACRO_5, /* Primary Macro 5 Interrupt */ 423fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_UC_PRIMACRO_6, /* Primary Macro 6 Interrupt */ 424fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_UC_PRIMACRO_7, /* Primary Macro 7 Interrupt */ 425fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_UC_PRIMACRO_8, /* Primary Macro 8 Interrupt */ 426fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_UC_PRIMACRO_9, /* Primary Macro 9 Interrupt */ 427fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_UC_PRIMACRO_10, /* Primary Macro 10 Interrupt */ 428fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_UC_PRIMACRO_11, /* Primary Macro 11 Interrupt */ 429fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_UC_PRIMACRO_12, /* Primary Macro 12 Interrupt */ 430fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_UC_PRIMACRO_13, /* Primary Macro 13 Interrupt */ 431fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_UC_PRIMACRO_14, /* Primary Macro 14 Interrupt */ 432fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ_UC_PRIMACRO_15, /* Primary Macro 15 Interrupt */ 433fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_IRQ__NUM /* Number of allocated events */ 434fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly}; 435fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 436fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellyenum cpcap_adc_bank0 { 437fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_ADC_AD0_BATTDETB, 438fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_ADC_BATTP, 439fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_ADC_VBUS, 440fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_ADC_AD3, 441fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_ADC_BPLUS_AD4, 442fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_ADC_CHG_ISENSE, 443fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_ADC_BATTI_ADC, 444fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_ADC_USB_ID, 445fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 446fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_ADC_BANK0_NUM, 447fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly}; 448fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 449fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellyenum cpcap_adc_bank1 { 450fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_ADC_AD8, 451fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_ADC_AD9, 452fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_ADC_LICELL, 453fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_ADC_HV_BATTP, 454fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_ADC_TSX1_AD12, 455fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_ADC_TSX2_AD13, 456fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_ADC_TSY1_AD14, 457fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_ADC_TSY2_AD15, 458fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 459fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_ADC_BANK1_NUM, 460fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly}; 461fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 462fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellyenum cpcap_adc_format { 463fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_ADC_FORMAT_RAW, 464fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_ADC_FORMAT_PHASED, 465fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_ADC_FORMAT_CONVERTED, 466fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly}; 467fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 468fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellyenum cpcap_adc_timing { 469fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_ADC_TIMING_IMM, 470fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_ADC_TIMING_IN, 471fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_ADC_TIMING_OUT, 472fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly}; 473fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 474fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellyenum cpcap_adc_type { 475fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_ADC_TYPE_BANK_0, 476fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_ADC_TYPE_BANK_1, 477fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_ADC_TYPE_BATT_PI, 478fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly}; 479fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 480fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellyenum cpcap_macro { 481fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_MACRO_ROMR, 482fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_MACRO_RAMW, 483fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_MACRO_RAMR, 484fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_MACRO_USEROFF, 485fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_MACRO_4, 486fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_MACRO_5, 487fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_MACRO_6, 488fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_MACRO_7, 489fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_MACRO_8, 490fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_MACRO_9, 491fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_MACRO_10, 492fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_MACRO_11, 493fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_MACRO_12, 494fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_MACRO_13, 495fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_MACRO_14, 496fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_MACRO_15, 497fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 498fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_MACRO__END, 499fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly}; 500fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 501fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellyenum cpcap_vendor { 502fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_VENDOR_ST, 503fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_VENDOR_TI, 504fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly}; 505fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 506fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellyenum cpcap_revision { 507fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REVISION_1_0 = 0x08, 508fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REVISION_1_1 = 0x09, 509fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REVISION_2_0 = 0x10, 510fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_REVISION_2_1 = 0x11, 511fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly}; 512fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 513fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellyenum cpcap_batt_usb_model { 514fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_BATT_USB_MODEL_NONE, 515fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_BATT_USB_MODEL_USB, 516fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly CPCAP_BATT_USB_MODEL_FACTORY, 517fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly}; 518fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 519fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellystruct cpcap_spi_init_data { 520fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly enum cpcap_reg reg; 521fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly unsigned short data; 522fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly}; 523fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 524fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellystruct cpcap_adc_ato { 525fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly unsigned short ato_in; 526fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly unsigned short atox_in; 527fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly unsigned short adc_ps_factor_in; 528fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly unsigned short atox_ps_factor_in; 529fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly unsigned short ato_out; 530fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly unsigned short atox_out; 531fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly unsigned short adc_ps_factor_out; 532fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly unsigned short atox_ps_factor_out; 533fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly}; 534fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 535fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellystruct cpcap_batt_data { 536fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly int status; 537fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly int health; 538fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly int present; 539fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly int capacity; 540fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly int batt_volt; 541fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly int batt_temp; 542fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly}; 543fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 544fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellystruct cpcap_batt_ac_data { 545fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly int online; 546fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly}; 547fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 548fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellystruct cpcap_batt_usb_data { 549fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly int online; 550fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly int current_now; 551fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly enum cpcap_batt_usb_model model; 552fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly}; 553fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 554fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#ifdef CONFIG_RTC_INTF_CPCAP_SECCLKD 555fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellystruct cpcap_rtc_time_cnt { 556fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly struct rtc_time time; 557fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly unsigned short count; 558fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly}; 559fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#endif 560fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellystruct cpcap_device; 561fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 562fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#ifdef __KERNEL__ 563fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellystruct cpcap_platform_data { 564fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly struct cpcap_spi_init_data *init; 565fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly int init_len; 566fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly unsigned short *regulator_mode_values; 567fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly unsigned short *regulator_off_mode_values; 568fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly struct regulator_init_data *regulator_init; 569fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly struct cpcap_adc_ato *adc_ato; 570fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly void (*ac_changed)(struct power_supply *, 571fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly struct cpcap_batt_ac_data *); 572fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly void (*batt_changed)(struct power_supply *, 573fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly struct cpcap_batt_data *); 574fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly void (*usb_changed)(struct power_supply *, 575fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly struct cpcap_batt_usb_data *); 5765d7191c7ca223b63d192a4915a757125177aa5eeIliyan Malchev u16 hwcfg[CPCAP_HWCFG_NUM]; 577fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly}; 578fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 579fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellystruct cpcap_whisper_pdata { 580fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly unsigned int data_gpio; 581fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly unsigned int pwr_gpio; 582fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly unsigned char uartmux; 583fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly}; 584fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 585fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellystruct cpcap_adc_request { 586fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly enum cpcap_adc_format format; 587fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly enum cpcap_adc_timing timing; 588fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly enum cpcap_adc_type type; 589fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly int status; 590fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly int result[CPCAP_ADC_BANK0_NUM]; 591fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly void (*callback)(struct cpcap_device *, void *); 592fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly void *callback_param; 593fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 594fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly /* Used in case of sync requests */ 595fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly struct completion completion; 596fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly}; 597fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#endif 598fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 599fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellystruct cpcap_adc_us_request { 600fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly enum cpcap_adc_format format; 601fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly enum cpcap_adc_timing timing; 602fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly enum cpcap_adc_type type; 603fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly int status; 604fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly int result[CPCAP_ADC_BANK0_NUM]; 605fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly}; 606fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 607fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellystruct cpcap_adc_phase { 608fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly signed char offset_batti; 609fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly unsigned char slope_batti; 610fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly signed char offset_chrgi; 611fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly unsigned char slope_chrgi; 612fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly signed char offset_battp; 613fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly unsigned char slope_battp; 614fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly signed char offset_bp; 615fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly unsigned char slope_bp; 616fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly signed char offset_battt; 617fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly unsigned char slope_battt; 618fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly signed char offset_chrgv; 619fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly unsigned char slope_chrgv; 620fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly}; 621fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 622fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellystruct cpcap_regacc { 623fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly unsigned short reg; 624fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly unsigned short value; 625fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly unsigned short mask; 626fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly}; 627fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 628fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellystruct cpcap_whisper_request { 629fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly unsigned int cmd; 630fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly char dock_id[CPCAP_WHISPER_ID_SIZE]; 6315d7191c7ca223b63d192a4915a757125177aa5eeIliyan Malchev char dock_prop[CPCAP_WHISPER_PROP_SIZE]; 632fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly}; 633fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 634fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly/* 635fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly * Gets the contents of the specified cpcap register. 636fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly * 637fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly * INPUTS: The register number in the cpcap driver's format. 638fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly * 639fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly * OUTPUTS: The command writes the register data back to user space at the 640fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly * location specified, or it may return an error code. 641fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly */ 642fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#ifdef CONFIG_RTC_INTF_CPCAP_SECCLKD 643fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#define CPCAP_IOCTL_GET_RTC_TIME_COUNTER \ 644fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly _IOR(0, CPCAP_IOCTL_NUM_RTC_COUNT, struct cpcap_rtc_time_cnt) 645fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#endif 646fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 647fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#define CPCAP_IOCTL_TEST_READ_REG \ 648fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly _IOWR(0, CPCAP_IOCTL_NUM_TEST_READ_REG, struct cpcap_regacc*) 649fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 650fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly/* 651fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly * Writes the specifed cpcap register. 652fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly * 653fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly * This function writes the specified cpcap register with the specified 654fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly * data. 655fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly * 656fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly * INPUTS: The register number in the cpcap driver's format and the data to 657fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly * write to that register. 658fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly * 659fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly * OUTPUTS: The command has no output other than the returned error code for 660fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly * the ioctl() call. 661fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly */ 662fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#define CPCAP_IOCTL_TEST_WRITE_REG \ 663fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly _IOWR(0, CPCAP_IOCTL_NUM_TEST_WRITE_REG, struct cpcap_regacc*) 664fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 665fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#define CPCAP_IOCTL_ADC_PHASE \ 666fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly _IOWR(0, CPCAP_IOCTL_NUM_ADC_PHASE, struct cpcap_adc_phase*) 667fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 668fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#define CPCAP_IOCTL_BATT_DISPLAY_UPDATE \ 669fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly _IOW(0, CPCAP_IOCTL_NUM_BATT_DISPLAY_UPDATE, struct cpcap_batt_data*) 670fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 671fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#define CPCAP_IOCTL_BATT_ATOD_ASYNC \ 672fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly _IOW(0, CPCAP_IOCTL_NUM_BATT_ATOD_ASYNC, struct cpcap_adc_us_request*) 673fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 674fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#define CPCAP_IOCTL_BATT_ATOD_SYNC \ 675fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly _IOWR(0, CPCAP_IOCTL_NUM_BATT_ATOD_SYNC, struct cpcap_adc_us_request*) 676fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 677fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#define CPCAP_IOCTL_BATT_ATOD_READ \ 678fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly _IOWR(0, CPCAP_IOCTL_NUM_BATT_ATOD_READ, struct cpcap_adc_us_request*) 679fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 680fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 681fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#define CPCAP_IOCTL_UC_MACRO_START \ 682fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly _IOWR(0, CPCAP_IOCTL_NUM_UC_MACRO_START, enum cpcap_macro) 683fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 684fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#define CPCAP_IOCTL_UC_MACRO_STOP \ 685fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly _IOWR(0, CPCAP_IOCTL_NUM_UC_MACRO_STOP, enum cpcap_macro) 686fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 687fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#define CPCAP_IOCTL_UC_GET_VENDOR \ 688fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly _IOWR(0, CPCAP_IOCTL_NUM_UC_GET_VENDOR, enum cpcap_vendor) 689fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 690fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#define CPCAP_IOCTL_UC_SET_TURBO_MODE \ 691fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly _IOW(0, CPCAP_IOCTL_NUM_UC_SET_TURBO_MODE, unsigned short) 692fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 693fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#define CPCAP_IOCTL_ACCY_WHISPER \ 694fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly _IOW(0, CPCAP_IOCTL_NUM_ACCY_WHISPER, struct cpcap_whisper_request*) 695fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 696fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#ifdef __KERNEL__ 697fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellystruct cpcap_device { 698fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly struct spi_device *spi; 699fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly enum cpcap_vendor vendor; 700fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly enum cpcap_revision revision; 701fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly void *keydata; 702fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly struct platform_device *regulator_pdev[CPCAP_NUM_REGULATORS]; 703fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly void *irqdata; 704fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly void *adcdata; 705fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly void *battdata; 706fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly void *ucdata; 707fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly void *accydata; 708fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly void (*h2w_new_state)(int); 709fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly}; 710fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 711fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellystatic inline void cpcap_set_keydata(struct cpcap_device *cpcap, void *data) 712fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly{ 713fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly cpcap->keydata = data; 714fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly} 715fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 716fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellystatic inline void *cpcap_get_keydata(struct cpcap_device *cpcap) 717fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly{ 718fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly return cpcap->keydata; 719fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly} 720fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 721fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellyint cpcap_regacc_write(struct cpcap_device *cpcap, enum cpcap_reg reg, 722fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly unsigned short value, unsigned short mask); 723fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 724fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellyint cpcap_regacc_read(struct cpcap_device *cpcap, enum cpcap_reg reg, 725fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly unsigned short *value_ptr); 726fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 727fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellyint cpcap_regacc_init(struct cpcap_device *cpcap); 728fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 729fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellyvoid cpcap_broadcast_key_event(struct cpcap_device *cpcap, 730fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly unsigned int code, int value); 731fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 732fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellyint cpcap_irq_init(struct cpcap_device *cpcap); 733fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 734fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellyvoid cpcap_irq_shutdown(struct cpcap_device *cpcap); 735fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 736fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellyint cpcap_irq_register(struct cpcap_device *cpcap, enum cpcap_irqs irq, 737fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly void (*cb_func) (enum cpcap_irqs, void *), void *data); 738fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 739fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellyint cpcap_irq_free(struct cpcap_device *cpcap, enum cpcap_irqs irq); 740fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 741fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellyint cpcap_irq_get_data(struct cpcap_device *cpcap, enum cpcap_irqs irq, 742fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly void **data); 743fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 744fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellyint cpcap_irq_clear(struct cpcap_device *cpcap, enum cpcap_irqs int_event); 745fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 746fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellyint cpcap_irq_mask(struct cpcap_device *cpcap, enum cpcap_irqs int_event); 747fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 748fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellyint cpcap_irq_unmask(struct cpcap_device *cpcap, enum cpcap_irqs int_event); 749fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 750fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellyint cpcap_irq_mask_get(struct cpcap_device *cpcap, enum cpcap_irqs int_event); 751fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 752fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellyint cpcap_irq_sense(struct cpcap_device *cpcap, enum cpcap_irqs int_event, 753fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly unsigned char clear); 754fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 755fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#ifdef CONFIG_PM 756fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellyint cpcap_irq_suspend(struct cpcap_device *cpcap); 757fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 758fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellyint cpcap_irq_resume(struct cpcap_device *cpcap); 759fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#endif 760fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 761fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellyint cpcap_adc_sync_read(struct cpcap_device *cpcap, 762fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly struct cpcap_adc_request *request); 763fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 764fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellyint cpcap_adc_async_read(struct cpcap_device *cpcap, 765fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly struct cpcap_adc_request *request); 766fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 767fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellyvoid cpcap_adc_phase(struct cpcap_device *cpcap, struct cpcap_adc_phase *phase); 768fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 769fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellyvoid cpcap_batt_set_ac_prop(struct cpcap_device *cpcap, int online); 770fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 771fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellyvoid cpcap_batt_set_usb_prop_online(struct cpcap_device *cpcap, int online, 772fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly enum cpcap_batt_usb_model model); 773fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 774fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellyvoid cpcap_batt_set_usb_prop_curr(struct cpcap_device *cpcap, 775fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly unsigned int curr); 776fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 777fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellyint cpcap_uc_start(struct cpcap_device *cpcap, enum cpcap_macro macro); 778fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 779fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellyint cpcap_uc_stop(struct cpcap_device *cpcap, enum cpcap_macro macro); 780fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 781fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellyunsigned char cpcap_uc_status(struct cpcap_device *cpcap, 782fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly enum cpcap_macro macro); 783fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 7845d7191c7ca223b63d192a4915a757125177aa5eeIliyan Malchevint cpcap_accy_whisper(struct cpcap_device *cpcap, 7855d7191c7ca223b63d192a4915a757125177aa5eeIliyan Malchev struct cpcap_whisper_request *req); 7865d7191c7ca223b63d192a4915a757125177aa5eeIliyan Malchev 7875d7191c7ca223b63d192a4915a757125177aa5eeIliyan Malchevvoid cpcap_accy_whisper_spdif_set_state(int state); 788fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 789fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#define cpcap_driver_register platform_driver_register 790fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#define cpcap_driver_unregister platform_driver_unregister 791fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 792fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellyint cpcap_device_register(struct platform_device *pdev); 793fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pellyint cpcap_device_unregister(struct platform_device *pdev); 794fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 795fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly 796fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#endif /* __KERNEL__ */ 797fae8ba518da5796231b7be04e28829ae195fc0a9Nick Pelly#endif /* _LINUX_SPI_CPCAP_H */ 798