aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/exynos4-is/fimc-is-sensor.h
diff options
context:
space:
mode:
authorSylwester Nawrocki <s.nawrocki@samsung.com>2013-03-11 14:38:29 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-04-04 19:14:01 -0400
commitb8d9834a1258460311a7b318cd851eb323dd63cd (patch)
tree387f867c1694c260806862a33e48a467678c568c /drivers/media/platform/exynos4-is/fimc-is-sensor.h
parent294781db46155b8a64976649567538ada91131f8 (diff)
[media] exynos4-is: Add common FIMC-IS image sensor driver
This patch adds a common image sensor driver and Makefile/Kconfig to enable compilation of the whole IS driver. The sensor subdev driver currently only handles an image sensor's power supplies and reset signal. There is no I2C communication as it is handled by the ISP's firmware. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/platform/exynos4-is/fimc-is-sensor.h')
-rw-r--r--drivers/media/platform/exynos4-is/fimc-is-sensor.h83
1 files changed, 83 insertions, 0 deletions
diff --git a/drivers/media/platform/exynos4-is/fimc-is-sensor.h b/drivers/media/platform/exynos4-is/fimc-is-sensor.h
new file mode 100644
index 000000000000..50b8e4d59d62
--- /dev/null
+++ b/drivers/media/platform/exynos4-is/fimc-is-sensor.h
@@ -0,0 +1,83 @@
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/clk.h>
17#include <linux/device.h>
18#include <linux/kernel.h>
19#include <linux/platform_device.h>
20#include <linux/regulator/consumer.h>
21#include <linux/videodev2.h>
22#include <media/v4l2-subdev.h>
23
24#define FIMC_IS_SENSOR_OPEN_TIMEOUT 2000 /* ms */
25
26#define FIMC_IS_SENSOR_DEF_PIX_WIDTH 1296
27#define FIMC_IS_SENSOR_DEF_PIX_HEIGHT 732
28
29#define S5K6A3_SENSOR_WIDTH 1392
30#define S5K6A3_SENSOR_HEIGHT 1392
31
32#define SENSOR_NUM_SUPPLIES 2
33
34enum fimc_is_sensor_id {
35 FIMC_IS_SENSOR_ID_S5K3H2 = 1,
36 FIMC_IS_SENSOR_ID_S5K6A3,
37 FIMC_IS_SENSOR_ID_S5K4E5,
38 FIMC_IS_SENSOR_ID_S5K3H7,
39 FIMC_IS_SENSOR_ID_CUSTOM,
40 FIMC_IS_SENSOR_ID_END
41};
42
43#define IS_SENSOR_CTRL_BUS_I2C0 0
44#define IS_SENSOR_CTRL_BUS_I2C1 1
45
46struct sensor_drv_data {
47 enum fimc_is_sensor_id id;
48 const char * const subdev_name;
49 unsigned int width;
50 unsigned int height;
51};
52
53/**
54 * struct fimc_is_sensor - fimc-is sensor data structure
55 * @dev: pointer to this I2C client device structure
56 * @subdev: the image sensor's v4l2 subdev
57 * @pad: subdev media source pad
58 * @supplies: image sensor's voltage regulator supplies
59 * @gpio_reset: GPIO connected to the sensor's reset pin
60 * @drvdata: a pointer to the sensor's parameters data structure
61 * @i2c_bus: ISP I2C bus index (0...1)
62 * @test_pattern: true to enable video test pattern
63 * @lock: mutex protecting the structure's members below
64 * @format: media bus format at the sensor's source pad
65 */
66struct fimc_is_sensor {
67 struct device *dev;
68 struct v4l2_subdev subdev;
69 struct media_pad pad;
70 struct regulator_bulk_data supplies[SENSOR_NUM_SUPPLIES];
71 int gpio_reset;
72 const struct sensor_drv_data *drvdata;
73 unsigned int i2c_bus;
74 bool test_pattern;
75
76 struct mutex lock;
77 struct v4l2_mbus_framefmt format;
78};
79
80int fimc_is_register_sensor_driver(void);
81void fimc_is_unregister_sensor_driver(void);
82
83#endif /* FIMC_IS_SENSOR_H_ */