}
EXPORT_SYMBOL(mfld_fg_save_config_data);
+static uint16_t ctp_cell_char_tbl[] = {
+ /* Data to be written from 0x80h */
+ 0x9d70, 0xb720, 0xb940, 0xba50, 0xbba0, 0xbc70, 0xbce0, 0xbd40,
+ 0xbe60, 0xbf60, 0xc1e0, 0xc470, 0xc700, 0xc970, 0xcce0, 0xd070,
+
+ /* Data to be written from 0x90h */
+ 0x00c0, 0x1730, 0x0690, 0x1260, 0x2a00, 0x3100, 0x3a30, 0x15a0,
+ 0x18f0, 0x0c80, 0x0c20, 0x0b10, 0x0b60, 0x07e0, 0x07a0, 0x07a0,
+
+ /* Data to be written from 0xA0h */
+ 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
+ 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
+};
+
+static void ctp_fg_restore_config_data(const char *name, void *data, int len)
+{
+ struct max17042_config_data *fg_cfg_data =
+ (struct max17042_config_data *)data;
+ fg_cfg_data->cfg = 0x2210;
+ fg_cfg_data->learn_cfg = 0x0076;
+ fg_cfg_data->filter_cfg = 0x87a4;
+ fg_cfg_data->relax_cfg = 0x506b;
+ memcpy(&fg_cfg_data->cell_char_tbl, ctp_cell_char_tbl,
+ sizeof(ctp_cell_char_tbl));
+ fg_cfg_data->rcomp0 = 0x0047;
+ fg_cfg_data->tempCo = 0x1920;
+ fg_cfg_data->etc = 0x00e0;
+ fg_cfg_data->kempty0 = 0x0100;
+ fg_cfg_data->ichgt_term = 0x0240;
+ fg_cfg_data->full_cap = 3400;
+ fg_cfg_data->design_cap = 3400;
+ fg_cfg_data->full_capnom = 3400;
+ fg_cfg_data->soc_empty = 0x0060;
+ fg_cfg_data->rsense = 1;
+}
+EXPORT_SYMBOL(ctp_fg_restore_config_data);
+
+static int ctp_fg_save_config_data(const char *name, void *data, int len)
+{
+ return 0;
+}
+EXPORT_SYMBOL(ctp_fg_save_config_data);
+
void *max17042_platform_data(void *info)
{
static struct max17042_platform_data platform_data;
platform_data.restore_config_data = mfld_fg_restore_config_data;
platform_data.save_config_data = mfld_fg_save_config_data;
#endif
+#ifdef CONFIG_BOARD_CTP
+ platform_data.enable_current_sense = true;
+ platform_data.technology = POWER_SUPPLY_TECHNOLOGY_LION;
+ platform_data.restore_config_data = ctp_fg_restore_config_data;
+ platform_data.save_config_data = ctp_fg_save_config_data;
+#endif
#ifdef CONFIG_CHARGER_SMB347 /* redridge dv10 */
platform_data.battery_status = smb347_get_charging_status;
#endif