aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx18/cx18-driver.h
diff options
context:
space:
mode:
authorAndy Walls <awalls@radix.net>2009-02-20 21:52:13 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-30 11:43:01 -0400
commitff2a20018094c593a35f4887bbdabf8926ddb6e6 (patch)
treee6c89f8e06e6006035420ea20a6754dd4ca7e89c /drivers/media/video/cx18/cx18-driver.h
parentfa3e70360c86480acbaa54c9791e843196327a66 (diff)
V4L/DVB (10758): cx18: Convert I2C devices to v4l2_subdevices
This is a major perturbation to cx18 I2C device handling to convert it to the v4l2_device/subdeivce framework. This change breaks GPIO audio multiplexer control for the time being. It will be fixed in a coming change. Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx18/cx18-driver.h')
-rw-r--r--drivers/media/video/cx18/cx18-driver.h24
1 files changed, 20 insertions, 4 deletions
diff --git a/drivers/media/video/cx18/cx18-driver.h b/drivers/media/video/cx18/cx18-driver.h
index 4b50878fc265..b81106d682ae 100644
--- a/drivers/media/video/cx18/cx18-driver.h
+++ b/drivers/media/video/cx18/cx18-driver.h
@@ -448,7 +448,8 @@ struct cx18 {
448 int instance; 448 int instance;
449 struct pci_dev *pci_dev; 449 struct pci_dev *pci_dev;
450 struct v4l2_device v4l2_dev; 450 struct v4l2_device v4l2_dev;
451 struct v4l2_subdev *sd_av; 451 struct v4l2_subdev *sd_av; /* A/V decoder/digitizer sub-device */
452 struct v4l2_subdev *sd_extmux; /* External audio multiplexer sub-dev */
452 453
453 const struct cx18_card *card; /* card information */ 454 const struct cx18_card *card; /* card information */
454 const char *card_name; /* full name of the card */ 455 const char *card_name; /* full name of the card */
@@ -528,9 +529,6 @@ struct cx18 {
528 struct i2c_adapter i2c_adap[2]; 529 struct i2c_adapter i2c_adap[2];
529 struct i2c_algo_bit_data i2c_algo[2]; 530 struct i2c_algo_bit_data i2c_algo[2];
530 struct cx18_i2c_algo_callback_data i2c_algo_cb_data[2]; 531 struct cx18_i2c_algo_callback_data i2c_algo_cb_data[2];
531 struct i2c_client i2c_client[2];
532 struct mutex i2c_bus_lock[2];
533 struct i2c_client *i2c_clients[I2C_CLIENTS_MAX];
534 532
535 /* gpio */ 533 /* gpio */
536 u32 gpio_dir; 534 u32 gpio_dir;
@@ -573,4 +571,22 @@ static inline int cx18_raw_vbi(const struct cx18 *cx)
573 return cx->vbi.in.type == V4L2_BUF_TYPE_VBI_CAPTURE; 571 return cx->vbi.in.type == V4L2_BUF_TYPE_VBI_CAPTURE;
574} 572}
575 573
574/* Call the specified callback for all subdevs with a grp_id bit matching the
575 * mask in hw (if 0, then match them all). Ignore any errors. */
576#define cx18_call_hw(cx, hw, o, f, args...) \
577 __v4l2_device_call_subdevs(&(cx)->v4l2_dev, \
578 !(hw) || (sd->grp_id & (hw)), o, f , ##args)
579
580#define cx18_call_all(cx, o, f, args...) cx18_call_hw(cx, 0, o, f , ##args)
581
582/* Call the specified callback for all subdevs with a grp_id bit matching the
583 * mask in hw (if 0, then match them all). If the callback returns an error
584 * other than 0 or -ENOIOCTLCMD, then return with that error code. */
585#define cx18_call_hw_err(cx, hw, o, f, args...) \
586 __v4l2_device_call_subdevs_until_err( \
587 &(cx)->v4l2_dev, !(hw) || (sd->grp_id & (hw)), o, f , ##args)
588
589#define cx18_call_all_err(cx, o, f, args...) \
590 cx18_call_hw_err(cx, 0, o, f , ##args)
591
576#endif /* CX18_DRIVER_H */ 592#endif /* CX18_DRIVER_H */