GNU Linux-libre 4.14.332-gnu1
[releases.git] / drivers / media / platform / vsp1 / vsp1_hgo.h
1 /*
2  * vsp1_hgo.h  --  R-Car VSP1 Histogram Generator 1D
3  *
4  * Copyright (C) 2016 Renesas Electronics Corporation
5  *
6  * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  */
13 #ifndef __VSP1_HGO_H__
14 #define __VSP1_HGO_H__
15
16 #include <media/media-entity.h>
17 #include <media/v4l2-ctrls.h>
18 #include <media/v4l2-subdev.h>
19
20 #include "vsp1_histo.h"
21
22 struct vsp1_device;
23
24 struct vsp1_hgo {
25         struct vsp1_histogram histo;
26
27         struct {
28                 struct v4l2_ctrl_handler handler;
29                 struct v4l2_ctrl *max_rgb;
30                 struct v4l2_ctrl *num_bins;
31         } ctrls;
32
33         bool max_rgb;
34         unsigned int num_bins;
35 };
36
37 static inline struct vsp1_hgo *to_hgo(struct v4l2_subdev *subdev)
38 {
39         return container_of(subdev, struct vsp1_hgo, histo.entity.subdev);
40 }
41
42 struct vsp1_hgo *vsp1_hgo_create(struct vsp1_device *vsp1);
43 void vsp1_hgo_frame_end(struct vsp1_entity *hgo);
44
45 #endif /* __VSP1_HGO_H__ */