diff options
author | Bhanu Murthy V <bmurthyv@nvidia.com> | 2017-03-22 13:19:07 -0400 |
---|---|---|
committer | Bhanu Murthy V <bmurthyv@nvidia.com> | 2017-03-22 13:19:07 -0400 |
commit | 666bc65920e7990c90f6da5d6e50373ef329f105 (patch) | |
tree | 3269be1063c4727beee7af3c3ed00f5b7d9e3fb2 /drivers/media/i2c/ov5693.c | |
parent | ebc4bca2a7c6f2097c39ee21a04a141e37292678 (diff) |
media:i2c: Port ov5693 to k4.4
Bug 1778427
Change-Id: I13f62f3c2d86709de095e81272761a518ccb5879
Signed-off-by: Wenjia Zhou <wenjiaz@nvidia.com>
Diffstat (limited to 'drivers/media/i2c/ov5693.c')
-rw-r--r-- | drivers/media/i2c/ov5693.c | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/drivers/media/i2c/ov5693.c b/drivers/media/i2c/ov5693.c index 97eb74bb6..018b81fdf 100644 --- a/drivers/media/i2c/ov5693.c +++ b/drivers/media/i2c/ov5693.c | |||
@@ -29,7 +29,7 @@ | |||
29 | #include <media/camera_common.h> | 29 | #include <media/camera_common.h> |
30 | #include <media/ov5693.h> | 30 | #include <media/ov5693.h> |
31 | 31 | ||
32 | #include "cam_dev/camera_gpio.h" | 32 | #include "../platform/tegra/camera/camera_gpio.h" |
33 | 33 | ||
34 | #include "ov5693_mode_tbls.h" | 34 | #include "ov5693_mode_tbls.h" |
35 | 35 | ||
@@ -55,7 +55,7 @@ | |||
55 | #define OV5693_DEFAULT_HDR_MODE OV5693_MODE_2592X1944_HDR | 55 | #define OV5693_DEFAULT_HDR_MODE OV5693_MODE_2592X1944_HDR |
56 | #define OV5693_DEFAULT_WIDTH 2592 | 56 | #define OV5693_DEFAULT_WIDTH 2592 |
57 | #define OV5693_DEFAULT_HEIGHT 1944 | 57 | #define OV5693_DEFAULT_HEIGHT 1944 |
58 | #define OV5693_DEFAULT_DATAFMT V4L2_MBUS_FMT_SRGGB10_1X10 | 58 | #define OV5693_DEFAULT_DATAFMT MEDIA_BUS_FMT_SRGGB10_1X10 |
59 | #define OV5693_DEFAULT_CLK_FREQ 24000000 | 59 | #define OV5693_DEFAULT_CLK_FREQ 24000000 |
60 | 60 | ||
61 | struct ov5693 { | 61 | struct ov5693 { |
@@ -522,10 +522,6 @@ exit: | |||
522 | 522 | ||
523 | static struct v4l2_subdev_video_ops ov5693_subdev_video_ops = { | 523 | static struct v4l2_subdev_video_ops ov5693_subdev_video_ops = { |
524 | .s_stream = ov5693_s_stream, | 524 | .s_stream = ov5693_s_stream, |
525 | .s_mbus_fmt = camera_common_s_fmt, | ||
526 | .g_mbus_fmt = camera_common_g_fmt, | ||
527 | .try_mbus_fmt = camera_common_try_fmt, | ||
528 | .enum_mbus_fmt = camera_common_enum_fmt, | ||
529 | .g_mbus_config = camera_common_g_mbus_config, | 525 | .g_mbus_config = camera_common_g_mbus_config, |
530 | }; | 526 | }; |
531 | 527 | ||
@@ -533,9 +529,37 @@ static struct v4l2_subdev_core_ops ov5693_subdev_core_ops = { | |||
533 | .s_power = camera_common_s_power, | 529 | .s_power = camera_common_s_power, |
534 | }; | 530 | }; |
535 | 531 | ||
532 | static int ov5693_get_fmt(struct v4l2_subdev *sd, | ||
533 | struct v4l2_subdev_pad_config *cfg, | ||
534 | struct v4l2_subdev_format *format) | ||
535 | { | ||
536 | return camera_common_g_fmt(sd, &format->format); | ||
537 | } | ||
538 | |||
539 | static int ov5693_set_fmt(struct v4l2_subdev *sd, | ||
540 | struct v4l2_subdev_pad_config *cfg, | ||
541 | struct v4l2_subdev_format *format) | ||
542 | { | ||
543 | int ret; | ||
544 | |||
545 | if (format->which == V4L2_SUBDEV_FORMAT_TRY) | ||
546 | ret = camera_common_try_fmt(sd, &format->format); | ||
547 | else | ||
548 | ret = camera_common_s_fmt(sd, &format->format); | ||
549 | |||
550 | return ret; | ||
551 | } | ||
552 | |||
553 | static struct v4l2_subdev_pad_ops ov5693_subdev_pad_ops = { | ||
554 | .set_fmt = ov5693_set_fmt, | ||
555 | .get_fmt = ov5693_get_fmt, | ||
556 | .enum_mbus_code = camera_common_enum_mbus_code, | ||
557 | }; | ||
558 | |||
536 | static struct v4l2_subdev_ops ov5693_subdev_ops = { | 559 | static struct v4l2_subdev_ops ov5693_subdev_ops = { |
537 | .core = &ov5693_subdev_core_ops, | 560 | .core = &ov5693_subdev_core_ops, |
538 | .video = &ov5693_subdev_video_ops, | 561 | .video = &ov5693_subdev_video_ops, |
562 | .pad = &ov5693_subdev_pad_ops, | ||
539 | }; | 563 | }; |
540 | 564 | ||
541 | static struct of_device_id ov5693_of_match[] = { | 565 | static struct of_device_id ov5693_of_match[] = { |