15 #include <linux/bitops.h>
16 #include <linux/device.h>
19 #include <linux/videodev2.h>
60 #define SOCAM_HOST_CAP_STRIDE (1 << 0)
84 struct soc_camera_format_xlate *);
111 #define SOCAM_SENSOR_INVERT_PCLK (1 << 0)
112 #define SOCAM_SENSOR_INVERT_MCLK (1 << 1)
113 #define SOCAM_SENSOR_INVERT_HSYNC (1 << 2)
114 #define SOCAM_SENSOR_INVERT_VSYNC (1 << 3)
115 #define SOCAM_SENSOR_INVERT_DATA (1 << 4)
167 static inline struct device *to_soc_camera_control(
173 static inline struct v4l2_subdev *soc_camera_to_subdev(
196 struct soc_camera_format_xlate {
201 #define SOCAM_SENSE_PCLK_CHANGED (1 << 0)
220 struct soc_camera_sense {
222 unsigned long master_clock;
223 unsigned long pixel_clock_max;
227 #define SOCAM_DATAWIDTH(x) BIT((x) - 1)
228 #define SOCAM_DATAWIDTH_4 SOCAM_DATAWIDTH(4)
229 #define SOCAM_DATAWIDTH_8 SOCAM_DATAWIDTH(8)
230 #define SOCAM_DATAWIDTH_9 SOCAM_DATAWIDTH(9)
231 #define SOCAM_DATAWIDTH_10 SOCAM_DATAWIDTH(10)
232 #define SOCAM_DATAWIDTH_15 SOCAM_DATAWIDTH(15)
233 #define SOCAM_DATAWIDTH_16 SOCAM_DATAWIDTH(16)
235 #define SOCAM_DATAWIDTH_MASK (SOCAM_DATAWIDTH_4 | SOCAM_DATAWIDTH_8 | \
236 SOCAM_DATAWIDTH_9 | SOCAM_DATAWIDTH_10 | \
237 SOCAM_DATAWIDTH_15 | SOCAM_DATAWIDTH_16)
239 static inline void soc_camera_limit_side(
int *
start,
int *
length,
240 unsigned int start_min,
241 unsigned int length_min,
unsigned int length_max)
243 if (*length < length_min)
244 *length = length_min;
245 else if (*length > length_max)
246 *length = length_max;
248 if (*start < start_min)
250 else if (*start > start_min + length_max - *length)
251 *start = start_min + length_max - *
length;
254 unsigned long soc_camera_apply_sensor_flags(
struct soc_camera_link *icl,
255 unsigned long flags);
262 static inline int soc_camera_set_power(
struct device *
dev,
270 #include <linux/i2c.h>
280 return client->
dev.platform_data;
286 return soc_camera_to_subdev(icd);