diff options
author | Robert Jarzmik <robert.jarzmik@free.fr> | 2016-09-06 06:04:21 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-09-09 10:52:56 -0300 |
commit | cdd657eb441ceb3b938ed0664d90ce07fbde3139 (patch) | |
tree | ea7ec490adf84805353e40f74518e060c7f8a096 /drivers/media/platform/soc_camera | |
parent | 283e4a82999f48c61495436b9bbd0357a3268f9d (diff) | |
download | blackbird-op-linux-cdd657eb441ceb3b938ed0664d90ce07fbde3139.tar.gz blackbird-op-linux-cdd657eb441ceb3b938ed0664d90ce07fbde3139.zip |
[media] media: platform: pxa_camera: add debug register access
Add pxa_camera registers access through advanced video debugging.
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/platform/soc_camera')
-rw-r--r-- | drivers/media/platform/soc_camera/pxa_camera.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/media/platform/soc_camera/pxa_camera.c b/drivers/media/platform/soc_camera/pxa_camera.c index 395cd398c32b..fb89b85f59ab 100644 --- a/drivers/media/platform/soc_camera/pxa_camera.c +++ b/drivers/media/platform/soc_camera/pxa_camera.c @@ -1342,6 +1342,34 @@ static int pxa_camera_check_frame(u32 width, u32 height) (width & 0x01); } +#ifdef CONFIG_VIDEO_ADV_DEBUG +static int pxac_vidioc_g_register(struct file *file, void *priv, + struct v4l2_dbg_register *reg) +{ + struct pxa_camera_dev *pcdev = video_drvdata(file); + + if (reg->reg > CIBR2) + return -ERANGE; + + reg->val = __raw_readl(pcdev->base + reg->reg); + reg->size = sizeof(__u32); + return 0; +} + +static int pxac_vidioc_s_register(struct file *file, void *priv, + const struct v4l2_dbg_register *reg) +{ + struct pxa_camera_dev *pcdev = video_drvdata(file); + + if (reg->reg > CIBR2) + return -ERANGE; + if (reg->size != sizeof(__u32)) + return -EINVAL; + __raw_writel(reg->val, pcdev->base + reg->reg); + return 0; +} +#endif + static int pxac_vidioc_enum_fmt_vid_cap(struct file *filp, void *priv, struct v4l2_fmtdesc *f) { @@ -1592,6 +1620,10 @@ static const struct v4l2_ioctl_ops pxa_camera_ioctl_ops = { .vidioc_expbuf = vb2_ioctl_expbuf, .vidioc_streamon = vb2_ioctl_streamon, .vidioc_streamoff = vb2_ioctl_streamoff, +#ifdef CONFIG_VIDEO_ADV_DEBUG + .vidioc_g_register = pxac_vidioc_g_register, + .vidioc_s_register = pxac_vidioc_s_register, +#endif }; static struct v4l2_clk_ops pxa_camera_mclk_ops = { |