int set_charger_ctrl(u32 ctl) { int result = 0; u8 version; switch (ctl) { case DISABLE: pr_info("Switch charger OFF\n"); if (machine_is_incrediblec()) { smb329_i2c_write_byte(0x80, 0x31); smb329_i2c_write_byte(0x20, 0x06); } break; case ENABLE_SLOW_CHG: pr_info("Switch charger ON (SLOW)\n"); smb329_i2c_write_byte(0x88, 0x31); smb329_i2c_write_byte(0x08, 0x05); break; case ENABLE_FAST_CHG: pr_info("Switch charger ON (FAST)\n"); smb329_i2c_write_byte(0x84, 0x31); smb329_i2c_write_byte(0x08, 0x05); smb329_i2c_read_byte(&version, 0x3B); pr_info("Switch charger version%x\n", version); if ((version & 0x18) == 0x0) smb329_i2c_write_byte(0xA9, 0x00); break; default: pr_info("%s: Not supported battery ctr called.!", __func__); result = -EINVAL; break; } return result; }
static int __init incrediblec_rfkill_init(void) { if (!machine_is_incrediblec()) return 0; return platform_driver_register(&incrediblec_rfkill_driver); }
static int __init incrediblec_wifi_init(void) { int ret; if (!machine_is_incrediblec()) return 0; printk("%s: start\n", __func__); incrediblec_wifi_update_nvs("sd_oobonly=1\r\n"); incrediblec_init_wifi_mem(); ret = platform_device_register(&incrediblec_wifi_device); return ret; }
static int smb329_probe(struct i2c_client *client, const struct i2c_device_id *id) { struct smb329_i2c_client *data = &smb329_i2c_module; if (i2c_check_functionality(client->adapter, I2C_FUNC_I2C) == 0) { dev_dbg(&client->dev, "[SMB329]:I2C fail\n"); return -EIO; } if (machine_is_incrediblec()||(machine_is_supersonic()&&(system_rev < 1))) register_notifier_cable_status(&cable_status_handler); data->address = client->addr; data->client = client; mutex_init(&data->xfer_lock); pr_info("[SMB329]: Driver registration done\n"); return 0; }
int __init incrediblec_init_tv(void) { int ret, engid; uint32_t config; if (!machine_is_incrediblec()) return 0; engid = incrediblec_get_engineerid(); if (0 == engid || 0xF == engid) { msm_tvenc_resources[1].start = MSM_TV_FB_XA_BASE; msm_tvenc_resources[1].end = msm_tvenc_resources[1].start + MSM_TV_FB_SIZE - 1; } else if (engid >= 3) { msm_tvenc_resources[1].start = MSM_TV_FB_BASE + MSM_MEM_128MB_OFFSET; msm_tvenc_resources[1].end = msm_tvenc_resources[1].start + MSM_TV_FB_SIZE - 1; } config = PCOM_GPIO_CFG(INCREDIBLEC_VIDEO_SHDN_N, 0, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_16MA); msm_proc_comm(PCOM_RPC_GPIO_TLMM_CONFIG_EX, &config, 0); gpio_set_value(INCREDIBLEC_VIDEO_SHDN_N, 1); config = PCOM_GPIO_CFG(INCREDIBLEC_TV_LOAD_DET, 0, GPIO_INPUT, GPIO_PULL_DOWN, GPIO_16MA); msm_proc_comm(PCOM_RPC_GPIO_TLMM_CONFIG_EX, &config, 0); if (system_rev < 2) { config = PCOM_GPIO_CFG(INCREDIBLEC_AV_SWITCH, 0, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_16MA); msm_proc_comm(PCOM_RPC_GPIO_TLMM_CONFIG_EX, &config, 0); } if ((ret = platform_device_register(&msm_tvenc_device)) != 0) return ret; return 0; }