mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-19 10:14:23 +08:00
V4L/DVB (3064): Some cleanups on msp3400
- Change function order to reduce usage of function prototypes. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
This commit is contained in:
parent
174329d951
commit
14725165dd
@ -157,6 +157,9 @@ struct msp3400c {
|
|||||||
#define HAVE_SIMPLER(msp) ((msp->rev1 & 0xff) >= 'G'-'@')
|
#define HAVE_SIMPLER(msp) ((msp->rev1 & 0xff) >= 'G'-'@')
|
||||||
#define HAVE_RADIO(msp) ((msp->rev1 & 0xff) >= 'G'-'@')
|
#define HAVE_RADIO(msp) ((msp->rev1 & 0xff) >= 'G'-'@')
|
||||||
|
|
||||||
|
/* defined at the end of the source */
|
||||||
|
extern struct i2c_client client_template;
|
||||||
|
|
||||||
#define VIDEO_MODE_RADIO 16 /* norm magic for radio mode */
|
#define VIDEO_MODE_RADIO 16 /* norm magic for radio mode */
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
@ -1553,33 +1556,17 @@ static void msp34xxg_set_audmode(struct i2c_client *client, int audmode)
|
|||||||
|
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
|
|
||||||
static int msp_attach(struct i2c_adapter *adap, int addr, int kind);
|
static void msp_wake_thread(struct i2c_client *client)
|
||||||
static int msp_detach(struct i2c_client *client);
|
|
||||||
static int msp_probe(struct i2c_adapter *adap);
|
|
||||||
static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg);
|
|
||||||
|
|
||||||
static int msp_suspend(struct device * dev, pm_message_t state);
|
|
||||||
static int msp_resume(struct device * dev);
|
|
||||||
|
|
||||||
static void msp_wake_thread(struct i2c_client *client);
|
|
||||||
|
|
||||||
static struct i2c_driver driver = {
|
|
||||||
.id = I2C_DRIVERID_MSP3400,
|
|
||||||
.attach_adapter = msp_probe,
|
|
||||||
.detach_client = msp_detach,
|
|
||||||
.command = msp_command,
|
|
||||||
.driver = {
|
|
||||||
.name = "i2c msp3400 driver",
|
|
||||||
.suspend = msp_suspend,
|
|
||||||
.resume = msp_resume,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
static struct i2c_client client_template =
|
|
||||||
{
|
{
|
||||||
.name = "(unset)",
|
struct msp3400c *msp = i2c_get_clientdata(client);
|
||||||
.driver = &driver,
|
|
||||||
};
|
if (NULL == msp->kthread)
|
||||||
|
return;
|
||||||
|
msp3400c_setvolume(client,msp->muted,0,0);
|
||||||
|
msp->watch_stereo = 0;
|
||||||
|
msp->restart = 1;
|
||||||
|
wake_up_interruptible(&msp->wq);
|
||||||
|
}
|
||||||
|
|
||||||
static int msp_attach(struct i2c_adapter *adap, int addr, int kind)
|
static int msp_attach(struct i2c_adapter *adap, int addr, int kind)
|
||||||
{
|
{
|
||||||
@ -1739,18 +1726,6 @@ static int msp_probe(struct i2c_adapter *adap)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void msp_wake_thread(struct i2c_client *client)
|
|
||||||
{
|
|
||||||
struct msp3400c *msp = i2c_get_clientdata(client);
|
|
||||||
|
|
||||||
if (NULL == msp->kthread)
|
|
||||||
return;
|
|
||||||
msp3400c_setvolume(client,msp->muted,0,0);
|
|
||||||
msp->watch_stereo = 0;
|
|
||||||
msp->restart = 1;
|
|
||||||
wake_up_interruptible(&msp->wq);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
|
|
||||||
static int mode_v4l2_to_v4l1(int rxsubchans)
|
static int mode_v4l2_to_v4l1(int rxsubchans)
|
||||||
@ -2207,6 +2182,27 @@ static int msp_resume(struct device * dev)
|
|||||||
|
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
static struct i2c_driver driver = {
|
||||||
|
.owner = THIS_MODULE,
|
||||||
|
.name = "msp3400",
|
||||||
|
.id = I2C_DRIVERID_MSP3400,
|
||||||
|
.flags = I2C_DF_NOTIFY,
|
||||||
|
.attach_adapter = msp_probe,
|
||||||
|
.detach_client = msp_detach,
|
||||||
|
.command = msp_command,
|
||||||
|
.driver = {
|
||||||
|
.suspend = msp_suspend,
|
||||||
|
.resume = msp_resume,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct i2c_client client_template =
|
||||||
|
{
|
||||||
|
.name = "(unset)",
|
||||||
|
.flags = I2C_CLIENT_ALLOW_USE,
|
||||||
|
.driver = &driver,
|
||||||
|
};
|
||||||
|
|
||||||
static int __init msp3400_init_module(void)
|
static int __init msp3400_init_module(void)
|
||||||
{
|
{
|
||||||
return i2c_add_driver(&driver);
|
return i2c_add_driver(&driver);
|
||||||
|
Loading…
Reference in New Issue
Block a user