summaryrefslogtreecommitdiff
path: root/drivers/media/platform/ti-vpe/cal.c
AgeCommit message (Collapse)Author
2016-09-19[media] platform: constify vb2_ops structuresJulia Lawall
Check for vb2_ops structures that are only stored in the ops field of a vb2_queue structure. That field is declared const, so vb2_ops structures that have this property can be declared as const also. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r disable optional_qualifier@ identifier i; position p; @@ static struct vb2_ops i@p = { ... }; @ok@ identifier r.i; struct vb2_queue e; position p; @@ e.ops = &i@p; @bad@ position p != {r.p,ok.p}; identifier r.i; struct vb2_ops e; @@ e@i@p @depends on !bad disable optional_qualifier@ identifier r.i; @@ static +const struct vb2_ops i = { ... }; // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com> Reviewed-by: Jacek Anaszewski <j.anaszewski@samsung.com> Reviewed-by: Benoit Parrot <bparrot@ti.com> [hans.verkuil@cisco.com: dropped soc_camera/rcar_vin.c patch because that driver will be removed] Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-07-08[media] vb2: replace void *alloc_ctxs by struct device *alloc_devsHans Verkuil
Make this a proper typed array. Drop the old allocate context code since that is no longer used. Note that the memops functions now get a struct device pointer instead of the struct device ** that was there initially (actually a void pointer to a struct containing only a struct device pointer). This code is now a lot cleaner. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Sakari Ailus <sakari.ailus@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-07-08[media] media/platform: convert drivers to use the new vb2_queue dev fieldHans Verkuil
Stop using alloc_ctx and just fill in the device pointer. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Fabien Dessenne <fabien.dessenne@st.com> Acked-by: Benoit Parrot <bparrot@ti.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-02-23[media] media: ti-vpe: cal: Fix warning: variable dereference before being ↵Benoit Parrot
checked As reported ctx->sensor is being dereferenced before being checked in cal_get_external_info(). That being the case it was also checked twice in multiple other location where v4l2_subdev_call is already checking it so no need to explicitly check it again. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Benoit Parrot <bparrot@ti.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-23[media] media: ti-vpe: cal: Fix unreachable code in enum_frame_intervalBenoit Parrot
As reported, the current cal_enum_frameintervals() is confusing and does not have the intended behavior. Fix this by re-implementing to properly propagate the enum_frame_interval request to the subdevice. [mchehab@osg.samsung.com: remove a now bogus "ret = 0" statement] Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Reported-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Signed-off-by: Benoit Parrot <bparrot@ti.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-19[media] media: ti-vpe: cal: Fix syntax check warningsBenoit Parrot
Fix the following sparse warnings: ti-vpe/cal.c:387:26: warning: incorrect type in return expression (different address spaces) ti-vpe/cal.c:459:26: warning: incorrect type in return expression (different address spaces) ti-vpe/cal.c:503:27: warning: incorrect type in argument 6 (different address spaces) ti-vpe/cal.c:509:47: warning: incorrect type in argument 6 (different address spaces) ti-vpe/cal.c:518:47: warning: incorrect type in argument 6 (different address spaces) ti-vpe/cal.c:526:31: warning: incorrect type in argument 6 (different address spaces) ti-vpe/cal.c:1807:24: warning: Using plain integer as NULL pointer ti-vpe/cal.c:1844:16: warning: Using plain integer as NULL pointer Signed-off-by: Benoit Parrot <bparrot@ti.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-02-01[media] media: ti-vpe: Add CAL v4l2 camera capture driverBenoit Parrot
The Camera Adaptation Layer (CAL) is a block which consists of a dual port CSI2/MIPI camera capture engine. Port #0 can handle CSI2 camera connected to up to 4 data lanes. Port #1 can handle CSI2 camera connected to up to 2 data lanes. The driver implements the required API/ioctls to be V4L2 compliant. Driver supports the following: - V4L2 API using DMABUF/MMAP buffer access based on videobuf2 api - Asynchronous sensor sub device registration - DT support Signed-off-by: Benoit Parrot <bparrot@ti.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>