]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/input/touchscreen/ads7846.c
Extra omap code in linux-omap tree
[linux-2.6-omap-h63xx.git] / drivers / input / touchscreen / ads7846.c
index e1ece89fe9222b5ef810516ca0ea7384fd98eb2e..c5ecce1842fea53539e828c2bfd67d9fc5583cc3 100644 (file)
@@ -295,7 +295,7 @@ name ## _show(struct device *dev, struct device_attribute *attr, char *buf) \
 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.
@@ -472,7 +472,7 @@ static ssize_t ads7846_disable_store(struct device *dev,
                                     const char *buf, size_t count)
 {
        struct ads7846 *ts = dev_get_drvdata(dev);
-       long i;
+       unsigned long i;
 
        if (strict_strtoul(buf, 10, &i))
                return -EINVAL;
@@ -559,7 +559,7 @@ static void ads7846_rx(void *ads)
        if (packet->tc.ignore || Rt > ts->pressure_max) {
 #ifdef VERBOSE
                pr_debug("%s: ignored %d pressure %d\n",
-                       ts->spi->dev.bus_id, packet->tc.ignore, Rt);
+                       dev_name(&ts->spi->dev), packet->tc.ignore, Rt);
 #endif
                hrtimer_start(&ts->timer, ktime_set(0, TS_POLL_PERIOD),
                              HRTIMER_MODE_REL);
@@ -878,6 +878,15 @@ static int __devinit ads7846_probe(struct spi_device *spi)
                return -ENODEV;
        }
 
+       /* enable voltage */
+       if (pdata->vaux_control != NULL) {
+               err = pdata->vaux_control(VAUX_ENABLE);
+               if (err != 0) {
+                       dev_dbg(&spi->dev, "TS vaux enable failed\n");
+                       return err;
+               }
+       }
+
        /* don't exceed max specified sample rate */
        if (spi->max_speed_hz > (125000 * SAMPLE_BITS)) {
                dev_dbg(&spi->dev, "f(sample) %d KHz?\n",
@@ -947,7 +956,7 @@ static int __devinit ads7846_probe(struct spi_device *spi)
                ts->penirq_recheck_delay_usecs =
                                pdata->penirq_recheck_delay_usecs;
 
-       snprintf(ts->phys, sizeof(ts->phys), "%s/input0", spi->dev.bus_id);
+       snprintf(ts->phys, sizeof(ts->phys), "%s/input0", dev_name(&spi->dev));
 
        input_dev->name = "ADS784x Touchscreen";
        input_dev->phys = ts->phys;