Esempio n. 1
0
int ds2746_blocking_notify(unsigned long val, void *v)
{
	int chg_ctl;

	if (val == DS2746_CHARGING_CONTROL){
		chg_ctl = *(int *) v;
		if (machine_is_passionc()){
			if (chg_ctl <= 2){
				gpio_direction_output(22, !(!!chg_ctl));/*PNC*/
				set_charger_ctrl(chg_ctl);
			}
			return 0;
		}else if (TOGGLE_CHARGER == chg_ctl || ENABLE_MIN_TAPER == chg_ctl || DISABLE_MIN_TAPER == chg_ctl) {
			if (0 == poweralg.charging_enable)
				return 0;
		} else if (poweralg.charge_state != CHARGE_STATE_PREDICTION) {
			/* only notify at changes */
			if (g_first_update_charger_ctl == 1) {
				printk(DRIVER_ZONE "first update charger control forcely.\n");
				g_first_update_charger_ctl = 0;
				poweralg.charging_enable = chg_ctl;
			} else if (poweralg.charging_enable == chg_ctl)
				return 0;
			else
				poweralg.charging_enable = chg_ctl;
		} else {
			poweralg.charging_enable = DISABLE;
			v = DISABLE;
			printk(DRIVER_ZONE "Charging disable due to PREDICTION state\n");
		}
	}
	return blocking_notifier_call_chain(&ds2746_notifier_list, val, v);
}
static int samsung_oled_panel_init(struct msm_lcdc_panel_ops *ops)
{
	LCMDBG("%s()\n", __func__);

	amoled_panel_power(1);

	wake_lock(&panel_idle_lock);
	mutex_lock(&panel_lock);
	if (machine_is_passionc()) {
		/* FIXME: display team will clean up the below codes */
		if (system_rev == 0xC0 || system_rev == 0) /* for Passion#C EVT1 */
			lcm_write_tb(lcm_init_seq, ARRAY_SIZE(lcm_init_seq));
		else
			lcm_write_tb(lcm_init_seq, ARRAY_SIZE(lcm_init_666seq));
	} else {
		if (system_rev < 1)
			lcm_write_tb(lcm_init_seq, ARRAY_SIZE(lcm_init_seq));
		else
			lcm_write_tb(lcm_init_seq, ARRAY_SIZE(lcm_init_666seq));
	}
	gamma_table_bank_select();
	mutex_unlock(&panel_lock);
	wake_unlock(&panel_idle_lock);
	return 0;
}