Merge commit 'v2.6.31-rc8' into next
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 28 Aug 2009 05:00:20 +0000 (22:00 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 28 Aug 2009 05:00:20 +0000 (22:00 -0700)
1  2 
drivers/base/platform.c
drivers/input/misc/wistron_btns.c
drivers/input/touchscreen/ucb1400_ts.c
drivers/pci/pci-driver.c

diff --combined drivers/base/platform.c
index c4b3fcee17b28b7f3bb94274ca9941d6051a8ac7,456594bd97bc5f13f9189854a73b84dfef157bd8..0b111e8e444f0c47ae62292a5d78e0ef16832a25
@@@ -483,9 -483,6 +483,6 @@@ int platform_driver_register(struct pla
                drv->driver.remove = platform_drv_remove;
        if (drv->shutdown)
                drv->driver.shutdown = platform_drv_shutdown;
-       if (drv->suspend || drv->resume)
-               pr_warning("Platform driver '%s' needs updating - please use "
-                       "dev_pm_ops\n", drv->driver.name);
  
        return driver_register(&drv->driver);
  }
@@@ -925,7 -922,7 +922,7 @@@ static int platform_pm_restore_noirq(st
  
  #endif /* !CONFIG_HIBERNATION */
  
 -static struct dev_pm_ops platform_dev_pm_ops = {
 +static const struct dev_pm_ops platform_dev_pm_ops = {
        .prepare = platform_pm_prepare,
        .complete = platform_pm_complete,
        .suspend = platform_pm_suspend,
index bc3116bebfe9df9f4cb03da1cd779d4a645c5b87,27ee976eb54cea4e561fd32665ccfa539d244b96..ebb08cfe27319fc8088bfdfcda0a6624e8ba6413
@@@ -243,9 -243,9 +243,9 @@@ enum { KE_END, KE_KEY, KE_SW, KE_WIFI, 
  #define FE_UNTESTED 0x80
  
  static struct key_entry *keymap; /* = NULL; Current key map */
 -static int have_wifi;
 -static int have_bluetooth;
 -static int have_leds;
 +static bool have_wifi;
 +static bool have_bluetooth;
 +static int leds_present;      /* bitmask of leds present */
  
  static int __init dmi_matched(const struct dmi_system_id *dmi)
  {
        keymap = dmi->driver_data;
        for (key = keymap; key->type != KE_END; key++) {
                if (key->type == KE_WIFI)
 -                      have_wifi = 1;
 +                      have_wifi = true;
                else if (key->type == KE_BLUETOOTH)
 -                      have_bluetooth = 1;
 +                      have_bluetooth = true;
        }
 -      have_leds = key->code & (FE_MAIL_LED | FE_WIFI_LED);
 +      leds_present = key->code & (FE_MAIL_LED | FE_WIFI_LED);
  
        return 1;
  }
@@@ -611,6 -611,20 +611,20 @@@ static struct key_entry keymap_wistron_
        { KE_END, 0 }
  };
  
+ static struct key_entry keymap_prestigio[] __initdata = {
+       { KE_KEY,  0x11, {KEY_PROG1} },
+       { KE_KEY,  0x12, {KEY_PROG2} },
+       { KE_WIFI,  0x30 },
+       { KE_KEY,  0x22, {KEY_REWIND} },
+       { KE_KEY,  0x23, {KEY_FORWARD} },
+       { KE_KEY,  0x24, {KEY_PLAYPAUSE} },
+       { KE_KEY,  0x25, {KEY_STOPCD} },
+       { KE_KEY,  0x31, {KEY_MAIL} },
+       { KE_KEY,  0x36, {KEY_WWW} },
+       { KE_END,  0 }
+ };
  /*
   * If your machine is not here (which is currently rather likely), please send
   * a list of buttons and their key codes (reported when loading this module
@@@ -971,6 -985,8 +985,8 @@@ static int __init select_keymap(void
        if (keymap_name != NULL) {
                if (strcmp (keymap_name, "1557/MS2141") == 0)
                        keymap = keymap_wistron_ms2141;
+               else if (strcmp (keymap_name, "prestigio") == 0)
+                       keymap = keymap_prestigio;
                else if (strcmp (keymap_name, "generic") == 0)
                        keymap = keymap_wistron_generic;
                else {
  
  static struct input_polled_dev *wistron_idev;
  static unsigned long jiffies_last_press;
 -static int wifi_enabled;
 -static int bluetooth_enabled;
 +static bool wifi_enabled;
 +static bool bluetooth_enabled;
  
  static void report_key(struct input_dev *dev, unsigned int keycode)
  {
@@@ -1037,24 -1053,24 +1053,24 @@@ static struct led_classdev wistron_wifi
  
  static void __devinit wistron_led_init(struct device *parent)
  {
 -      if (have_leds & FE_WIFI_LED) {
 +      if (leds_present & FE_WIFI_LED) {
                u16 wifi = bios_get_default_setting(WIFI);
                if (wifi & 1) {
                        wistron_wifi_led.brightness = (wifi & 2) ? LED_FULL : LED_OFF;
                        if (led_classdev_register(parent, &wistron_wifi_led))
 -                              have_leds &= ~FE_WIFI_LED;
 +                              leds_present &= ~FE_WIFI_LED;
                        else
                                bios_set_state(WIFI, wistron_wifi_led.brightness);
  
                } else
 -                      have_leds &= ~FE_WIFI_LED;
 +                      leds_present &= ~FE_WIFI_LED;
        }
  
 -      if (have_leds & FE_MAIL_LED) {
 +      if (leds_present & FE_MAIL_LED) {
                /* bios_get_default_setting(MAIL) always retuns 0, so just turn the led off */
                wistron_mail_led.brightness = LED_OFF;
                if (led_classdev_register(parent, &wistron_mail_led))
 -                      have_leds &= ~FE_MAIL_LED;
 +                      leds_present &= ~FE_MAIL_LED;
                else
                        bios_set_state(MAIL_LED, wistron_mail_led.brightness);
        }
  
  static void __devexit wistron_led_remove(void)
  {
 -      if (have_leds & FE_MAIL_LED)
 +      if (leds_present & FE_MAIL_LED)
                led_classdev_unregister(&wistron_mail_led);
  
 -      if (have_leds & FE_WIFI_LED)
 +      if (leds_present & FE_WIFI_LED)
                led_classdev_unregister(&wistron_wifi_led);
  }
  
  static inline void wistron_led_suspend(void)
  {
 -      if (have_leds & FE_MAIL_LED)
 +      if (leds_present & FE_MAIL_LED)
                led_classdev_suspend(&wistron_mail_led);
  
 -      if (have_leds & FE_WIFI_LED)
 +      if (leds_present & FE_WIFI_LED)
                led_classdev_suspend(&wistron_wifi_led);
  }
  
  static inline void wistron_led_resume(void)
  {
 -      if (have_leds & FE_MAIL_LED)
 +      if (leds_present & FE_MAIL_LED)
                led_classdev_resume(&wistron_mail_led);
  
 -      if (have_leds & FE_WIFI_LED)
 +      if (leds_present & FE_WIFI_LED)
                led_classdev_resume(&wistron_wifi_led);
  }
  
@@@ -1296,7 -1312,7 +1312,7 @@@ static int __devinit wistron_probe(stru
        if (have_wifi) {
                u16 wifi = bios_get_default_setting(WIFI);
                if (wifi & 1)
 -                      wifi_enabled = (wifi & 2) ? 1 : 0;
 +                      wifi_enabled = wifi & 2;
                else
                        have_wifi = 0;
  
        if (have_bluetooth) {
                u16 bt = bios_get_default_setting(BLUETOOTH);
                if (bt & 1)
 -                      bluetooth_enabled = (bt & 2) ? 1 : 0;
 +                      bluetooth_enabled = bt & 2;
                else
 -                      have_bluetooth = 0;
 +                      have_bluetooth = false;
  
                if (have_bluetooth)
                        bios_set_state(BLUETOOTH, bluetooth_enabled);
        }
  
        wistron_led_init(&dev->dev);
 +
        err = setup_input_dev();
        if (err) {
                bios_detach();
@@@ -1337,7 -1352,7 +1353,7 @@@ static int __devexit wistron_remove(str
  }
  
  #ifdef CONFIG_PM
 -static int wistron_suspend(struct platform_device *dev, pm_message_t state)
 +static int wistron_suspend(struct device *dev)
  {
        if (have_wifi)
                bios_set_state(WIFI, 0);
                bios_set_state(BLUETOOTH, 0);
  
        wistron_led_suspend();
 +
        return 0;
  }
  
 -static int wistron_resume(struct platform_device *dev)
 +static int wistron_resume(struct device *dev)
  {
        if (have_wifi)
                bios_set_state(WIFI, wifi_enabled);
                bios_set_state(BLUETOOTH, bluetooth_enabled);
  
        wistron_led_resume();
 +
        poll_bios(true);
  
        return 0;
  }
 -#else
 -#define wistron_suspend               NULL
 -#define wistron_resume                NULL
 +
 +static const struct dev_pm_ops wistron_pm_ops = {
 +      .suspend        = wistron_suspend,
 +      .resume         = wistron_resume,
 +      .poweroff       = wistron_suspend,
 +      .restore        = wistron_resume,
 +};
  #endif
  
  static struct platform_driver wistron_driver = {
        .driver         = {
                .name   = "wistron-bios",
                .owner  = THIS_MODULE,
 +#if CONFIG_PM
 +              .pm     = &wistron_pm_ops,
 +#endif
        },
        .probe          = wistron_probe,
        .remove         = __devexit_p(wistron_remove),
 -      .suspend        = wistron_suspend,
 -      .resume         = wistron_resume,
  };
  
  static int __init wb_module_init(void)
index e85483578bd4f2207e82c257430fc63a2d6d02d1,3a7a58222f836ed5c9aea5022a1196482c7ee355..095f84b1f56e33769a4513a9d635aa3b0100f7f3
@@@ -128,10 -128,9 +128,10 @@@ static inline unsigned int ucb1400_ts_r
        return ucb1400_adc_read(ucb->ac97, 0, adcsync);
  }
  
 -static inline int ucb1400_ts_pen_down(struct snd_ac97 *ac97)
 +static inline int ucb1400_ts_pen_up(struct snd_ac97 *ac97)
  {
        unsigned short val = ucb1400_reg_read(ac97, UCB_TS_CR);
 +
        return val & (UCB_TS_CR_TSPX_LOW | UCB_TS_CR_TSMX_LOW);
  }
  
@@@ -171,11 -170,11 +171,11 @@@ static void ucb1400_handle_pending_irq(
        ucb1400_reg_write(ucb->ac97, UCB_IE_CLEAR, isr);
        ucb1400_reg_write(ucb->ac97, UCB_IE_CLEAR, 0);
  
-       if (isr & UCB_IE_TSPX) {
+       if (isr & UCB_IE_TSPX)
                ucb1400_ts_irq_disable(ucb->ac97);
-               enable_irq(ucb->irq);
-       } else
-               printk(KERN_ERR "ucb1400: unexpected IE_STATUS = %#x\n", isr);
+       else
+               dev_dbg(&ucb->ts_idev->dev, "ucb1400: unexpected IE_STATUS = %#x\n", isr);
+       enable_irq(ucb->irq);
  }
  
  static int ucb1400_ts_thread(void *_ucb)
  
                msleep(10);
  
 -              if (ucb1400_ts_pen_down(ucb->ac97)) {
 +              if (ucb1400_ts_pen_up(ucb->ac97)) {
                        ucb1400_ts_irq_enable(ucb->ac97);
  
                        /*
@@@ -346,6 -345,7 +346,7 @@@ static int ucb1400_ts_detect_irq(struc
  static int ucb1400_ts_probe(struct platform_device *dev)
  {
        int error, x_res, y_res;
+       u16 fcsr;
        struct ucb1400_ts *ucb = dev->dev.platform_data;
  
        ucb->ts_idev = input_allocate_device();
        ucb->ts_idev->evbit[0]          = BIT_MASK(EV_ABS) | BIT_MASK(EV_KEY);
        ucb->ts_idev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
  
+       /*
+        * Enable ADC filter to prevent horrible jitter on Colibri.
+        * This also further reduces jitter on boards where ADCSYNC
+        * pin is connected.
+        */
+       fcsr = ucb1400_reg_read(ucb->ac97, UCB_FCSR);
+       ucb1400_reg_write(ucb->ac97, UCB_FCSR, fcsr | UCB_FCSR_AVE);
        ucb1400_adc_enable(ucb->ac97);
        x_res = ucb1400_ts_read_xres(ucb);
        y_res = ucb1400_ts_read_yres(ucb);
diff --combined drivers/pci/pci-driver.c
index 0c2ea44ae5e102b97fcdd0ad3593d7bf8ecb9294,f99bc7f089f1ab8c0839775c58f2cabc487e37cf..a7eb7277b106020e1dbbea143a97bba5f95a6c47
@@@ -508,7 -508,7 +508,7 @@@ static int pci_restore_standard_config(
                        return error;
        }
  
-       return pci_dev->state_saved ? pci_restore_state(pci_dev) : 0;
+       return pci_restore_state(pci_dev);
  }
  
  static void pci_pm_default_resume_noirq(struct pci_dev *pci_dev)
@@@ -575,7 -575,7 +575,7 @@@ static void pci_pm_complete(struct devi
  static int pci_pm_suspend(struct device *dev)
  {
        struct pci_dev *pci_dev = to_pci_dev(dev);
 -      struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
 +      const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
  
        if (pci_has_legacy_pm_support(pci_dev))
                return pci_legacy_suspend(dev, PMSG_SUSPEND);
  static int pci_pm_suspend_noirq(struct device *dev)
  {
        struct pci_dev *pci_dev = to_pci_dev(dev);
 -      struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
 +      const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
  
        if (pci_has_legacy_pm_support(pci_dev))
                return pci_legacy_suspend_late(dev, PMSG_SUSPEND);
@@@ -672,7 -672,7 +672,7 @@@ static int pci_pm_resume_noirq(struct d
  static int pci_pm_resume(struct device *dev)
  {
        struct pci_dev *pci_dev = to_pci_dev(dev);
 -      struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
 +      const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
        int error = 0;
  
        /*
  static int pci_pm_freeze(struct device *dev)
  {
        struct pci_dev *pci_dev = to_pci_dev(dev);
 -      struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
 +      const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
  
        if (pci_has_legacy_pm_support(pci_dev))
                return pci_legacy_suspend(dev, PMSG_FREEZE);
@@@ -780,7 -780,7 +780,7 @@@ static int pci_pm_thaw_noirq(struct dev
  static int pci_pm_thaw(struct device *dev)
  {
        struct pci_dev *pci_dev = to_pci_dev(dev);
 -      struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
 +      const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
        int error = 0;
  
        if (pci_has_legacy_pm_support(pci_dev))
  static int pci_pm_poweroff(struct device *dev)
  {
        struct pci_dev *pci_dev = to_pci_dev(dev);
 -      struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
 +      const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
  
        if (pci_has_legacy_pm_support(pci_dev))
                return pci_legacy_suspend(dev, PMSG_HIBERNATE);
@@@ -872,7 -872,7 +872,7 @@@ static int pci_pm_restore_noirq(struct 
  static int pci_pm_restore(struct device *dev)
  {
        struct pci_dev *pci_dev = to_pci_dev(dev);
 -      struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
 +      const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
        int error = 0;
  
        /*
  
  #endif /* !CONFIG_HIBERNATION */
  
 -struct dev_pm_ops pci_dev_pm_ops = {
 +const struct dev_pm_ops pci_dev_pm_ops = {
        .prepare = pci_pm_prepare,
        .complete = pci_pm_complete,
        .suspend = pci_pm_suspend,