diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-09-14 17:16:32 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-09-14 17:16:32 -0300 |
commit | 49decf8c441358a1b36395f2d18eae6edc14dd6b (patch) | |
tree | f73fa5ec98c22d30fa7f34c32e5cafc8c3448b21 /linux/drivers | |
parent | 642564d8a5c3fca4ab8de5a791c7ed05e71ba154 (diff) | |
download | mediapointer-dvb-s2-49decf8c441358a1b36395f2d18eae6edc14dd6b.tar.gz mediapointer-dvb-s2-49decf8c441358a1b36395f2d18eae6edc14dd6b.tar.bz2 |
tm6000: Fix almost all warnings at the driver
From: Mauro Carvalho Chehab <mchehab@redhat.com>
Onr warning is left, since it is there for a purpose:
tm6000-core.c:218: warning: ISO C90 forbids mixed declarations and code
It indicates a place where a temporary hack were added. Tests are needed to be sure that
we can remove it.
Priority: normal
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/drivers')
-rw-r--r-- | linux/drivers/staging/tm6000/tm6000-cards.c | 57 | ||||
-rw-r--r-- | linux/drivers/staging/tm6000/tm6000-i2c.c | 56 | ||||
-rw-r--r-- | linux/drivers/staging/tm6000/tm6000-video.c | 13 |
3 files changed, 63 insertions, 63 deletions
diff --git a/linux/drivers/staging/tm6000/tm6000-cards.c b/linux/drivers/staging/tm6000/tm6000-cards.c index 838376764..f6aafaf55 100644 --- a/linux/drivers/staging/tm6000/tm6000-cards.c +++ b/linux/drivers/staging/tm6000/tm6000-cards.c @@ -206,6 +206,61 @@ struct usb_device_id tm6000_id_table [] = { { }, }; +/* Tuner callback to provide the proper gpio changes needed for xc2028 */ + +static int tm6000_tuner_callback(void *ptr, int component, int command, int arg) +{ + int rc=0; + struct tm6000_core *dev = ptr; + + if (dev->tuner_type!=TUNER_XC2028) + return 0; + + switch (command) { + case XC2028_RESET_CLK: + tm6000_set_reg (dev, REQ_04_EN_DISABLE_MCU_INT, + 0x02, arg); + msleep(10); + rc=tm6000_set_reg (dev, REQ_03_SET_GET_MCU_PIN, + TM6000_GPIO_CLK, 0); + if (rc<0) + return rc; + msleep(10); + rc=tm6000_set_reg (dev, REQ_03_SET_GET_MCU_PIN, + TM6000_GPIO_CLK, 1); + break; + case XC2028_TUNER_RESET: + /* Reset codes during load firmware */ + switch (arg) { + case 0: + tm6000_set_reg (dev, REQ_03_SET_GET_MCU_PIN, + dev->tuner_reset_gpio, 0x00); + msleep(130); + tm6000_set_reg (dev, REQ_03_SET_GET_MCU_PIN, + dev->tuner_reset_gpio, 0x01); + msleep(130); + break; + case 1: + tm6000_set_reg (dev, REQ_04_EN_DISABLE_MCU_INT, + 0x02, 0x01); + msleep(10); + break; + + case 2: + rc=tm6000_set_reg (dev, REQ_03_SET_GET_MCU_PIN, + TM6000_GPIO_CLK, 0); + if (rc<0) + return rc; + msleep(100); + rc=tm6000_set_reg (dev, REQ_03_SET_GET_MCU_PIN, + TM6000_GPIO_CLK, 1); + msleep(100); + break; + } + } + return (rc); +} + static void tm6000_config_tuner (struct tm6000_core *dev) { struct tuner_setup tun_setup; @@ -217,6 +272,8 @@ static void tm6000_config_tuner (struct tm6000_core *dev) memset(&tun_setup, 0, sizeof(tun_setup)); tun_setup.type = dev->tuner_type; tun_setup.addr = dev->tuner_addr; + tun_setup.mode_mask = T_ANALOG_TV | T_RADIO; + tun_setup.tuner_callback = tm6000_tuner_callback; v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_type_addr, &tun_setup); diff --git a/linux/drivers/staging/tm6000/tm6000-i2c.c b/linux/drivers/staging/tm6000/tm6000-i2c.c index b62215513..1af03c38f 100644 --- a/linux/drivers/staging/tm6000/tm6000-i2c.c +++ b/linux/drivers/staging/tm6000/tm6000-i2c.c @@ -208,62 +208,6 @@ static void dec_use(struct i2c_adapter *adap) msleep (10); \ } -/* Tuner callback to provide the proper gpio changes needed for xc2028 */ - -static int tm6000_tuner_callback(void *ptr, int command, int arg) -{ - int rc=0; - struct tm6000_core *dev = ptr; - - if (dev->tuner_type!=TUNER_XC2028) - return 0; - - switch (command) { - case XC2028_RESET_CLK: - tm6000_set_reg (dev, REQ_04_EN_DISABLE_MCU_INT, - 0x02, arg); - msleep(10); - rc=tm6000_set_reg (dev, REQ_03_SET_GET_MCU_PIN, - TM6000_GPIO_CLK, 0); - if (rc<0) - return rc; - msleep(10); - rc=tm6000_set_reg (dev, REQ_03_SET_GET_MCU_PIN, - TM6000_GPIO_CLK, 1); - break; - case XC2028_TUNER_RESET: - /* Reset codes during load firmware */ - switch (arg) { - case 0: - tm6000_set_reg (dev, REQ_03_SET_GET_MCU_PIN, - dev->tuner_reset_gpio, 0x00); - msleep(130); - tm6000_set_reg (dev, REQ_03_SET_GET_MCU_PIN, - dev->tuner_reset_gpio, 0x01); - msleep(130); - break; - case 1: - tm6000_set_reg (dev, REQ_04_EN_DISABLE_MCU_INT, - 0x02, 0x01); - msleep(10); - break; - - case 2: - rc=tm6000_set_reg (dev, REQ_03_SET_GET_MCU_PIN, - TM6000_GPIO_CLK, 0); - if (rc<0) - return rc; - msleep(100); - rc=tm6000_set_reg (dev, REQ_03_SET_GET_MCU_PIN, - TM6000_GPIO_CLK, 1); - msleep(100); - break; - } - } - return (rc); -} - - static struct i2c_algorithm tm6000_algo = { .master_xfer = tm6000_i2c_xfer, .functionality = functionality, diff --git a/linux/drivers/staging/tm6000/tm6000-video.c b/linux/drivers/staging/tm6000/tm6000-video.c index e0047d246..7ce2e43a4 100644 --- a/linux/drivers/staging/tm6000/tm6000-video.c +++ b/linux/drivers/staging/tm6000/tm6000-video.c @@ -1349,7 +1349,7 @@ static int vidioc_s_frequency (struct file *file, void *priv, // mutex_lock(&dev->lock); dev->freq = f->frequency; - v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_frequency, &f); + v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_frequency, f); // mutex_unlock(&dev->lock); return 0; @@ -1359,9 +1359,9 @@ static int vidioc_s_frequency (struct file *file, void *priv, File operations for the device ------------------------------------------------------------------*/ -static int tm6000_open(struct inode *inode, struct file *file) +static int tm6000_open(struct file *file) { - int minor = iminor(inode); + int minor = video_devdata(file)->minor; struct tm6000_core *h,*dev = NULL; struct tm6000_fh *fh; struct list_head *list; @@ -1503,11 +1503,11 @@ tm6000_poll(struct file *file, struct poll_table_struct *wait) return 0; } -static int tm6000_release(struct inode *inode, struct file *file) +static int tm6000_release(struct file *file) { struct tm6000_fh *fh = file->private_data; struct tm6000_core *dev = fh->dev; - int minor = iminor(inode); + int minor = video_devdata(file)->minor; dprintk(dev, V4L2_DEBUG_OPEN, "tm6000: close called (minor=%d, users=%d)\n",minor,dev->users); @@ -1533,7 +1533,7 @@ static int tm6000_mmap(struct file *file, struct vm_area_struct * vma) return ret; } -static struct file_operations tm6000_fops = { +static struct v4l2_file_operations tm6000_fops = { .owner = THIS_MODULE, .open = tm6000_open, .release = tm6000_release, @@ -1541,7 +1541,6 @@ static struct file_operations tm6000_fops = { .read = tm6000_read, .poll = tm6000_poll, .mmap = tm6000_mmap, - .llseek = no_llseek, }; static const struct v4l2_ioctl_ops video_ioctl_ops = { |