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

« back to all changes in this revision

Viewing changes to drivers/input/keyboard/lm8323.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:
30
30
#include <linux/delay.h>
31
31
#include <linux/input.h>
32
32
#include <linux/leds.h>
 
33
#include <linux/pm.h>
33
34
#include <linux/i2c/lm8323.h>
34
35
#include <linux/slab.h>
35
36
 
802
803
 * We don't need to explicitly suspend the chip, as it already switches off
803
804
 * when there's no activity.
804
805
 */
805
 
static int lm8323_suspend(struct i2c_client *client, pm_message_t mesg)
 
806
static int lm8323_suspend(struct device *dev)
806
807
{
 
808
        struct i2c_client *client = to_i2c_client(dev);
807
809
        struct lm8323_chip *lm = i2c_get_clientdata(client);
808
810
        int i;
809
811
 
810
 
        set_irq_wake(client->irq, 0);
 
812
        irq_set_irq_wake(client->irq, 0);
811
813
        disable_irq(client->irq);
812
814
 
813
815
        mutex_lock(&lm->lock);
821
823
        return 0;
822
824
}
823
825
 
824
 
static int lm8323_resume(struct i2c_client *client)
 
826
static int lm8323_resume(struct device *dev)
825
827
{
 
828
        struct i2c_client *client = to_i2c_client(dev);
826
829
        struct lm8323_chip *lm = i2c_get_clientdata(client);
827
830
        int i;
828
831
 
835
838
                        led_classdev_resume(&lm->pwm[i].cdev);
836
839
 
837
840
        enable_irq(client->irq);
838
 
        set_irq_wake(client->irq, 1);
 
841
        irq_set_irq_wake(client->irq, 1);
839
842
 
840
843
        return 0;
841
844
}
842
 
#else
843
 
#define lm8323_suspend  NULL
844
 
#define lm8323_resume   NULL
845
845
#endif
846
846
 
 
847
static SIMPLE_DEV_PM_OPS(lm8323_pm_ops, lm8323_suspend, lm8323_resume);
 
848
 
847
849
static const struct i2c_device_id lm8323_id[] = {
848
850
        { "lm8323", 0 },
849
851
        { }
852
854
static struct i2c_driver lm8323_i2c_driver = {
853
855
        .driver = {
854
856
                .name   = "lm8323",
 
857
                .pm     = &lm8323_pm_ops,
855
858
        },
856
859
        .probe          = lm8323_probe,
857
860
        .remove         = __devexit_p(lm8323_remove),
858
 
        .suspend        = lm8323_suspend,
859
 
        .resume         = lm8323_resume,
860
861
        .id_table       = lm8323_id,
861
862
};
862
863
MODULE_DEVICE_TABLE(i2c, lm8323_id);