1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * vsp1_lut.h  --  R-Car VSP1 Look-Up Table
4  *
5  * Copyright (C) 2013 Renesas Corporation
6  *
7  * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
8  */
9 #ifndef __VSP1_LUT_H__
10 #define __VSP1_LUT_H__
11 
12 #include <linux/spinlock.h>
13 
14 #include <media/media-entity.h>
15 #include <media/v4l2-ctrls.h>
16 #include <media/v4l2-subdev.h>
17 
18 #include "vsp1_entity.h"
19 
20 struct vsp1_device;
21 
22 #define LUT_PAD_SINK				0
23 #define LUT_PAD_SOURCE				1
24 
25 struct vsp1_lut {
26 	struct vsp1_entity entity;
27 
28 	struct v4l2_ctrl_handler ctrls;
29 
30 	spinlock_t lock;
31 	struct vsp1_dl_body *lut;
32 	struct vsp1_dl_body_pool *pool;
33 };
34 
to_lut(struct v4l2_subdev * subdev)35 static inline struct vsp1_lut *to_lut(struct v4l2_subdev *subdev)
36 {
37 	return container_of(subdev, struct vsp1_lut, entity.subdev);
38 }
39 
40 struct vsp1_lut *vsp1_lut_create(struct vsp1_device *vsp1);
41 
42 #endif /* __VSP1_LUT_H__ */
43