Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 261597
b: refs/heads/master
c: 91c7953
h: refs/heads/master
i:
  261595: c3f9805
v: v3
  • Loading branch information
Guennadi Liakhovetski authored and Mauro Carvalho Chehab committed Jul 27, 2011
1 parent 9fe64e9 commit 631dd5e
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7a05dfeddee9ffc2405230759ef32ecb603e3f48
refs/heads/master: 91c7953005247c9563408bbdbf35e27de33e6ec3
63 changes: 63 additions & 0 deletions trunk/include/media/v4l2-mediabus.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,69 @@

#include <linux/v4l2-mediabus.h>

/* Parallel flags */
/*
* Can the client run in master or in slave mode. By "Master mode" an operation
* mode is meant, when the client (e.g., a camera sensor) is producing
* horizontal and vertical synchronisation. In "Slave mode" the host is
* providing these signals to the slave.
*/
#define V4L2_MBUS_MASTER (1 << 0)
#define V4L2_MBUS_SLAVE (1 << 1)
/* Which signal polarities it supports */
/* Note: in BT.656 mode HSYNC and VSYNC are unused */
#define V4L2_MBUS_HSYNC_ACTIVE_HIGH (1 << 2)
#define V4L2_MBUS_HSYNC_ACTIVE_LOW (1 << 3)
#define V4L2_MBUS_VSYNC_ACTIVE_HIGH (1 << 4)
#define V4L2_MBUS_VSYNC_ACTIVE_LOW (1 << 5)
#define V4L2_MBUS_PCLK_SAMPLE_RISING (1 << 6)
#define V4L2_MBUS_PCLK_SAMPLE_FALLING (1 << 7)
#define V4L2_MBUS_DATA_ACTIVE_HIGH (1 << 8)
#define V4L2_MBUS_DATA_ACTIVE_LOW (1 << 9)

/* Serial flags */
/* How many lanes the client can use */
#define V4L2_MBUS_CSI2_1_LANE (1 << 0)
#define V4L2_MBUS_CSI2_2_LANE (1 << 1)
#define V4L2_MBUS_CSI2_3_LANE (1 << 2)
#define V4L2_MBUS_CSI2_4_LANE (1 << 3)
/* On which channels it can send video data */
#define V4L2_MBUS_CSI2_CHANNEL_0 (1 << 4)
#define V4L2_MBUS_CSI2_CHANNEL_1 (1 << 5)
#define V4L2_MBUS_CSI2_CHANNEL_2 (1 << 6)
#define V4L2_MBUS_CSI2_CHANNEL_3 (1 << 7)
/* Does it support only continuous or also non-continuous clock mode */
#define V4L2_MBUS_CSI2_CONTINUOUS_CLOCK (1 << 8)
#define V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK (1 << 9)

#define V4L2_MBUS_CSI2_LANES (V4L2_MBUS_CSI2_1_LANE | V4L2_MBUS_CSI2_2_LANE | \
V4L2_MBUS_CSI2_3_LANE | V4L2_MBUS_CSI2_4_LANE)
#define V4L2_MBUS_CSI2_CHANNELS (V4L2_MBUS_CSI2_CHANNEL_0 | V4L2_MBUS_CSI2_CHANNEL_1 | \
V4L2_MBUS_CSI2_CHANNEL_2 | V4L2_MBUS_CSI2_CHANNEL_3)

/**
* v4l2_mbus_type - media bus type
* @V4L2_MBUS_PARALLEL: parallel interface with hsync and vsync
* @V4L2_MBUS_BT656: parallel interface with embedded synchronisation, can
* also be used for BT.1120
* @V4L2_MBUS_CSI2: MIPI CSI-2 serial interface
*/
enum v4l2_mbus_type {
V4L2_MBUS_PARALLEL,
V4L2_MBUS_BT656,
V4L2_MBUS_CSI2,
};

/**
* v4l2_mbus_config - media bus configuration
* @type: in: interface type
* @flags: in / out: configuration flags, depending on @type
*/
struct v4l2_mbus_config {
enum v4l2_mbus_type type;
unsigned int flags;
};

static inline void v4l2_fill_pix_format(struct v4l2_pix_format *pix_fmt,
const struct v4l2_mbus_framefmt *mbus_fmt)
{
Expand Down
10 changes: 10 additions & 0 deletions trunk/include/media/v4l2-subdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,12 @@ struct v4l2_subdev_audio_ops {
try_mbus_fmt: try to set a pixel format on a video data source
s_mbus_fmt: set a pixel format on a video data source
g_mbus_config: get supported mediabus configurations
s_mbus_config: set a certain mediabus configuration. This operation is added
for compatibility with soc-camera drivers and should not be used by new
software.
*/
struct v4l2_subdev_video_ops {
int (*s_routing)(struct v4l2_subdev *sd, u32 input, u32 output, u32 config);
Expand Down Expand Up @@ -310,6 +316,10 @@ struct v4l2_subdev_video_ops {
struct v4l2_mbus_framefmt *fmt);
int (*s_mbus_fmt)(struct v4l2_subdev *sd,
struct v4l2_mbus_framefmt *fmt);
int (*g_mbus_config)(struct v4l2_subdev *sd,
struct v4l2_mbus_config *cfg);
int (*s_mbus_config)(struct v4l2_subdev *sd,
const struct v4l2_mbus_config *cfg);
};

/*
Expand Down

0 comments on commit 631dd5e

Please sign in to comment.