static int hx8369_cs05_disable(struct pxa168fb_info *fbi) { printk("%s\n", __func__); /* * Sperated lcd off routine multi tasking issue * becasue of share of cpu0 after suspend. */ #if defined(CONFIG_QUICKLOGIC_BRIDGE) /*sleep in*/ Quicklogic_i2cTomipi_write(DTYPE_DCS_WRITE, QL_VX_LCD_VC,\ sizeof(display_off),display_off); msleep(HX8369B_DISP_OFF_DELAY); Quicklogic_i2cTomipi_write(DTYPE_DCS_WRITE, QL_VX_LCD_VC,\ sizeof(sleep_in),sleep_in); msleep(HX8369B_SLEEP_IN_DELAY); #if defined(CONFIG_SPA) || defined(CONFIG_SPA_LPM_MODE) if(!spa_lpm_charging_mode_get()) #else if (!lpcharge) #endif i2c1_pin_changed(1); #endif return 0; }
static int bt532_power(int on) { int ret = 0; static u8 is_power_on; if (touch_regulator == NULL) { touch_regulator = regulator_get(NULL, "v_tsp_3v3"); if (IS_ERR(touch_regulator)) { touch_regulator = NULL; pr_info("[TSP]: %s: get touch_regulator error\n", __func__); return -EIO; } } if ((on == POWER_OFF) || (on == PM_POWER_OFF)) { if (is_power_on) { is_power_on = 0; if(on == POWER_OFF) i2c1_pin_changed(1); ret = regulator_disable(touch_regulator); if (ret) { is_power_on = 1; pr_err("[TSP]: %s: touch_regulator disable " \ "failed (%d)\n", __func__, ret); return -EIO; } msleep(50); } } else { if (!is_power_on) { is_power_on = 1; regulator_set_voltage(touch_regulator, 2800000, 2800000); ret = regulator_enable(touch_regulator); if (ret) { is_power_on = 0; pr_err("[TSP]: %s: touch_regulator enable "\ "failed (%d)\n", __func__, ret); return -EIO; } i2c1_pin_changed(0); } } pr_info("[TSP]: %s, expected power[%d], actural power[%d]\n", __func__, on, is_power_on); return 0; }
int cyttsp4_hw_power(int on, int use_irq, int irq_gpio) { int ret = 0; static u8 is_power_on = 0; CAPRI_TSP_DEBUG(" %s set %d \n", __func__, on); if (tsp_regulator_3_3 == NULL){ tsp_regulator_3_3 = regulator_get(NULL, "v_tsp_3v3"); if(IS_ERR(tsp_regulator_3_3)){ tsp_regulator_3_3 = NULL; printk("get touch_regulator_3v3 regulator error\n"); goto exit; } } #if defined(CONFIG_MACH_BAFFIN) if (tsp_regulator_1_8 == NULL){ tsp_regulator_1_8 = regulator_get(NULL, "v_tsp_1v8"); if(IS_ERR(tsp_regulator_1_8)){ tsp_regulator_1_8 = NULL; printk("get touch_regulator_1v8 regulator error\n"); goto exit; } } #endif if (on) { if (!is_power_on){ is_power_on = 1; regulator_set_voltage(tsp_regulator_3_3, 2850000, 2850000); ret = regulator_enable(tsp_regulator_3_3); if (ret) { is_power_on = 0; pr_err("can not enable TSP AVDD 3.3V, ret=%d\n", ret); goto exit; } #if defined(CONFIG_MACH_BAFFIN) regulator_set_voltage(tsp_regulator_1_8, 1800000, 1800000); ret = regulator_enable(tsp_regulator_1_8); if (ret) { is_power_on = 0; pr_err("can not enable TSP AVDD 1.8V, ret=%d\n", ret); goto exit; } #endif mfp_config(ARRAY_AND_SIZE(tsp_int_wakeup_mfpr)); /* Delay for 10 msec */ msleep(10); i2c1_pin_changed(0); } /* Enable the IRQ */ /* if (use_irq) { enable_irq(gpio_to_irq(irq_gpio)); pr_debug("Enabled IRQ %d for TSP\n", gpio_to_irq(irq_gpio)); }*/ } else { /* Disable the IRQ */ /*if (use_irq) { pr_debug("Disabling IRQ %d for TSP\n", gpio_to_irq(irq_gpio)); disable_irq_nosync(gpio_to_irq(irq_gpio)); }*/ if (is_power_on) { is_power_on = 0; i2c1_pin_changed(1); ret = regulator_disable(tsp_regulator_3_3); if (ret) { is_power_on = 1; pr_err("can not disable TSP AVDD 3.3V, ret=%d\n", ret); goto exit; } #if defined(CONFIG_MACH_BAFFIN) ret = regulator_disable(tsp_regulator_1_8); if (ret) { is_power_on = 1; pr_err("can not disable TSP AVDD 1.8V, ret=%d\n", ret); goto exit; } #endif mfp_config(ARRAY_AND_SIZE(tsp_int_suspend_mfpr)); /* Delay for 100 msec */ msleep(100); } } exit: return ret; }