126e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchart/* 226e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchart * vsp1_rwpf.h -- R-Car VSP1 Read and Write Pixel Formatters 326e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchart * 48a1edc55c1ec1ff3624c25b4ac6c1ce776d872b8Laurent Pinchart * Copyright (C) 2013-2014 Renesas Electronics Corporation 526e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchart * 626e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchart * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com) 726e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchart * 826e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchart * This program is free software; you can redistribute it and/or modify 926e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchart * it under the terms of the GNU General Public License as published by 1026e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchart * the Free Software Foundation; either version 2 of the License, or 1126e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchart * (at your option) any later version. 1226e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchart */ 1326e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchart#ifndef __VSP1_RWPF_H__ 1426e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchart#define __VSP1_RWPF_H__ 1526e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchart 1626e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchart#include <media/media-entity.h> 177578c204620c8e25ec6e4849cd12098f831a14d0Laurent Pinchart#include <media/v4l2-ctrls.h> 1826e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchart#include <media/v4l2-subdev.h> 1926e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchart 2026e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchart#include "vsp1.h" 2126e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchart#include "vsp1_entity.h" 2226e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchart#include "vsp1_video.h" 2326e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchart 2426e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchart#define RWPF_PAD_SINK 0 2526e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchart#define RWPF_PAD_SOURCE 1 2626e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchart 2726e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchartstruct vsp1_rwpf { 2826e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchart struct vsp1_entity entity; 2926e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchart struct vsp1_video video; 307578c204620c8e25ec6e4849cd12098f831a14d0Laurent Pinchart struct v4l2_ctrl_handler ctrls; 3126e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchart 3226e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchart unsigned int max_width; 3326e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchart unsigned int max_height; 34e5ad37b64de975463c51f9ed4e4c55dc6e442ba5Laurent Pinchart 35629bb6d4b38fe62d36ab52ad22c3ab726f6ce6e8Laurent Pinchart struct { 36629bb6d4b38fe62d36ab52ad22c3ab726f6ce6e8Laurent Pinchart unsigned int left; 37629bb6d4b38fe62d36ab52ad22c3ab726f6ce6e8Laurent Pinchart unsigned int top; 38629bb6d4b38fe62d36ab52ad22c3ab726f6ce6e8Laurent Pinchart } location; 39e5ad37b64de975463c51f9ed4e4c55dc6e442ba5Laurent Pinchart struct v4l2_rect crop; 40e5ad37b64de975463c51f9ed4e4c55dc6e442ba5Laurent Pinchart 41e5ad37b64de975463c51f9ed4e4c55dc6e442ba5Laurent Pinchart unsigned int offsets[2]; 4226e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchart}; 4326e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchart 4426e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchartstatic inline struct vsp1_rwpf *to_rwpf(struct v4l2_subdev *subdev) 4526e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchart{ 4626e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchart return container_of(subdev, struct vsp1_rwpf, entity.subdev); 4726e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchart} 4826e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchart 4926e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchartstruct vsp1_rwpf *vsp1_rpf_create(struct vsp1_device *vsp1, unsigned int index); 5026e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchartstruct vsp1_rwpf *vsp1_wpf_create(struct vsp1_device *vsp1, unsigned int index); 5126e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchart 5226e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchartint vsp1_rwpf_enum_mbus_code(struct v4l2_subdev *subdev, 5326e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchart struct v4l2_subdev_fh *fh, 5426e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchart struct v4l2_subdev_mbus_code_enum *code); 5526e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchartint vsp1_rwpf_enum_frame_size(struct v4l2_subdev *subdev, 5626e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchart struct v4l2_subdev_fh *fh, 5726e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchart struct v4l2_subdev_frame_size_enum *fse); 5826e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchartint vsp1_rwpf_get_format(struct v4l2_subdev *subdev, struct v4l2_subdev_fh *fh, 5926e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchart struct v4l2_subdev_format *fmt); 6026e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchartint vsp1_rwpf_set_format(struct v4l2_subdev *subdev, struct v4l2_subdev_fh *fh, 6126e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchart struct v4l2_subdev_format *fmt); 62e5ad37b64de975463c51f9ed4e4c55dc6e442ba5Laurent Pinchartint vsp1_rwpf_get_selection(struct v4l2_subdev *subdev, 63e5ad37b64de975463c51f9ed4e4c55dc6e442ba5Laurent Pinchart struct v4l2_subdev_fh *fh, 64e5ad37b64de975463c51f9ed4e4c55dc6e442ba5Laurent Pinchart struct v4l2_subdev_selection *sel); 65e5ad37b64de975463c51f9ed4e4c55dc6e442ba5Laurent Pinchartint vsp1_rwpf_set_selection(struct v4l2_subdev *subdev, 66e5ad37b64de975463c51f9ed4e4c55dc6e442ba5Laurent Pinchart struct v4l2_subdev_fh *fh, 67e5ad37b64de975463c51f9ed4e4c55dc6e442ba5Laurent Pinchart struct v4l2_subdev_selection *sel); 6826e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchart 6926e0ca22c3b85b04f693dd0422f13a61846ccfa9Laurent Pinchart#endif /* __VSP1_RWPF_H__ */ 70