[PATCH 1/7] add-neo1973kbd-jack-state-sys.patch

Werner Almesberger werner at openmoko.org
Tue Sep 23 01:34:06 CEST 2008


Andy Green wrote:
> @@ -84,6 +108,8 @@ static void neo1973kbd_debounce_jack(struct work_struct *work)
>  		input_report_switch(kbd->input, SW_HEADPHONE_INSERT,
>  				    gpio_get_value(irq_to_gpio(kbd->jack_irq)));
>  		input_sync(kbd->input);
> +		neo1973kbd_jack_event(kbd->cdev,
> +				      gpio_get_value(irq_to_gpio(kbd->jack_irq)));

Redundancy, my nemesis :-( How about doing it like the other buttons do ?
E.g., something like this:

	int jack_inserted;

	jack_inserted = gpio_get_value(irq_to_gpio(kbd->jack_irq)));

	input_report_switch(kbd->input, SW_HEADPHONE_INSERT, jack_inserted);
	...
	neo1973kbd_jack_event(kbd->cdev, jack_inserted);

? (Replacing "key_pressed", which would be a bit confusing here.)

- Werner



More information about the openmoko-kernel mailing list