summaryrefslogtreecommitdiffstats
path: root/include/media/sensor_common.h
blob: 2fe9595d7cece0855ed1a44dd83712c3fdb81c26 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/**
 * sensor_common.h - utilities for tegra camera driver
 *
 * Copyright (c) 2017-2019, NVIDIA Corporation.  All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms and conditions of the GNU General Public License,
 * version 2, as published by the Free Software Foundation.
 *
 * This program is distributed in the hope it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef __sensor_common__
#define __sensor_common__

#include <linux/delay.h>
#include <linux/fs.h>
#include <linux/i2c.h>
#include <linux/regmap.h>
#include <linux/clk.h>
#include <linux/regulator/consumer.h>
#include <linux/platform_device.h>
#include <linux/videodev2.h>

#include <linux/kernel.h>
#include <linux/debugfs.h>

#include <media/v4l2-device.h>
#include <media/v4l2-subdev.h>
#include <media/v4l2-ctrls.h>
#include <linux/v4l2-mediabus.h>
#include <media/tegra-v4l2-camera.h>
#include <uapi/media/camera_device.h>

struct sensor_properties {
	struct sensor_cfg cfg;
	/* sensor_modes points to an array of mode properties */
	struct sensor_mode_properties *sensor_modes;
	u32 num_modes;
};

int sensor_common_parse_num_modes(const struct device *dev);
int sensor_common_init_sensor_properties(
	struct device *dev, struct device_node *node,
	struct sensor_properties *sensor);

#endif /* __sensor_common__ */