Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 176814
b: refs/heads/master
c: d1471f0
h: refs/heads/master
v: v3
  • Loading branch information
Joonyoung Shim authored and Mauro Carvalho Chehab committed Dec 16, 2009
1 parent 7f046cb commit 8eff40c
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fe2137dd4e6e4b2f5e758765d5305e8dbb0d931c
refs/heads/master: d1471f02dfb5b3424ee3afb6459d8cb97730af76
40 changes: 40 additions & 0 deletions trunk/drivers/media/radio/si470x/radio-si470x-i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,44 @@ static __devexit int si470x_i2c_remove(struct i2c_client *client)
}


#ifdef CONFIG_PM
/*
* si470x_i2c_suspend - suspend the device
*/
static int si470x_i2c_suspend(struct i2c_client *client, pm_message_t mesg)
{
struct si470x_device *radio = i2c_get_clientdata(client);

/* power down */
radio->registers[POWERCFG] |= POWERCFG_DISABLE;
if (si470x_set_register(radio, POWERCFG) < 0)
return -EIO;

return 0;
}


/*
* si470x_i2c_resume - resume the device
*/
static int si470x_i2c_resume(struct i2c_client *client)
{
struct si470x_device *radio = i2c_get_clientdata(client);

/* power up : need 110ms */
radio->registers[POWERCFG] |= POWERCFG_ENABLE;
if (si470x_set_register(radio, POWERCFG) < 0)
return -EIO;
msleep(110);

return 0;
}
#else
#define si470x_i2c_suspend NULL
#define si470x_i2c_resume NULL
#endif


/*
* si470x_i2c_driver - i2c driver interface
*/
Expand All @@ -497,6 +535,8 @@ static struct i2c_driver si470x_i2c_driver = {
},
.probe = si470x_i2c_probe,
.remove = __devexit_p(si470x_i2c_remove),
.suspend = si470x_i2c_suspend,
.resume = si470x_i2c_resume,
.id_table = si470x_i2c_id,
};

Expand Down

0 comments on commit 8eff40c

Please sign in to comment.