}
+#define SW2_SW4_VAL_TBL_SIZE 69
+#define SW2_SW4_VAL_TBL_STEP 12500
+
+static int sw2_sw4_val_tbl[SW2_SW4_VAL_TBL_SIZE];
static const int sw5_val_tbl[] = {0, 5050000};
static const int vcam_val_tbl[] = {2600000, 2700000, 2800000, 2900000};
static const int vcsi_val_tbl[] = {1200000, 1800000};
const unsigned int volt_trans_time; /* in micro seconds */
const unsigned int turn_on_time; /* in micro seconds */
} cpcap_regltr_data[CPCAP_NUM_REGULATORS] = {
+ [CPCAP_SW2] = {CPCAP_REG_S2C1,
+ 0x0F00,
+ 0x007F,
+ 0,
+ 0x0000,
+ 0x0000,
+ ARRAY_SIZE(sw2_sw4_val_tbl),
+ sw2_sw4_val_tbl,
+ 0,
+ 120,
+ 1500},
+
+ [CPCAP_SW4] = {CPCAP_REG_S4C1,
+ 0x0F00,
+ 0x007F,
+ 0,
+ 0x0000,
+ 0x0000,
+ ARRAY_SIZE(sw2_sw4_val_tbl),
+ sw2_sw4_val_tbl,
+ 0,
+ 100,
+ 1500},
+
[CPCAP_SW5] = {CPCAP_REG_S5C,
0x002A,
0x0000,
};
static struct regulator_desc regulators[] = {
+ [CPCAP_SW2] = CPCAP_REGULATOR("sw2", CPCAP_SW2),
+ [CPCAP_SW4] = CPCAP_REGULATOR("sw4", CPCAP_SW4),
[CPCAP_SW5] = CPCAP_REGULATOR("sw5", CPCAP_SW5),
[CPCAP_VCAM] = CPCAP_REGULATOR("vcam", CPCAP_VCAM),
[CPCAP_VCSI] = CPCAP_REGULATOR("vcsi", CPCAP_VCSI),
static int __init cpcap_regulator_init(void)
{
+ int i;
+
+ for (i = 0; i < SW2_SW4_VAL_TBL_SIZE; i++)
+ sw2_sw4_val_tbl[i] = 600000 + (i * SW2_SW4_VAL_TBL_STEP);
+
return platform_driver_register(&cpcap_regulator_driver);
}
subsys_initcall(cpcap_regulator_init);
#include <linux/platform_device.h>
#endif
-#ifdef CONFIG_RTC_INTF_SECCLKD
+#ifdef CONFIG_RTC_INTF_CPCAP_SECCLKD
#include <linux/rtc.h>
#endif
#define CPCAP_WHISPER_ACCY_SHFT 27
enum cpcap_regulator_id {
+ CPCAP_SW2,
+ CPCAP_SW4,
CPCAP_SW5,
CPCAP_VCAM,
CPCAP_VCSI,
CPCAP_IOCTL_NUM_UC_SET_TURBO_MODE,
CPCAP_IOCTL_NUM_UC__END,
-#ifdef CONFIG_RTC_INTF_SECCLKD
+#ifdef CONFIG_RTC_INTF_CPCAP_SECCLKD
CPCAP_IOCTL_NUM_RTC__START,
CPCAP_IOCTL_NUM_RTC_COUNT,
CPCAP_IOCTL_NUM_RTC__END,
enum cpcap_batt_usb_model model;
};
-#ifdef CONFIG_RTC_INTF_SECCLKD
+#ifdef CONFIG_RTC_INTF_CPCAP_SECCLKD
struct cpcap_rtc_time_cnt {
struct rtc_time time;
unsigned short count;
* OUTPUTS: The command writes the register data back to user space at the
* location specified, or it may return an error code.
*/
-#ifdef CONFIG_RTC_INTF_SECCLKD
+#ifdef CONFIG_RTC_INTF_CPCAP_SECCLKD
#define CPCAP_IOCTL_GET_RTC_TIME_COUNTER \
_IOR(0, CPCAP_IOCTL_NUM_RTC_COUNT, struct cpcap_rtc_time_cnt)
#endif