~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to drivers/input/touchscreen/ad7879-spi.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 */
8
8
 
9
9
#include <linux/input.h>        /* BUS_SPI */
 
10
#include <linux/pm.h>
10
11
#include <linux/spi/spi.h>
11
12
 
12
13
#include "ad7879.h"
20
21
#define AD7879_WRITECMD(reg) (AD7879_CMD(reg))
21
22
#define AD7879_READCMD(reg)  (AD7879_CMD(reg) | AD7879_CMD_READ)
22
23
 
23
 
#ifdef CONFIG_PM
24
 
static int ad7879_spi_suspend(struct spi_device *spi, pm_message_t message)
 
24
#ifdef CONFIG_PM_SLEEP
 
25
static int ad7879_spi_suspend(struct device *dev)
25
26
{
 
27
        struct spi_device *spi = to_spi_device(dev);
26
28
        struct ad7879 *ts = spi_get_drvdata(spi);
27
29
 
28
30
        ad7879_suspend(ts);
30
32
        return 0;
31
33
}
32
34
 
33
 
static int ad7879_spi_resume(struct spi_device *spi)
 
35
static int ad7879_spi_resume(struct device *dev)
34
36
{
 
37
        struct spi_device *spi = to_spi_device(dev);
35
38
        struct ad7879 *ts = spi_get_drvdata(spi);
36
39
 
37
40
        ad7879_resume(ts);
38
41
 
39
42
        return 0;
40
43
}
41
 
#else
42
 
# define ad7879_spi_suspend NULL
43
 
# define ad7879_spi_resume  NULL
44
44
#endif
45
45
 
 
46
static SIMPLE_DEV_PM_OPS(ad7879_spi_pm, ad7879_spi_suspend, ad7879_spi_resume);
 
47
 
46
48
/*
47
49
 * ad7879_read/write are only used for initial setup and for sysfs controls.
48
50
 * The main traffic is done in ad7879_collect().
173
175
                .name   = "ad7879",
174
176
                .bus    = &spi_bus_type,
175
177
                .owner  = THIS_MODULE,
 
178
                .pm     = &ad7879_spi_pm,
176
179
        },
177
180
        .probe          = ad7879_spi_probe,
178
181
        .remove         = __devexit_p(ad7879_spi_remove),
179
 
        .suspend        = ad7879_spi_suspend,
180
 
        .resume         = ad7879_spi_resume,
181
182
};
182
183
 
183
184
static int __init ad7879_spi_init(void)