Sylwester Nawrocki | b8d9834 | 2013-03-11 15:38:29 -0300 | [diff] [blame] | 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 | |
Sylwester Nawrocki | d265d9a | 2013-07-19 11:35:11 -0300 | [diff] [blame] | 16 | #include <linux/of.h> |
| 17 | #include <linux/types.h> |
Sylwester Nawrocki | b8d9834 | 2013-03-11 15:38:29 -0300 | [diff] [blame] | 18 | |
Sylwester Nawrocki | d265d9a | 2013-07-19 11:35:11 -0300 | [diff] [blame] | 19 | #define S5K6A3_OPEN_TIMEOUT 2000 /* ms */ |
Sylwester Nawrocki | b8d9834 | 2013-03-11 15:38:29 -0300 | [diff] [blame] | 20 | #define S5K6A3_SENSOR_WIDTH 1392 |
| 21 | #define S5K6A3_SENSOR_HEIGHT 1392 |
| 22 | |
Sylwester Nawrocki | b8d9834 | 2013-03-11 15:38:29 -0300 | [diff] [blame] | 23 | enum 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 | |
| 35 | struct sensor_drv_data { |
| 36 | enum fimc_is_sensor_id id; |
Sylwester Nawrocki | d265d9a | 2013-07-19 11:35:11 -0300 | [diff] [blame] | 37 | /* sensor open timeout in ms */ |
| 38 | unsigned short open_timeout; |
Sylwester Nawrocki | b8d9834 | 2013-03-11 15:38:29 -0300 | [diff] [blame] | 39 | }; |
| 40 | |
| 41 | /** |
| 42 | * struct fimc_is_sensor - fimc-is sensor data structure |
Sylwester Nawrocki | b8d9834 | 2013-03-11 15:38:29 -0300 | [diff] [blame] | 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 |
Sylwester Nawrocki | b8d9834 | 2013-03-11 15:38:29 -0300 | [diff] [blame] | 46 | */ |
| 47 | struct fimc_is_sensor { |
Sylwester Nawrocki | b8d9834 | 2013-03-11 15:38:29 -0300 | [diff] [blame] | 48 | const struct sensor_drv_data *drvdata; |
| 49 | unsigned int i2c_bus; |
Sylwester Nawrocki | d265d9a | 2013-07-19 11:35:11 -0300 | [diff] [blame] | 50 | u8 test_pattern; |
Sylwester Nawrocki | b8d9834 | 2013-03-11 15:38:29 -0300 | [diff] [blame] | 51 | }; |
| 52 | |
Sylwester Nawrocki | d265d9a | 2013-07-19 11:35:11 -0300 | [diff] [blame] | 53 | const struct sensor_drv_data *fimc_is_sensor_get_drvdata( |
| 54 | struct device_node *node); |
Sylwester Nawrocki | b8d9834 | 2013-03-11 15:38:29 -0300 | [diff] [blame] | 55 | |
| 56 | #endif /* FIMC_IS_SENSOR_H_ */ |