drivers/usb/net/kaweth.c: add device "Allied Telesyn AT-USB10 USB Ethernet Adapter"
[safe/jmp/linux-2.6] / drivers / hwmon / max1111.c
index 12c0577..12a54aa 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/hwmon.h>
 #include <linux/hwmon-sysfs.h>
 #include <linux/spi/spi.h>
+#include <linux/slab.h>
 
 #define MAX1111_TX_BUF_SIZE    1
 #define MAX1111_RX_BUF_SIZE    2
@@ -66,6 +67,16 @@ static int max1111_read(struct device *dev, int channel)
        return (v1 << 2) | (v2 >> 6);
 }
 
+#ifdef CONFIG_SHARPSL_PM
+static struct max1111_data *the_max1111;
+
+int max1111_read_channel(int channel)
+{
+       return max1111_read(&the_max1111->spi->dev, channel);
+}
+EXPORT_SYMBOL(max1111_read_channel);
+#endif
+
 /*
  * NOTE: SPI devices do not have a default 'name' attribute, which is
  * likely to be used by hwmon applications to distinguish between
@@ -181,6 +192,9 @@ static int __devinit max1111_probe(struct spi_device *spi)
                goto err_remove;
        }
 
+#ifdef CONFIG_SHARPSL_PM
+       the_max1111 = data;
+#endif
        return 0;
 
 err_remove:
@@ -229,3 +243,4 @@ module_exit(max1111_exit);
 MODULE_AUTHOR("Eric Miao <eric.miao@marvell.com>");
 MODULE_DESCRIPTION("MAX1111 ADC Driver");
 MODULE_LICENSE("GPL");
+MODULE_ALIAS("spi:max1111");