staging: fix gpio_ compilation
PATCH 1/1 staging: fix gpio_ compilation
Fix compilation of gpio_* input drivers on -next kernel. Adds needed headers and removes unprotected wakelock/earlysuspend dependencies.
Because creating regular includes is not allowed for drivers/staging, I created drivers/staging/include/ hierarchy for headers that should be system-wide in future. Hopefully that's ok.
(It contains single file now, but it will get more files in near future).
Signed-off-by Pavel Machek <[email protected]>
drivers/staging/dream/Makefile +2 -0
@@ -1,3 +1,5 @@ +EXTRA_CFLAGS += -Idrivers/staging/include + obj-$(CONFIG_MSM_ADSP) += qdsp5/ smd/ obj-$(CONFIG_MSM_CAMERA) += camera/ obj-$(CONFIG_INPUT_GPIO) += gpio_axis.o gpio_event.o gpio_input.o gpio_matrix.o gpio_output.o
drivers/staging/dream/gpio_event.c +1 -2
@@ -13,7 +13,7 @@* */ -#include <linux/earlysuspend.h> +#include <linux/module.h> #include <linux/input.h> #include <linux/gpio_event.h>
@@ -23,7 +23,6 @@struct gpio_event {struct input_dev *input_dev;const struct gpio_event_platform_data *info; -struct early_suspend early_suspend;void *state[0 ]; };
drivers/staging/dream/gpio_input.c +0 -7
@@ -19,7 +19,6 @@#include <linux/hrtimer.h> #include <linux/input.h> #include <linux/interrupt.h> -#include <linux/wakelock.h> enum {DEBOUNCE_UNSTABLE =BIT (0 ),/* Got irq, while debouncing */
@@ -44,7 +43,6 @@ struct gpio_input_state {int use_irq;int debounce_count;spinlock_t irq_lock; -struct wake_lock wake_lock;struct gpio_key_state key_state[0 ]; };
@@ -143,8 +141,6 @@ static enum hrtimer_restart gpio_event_input_timer_func(struct hrtimer *timer)hrtimer_start (timer, ds->info->debounce_time,HRTIMER_MODE_REL ); else if (!ds->use_irq)hrtimer_start (timer, ds->info->poll_time,HRTIMER_MODE_REL ); - else - wake_unlock(&ds->wake_lock);spin_unlock_irqrestore (&ds->irq_lock, irqflags);
@@ -170,7 +166,6 @@ static irqreturn_t gpio_event_input_irq_handler(int irq, void *dev_id)if (ks->debounce &DEBOUNCE_WAIT_IRQ ) { ks->debounce =DEBOUNCE_UNKNOWN ;if (ds->debounce_count++ ==0 ) { -wake_lock (&ds->wake_lock);hrtimer_start ( &ds->timer, ds->info->debounce_time,HRTIMER_MODE_REL );
@@ -277,7 +272,6 @@ int gpio_event_input_func(struct input_dev *input_dev, ds->debounce_count = di->keymap_size; ds->input_dev = input_dev; ds->info = di; -wake_lock_init (&ds->wake_lock,WAKE_LOCK_SUSPEND ,"gpio_input" );spin_lock_init (&ds->irq_lock);for (i =0 ; i < di->keymap_size; i++) {
@@ -336,7 +330,6 @@ err_gpio_configure_failed: err_gpio_request_failed: ; } -wake_lock_destroy (&ds->wake_lock);kfree (ds); err_ds_alloc_failed:return ret;
drivers/staging/dream/gpio_matrix.c +0 -8
@@ -18,13 +18,11 @@#include <linux/gpio_event.h> #include <linux/hrtimer.h> #include <linux/interrupt.h> -#include <linux/wakelock.h> struct gpio_kp {struct input_dev *input_dev;struct gpio_event_matrix_info *keypad_info;struct hrtimer timer; -struct wake_lock wake_lock;int current_output;unsigned int use_irq:1 ;unsigned int key_state_changed:1 ;
@@ -199,7 +197,6 @@ static enum hrtimer_restart gpio_keypad_timer_func(struct hrtimer *timer) }for (in =0 ; in < mi->ninputs; in++)enable_irq (gpio_to_irq (mi->input_gpios[in])); -wake_unlock (&kp->wake_lock);return HRTIMER_NORESTART ; }
@@ -222,7 +219,6 @@ static irqreturn_t gpio_keypad_irq_handler(int irq_in, void *dev_id)else gpio_direction_input (mi->output_gpios[i]); } -wake_lock (&kp->wake_lock);hrtimer_start (&kp->timer,ktime_set (0 ,0 ),HRTIMER_MODE_REL );return IRQ_HANDLED ; }
@@ -363,7 +359,6 @@ int gpio_event_matrix_func(struct input_dev *input_dev,hrtimer_init (&kp->timer,CLOCK_MONOTONIC ,HRTIMER_MODE_REL ); kp->timer.function = gpio_keypad_timer_func; -wake_lock_init (&kp->wake_lock,WAKE_LOCK_SUSPEND ,"gpio_kp" ); err =gpio_keypad_request_irqs (kp); kp->use_irq = err ==0 ;
@@ -371,8 +366,6 @@ int gpio_event_matrix_func(struct input_dev *input_dev,"in %s mode\n" , input_dev->name, kp->use_irq ? "interrupt" : "polling"); -if (kp->use_irq) -wake_lock (&kp->wake_lock);hrtimer_start (&kp->timer,ktime_set (0 ,0 ),HRTIMER_MODE_REL );return 0 ;
@@ -386,7 +379,6 @@ int gpio_event_matrix_func(struct input_dev *input_dev,free_irq (gpio_to_irq (mi->input_gpios[i]), kp);hrtimer_cancel (&kp->timer); -wake_lock_destroy (&kp->wake_lock);for (i = mi->noutputs -1 ; i >=0 ; i--) { err_gpio_direction_input_failed:gpio_free (mi->input_gpios[i]);
drivers/staging/include/linux/gpio_event.h new file +154 -0
154 lines not on this page · raw message
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html