Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
authorLinus Torvalds <torvalds@woody.linux-foundation.org>
Thu, 7 Feb 2008 20:57:44 +0000 (12:57 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Thu, 7 Feb 2008 20:57:44 +0000 (12:57 -0800)
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (34 commits)
  Input: i8042 - non-x86 build fix
  Input: pxa27x_keypad - also enable on PXA3xx
  Input: pxa27x_keypad - add debounce_interval to the keypad platform data
  Input: pxa27x_keypad - use device resources for I/O memory mapping and IRQ
  Input: pxa27x_keypad - enable rotary encoders and direct keys
  Input: pxa27x_keypad - introduce pxa27x_keypad_config()
  Input: pxa27x_keypad - introduce driver structure and use KEY() to define matrix keys
  Input: pxa27x_keypad - remove pin configuration from the driver
  Input: pxa27x_keypad - rename the driver (was pxa27x_keyboard)
  Input: constify function pointer tables (seq_operations)
  Input: i8042 - add Fujitsu-Siemens Amilo Pro 2010 to nomux list
  Input: i8042 - enable DMI quirks on x86-64
  Input: i8042 - add Dritek quirk for Acer Aspire 9110
  Input: add input event to APM event bridge
  Input: mousedev - use BIT_MASK instead of BIT
  Input: remove duplicate includes
  Input: remove cdev from input_dev structure
  Input: remove duplicated headers in drivers/char/keyboard.c
  Input: i8042 - add Dritek keyboard extension quirk
  Input: add Tosa keyboard driver
  ...

1  2 
arch/arm/mach-pxa/tosa.c
drivers/input/touchscreen/ads7846.c
drivers/input/touchscreen/ucb1400_ts.c
drivers/media/video/usbvideo/quickcam_messenger.c
include/linux/input.h

diff --combined arch/arm/mach-pxa/tosa.c
index 9b26fa5edad69200756d02384cdfcb941e8911d7,e7e0f52d6083823bb8eb157f8f9a272b331d92f0..f99112d50b41ef44b82b99e9c187767646bb777b
@@@ -21,6 -21,8 +21,8 @@@
  #include <linux/mmc/host.h>
  #include <linux/pm.h>
  #include <linux/delay.h>
+ #include <linux/gpio_keys.h>
+ #include <linux/input.h>
  
  #include <asm/setup.h>
  #include <asm/memory.h>
@@@ -29,7 -31,6 +31,7 @@@
  #include <asm/irq.h>
  #include <asm/system.h>
  #include <asm/arch/pxa-regs.h>
 +#include <asm/arch/pxa2xx-regs.h>
  #include <asm/arch/irda.h>
  #include <asm/arch/mmc.h>
  #include <asm/arch/udc.h>
@@@ -158,10 -159,15 +160,10 @@@ static void tosa_udc_command(int cmd
        }
  }
  
 -static int tosa_udc_is_connected(void)
 -{
 -      return ((GPLR(TOSA_GPIO_USB_IN) & GPIO_bit(TOSA_GPIO_USB_IN)) == 0);
 -}
 -
 -
  static struct pxa2xx_udc_mach_info udc_info __initdata = {
        .udc_command            = tosa_udc_command,
 -      .udc_is_connected       = tosa_udc_is_connected,
 +      .gpio_vbus              = TOSA_GPIO_USB_IN,
 +      .gpio_vbus_inverted     = 1,
  };
  
  /*
@@@ -180,13 -186,16 +182,13 @@@ static int tosa_mci_init(struct device 
  
        tosa_mci_platform_data.detect_delay = msecs_to_jiffies(250);
  
 -      err = request_irq(TOSA_IRQ_GPIO_nSD_DETECT, tosa_detect_int, IRQF_DISABLED,
 +      err = request_irq(TOSA_IRQ_GPIO_nSD_DETECT, tosa_detect_int,
 +                        IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
                                "MMC/SD card detect", data);
 -      if (err) {
 +      if (err)
                printk(KERN_ERR "tosa_mci_init: MMC/SD: can't request MMC card detect IRQ\n");
 -              return -1;
 -      }
 -
 -      set_irq_type(TOSA_IRQ_GPIO_nSD_DETECT, IRQT_BOTHEDGE);
  
 -      return 0;
 +      return err;
  }
  
  static void tosa_mci_setpower(struct device *dev, unsigned int vdd)
@@@ -246,6 -255,46 +248,46 @@@ static struct platform_device tosakbd_d
        .id             = -1,
  };
  
+ static struct gpio_keys_button tosa_gpio_keys[] = {
+       {
+               .type   = EV_PWR,
+               .code   = KEY_SUSPEND,
+               .gpio   = TOSA_GPIO_ON_KEY,
+               .desc   = "On key",
+               .wakeup = 1,
+               .active_low = 1,
+       },
+       {
+               .type   = EV_KEY,
+               .code   = TOSA_KEY_RECORD,
+               .gpio   = TOSA_GPIO_RECORD_BTN,
+               .desc   = "Record Button",
+               .wakeup = 1,
+               .active_low = 1,
+       },
+       {
+               .type   = EV_KEY,
+               .code   = TOSA_KEY_SYNC,
+               .gpio   = TOSA_GPIO_SYNC,
+               .desc   = "Sync Button",
+               .wakeup = 1,
+               .active_low = 1,
+       },
+ };
+ static struct gpio_keys_platform_data tosa_gpio_keys_platform_data = {
+       .buttons        = tosa_gpio_keys,
+       .nbuttons       = ARRAY_SIZE(tosa_gpio_keys),
+ };
+ static struct platform_device tosa_gpio_keys_device = {
+       .name   = "gpio-keys",
+       .id     = -1,
+       .dev    = {
+               .platform_data  = &tosa_gpio_keys_platform_data,
+       },
+ };
  /*
   * Tosa LEDs
   */
@@@ -258,6 -307,7 +300,7 @@@ static struct platform_device *devices[
        &tosascoop_device,
        &tosascoop_jc_device,
        &tosakbd_device,
+       &tosa_gpio_keys_device,
        &tosaled_device,
  };
  
index fd9c5d51870a095511e8d81728081802ad09e5ed,1c08ecc547703df93c11194306d48f3bd84f441d..58934a40f5ce5ff90abfbe071327370598d0e631
@@@ -116,6 -116,7 +116,7 @@@ struct ads7846 
  // FIXME remove "irq_disabled"
        unsigned                irq_disabled:1; /* P: lock */
        unsigned                disabled:1;
+       unsigned                is_suspended:1;
  
        int                     (*filter)(void *data, int data_idx, int *val);
        void                    *filter_data;
@@@ -203,7 -204,7 +204,7 @@@ static void ads7846_disable(struct ads7
  static int device_suspended(struct device *dev)
  {
        struct ads7846 *ts = dev_get_drvdata(dev);
-       return dev->power.power_state.event != PM_EVENT_ON || ts->disabled;
+       return ts->is_suspended || ts->disabled;
  }
  
  static int ads7846_read12_ser(struct device *dev, unsigned command)
        ts->irq_disabled = 0;
        enable_irq(spi->irq);
  
 -      if (req->msg.status)
 -              status = req->msg.status;
 -
 -      /* on-wire is a must-ignore bit, a BE12 value, then padding */
 -      sample = be16_to_cpu(req->sample);
 -      sample = sample >> 3;
 -      sample &= 0x0fff;
 +      if (status == 0) {
 +              /* on-wire is a must-ignore bit, a BE12 value, then padding */
 +              sample = be16_to_cpu(req->sample);
 +              sample = sample >> 3;
 +              sample &= 0x0fff;
 +      }
  
        kfree(req);
        return status ? status : sample;
@@@ -794,7 -796,7 +795,7 @@@ static int ads7846_suspend(struct spi_d
  
        spin_lock_irq(&ts->lock);
  
-       spi->dev.power.power_state = message;
+       ts->is_suspended = 1;
        ads7846_disable(ts);
  
        spin_unlock_irq(&ts->lock);
@@@ -809,7 -811,7 +810,7 @@@ static int ads7846_resume(struct spi_de
  
        spin_lock_irq(&ts->lock);
  
-       spi->dev.power.power_state = PMSG_ON;
+       ts->is_suspended = 0;
        ads7846_enable(ts);
  
        spin_unlock_irq(&ts->lock);
@@@ -871,7 -873,6 +872,6 @@@ static int __devinit ads7846_probe(stru
        }
  
        dev_set_drvdata(&spi->dev, ts);
-       spi->dev.power.power_state = PMSG_ON;
  
        ts->spi = spi;
        ts->input = input_dev;
index 986a8365e37fb6e867248932bc6f7a66edc97784,35faf469eff2d454a5a23e48ea67d1799c4b60ef..607f9933aa1fd6d91f423fd62e821b17dc243b1d
@@@ -15,7 -15,6 +15,6 @@@
   */
  
  #include <linux/module.h>
- #include <linux/moduleparam.h>
  #include <linux/init.h>
  #include <linux/completion.h>
  #include <linux/delay.h>
@@@ -27,6 -26,7 +26,6 @@@
  #include <linux/kthread.h>
  #include <linux/freezer.h>
  
 -#include <sound/driver.h>
  #include <sound/core.h>
  #include <sound/ac97_codec.h>
  
index 5e7b795013706591aff8dfb09099d9dd60a8fff1,6438bc1f506deeddfa8e777b6069575c58053fe8..a2acba0bcc47586163bd4d82dffa91340354251b
@@@ -105,8 -105,6 +105,6 @@@ static void qcm_register_input(struct q
        input_dev->evbit[0] = BIT_MASK(EV_KEY);
        input_dev->keybit[BIT_WORD(BTN_0)] = BIT_MASK(BTN_0);
  
-       input_dev->private = cam;
        error = input_register_device(cam->input);
        if (error) {
                warn("Failed to register camera's input device, err: %d\n",
@@@ -258,7 -256,7 +256,7 @@@ static void qcm_hsv2rgb(u16 hue, u16 sa
        unsigned int p;
  
        /*
 -      the registers controling gain are 8 bit of which
 +      the registers controlling gain are 8 bit of which
        we affect only the last 4 bits with our gain.
        we know that if saturation is 0, (unsaturated) then
        we're grayscale (center axis of the colour cone) so
diff --combined include/linux/input.h
index 056a17a4f34f5bbf4e31f8bd9ea6c1ccd0e0c9fe,48937ffa977ad1f3d3a3d5311babe4dc845bbf33..1bdc39a8c76c6a0916af7b6698fdcd219a26c1fb
@@@ -371,8 -371,6 +371,8 @@@ struct input_absinfo 
  #define KEY_BRIGHTNESS_ZERO   244     /* brightness off, use ambient */
  #define KEY_DISPLAY_OFF               245     /* display device to off state */
  
 +#define KEY_WIMAX             246
 +
  #define BTN_MISC              0x100
  #define BTN_0                 0x100
  #define BTN_1                 0x101
@@@ -1020,7 -1018,6 +1020,6 @@@ struct ff_effect 
   * @going_away: marks devices that are in a middle of unregistering and
   *    causes input_open_device*() fail with -ENODEV.
   * @dev: driver model's view of this device
-  * @cdev: union for struct device pointer
   * @h_list: list of input handles associated with the device. When
   *    accessing the list dev->mutex must be held
   * @node: used to place the device onto input_dev_list
@@@ -1085,9 -1082,6 +1084,6 @@@ struct input_dev 
        int going_away;
  
        struct device dev;
-       union {                 /* temporarily so while we switching to struct device */
-               struct device *dev;
-       } cdev;
  
        struct list_head        h_list;
        struct list_head        node;
@@@ -1311,6 -1305,9 +1307,9 @@@ static inline void input_set_abs_params
        dev->absbit[BIT_WORD(axis)] |= BIT_MASK(axis);
  }
  
+ int input_get_keycode(struct input_dev *dev, int scancode, int *keycode);
+ int input_set_keycode(struct input_dev *dev, int scancode, int keycode);
  extern struct class input_class;
  
  /**