1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * vsp1_hgo.h  --  R-Car VSP1 Histogram Generator 1D
4  *
5  * Copyright (C) 2016 Renesas Electronics Corporation
6  *
7  * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
8  */
9 #ifndef __VSP1_HGO_H__
10 #define __VSP1_HGO_H__
11 
12 #include <media/media-entity.h>
13 #include <media/v4l2-ctrls.h>
14 #include <media/v4l2-subdev.h>
15 
16 #include "vsp1_histo.h"
17 
18 struct vsp1_device;
19 
20 struct vsp1_hgo {
21 	struct vsp1_histogram histo;
22 
23 	struct {
24 		struct v4l2_ctrl_handler handler;
25 		struct v4l2_ctrl *max_rgb;
26 		struct v4l2_ctrl *num_bins;
27 	} ctrls;
28 
29 	bool max_rgb;
30 	unsigned int num_bins;
31 };
32 
to_hgo(struct v4l2_subdev * subdev)33 static inline struct vsp1_hgo *to_hgo(struct v4l2_subdev *subdev)
34 {
35 	return container_of(subdev, struct vsp1_hgo, histo.entity.subdev);
36 }
37 
38 struct vsp1_hgo *vsp1_hgo_create(struct vsp1_device *vsp1);
39 void vsp1_hgo_frame_end(struct vsp1_entity *hgo);
40 
41 #endif /* __VSP1_HGO_H__ */
42