aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/exynos4-is/media-dev.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/platform/exynos4-is/media-dev.h')
-rw-r--r--drivers/media/platform/exynos4-is/media-dev.h32
1 files changed, 30 insertions, 2 deletions
diff --git a/drivers/media/platform/exynos4-is/media-dev.h b/drivers/media/platform/exynos4-is/media-dev.h
index 62599fd7756f..ee1e2519f728 100644
--- a/drivers/media/platform/exynos4-is/media-dev.h
+++ b/drivers/media/platform/exynos4-is/media-dev.h
@@ -10,6 +10,7 @@
10#define FIMC_MDEVICE_H_ 10#define FIMC_MDEVICE_H_
11 11
12#include <linux/clk.h> 12#include <linux/clk.h>
13#include <linux/clk-provider.h>
13#include <linux/platform_device.h> 14#include <linux/platform_device.h>
14#include <linux/mutex.h> 15#include <linux/mutex.h>
15#include <linux/of.h> 16#include <linux/of.h>
@@ -31,8 +32,9 @@
31 32
32#define PINCTRL_STATE_IDLE "idle" 33#define PINCTRL_STATE_IDLE "idle"
33 34
34#define FIMC_MAX_SENSORS 8 35#define FIMC_MAX_SENSORS 4
35#define FIMC_MAX_CAMCLKS 2 36#define FIMC_MAX_CAMCLKS 2
37#define DEFAULT_SENSOR_CLK_FREQ 24000000U
36 38
37/* LCD/ISP Writeback clocks (PIXELASYNCMx) */ 39/* LCD/ISP Writeback clocks (PIXELASYNCMx) */
38enum { 40enum {
@@ -78,6 +80,7 @@ struct fimc_camclk_info {
78/** 80/**
79 * struct fimc_sensor_info - image data source subdev information 81 * struct fimc_sensor_info - image data source subdev information
80 * @pdata: sensor's atrributes passed as media device's platform data 82 * @pdata: sensor's atrributes passed as media device's platform data
83 * @asd: asynchronous subdev registration data structure
81 * @subdev: image sensor v4l2 subdev 84 * @subdev: image sensor v4l2 subdev
82 * @host: fimc device the sensor is currently linked to 85 * @host: fimc device the sensor is currently linked to
83 * 86 *
@@ -85,10 +88,17 @@ struct fimc_camclk_info {
85 */ 88 */
86struct fimc_sensor_info { 89struct fimc_sensor_info {
87 struct fimc_source_info pdata; 90 struct fimc_source_info pdata;
91 struct v4l2_async_subdev asd;
88 struct v4l2_subdev *subdev; 92 struct v4l2_subdev *subdev;
89 struct fimc_dev *host; 93 struct fimc_dev *host;
90}; 94};
91 95
96struct cam_clk {
97 struct clk_hw hw;
98 struct fimc_md *fmd;
99};
100#define to_cam_clk(_hw) container_of(_hw, struct cam_clk, hw)
101
92/** 102/**
93 * struct fimc_md - fimc media device information 103 * struct fimc_md - fimc media device information
94 * @csis: MIPI CSIS subdevs data 104 * @csis: MIPI CSIS subdevs data
@@ -105,6 +115,7 @@ struct fimc_sensor_info {
105 * @pinctrl: camera port pinctrl handle 115 * @pinctrl: camera port pinctrl handle
106 * @state_default: pinctrl default state handle 116 * @state_default: pinctrl default state handle
107 * @state_idle: pinctrl idle state handle 117 * @state_idle: pinctrl idle state handle
118 * @cam_clk_provider: CAMCLK clock provider structure
108 * @user_subdev_api: true if subdevs are not configured by the host driver 119 * @user_subdev_api: true if subdevs are not configured by the host driver
109 * @slock: spinlock protecting @sensor array 120 * @slock: spinlock protecting @sensor array
110 */ 121 */
@@ -122,13 +133,25 @@ struct fimc_md {
122 struct media_device media_dev; 133 struct media_device media_dev;
123 struct v4l2_device v4l2_dev; 134 struct v4l2_device v4l2_dev;
124 struct platform_device *pdev; 135 struct platform_device *pdev;
136
125 struct fimc_pinctrl { 137 struct fimc_pinctrl {
126 struct pinctrl *pinctrl; 138 struct pinctrl *pinctrl;
127 struct pinctrl_state *state_default; 139 struct pinctrl_state *state_default;
128 struct pinctrl_state *state_idle; 140 struct pinctrl_state *state_idle;
129 } pinctl; 141 } pinctl;
130 bool user_subdev_api;
131 142
143 struct cam_clk_provider {
144 struct clk *clks[FIMC_MAX_CAMCLKS];
145 struct clk_onecell_data clk_data;
146 struct device_node *of_node;
147 struct cam_clk camclk[FIMC_MAX_CAMCLKS];
148 int num_clocks;
149 } clk_provider;
150
151 struct v4l2_async_notifier subdev_notifier;
152 struct v4l2_async_subdev *async_subdevs[FIMC_MAX_SENSORS];
153
154 bool user_subdev_api;
132 spinlock_t slock; 155 spinlock_t slock;
133 struct list_head pipelines; 156 struct list_head pipelines;
134}; 157};
@@ -145,6 +168,11 @@ static inline struct fimc_md *entity_to_fimc_mdev(struct media_entity *me)
145 container_of(me->parent, struct fimc_md, media_dev); 168 container_of(me->parent, struct fimc_md, media_dev);
146} 169}
147 170
171static inline struct fimc_md *notifier_to_fimc_md(struct v4l2_async_notifier *n)
172{
173 return container_of(n, struct fimc_md, subdev_notifier);
174}
175
148static inline void fimc_md_graph_lock(struct exynos_video_entity *ve) 176static inline void fimc_md_graph_lock(struct exynos_video_entity *ve)
149{ 177{
150 mutex_lock(&ve->vdev.entity.parent->graph_mutex); 178 mutex_lock(&ve->vdev.entity.parent->graph_mutex);