int hs_notify_key_irq(void)
{
	int adc = 0;
	int key_code = HS_MGR_KEY_INVALID;

	if (hi->hs_35mm_type == HEADSET_INDICATOR) {
		HS_LOG("Not support remote control");
		return 1;
	}

	if (!hs_mgr_notifier.remote_adc || !hs_mgr_notifier.remote_keycode) {
		HS_LOG("Failed to get remote key code");
		return 1;
	}

	if (hs_hpin_stable()) {
		mdelay(40);
		hs_mgr_notifier.remote_adc(&adc);
		key_code = hs_mgr_notifier.remote_keycode(adc);
		hs_notify_key_event(key_code);
	} else if (hi->hs_35mm_type == HEADSET_NO_MIC ||
		   hi->hs_35mm_type == HEADSET_UNKNOWN_MIC) {
		HS_LOG("IGNORE key IRQ (Unstable HPIN)");
		update_mic_status(HS_DEF_MIC_DETECT_COUNT);
	}

	return 1;
}
Пример #2
0
static void hs_pmic_rpc_key(int adc)
{
	int key_code = hs_pmic_adc_to_keycode(adc);

	if (key_code != HS_MGR_KEY_INVALID)
		hs_notify_key_event(key_code);
}
static void button_8x60_work_func(struct work_struct *work)
{
	int adc = 0;
	int key_code = HS_MGR_KEY_INVALID;

	HS_DBG();

	hs_8x60_remote_adc(&adc);
	key_code = hs_8x60_adc_to_keycode(adc);

	if (key_code != HS_MGR_KEY_INVALID)
		hs_notify_key_event(key_code);
}
Пример #4
0
int hs_notify_key_irq(void)
{
	int adc = 0;
	int key_code = HS_MGR_KEY_INVALID;

	key_bounce++;

	if (hi->one_wire_mode == 1 && hs_hpin_stable()) {
		wake_lock_timeout(&hi->hs_wake_lock, HS_WAKE_LOCK_TIMEOUT);
		key_code = hs_mgr_notifier.hs_1wire_read_key();
		if (key_code >= 0)
			hs_notify_key_event(key_code);
		return 1;
	}

	if (hi->hs_35mm_type == HEADSET_INDICATOR) {
		HS_LOG("Not support remote control");
		return 1;
	}

	if (!hs_mgr_notifier.remote_adc || !hs_mgr_notifier.remote_keycode) {
		HS_LOG("Failed to get remote key code");
		return 1;
	}

	if (hs_hpin_stable()) {
		hs_mgr_notifier.remote_adc(&adc);
		key_code = hs_mgr_notifier.remote_keycode(adc);
		hs_notify_key_event(key_code);
	} else if (hi->hs_35mm_type == HEADSET_NO_MIC ||
		   hi->hs_35mm_type == HEADSET_UNKNOWN_MIC) {
		HS_LOG("IGNORE key IRQ (Unstable HPIN)");
		update_mic_status(HS_DEF_MIC_DETECT_COUNT);
	}

	return 1;
}
int hs_notify_key_irq(void)
{
	int adc = 0;
	int key_code = HS_MGR_KEY_INVALID;

	if (!hs_mgr_notifier.remote_adc || !hs_mgr_notifier.remote_keycode) {
		HS_LOG("Failed to get remote key code");
		return 1;
	}

	hs_mgr_notifier.remote_adc(&adc);
	key_code = hs_mgr_notifier.remote_keycode(adc);
	hs_notify_key_event(key_code);

	return 1;
}