]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/media/video/ivtv/ivtv-i2c.c
i2c: Add support for custom probe function
[net-next-2.6.git] / drivers / media / video / ivtv / ivtv-i2c.c
index a5b92d109c6c1bd74d999961bb69febe8eebfadf..a74fa099c56536c0939df5cb4a41e0595ce01b00 100644 (file)
@@ -63,6 +63,7 @@
 #include "ivtv-cards.h"
 #include "ivtv-gpio.h"
 #include "ivtv-i2c.h"
+#include <media/cx25840.h>
 
 /* i2c implementation for cx23415/6 chip, ivtv project.
  * Author: Kevin Thayer (nufan_wfk at yahoo.com)
@@ -182,8 +183,8 @@ static int ivtv_i2c_new_ir(struct ivtv *itv, u32 hw, const char *type, u8 addr)
                        return -1;
                memset(&info, 0, sizeof(struct i2c_board_info));
                strlcpy(info.type, type, I2C_NAME_SIZE);
-               return i2c_new_probed_device(adap, &info, addr_list) == NULL
-                                                                    ? -1 : 0;
+               return i2c_new_probed_device(adap, &info, addr_list, NULL)
+                                                          == NULL ? -1 : 0;
        }
 
        /* Only allow one IR receiver to be registered per board */
@@ -220,7 +221,8 @@ static int ivtv_i2c_new_ir(struct ivtv *itv, u32 hw, const char *type, u8 addr)
        info.platform_data = init_data;
        strlcpy(info.type, type, I2C_NAME_SIZE);
 
-       return i2c_new_probed_device(adap, &info, addr_list) == NULL ? -1 : 0;
+       return i2c_new_probed_device(adap, &info, addr_list, NULL) == NULL ?
+              -1 : 0;
 }
 
 /* Instantiate the IR receiver device using probing -- undesirable */
@@ -248,7 +250,7 @@ struct i2c_client *ivtv_i2c_new_ir_legacy(struct ivtv *itv)
 
        memset(&info, 0, sizeof(struct i2c_board_info));
        strlcpy(info.type, "ir_video", I2C_NAME_SIZE);
-       return i2c_new_probed_device(&itv->i2c_adap, &info, addr_list);
+       return i2c_new_probed_device(&itv->i2c_adap, &info, addr_list, NULL);
 }
 
 int ivtv_i2c_register(struct ivtv *itv, unsigned idx)
@@ -292,6 +294,12 @@ int ivtv_i2c_register(struct ivtv *itv, unsigned idx)
        if (hw == IVTV_HW_UPD64031A || hw == IVTV_HW_UPD6408X) {
                sd = v4l2_i2c_new_subdev(&itv->v4l2_dev,
                                adap, mod, type, 0, I2C_ADDRS(hw_addrs[idx]));
+       } else if (hw == IVTV_HW_CX25840) {
+               struct cx25840_platform_data pdata;
+
+               pdata.pvr150_workaround = itv->pvr150_workaround;
+               sd = v4l2_i2c_new_subdev_cfg(&itv->v4l2_dev,
+                               adap, mod, type, 0, &pdata, hw_addrs[idx], NULL);
        } else {
                sd = v4l2_i2c_new_subdev(&itv->v4l2_dev,
                                adap, mod, type, hw_addrs[idx], NULL);