diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-24 20:35:10 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-24 20:35:10 -0500 |
commit | 21fbd5809ad126b949206d78e0a0e07ec872ea11 (patch) | |
tree | a824045df99fc1f0690095a925cceb50207e332b /drivers/media/i2c/soc_camera/ov772x.c | |
parent | d9978ec5680059d727b39d6c706777c6973587f2 (diff) | |
parent | ed72d37a33fdf43dc47787fe220532cdec9da528 (diff) |
Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull media updates from Mauro Carvalho Chehab:
- Some cleanups at V4L2 documentation
- new drivers: ts2020 frontend, ov9650 sensor, s5c73m3 sensor,
sh-mobile veu mem2mem driver, radio-ma901, davinci_vpfe staging
driver
- Lots of missing MAINTAINERS entries added
- several em28xx driver improvements, including its conversion to
videobuf2
- several fixups on drivers to make them to better comply with the API
- DVB core: add support for DVBv5 stats, allowing the implementation of
statistics for new standards like ISDB
- mb86a20s: add statistics to the driver
- lots of new board additions, cleanups, and driver improvements.
* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (596 commits)
[media] media: Add 0x3009 USB PID to ttusb2 driver (fixed diff)
[media] rtl28xxu: Add USB IDs for Compro VideoMate U620F
[media] em28xx: add usb id for terratec h5 rev. 3
[media] media: rc: gpio-ir-recv: add support for device tree parsing
[media] mceusb: move check earlier to make smatch happy
[media] radio-si470x doc: add info about v4l2-ctl and sox+alsa
[media] staging: media: Remove unnecessary OOM messages
[media] sh_vou: Use vou_dev instead of vou_file wherever possible
[media] sh_vou: Use video_drvdata()
[media] drivers/media/platform/soc_camera/pxa_camera.c: use devm_ functions
[media] mt9t112: mt9t111 format set up differs from mt9t112
[media] sh-mobile-ceu-camera: fix SHARPNESS control default
Revert "[media] fc0011: Return early, if the frequency is already tuned"
[media] cx18/ivtv: fix regression: remove __init from a non-init function
[media] em28xx: fix analog streaming with USB bulk transfers
[media] stv0900: remove unnecessary null pointer check
[media] fc0011: Return early, if the frequency is already tuned
[media] fc0011: Add some sanity checks and cleanups
[media] fc0011: Fix xin value clamping
Revert "[media] [PATH,1/2] mxl5007 move reset to attach"
...
Diffstat (limited to 'drivers/media/i2c/soc_camera/ov772x.c')
-rw-r--r-- | drivers/media/i2c/soc_camera/ov772x.c | 36 |
1 files changed, 14 insertions, 22 deletions
diff --git a/drivers/media/i2c/soc_camera/ov772x.c b/drivers/media/i2c/soc_camera/ov772x.c index e4a10751894d..fbeb5b2f3ae5 100644 --- a/drivers/media/i2c/soc_camera/ov772x.c +++ b/drivers/media/i2c/soc_camera/ov772x.c | |||
@@ -667,9 +667,9 @@ static int ov772x_s_register(struct v4l2_subdev *sd, | |||
667 | static int ov772x_s_power(struct v4l2_subdev *sd, int on) | 667 | static int ov772x_s_power(struct v4l2_subdev *sd, int on) |
668 | { | 668 | { |
669 | struct i2c_client *client = v4l2_get_subdevdata(sd); | 669 | struct i2c_client *client = v4l2_get_subdevdata(sd); |
670 | struct soc_camera_link *icl = soc_camera_i2c_to_link(client); | 670 | struct soc_camera_subdev_desc *ssdd = soc_camera_i2c_to_desc(client); |
671 | 671 | ||
672 | return soc_camera_set_power(&client->dev, icl, on); | 672 | return soc_camera_set_power(&client->dev, ssdd, on); |
673 | } | 673 | } |
674 | 674 | ||
675 | static const struct ov772x_win_size *ov772x_select_win(u32 width, u32 height) | 675 | static const struct ov772x_win_size *ov772x_select_win(u32 width, u32 height) |
@@ -1019,13 +1019,13 @@ static int ov772x_g_mbus_config(struct v4l2_subdev *sd, | |||
1019 | struct v4l2_mbus_config *cfg) | 1019 | struct v4l2_mbus_config *cfg) |
1020 | { | 1020 | { |
1021 | struct i2c_client *client = v4l2_get_subdevdata(sd); | 1021 | struct i2c_client *client = v4l2_get_subdevdata(sd); |
1022 | struct soc_camera_link *icl = soc_camera_i2c_to_link(client); | 1022 | struct soc_camera_subdev_desc *ssdd = soc_camera_i2c_to_desc(client); |
1023 | 1023 | ||
1024 | cfg->flags = V4L2_MBUS_PCLK_SAMPLE_RISING | V4L2_MBUS_MASTER | | 1024 | cfg->flags = V4L2_MBUS_PCLK_SAMPLE_RISING | V4L2_MBUS_MASTER | |
1025 | V4L2_MBUS_VSYNC_ACTIVE_HIGH | V4L2_MBUS_HSYNC_ACTIVE_HIGH | | 1025 | V4L2_MBUS_VSYNC_ACTIVE_HIGH | V4L2_MBUS_HSYNC_ACTIVE_HIGH | |
1026 | V4L2_MBUS_DATA_ACTIVE_HIGH; | 1026 | V4L2_MBUS_DATA_ACTIVE_HIGH; |
1027 | cfg->type = V4L2_MBUS_PARALLEL; | 1027 | cfg->type = V4L2_MBUS_PARALLEL; |
1028 | cfg->flags = soc_camera_apply_board_flags(icl, cfg); | 1028 | cfg->flags = soc_camera_apply_board_flags(ssdd, cfg); |
1029 | 1029 | ||
1030 | return 0; | 1030 | return 0; |
1031 | } | 1031 | } |
@@ -1054,11 +1054,11 @@ static int ov772x_probe(struct i2c_client *client, | |||
1054 | const struct i2c_device_id *did) | 1054 | const struct i2c_device_id *did) |
1055 | { | 1055 | { |
1056 | struct ov772x_priv *priv; | 1056 | struct ov772x_priv *priv; |
1057 | struct soc_camera_link *icl = soc_camera_i2c_to_link(client); | 1057 | struct soc_camera_subdev_desc *ssdd = soc_camera_i2c_to_desc(client); |
1058 | struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); | 1058 | struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); |
1059 | int ret; | 1059 | int ret; |
1060 | 1060 | ||
1061 | if (!icl || !icl->priv) { | 1061 | if (!ssdd || !ssdd->drv_priv) { |
1062 | dev_err(&client->dev, "OV772X: missing platform data!\n"); | 1062 | dev_err(&client->dev, "OV772X: missing platform data!\n"); |
1063 | return -EINVAL; | 1063 | return -EINVAL; |
1064 | } | 1064 | } |
@@ -1070,11 +1070,11 @@ static int ov772x_probe(struct i2c_client *client, | |||
1070 | return -EIO; | 1070 | return -EIO; |
1071 | } | 1071 | } |
1072 | 1072 | ||
1073 | priv = kzalloc(sizeof(*priv), GFP_KERNEL); | 1073 | priv = devm_kzalloc(&client->dev, sizeof(*priv), GFP_KERNEL); |
1074 | if (!priv) | 1074 | if (!priv) |
1075 | return -ENOMEM; | 1075 | return -ENOMEM; |
1076 | 1076 | ||
1077 | priv->info = icl->priv; | 1077 | priv->info = ssdd->drv_priv; |
1078 | 1078 | ||
1079 | v4l2_i2c_subdev_init(&priv->subdev, client, &ov772x_subdev_ops); | 1079 | v4l2_i2c_subdev_init(&priv->subdev, client, &ov772x_subdev_ops); |
1080 | v4l2_ctrl_handler_init(&priv->hdl, 3); | 1080 | v4l2_ctrl_handler_init(&priv->hdl, 3); |
@@ -1085,22 +1085,15 @@ static int ov772x_probe(struct i2c_client *client, | |||
1085 | v4l2_ctrl_new_std(&priv->hdl, &ov772x_ctrl_ops, | 1085 | v4l2_ctrl_new_std(&priv->hdl, &ov772x_ctrl_ops, |
1086 | V4L2_CID_BAND_STOP_FILTER, 0, 256, 1, 0); | 1086 | V4L2_CID_BAND_STOP_FILTER, 0, 256, 1, 0); |
1087 | priv->subdev.ctrl_handler = &priv->hdl; | 1087 | priv->subdev.ctrl_handler = &priv->hdl; |
1088 | if (priv->hdl.error) { | 1088 | if (priv->hdl.error) |
1089 | ret = priv->hdl.error; | 1089 | return priv->hdl.error; |
1090 | goto done; | ||
1091 | } | ||
1092 | 1090 | ||
1093 | ret = ov772x_video_probe(priv); | 1091 | ret = ov772x_video_probe(priv); |
1094 | if (ret < 0) | 1092 | if (ret < 0) { |
1095 | goto done; | ||
1096 | |||
1097 | priv->cfmt = &ov772x_cfmts[0]; | ||
1098 | priv->win = &ov772x_win_sizes[0]; | ||
1099 | |||
1100 | done: | ||
1101 | if (ret) { | ||
1102 | v4l2_ctrl_handler_free(&priv->hdl); | 1093 | v4l2_ctrl_handler_free(&priv->hdl); |
1103 | kfree(priv); | 1094 | } else { |
1095 | priv->cfmt = &ov772x_cfmts[0]; | ||
1096 | priv->win = &ov772x_win_sizes[0]; | ||
1104 | } | 1097 | } |
1105 | return ret; | 1098 | return ret; |
1106 | } | 1099 | } |
@@ -1111,7 +1104,6 @@ static int ov772x_remove(struct i2c_client *client) | |||
1111 | 1104 | ||
1112 | v4l2_device_unregister_subdev(&priv->subdev); | 1105 | v4l2_device_unregister_subdev(&priv->subdev); |
1113 | v4l2_ctrl_handler_free(&priv->hdl); | 1106 | v4l2_ctrl_handler_free(&priv->hdl); |
1114 | kfree(priv); | ||
1115 | return 0; | 1107 | return 0; |
1116 | } | 1108 | } |
1117 | 1109 | ||