Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 176843
b: refs/heads/master
c: 0f44829
h: refs/heads/master
i:
  176841: 1868bdf
  176839: 8b452e3
v: v3
  • Loading branch information
Guennadi Liakhovetski authored and Mauro Carvalho Chehab committed Dec 16, 2009
1 parent b1297c0 commit 60b7708
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 40 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3fd7ceffddd52c2f8c004a7999ccb705d592cbfd
refs/heads/master: 0f4482940a75b52db931e1fff181c9d267e462d2
38 changes: 21 additions & 17 deletions trunk/arch/sh/boards/mach-ap325rxa/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,12 +324,14 @@ static struct soc_camera_platform_info camera_info = {
.bus_param = SOCAM_PCLK_SAMPLE_RISING | SOCAM_HSYNC_ACTIVE_HIGH |
SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_MASTER | SOCAM_DATAWIDTH_8,
.set_capture = camera_set_capture,
.link = {
.bus_id = 0,
.add_device = ap325rxa_camera_add,
.del_device = ap325rxa_camera_del,
.module_name = "soc_camera_platform",
},
};

struct soc_camera_link camera_link = {
.bus_id = 0,
.add_device = ap325rxa_camera_add,
.del_device = ap325rxa_camera_del,
.module_name = "soc_camera_platform",
.priv = &camera_info,
};

static void dummy_release(struct device *dev)
Expand All @@ -347,7 +349,7 @@ static struct platform_device camera_device = {
static int ap325rxa_camera_add(struct soc_camera_link *icl,
struct device *dev)
{
if (icl != &camera_info.link || camera_probe() <= 0)
if (icl != &camera_link || camera_probe() <= 0)
return -ENODEV;

camera_info.dev = dev;
Expand All @@ -357,7 +359,7 @@ static int ap325rxa_camera_add(struct soc_camera_link *icl,

static void ap325rxa_camera_del(struct soc_camera_link *icl)
{
if (icl != &camera_info.link)
if (icl != &camera_link)
return;

platform_device_unregister(&camera_device);
Expand Down Expand Up @@ -470,27 +472,29 @@ static struct ov772x_camera_info ov7725_info = {
.buswidth = SOCAM_DATAWIDTH_8,
.flags = OV772X_FLAG_VFLIP | OV772X_FLAG_HFLIP,
.edgectrl = OV772X_AUTO_EDGECTRL(0xf, 0),
.link = {
.bus_id = 0,
.power = ov7725_power,
.board_info = &ap325rxa_i2c_camera[0],
.i2c_adapter_id = 0,
.module_name = "ov772x",
},
};

static struct soc_camera_link ov7725_link = {
.bus_id = 0,
.power = ov7725_power,
.board_info = &ap325rxa_i2c_camera[0],
.i2c_adapter_id = 0,
.module_name = "ov772x",
.priv = &ov7725_info,
};

static struct platform_device ap325rxa_camera[] = {
{
.name = "soc-camera-pdrv",
.id = 0,
.dev = {
.platform_data = &ov7725_info.link,
.platform_data = &ov7725_link,
},
}, {
.name = "soc-camera-pdrv",
.id = 1,
.dev = {
.platform_data = &camera_info.link,
.platform_data = &camera_link,
},
},
};
Expand Down
32 changes: 18 additions & 14 deletions trunk/arch/sh/boards/mach-migor/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,37 +432,41 @@ static struct i2c_board_info migor_i2c_camera[] = {

static struct ov772x_camera_info ov7725_info = {
.buswidth = SOCAM_DATAWIDTH_8,
.link = {
.power = ov7725_power,
.board_info = &migor_i2c_camera[0],
.i2c_adapter_id = 0,
.module_name = "ov772x",
},
};

static struct soc_camera_link ov7725_link = {
.power = ov7725_power,
.board_info = &migor_i2c_camera[0],
.i2c_adapter_id = 0,
.module_name = "ov772x",
.priv = &ov7725_info,
};

static struct tw9910_video_info tw9910_info = {
.buswidth = SOCAM_DATAWIDTH_8,
.mpout = TW9910_MPO_FIELD,
.link = {
.power = tw9910_power,
.board_info = &migor_i2c_camera[1],
.i2c_adapter_id = 0,
.module_name = "tw9910",
}
};

static struct soc_camera_link tw9910_link = {
.power = tw9910_power,
.board_info = &migor_i2c_camera[1],
.i2c_adapter_id = 0,
.module_name = "tw9910",
.priv = &tw9910_info,
};

static struct platform_device migor_camera[] = {
{
.name = "soc-camera-pdrv",
.id = 0,
.dev = {
.platform_data = &ov7725_info.link,
.platform_data = &ov7725_link,
},
}, {
.name = "soc-camera-pdrv",
.id = 1,
.dev = {
.platform_data = &tw9910_info.link,
.platform_data = &tw9910_link,
},
},
};
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/media/video/ov772x.c
Original file line number Diff line number Diff line change
Expand Up @@ -1143,10 +1143,10 @@ static int ov772x_probe(struct i2c_client *client,
}

icl = to_soc_camera_link(icd);
if (!icl)
if (!icl || !icl->priv)
return -EINVAL;

info = container_of(icl, struct ov772x_camera_info, link);
info = icl->priv;

if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) {
dev_err(&adapter->dev,
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/media/video/tw9910.c
Original file line number Diff line number Diff line change
Expand Up @@ -955,10 +955,10 @@ static int tw9910_probe(struct i2c_client *client,
}

icl = to_soc_camera_link(icd);
if (!icl)
if (!icl || !icl->priv)
return -EINVAL;

info = container_of(icl, struct tw9910_video_info, link);
info = icl->priv;

if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) {
dev_err(&client->dev,
Expand All @@ -976,7 +976,7 @@ static int tw9910_probe(struct i2c_client *client,
v4l2_i2c_subdev_init(&priv->subdev, client, &tw9910_subdev_ops);

icd->ops = &tw9910_ops;
icd->iface = info->link.bus_id;
icd->iface = icl->bus_id;

ret = tw9910_video_probe(icd, client);
if (ret) {
Expand Down
1 change: 0 additions & 1 deletion trunk/include/media/ov772x.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ struct ov772x_edge_ctrl {
struct ov772x_camera_info {
unsigned long buswidth;
unsigned long flags;
struct soc_camera_link link;
struct ov772x_edge_ctrl edgectrl;
};

Expand Down
1 change: 0 additions & 1 deletion trunk/include/media/soc_camera_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ struct soc_camera_platform_info {
unsigned long bus_param;
struct device *dev;
int (*set_capture)(struct soc_camera_platform_info *info, int enable);
struct soc_camera_link link;
};

#endif /* __SOC_CAMERA_H__ */
1 change: 0 additions & 1 deletion trunk/include/media/tw9910.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ enum tw9910_mpout_pin {
struct tw9910_video_info {
unsigned long buswidth;
enum tw9910_mpout_pin mpout;
struct soc_camera_link link;
};


Expand Down

0 comments on commit 60b7708

Please sign in to comment.