On Feb 18, 2:39 pm, Porting beginner <porting.begin...@gmail.com>
wrote:
> Hi,
>
> I am trying from few days but don't get any information related to issue as
> below.
>
> Which  KEYCODE to send to input dev ( /dev/input/event2 here ) on headset
> button press event from my
> headset driver so can answer / hang-up call ?

Please see arch/arm/mach-msm/htc_headset.c which says in part:

    Button presses are interpreted as input event (KEY_MEDIA). Button
presses
    are ignored if the headset is plugged in, so the buttons on 11 pin
-> 3.5mm
    jack adapters do not work until a headset is plugged into the
adapter. This
    is to avoid serial RX traffic causing spurious button press
events.

Also I don't think you want to inject  it into the event file
yourself:

static void button_pressed(void)
{
        printk(KERN_INFO "[H2W] button_pressed\n");
        atomic_set(&hi->btn_state, 1);
        input_report_key(hi->input, KEY_MEDIA, 1);
        input_sync(hi->input);
}

You will also want to read Documentation/input/input-programming.txt

Finally you might want to learn about the -R flag to grep ;-)

-- 
unsubscribe: android-kernel+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-kernel

Reply via email to