aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2011-07-28 17:42:57 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-11-03 16:28:18 -0400
commitd839fe17a13562897e52e29c13d09ac0435dee85 (patch)
tree43160915e5a31e06b0d2ae6161cc423ba496285a
parent5476ea8d67b9e2b258c1c9ce6620e69bf13ecf0f (diff)
[media] V4L: soc-camera: remove soc-camera client bus-param operations and supporting code
soc-camera has been completely ported over to V4L2 subdevice mbus-config operations, soc-camera client bus-param operations and supporting code can now be removed. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/video/soc_camera.c34
-rw-r--r--include/media/soc_camera.h52
2 files changed, 8 insertions, 78 deletions
diff --git a/drivers/media/video/soc_camera.c b/drivers/media/video/soc_camera.c
index e05d1c7fee8d..ac23916552db 100644
--- a/drivers/media/video/soc_camera.c
+++ b/drivers/media/video/soc_camera.c
@@ -141,40 +141,6 @@ unsigned long soc_camera_apply_board_flags(struct soc_camera_link *icl,
141} 141}
142EXPORT_SYMBOL(soc_camera_apply_board_flags); 142EXPORT_SYMBOL(soc_camera_apply_board_flags);
143 143
144/**
145 * soc_camera_apply_sensor_flags() - apply platform SOCAM_SENSOR_INVERT_* flags
146 * @icl: camera platform parameters
147 * @flags: flags to be inverted according to platform configuration
148 * @return: resulting flags
149 */
150unsigned long soc_camera_apply_sensor_flags(struct soc_camera_link *icl,
151 unsigned long flags)
152{
153 unsigned long f;
154
155 /* If only one of the two polarities is supported, switch to the opposite */
156 if (icl->flags & SOCAM_SENSOR_INVERT_HSYNC) {
157 f = flags & (SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_HSYNC_ACTIVE_LOW);
158 if (f == SOCAM_HSYNC_ACTIVE_HIGH || f == SOCAM_HSYNC_ACTIVE_LOW)
159 flags ^= SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_HSYNC_ACTIVE_LOW;
160 }
161
162 if (icl->flags & SOCAM_SENSOR_INVERT_VSYNC) {
163 f = flags & (SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_LOW);
164 if (f == SOCAM_VSYNC_ACTIVE_HIGH || f == SOCAM_VSYNC_ACTIVE_LOW)
165 flags ^= SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_LOW;
166 }
167
168 if (icl->flags & SOCAM_SENSOR_INVERT_PCLK) {
169 f = flags & (SOCAM_PCLK_SAMPLE_RISING | SOCAM_PCLK_SAMPLE_FALLING);
170 if (f == SOCAM_PCLK_SAMPLE_RISING || f == SOCAM_PCLK_SAMPLE_FALLING)
171 flags ^= SOCAM_PCLK_SAMPLE_RISING | SOCAM_PCLK_SAMPLE_FALLING;
172 }
173
174 return flags;
175}
176EXPORT_SYMBOL(soc_camera_apply_sensor_flags);
177
178#define pixfmtstr(x) (x) & 0xff, ((x) >> 8) & 0xff, ((x) >> 16) & 0xff, \ 144#define pixfmtstr(x) (x) & 0xff, ((x) >> 8) & 0xff, ((x) >> 16) & 0xff, \
179 ((x) >> 24) & 0xff 145 ((x) >> 24) & 0xff
180 146
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h
index 73337cff85a3..1864e2242d45 100644
--- a/include/media/soc_camera.h
+++ b/include/media/soc_camera.h
@@ -12,6 +12,7 @@
12#ifndef SOC_CAMERA_H 12#ifndef SOC_CAMERA_H
13#define SOC_CAMERA_H 13#define SOC_CAMERA_H
14 14
15#include <linux/bitops.h>
15#include <linux/device.h> 16#include <linux/device.h>
16#include <linux/mutex.h> 17#include <linux/mutex.h>
17#include <linux/pm.h> 18#include <linux/pm.h>
@@ -194,8 +195,6 @@ struct soc_camera_format_xlate {
194}; 195};
195 196
196struct soc_camera_ops { 197struct soc_camera_ops {
197 unsigned long (*query_bus_param)(struct soc_camera_device *);
198 int (*set_bus_param)(struct soc_camera_device *, unsigned long);
199 const struct v4l2_queryctrl *controls; 198 const struct v4l2_queryctrl *controls;
200 int num_controls; 199 int num_controls;
201}; 200};
@@ -238,53 +237,18 @@ static inline struct v4l2_queryctrl const *soc_camera_find_qctrl(
238 return NULL; 237 return NULL;
239} 238}
240 239
241#define SOCAM_MASTER (1 << 0) 240#define SOCAM_DATAWIDTH(x) BIT((x) - 1)
242#define SOCAM_SLAVE (1 << 1) 241#define SOCAM_DATAWIDTH_4 SOCAM_DATAWIDTH(4)
243#define SOCAM_HSYNC_ACTIVE_HIGH (1 << 2) 242#define SOCAM_DATAWIDTH_8 SOCAM_DATAWIDTH(8)
244#define SOCAM_HSYNC_ACTIVE_LOW (1 << 6) 243#define SOCAM_DATAWIDTH_9 SOCAM_DATAWIDTH(9)
245#define SOCAM_VSYNC_ACTIVE_HIGH (1 << 4) 244#define SOCAM_DATAWIDTH_10 SOCAM_DATAWIDTH(10)
246#define SOCAM_VSYNC_ACTIVE_LOW (1 << 5) 245#define SOCAM_DATAWIDTH_15 SOCAM_DATAWIDTH(15)
247#define SOCAM_DATAWIDTH_4 (1 << 3) 246#define SOCAM_DATAWIDTH_16 SOCAM_DATAWIDTH(16)
248#define SOCAM_DATAWIDTH_8 (1 << 7)
249#define SOCAM_DATAWIDTH_9 (1 << 8)
250#define SOCAM_DATAWIDTH_10 (1 << 9)
251#define SOCAM_DATAWIDTH_15 (1 << 14)
252#define SOCAM_DATAWIDTH_16 (1 << 15)
253#define SOCAM_PCLK_SAMPLE_RISING (1 << 12)
254#define SOCAM_PCLK_SAMPLE_FALLING (1 << 13)
255#define SOCAM_DATA_ACTIVE_HIGH (1 << 10)
256#define SOCAM_DATA_ACTIVE_LOW (1 << 11)
257#define SOCAM_MIPI_1LANE (1 << 16)
258#define SOCAM_MIPI_2LANE (1 << 17)
259#define SOCAM_MIPI_3LANE (1 << 18)
260#define SOCAM_MIPI_4LANE (1 << 19)
261#define SOCAM_MIPI (SOCAM_MIPI_1LANE | SOCAM_MIPI_2LANE | \
262 SOCAM_MIPI_3LANE | SOCAM_MIPI_4LANE)
263 247
264#define SOCAM_DATAWIDTH_MASK (SOCAM_DATAWIDTH_4 | SOCAM_DATAWIDTH_8 | \ 248#define SOCAM_DATAWIDTH_MASK (SOCAM_DATAWIDTH_4 | SOCAM_DATAWIDTH_8 | \
265 SOCAM_DATAWIDTH_9 | SOCAM_DATAWIDTH_10 | \ 249 SOCAM_DATAWIDTH_9 | SOCAM_DATAWIDTH_10 | \
266 SOCAM_DATAWIDTH_15 | SOCAM_DATAWIDTH_16) 250 SOCAM_DATAWIDTH_15 | SOCAM_DATAWIDTH_16)
267 251
268static inline unsigned long soc_camera_bus_param_compatible(
269 unsigned long camera_flags, unsigned long bus_flags)
270{
271 unsigned long common_flags, hsync, vsync, pclk, data, buswidth, mode;
272 unsigned long mipi;
273
274 common_flags = camera_flags & bus_flags;
275
276 hsync = common_flags & (SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_HSYNC_ACTIVE_LOW);
277 vsync = common_flags & (SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_LOW);
278 pclk = common_flags & (SOCAM_PCLK_SAMPLE_RISING | SOCAM_PCLK_SAMPLE_FALLING);
279 data = common_flags & (SOCAM_DATA_ACTIVE_HIGH | SOCAM_DATA_ACTIVE_LOW);
280 mode = common_flags & (SOCAM_MASTER | SOCAM_SLAVE);
281 buswidth = common_flags & SOCAM_DATAWIDTH_MASK;
282 mipi = common_flags & SOCAM_MIPI;
283
284 return ((!hsync || !vsync || !pclk || !data || !mode || !buswidth) && !mipi) ? 0 :
285 common_flags;
286}
287
288static inline void soc_camera_limit_side(int *start, int *length, 252static inline void soc_camera_limit_side(int *start, int *length,
289 unsigned int start_min, 253 unsigned int start_min,
290 unsigned int length_min, unsigned int length_max) 254 unsigned int length_min, unsigned int length_max)