1/*
2 * Samsung EXYNOS4x12 FIMC-IS (Imaging Subsystem) driver
3 *
4 * Copyright (C) 2013 Samsung Electronics Co., Ltd.
5 *
6 * Authors:  Sylwester Nawrocki <s.nawrocki@samsung.com>
7 *	     Younghwan Joo <yhwan.joo@samsung.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13#ifndef FIMC_IS_SENSOR_H_
14#define FIMC_IS_SENSOR_H_
15
16#include <linux/of.h>
17#include <linux/types.h>
18
19#define S5K6A3_OPEN_TIMEOUT		2000 /* ms */
20#define S5K6A3_SENSOR_WIDTH		1392
21#define S5K6A3_SENSOR_HEIGHT		1392
22
23enum fimc_is_sensor_id {
24	FIMC_IS_SENSOR_ID_S5K3H2 = 1,
25	FIMC_IS_SENSOR_ID_S5K6A3,
26	FIMC_IS_SENSOR_ID_S5K4E5,
27	FIMC_IS_SENSOR_ID_S5K3H7,
28	FIMC_IS_SENSOR_ID_CUSTOM,
29	FIMC_IS_SENSOR_ID_END
30};
31
32#define IS_SENSOR_CTRL_BUS_I2C0		0
33#define IS_SENSOR_CTRL_BUS_I2C1		1
34
35struct sensor_drv_data {
36	enum fimc_is_sensor_id id;
37	/* sensor open timeout in ms */
38	unsigned short open_timeout;
39};
40
41/**
42 * struct fimc_is_sensor - fimc-is sensor data structure
43 * @drvdata: a pointer to the sensor's parameters data structure
44 * @i2c_bus: ISP I2C bus index (0...1)
45 * @test_pattern: true to enable video test pattern
46 */
47struct fimc_is_sensor {
48	const struct sensor_drv_data *drvdata;
49	unsigned int i2c_bus;
50	u8 test_pattern;
51};
52
53const struct sensor_drv_data *fimc_is_sensor_get_drvdata(
54				struct device_node *node);
55
56#endif /* FIMC_IS_SENSOR_H_ */
57