diff options
author | Steven Toth <stoth@hauppauge.com> | 2008-08-04 21:18:19 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-10-12 07:36:49 -0400 |
commit | 89ce2216e338f62c411bea12df37a2f54f2ce13a (patch) | |
tree | 8df317f81f8c8896dbed193cff4b9c614910ba6d /drivers/media/video/cx23885/cx23885-cards.c | |
parent | 12886871ae7a6f4e2b1ea371f6604d8239dda724 (diff) |
V4L/DVB (8646): cx23885: Convert framework to use a single tuner callback function.
Code reduction. Tuner callback now assumes that tsport is passed as the void arg.
Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx23885/cx23885-cards.c')
-rw-r--r-- | drivers/media/video/cx23885/cx23885-cards.c | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/drivers/media/video/cx23885/cx23885-cards.c b/drivers/media/video/cx23885/cx23885-cards.c index 46d70262107b..0daffc3dbec0 100644 --- a/drivers/media/video/cx23885/cx23885-cards.c +++ b/drivers/media/video/cx23885/cx23885-cards.c | |||
@@ -329,11 +329,15 @@ static void hauppauge_eeprom(struct cx23885_dev *dev, u8 *eeprom_data) | |||
329 | dev->name, tv.model); | 329 | dev->name, tv.model); |
330 | } | 330 | } |
331 | 331 | ||
332 | static int cx23885_tuner_callback(struct cx23885_dev *dev, int port, | 332 | int cx23885_tuner_callback(void *priv, int command, int arg) |
333 | int command, int arg) | ||
334 | { | 333 | { |
334 | struct cx23885_tsport *port = priv; | ||
335 | struct cx23885_dev *dev = port->dev; | ||
335 | u32 bitmask = 0; | 336 | u32 bitmask = 0; |
336 | 337 | ||
338 | if (command == XC2028_RESET_CLK) | ||
339 | return 0; | ||
340 | |||
337 | if (command != 0) { | 341 | if (command != 0) { |
338 | printk(KERN_ERR "%s(): Unknown command 0x%x.\n", | 342 | printk(KERN_ERR "%s(): Unknown command 0x%x.\n", |
339 | __func__, command); | 343 | __func__, command); |
@@ -354,9 +358,9 @@ static int cx23885_tuner_callback(struct cx23885_dev *dev, int port, | |||
354 | 358 | ||
355 | /* Two identical tuners on two different i2c buses, | 359 | /* Two identical tuners on two different i2c buses, |
356 | * we need to reset the correct gpio. */ | 360 | * we need to reset the correct gpio. */ |
357 | if (port == 0) | 361 | if (port->nr == 0) |
358 | bitmask = 0x01; | 362 | bitmask = 0x01; |
359 | else if (port == 1) | 363 | else if (port->nr == 1) |
360 | bitmask = 0x04; | 364 | bitmask = 0x04; |
361 | } | 365 | } |
362 | break; | 366 | break; |
@@ -372,25 +376,6 @@ static int cx23885_tuner_callback(struct cx23885_dev *dev, int port, | |||
372 | return 0; | 376 | return 0; |
373 | } | 377 | } |
374 | 378 | ||
375 | int cx23885_xc5000_tuner_callback(void *priv, int command, int arg) | ||
376 | { | ||
377 | struct cx23885_i2c *bus = priv; | ||
378 | struct cx23885_dev *dev = bus->dev; | ||
379 | |||
380 | return cx23885_tuner_callback(dev, bus->nr, command, arg); | ||
381 | } | ||
382 | |||
383 | int cx23885_xc3028_tuner_callback(void *priv, int command, int arg) | ||
384 | { | ||
385 | struct cx23885_tsport *port = priv; | ||
386 | struct cx23885_dev *dev = port->dev; | ||
387 | |||
388 | if (command == XC2028_RESET_CLK) | ||
389 | return 0; | ||
390 | |||
391 | return cx23885_tuner_callback(dev, port->nr, command, arg); | ||
392 | } | ||
393 | |||
394 | void cx23885_gpio_setup(struct cx23885_dev *dev) | 379 | void cx23885_gpio_setup(struct cx23885_dev *dev) |
395 | { | 380 | { |
396 | switch(dev->board) { | 381 | switch(dev->board) { |