#include <linux/init.h>
#include <linux/errno.h>
#include <linux/slab.h>
-#include <linux/delay.h>
#include <media/audiochip.h>
#include <media/tuner.h>
/* insmod options */
static unsigned int debug = 0;
-module_param(debug, int, 0644);
+MODULE_PARM(debug,"i");
MODULE_LICENSE("GPL");
/* ---------------------------------------------------------------------- */
printk(PREFIX "read: 0x%2x\n", buf[0]);
printk(" after power on : %s\n", (buf[0] & 0x01) ? "yes" : "no");
printk(" afc : %s\n", afc[(buf[0] >> 1) & 0x0f]);
- printk(" fmif level : %s\n", (buf[0] & 0x20) ? "high" : "low");
printk(" afc window : %s\n", (buf[0] & 0x40) ? "in" : "out");
printk(" vfi level : %s\n", (buf[0] & 0x80) ? "high" : "low");
}
static unsigned int port2 = 1;
static unsigned int qss = UNSET;
static unsigned int adjust = 0x10;
-module_param(port1, int, 0644);
-module_param(port2, int, 0644);
-module_param(qss, int, 0644);
-module_param(adjust, int, 0644);
+MODULE_PARM(port1,"i");
+MODULE_PARM(port2,"i");
+MODULE_PARM(qss,"i");
+MODULE_PARM(adjust,"i");
static int tda9887_set_insmod(struct tda9887 *t, char *buf)
{
/* ---------------------------------------------------------------------- */
-static char pal[] = "-";
-module_param_string(pal, pal, 0644, sizeof(pal));
-static char secam[] = "-";
-module_param_string(secam, secam, 0644, sizeof(secam));
+static char *pal = "-";
+MODULE_PARM(pal,"s");
+static char *secam = "-";
+MODULE_PARM(secam,"s");
static int tda9887_fixup_std(struct tda9887 *t)
{
tda9887_set_config(t,buf);
tda9887_set_insmod(t,buf);
- if (t->std & V4L2_STD_SECAM_L) {
- /* secam fixup (FIXME: move this to tvnorms array?) */
- buf[1] &= ~cOutputPort2Inactive;
- }
-
dprintk(PREFIX "writing: b=0x%02x c=0x%02x e=0x%02x\n",
buf[1],buf[2],buf[3]);
if (debug > 1)
printk(PREFIX "i2c i/o error: rc == %d (should be 4)\n",rc);
if (debug > 2) {
- msleep_interruptible(1000);
+ set_current_state(TASK_INTERRUPTIBLE);
+ schedule_timeout(HZ);
tda9887_status(t);
}
return 0;
return -ENOMEM;
memset(t,0,sizeof(*t));
t->client = client_template;
- t->std = 0;
+ t->std = 0;;
t->pinnacle_id = UNSET;
i2c_set_clientdata(&t->client, t);
i2c_attach_client(&t->client);
-
+
return 0;
}
t->radio = 1;
tda9887_configure(t);
break;
-
+
case AUDC_CONFIG_PINNACLE:
{
int *i = arg;
return 0;
}
-static int tda9887_suspend(struct device * dev, u32 state, u32 level)
-{
- dprintk("tda9887: suspend\n");
- return 0;
-}
-
-static int tda9887_resume(struct device * dev, u32 level)
-{
- struct i2c_client *c = container_of(dev, struct i2c_client, dev);
- struct tda9887 *t = i2c_get_clientdata(c);
-
- dprintk("tda9887: resume\n");
- tda9887_configure(t);
- return 0;
-}
-
/* ----------------------------------------------------------------------- */
static struct i2c_driver driver = {
.attach_adapter = tda9887_probe,
.detach_client = tda9887_detach,
.command = tda9887_command,
- .driver = {
- .suspend = tda9887_suspend,
- .resume = tda9887_resume,
- },
};
static struct i2c_client client_template =
{