[PATCH] gta01-pcf50606-input-oops.patch

Harald Welte laforge at openmoko.org
Fri May 18 04:08:21 CEST 2007


On Tue, May 15, 2007 at 05:36:04PM +0800, matt_hsu wrote:
> Log:
> 	HXD8: Input device should be registered before request_irq.
> 			For HXD8, kernel would enter oops handling if request_irq before

Thanks.  This took me some time to apply, since I had to fix the error
path.   IF you change the order of device initialization, you also have
to change the order of the error path.

Please see attached patch which I'll now apply


> input device.  

> Index: linux-2.6.21/drivers/i2c/chips/pcf50606.c
> ===================================================================
> --- linux-2.6.21.orig/drivers/i2c/chips/pcf50606.c	2007-05-15 13:20:12.000000000 +0800
> +++ linux-2.6.21/drivers/i2c/chips/pcf50606.c	2007-05-15 13:22:07.000000000 +0800
> @@ -1613,6 +1613,24 @@
>  
>  	/* create virtual charger 'device' */
>  
> +	/* input device registration */
> +	data->input_dev = input_allocate_device();
> +	if (!data->input_dev)
> +		goto exit_sysfs;
> +
> +	data->input_dev->name = "FIC Neo1973 PMU events";
> +	data->input_dev->phys = "FIXME";
> +	data->input_dev->id.bustype = BUS_I2C;
> +	data->input_dev->cdev.dev = &new_client->dev;
> +
> +	data->input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_PWR);
> +	set_bit(KEY_POWER, data->input_dev->keybit);
> +	set_bit(KEY_POWER2, data->input_dev->keybit);
> +	set_bit(KEY_BATTERY, data->input_dev->keybit);
> +
> +	input_register_device(data->input_dev);
> +	
> +
>  	/* register power off handler with core power management */
>  	pm_power_off = &pcf50606_go_standby;
>  
> @@ -1671,22 +1689,6 @@
>  		backlight_update_status(data->backlight);
>  	}
>  
> -	data->input_dev = input_allocate_device();
> -	if (!data->input_dev)
> -		goto exit_pwm;
> -
> -	data->input_dev->name = "FIC Neo1973 PMU events";
> -	data->input_dev->phys = "FIXME";
> -	data->input_dev->id.bustype = BUS_I2C;
> -	data->input_dev->cdev.dev = &new_client->dev;
> -
> -	data->input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_PWR);
> -	set_bit(KEY_POWER, data->input_dev->keybit);
> -	set_bit(KEY_POWER2, data->input_dev->keybit);
> -	set_bit(KEY_BATTERY, data->input_dev->keybit);
> -
> -	input_register_device(data->input_dev);
> -
>  	apm_get_power_status = pcf50606_get_power_status;
>  
>  #ifdef CONFIG_MACH_NEO1973_GTA01


-- 
- Harald Welte <laforge at openmoko.org>          	        http://openmoko.org/
============================================================================
Software for the world's first truly open Free Software mobile phone
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gta01-pcf50606-input-oops-v2.patch
Type: text/x-diff
Size: 2401 bytes
Desc: not available
Url : http://lists.openmoko.org/pipermail/openmoko-kernel/attachments/20070518/cdb01046/attachment.patch 


More information about the openmoko-kernel mailing list