Merge branch 'next' into for-linus
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Thu, 16 Apr 2009 15:51:52 +0000 (08:51 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Thu, 16 Apr 2009 15:51:52 +0000 (08:51 -0700)
1  2 
drivers/input/input.c
drivers/input/touchscreen/ads7846.c

diff --combined drivers/input/input.c
index d44065d2e662d7fc6757986c4c91b89b5b7b8ebd,a79c83397a9c16f2450fb3fe3641506191d897d8..935a1835de2d3b854423d90a2af4f6ffeec9ca81
@@@ -910,6 -910,8 +910,6 @@@ static int __init input_proc_init(void
        if (!proc_bus_input_dir)
                return -ENOMEM;
  
 -      proc_bus_input_dir->owner = THIS_MODULE;
 -
        entry = proc_create("devices", 0, proc_bus_input_dir,
                            &input_devices_fileops);
        if (!entry)
@@@ -1549,7 -1551,6 +1549,6 @@@ int input_register_handle(struct input_
                return error;
        list_add_tail_rcu(&handle->d_node, &dev->h_list);
        mutex_unlock(&dev->mutex);
-       synchronize_rcu();
  
        /*
         * Since we are supposed to be called from ->connect()
index 056ac77e2cf0ed6fe5624d9f62f35bbab2d57697,8b6e30ac2919a324242f43364e795e478ec4da9e..2b01e56568f8c023097c62c4185090c0587e91d1
@@@ -127,6 -127,8 +127,8 @@@ struct ads7846 
        void                    (*filter_cleanup)(void *data);
        int                     (*get_pendown_state)(void);
        int                     gpio_pendown;
+       void                    (*wait_for_sync)(void);
  };
  
  /* leave chip selected when we're done, for quicker re-select? */
@@@ -295,7 -297,7 +297,7 @@@ name ## _show(struct device *dev, struc
  static DEVICE_ATTR(name, S_IRUGO, name ## _show, NULL);
  
  
 -/* Sysfs conventions report temperatures in millidegrees Celcius.
 +/* Sysfs conventions report temperatures in millidegrees Celsius.
   * ADS7846 could use the low-accuracy two-sample scheme, but can't do the high
   * accuracy scheme without calibration data.  For now we won't try either;
   * userspace sees raw sensor values, and must scale/calibrate appropriately.
@@@ -511,6 -513,10 +513,10 @@@ static int get_pendown_state(struct ads
        return !gpio_get_value(ts->gpio_pendown);
  }
  
+ static void null_wait_for_sync(void)
+ {
+ }
  /*
   * PENIRQ only kicks the timer.  The timer only reissues the SPI transfer,
   * to retrieve touchscreen status.
@@@ -686,6 -692,7 +692,7 @@@ static void ads7846_rx_val(void *ads
        default:
                BUG();
        }
+       ts->wait_for_sync();
        status = spi_async(ts->spi, m);
        if (status)
                dev_err(&ts->spi->dev, "spi_async --> %d\n",
@@@ -723,6 -730,7 +730,7 @@@ static enum hrtimer_restart ads7846_tim
        } else {
                /* pen is still down, continue with the measurement */
                ts->msg_idx = 0;
+               ts->wait_for_sync();
                status = spi_async(ts->spi, &ts->msg[0]);
                if (status)
                        dev_err(&ts->spi->dev, "spi_async --> %d\n", status);
@@@ -746,7 -754,7 +754,7 @@@ static irqreturn_t ads7846_irq(int irq
                         * that here.  (The "generic irq" framework may help...)
                         */
                        ts->irq_disabled = 1;
-                       disable_irq(ts->spi->irq);
+                       disable_irq_nosync(ts->spi->irq);
                        ts->pending = 1;
                        hrtimer_start(&ts->timer, ktime_set(0, TS_POLL_DELAY),
                                        HRTIMER_MODE_REL);
@@@ -947,6 -955,8 +955,8 @@@ static int __devinit ads7846_probe(stru
                ts->penirq_recheck_delay_usecs =
                                pdata->penirq_recheck_delay_usecs;
  
+       ts->wait_for_sync = pdata->wait_for_sync ? : null_wait_for_sync;
        snprintf(ts->phys, sizeof(ts->phys), "%s/input0", dev_name(&spi->dev));
  
        input_dev->name = "ADS784x Touchscreen";