From 8d009a0c41475a482aca17d2a9fc8e6965f2fdf9 Mon Sep 17 00:00:00 2001 From: Davide Ferri Date: Tue, 23 Jun 2009 22:34:06 -0300 Subject: [media] dib0700: add initial code for PCTV 340e by Davide Ferri This is initial code written by Davide Ferri for the PCTV 340e, including a new xc4000 driver. I am checking in all the code unmodified, and making no assertions about its quality (other than confirming it compiles). [mchehab@redhat.com: rebased on the top of the current tree] Signed-off-by: Devin Heitmueller Signed-off-by: Davide Ferri Cc: Patrick Boettcher Signed-off-by: Mauro Carvalho Chehab --- include/media/tuner.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/media') diff --git a/include/media/tuner.h b/include/media/tuner.h index 963e334..89c290b 100644 --- a/include/media/tuner.h +++ b/include/media/tuner.h @@ -127,6 +127,8 @@ #define TUNER_PHILIPS_FMD1216MEX_MK3 78 #define TUNER_PHILIPS_FM1216MK5 79 #define TUNER_PHILIPS_FQ1216LME_MK3 80 /* Active loopthrough, no FM */ +#define TUNER_XC4000 81 /* Xceive Silicon Tuner */ + #define TUNER_PARTSNIC_PTI_5NF05 81 #define TUNER_PHILIPS_CU1216L 82 #define TUNER_NXP_TDA18271 83 -- cgit v1.1 From 5588dc2b025fd8b2188142b8d59efe562bd57d80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20H=C3=A4rdeman?= Date: Thu, 28 Apr 2011 12:13:58 -0300 Subject: [media] rc-core: lirc use unsigned int MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Durations can never be negative, so it makes sense to consistently use unsigned int for LIRC transmission. Contrary to the initial impression, this shouldn't actually change the userspace API. Signed-off-by: David Härdeman Signed-off-by: Mauro Carvalho Chehab --- include/media/rc-core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/media') diff --git a/include/media/rc-core.h b/include/media/rc-core.h index 60536c7..b1f19b7 100644 --- a/include/media/rc-core.h +++ b/include/media/rc-core.h @@ -117,7 +117,7 @@ struct rc_dev { int (*s_tx_carrier)(struct rc_dev *dev, u32 carrier); int (*s_tx_duty_cycle)(struct rc_dev *dev, u32 duty_cycle); int (*s_rx_carrier_range)(struct rc_dev *dev, u32 min, u32 max); - int (*tx_ir)(struct rc_dev *dev, int *txbuf, u32 n); + int (*tx_ir)(struct rc_dev *dev, unsigned *txbuf, unsigned n); void (*s_idle)(struct rc_dev *dev, bool enable); int (*s_learning_mode)(struct rc_dev *dev, int enable); int (*s_carrier_report) (struct rc_dev *dev, int enable); -- cgit v1.1 From f8fc729870ee82662ae6e3a713d59b2fbf3b04c6 Mon Sep 17 00:00:00 2001 From: Jonathan Corbet Date: Sat, 11 Jun 2011 17:46:42 +0000 Subject: [media] marvell-cam: Move cafe-ccic into its own directory This driver will soon become a family of drivers, so let's give it its own place to live. This move requires putting ov7670.h into include/media, but there are no code changes. Cc: Daniel Drake Signed-off-by: Jonathan Corbet Signed-off-by: Mauro Carvalho Chehab --- include/media/ov7670.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 include/media/ov7670.h (limited to 'include/media') diff --git a/include/media/ov7670.h b/include/media/ov7670.h new file mode 100644 index 0000000..b133bc1 --- /dev/null +++ b/include/media/ov7670.h @@ -0,0 +1,20 @@ +/* + * A V4L2 driver for OmniVision OV7670 cameras. + * + * Copyright 2010 One Laptop Per Child + * + * This file may be distributed under the terms of the GNU General + * Public License, version 2. + */ + +#ifndef __OV7670_H +#define __OV7670_H + +struct ov7670_config { + int min_width; /* Filter out smaller sizes */ + int min_height; /* Filter out smaller sizes */ + int clock_speed; /* External clock speed (MHz) */ + bool use_smbus; /* Use smbus I/O instead of I2C */ +}; + +#endif -- cgit v1.1 From 67a8dbbc4e04cd256987b189352472a59aff73be Mon Sep 17 00:00:00 2001 From: Jonathan Corbet Date: Sat, 11 Jun 2011 14:46:49 -0300 Subject: [media] marvell-cam: Basic working MMP camera driver Now we have a camera working over the marvell cam controller core. It works like the cafe driver and has all the same limitations, contiguous DMA only being one of them. But it's a start. Signed-off-by: Jonathan Corbet Signed-off-by: Mauro Carvalho Chehab --- include/media/mmp-camera.h | 9 +++++++++ include/media/v4l2-chip-ident.h | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 include/media/mmp-camera.h (limited to 'include/media') diff --git a/include/media/mmp-camera.h b/include/media/mmp-camera.h new file mode 100644 index 0000000..7611963 --- /dev/null +++ b/include/media/mmp-camera.h @@ -0,0 +1,9 @@ +/* + * Information for the Marvell Armada MMP camera + */ + +struct mmp_camera_platform_data { + struct platform_device *i2c_device; + int sensor_power_gpio; + int sensor_reset_gpio; +}; diff --git a/include/media/v4l2-chip-ident.h b/include/media/v4l2-chip-ident.h index b3edb67..8717045 100644 --- a/include/media/v4l2-chip-ident.h +++ b/include/media/v4l2-chip-ident.h @@ -185,8 +185,9 @@ enum { /* module wm8775: just ident 8775 */ V4L2_IDENT_WM8775 = 8775, - /* module cafe_ccic, just ident 8801 */ + /* Marvell controllers starting at 8801 */ V4L2_IDENT_CAFE = 8801, + V4L2_IDENT_ARMADA610 = 8802, /* AKM AK8813/AK8814 */ V4L2_IDENT_AK8813 = 8813, -- cgit v1.1 From 9cd49719fda38613e9d7c712b11a54ea4ea005dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20R=C3=83=C6=92=C3=86=E2=80=99=C3=83=E2=80=9A?= =?UTF-8?q?=C3=82=C2=B6jfors?= Date: Fri, 10 Jun 2011 11:48:48 -0300 Subject: [media] radio-timb: Simplified platform data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch simplifies the platform data slightly, by removing unused elements. Signed-off-by: Richard Röjfors Signed-off-by: Mauro Carvalho Chehab --- include/media/timb_radio.h | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'include/media') diff --git a/include/media/timb_radio.h b/include/media/timb_radio.h index a59a848..a40a6a3 100644 --- a/include/media/timb_radio.h +++ b/include/media/timb_radio.h @@ -23,13 +23,8 @@ struct timb_radio_platform_data { int i2c_adapter; /* I2C adapter where the tuner and dsp are attached */ - struct { - struct i2c_board_info *info; - } tuner; - struct { - const char *module_name; - struct i2c_board_info *info; - } dsp; + struct i2c_board_info *tuner; + struct i2c_board_info *dsp; }; #endif -- cgit v1.1 From a2c25b444e99f2369b29e507568c8703186174d0 Mon Sep 17 00:00:00 2001 From: Manjunath Hadli Date: Fri, 17 Jun 2011 04:01:31 -0300 Subject: [media] davinci vpbe: V4L2 display driver for DM644X SoC This is the display driver for Texas Instruments's DM644X family SoC. This patch contains the main implementation of the driver with the V4L2 interface. The driver implements the streaming model with support for both kernel allocated buffers and user pointers. It also implements all of the necessary IOCTLs necessary and supported by the video display device. Signed-off-by: Manjunath Hadli Acked-by: Muralidharan Karicheri Acked-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- include/media/davinci/vpbe_display.h | 147 +++++++++++++++++++++++++++++++++++ include/media/davinci/vpbe_types.h | 91 ++++++++++++++++++++++ 2 files changed, 238 insertions(+) create mode 100644 include/media/davinci/vpbe_display.h create mode 100644 include/media/davinci/vpbe_types.h (limited to 'include/media') diff --git a/include/media/davinci/vpbe_display.h b/include/media/davinci/vpbe_display.h new file mode 100644 index 0000000..dbf6b37 --- /dev/null +++ b/include/media/davinci/vpbe_display.h @@ -0,0 +1,147 @@ +/* + * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/ + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation version 2. + * + * This program is distributed WITHOUT ANY WARRANTY of any + * kind, whether express or implied; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ +#ifndef VPBE_DISPLAY_H +#define VPBE_DISPLAY_H + +/* Header files */ +#include +#include +#include +#include +#include +#include + +#define VPBE_DISPLAY_MAX_DEVICES 2 + +enum vpbe_display_device_id { + VPBE_DISPLAY_DEVICE_0, + VPBE_DISPLAY_DEVICE_1 +}; + +#define VPBE_DISPLAY_DRV_NAME "vpbe-display" + +#define VPBE_DISPLAY_MAJOR_RELEASE 1 +#define VPBE_DISPLAY_MINOR_RELEASE 0 +#define VPBE_DISPLAY_BUILD 1 +#define VPBE_DISPLAY_VERSION_CODE ((VPBE_DISPLAY_MAJOR_RELEASE << 16) | \ + (VPBE_DISPLAY_MINOR_RELEASE << 8) | \ + VPBE_DISPLAY_BUILD) + +#define VPBE_DISPLAY_VALID_FIELD(field) ((V4L2_FIELD_NONE == field) || \ + (V4L2_FIELD_ANY == field) || (V4L2_FIELD_INTERLACED == field)) + +/* Exp ratio numerator and denominator constants */ +#define VPBE_DISPLAY_H_EXP_RATIO_N 9 +#define VPBE_DISPLAY_H_EXP_RATIO_D 8 +#define VPBE_DISPLAY_V_EXP_RATIO_N 6 +#define VPBE_DISPLAY_V_EXP_RATIO_D 5 + +/* Zoom multiplication factor */ +#define VPBE_DISPLAY_ZOOM_4X 4 +#define VPBE_DISPLAY_ZOOM_2X 2 + +/* Structures */ +struct display_layer_info { + int enable; + /* Layer ID used by Display Manager */ + enum osd_layer id; + struct osd_layer_config config; + enum osd_zoom_factor h_zoom; + enum osd_zoom_factor v_zoom; + enum osd_h_exp_ratio h_exp; + enum osd_v_exp_ratio v_exp; +}; + +/* vpbe display object structure */ +struct vpbe_layer { + /* number of buffers in fbuffers */ + unsigned int numbuffers; + /* Pointer to the vpbe_display */ + struct vpbe_display *disp_dev; + /* Pointer pointing to current v4l2_buffer */ + struct videobuf_buffer *cur_frm; + /* Pointer pointing to next v4l2_buffer */ + struct videobuf_buffer *next_frm; + /* videobuf specific parameters + * Buffer queue used in video-buf + */ + struct videobuf_queue buffer_queue; + /* Queue of filled frames */ + struct list_head dma_queue; + /* Used in video-buf */ + spinlock_t irqlock; + /* V4l2 specific parameters */ + /* Identifies video device for this layer */ + struct video_device video_dev; + /* This field keeps track of type of buffer exchange mechanism user + * has selected + */ + enum v4l2_memory memory; + /* Used to keep track of state of the priority */ + struct v4l2_prio_state prio; + /* Used to store pixel format */ + struct v4l2_pix_format pix_fmt; + enum v4l2_field buf_field; + /* Video layer configuration params */ + struct display_layer_info layer_info; + /* vpbe specific parameters + * enable window for display + */ + unsigned char window_enable; + /* number of open instances of the layer */ + unsigned int usrs; + /* number of users performing IO */ + unsigned int io_usrs; + /* Indicates id of the field which is being displayed */ + unsigned int field_id; + /* Indicates whether streaming started */ + unsigned char started; + /* Identifies device object */ + enum vpbe_display_device_id device_id; + /* facilitation of ioctl ops lock by v4l2*/ + struct mutex opslock; + u8 layer_first_int; +}; + +/* vpbe device structure */ +struct vpbe_display { + /* layer specific parameters */ + /* lock for isr updates to buf layers*/ + spinlock_t dma_queue_lock; + /* C-Plane offset from start of y-plane */ + unsigned int cbcr_ofst; + struct vpbe_layer *dev[VPBE_DISPLAY_MAX_DEVICES]; + struct vpbe_device *vpbe_dev; + struct osd_state *osd_device; +}; + +/* File handle structure */ +struct vpbe_fh { + /* vpbe device structure */ + struct vpbe_display *disp_dev; + /* pointer to layer object for opened device */ + struct vpbe_layer *layer; + /* Indicates whether this file handle is doing IO */ + unsigned char io_allowed; + /* Used to keep track priority of this instance */ + enum v4l2_priority prio; +}; + +struct buf_config_params { + unsigned char min_numbuffers; + unsigned char numbuffers[VPBE_DISPLAY_MAX_DEVICES]; + unsigned int min_bufsize[VPBE_DISPLAY_MAX_DEVICES]; + unsigned int layer_bufsize[VPBE_DISPLAY_MAX_DEVICES]; +}; + +#endif /* VPBE_DISPLAY_H */ diff --git a/include/media/davinci/vpbe_types.h b/include/media/davinci/vpbe_types.h new file mode 100644 index 0000000..727f551 --- /dev/null +++ b/include/media/davinci/vpbe_types.h @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2010 Texas Instruments Inc + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation version 2. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef _VPBE_TYPES_H +#define _VPBE_TYPES_H + +enum vpbe_version { + VPBE_VERSION_1 = 1, + VPBE_VERSION_2, + VPBE_VERSION_3, +}; + +/* vpbe_timing_type - Timing types used in vpbe device */ +enum vpbe_enc_timings_type { + VPBE_ENC_STD = 0x1, + VPBE_ENC_DV_PRESET = 0x2, + VPBE_ENC_CUSTOM_TIMINGS = 0x4, + /* Used when set timings through FB device interface */ + VPBE_ENC_TIMINGS_INVALID = 0x8, +}; + +union vpbe_timings { + v4l2_std_id std_id; + unsigned int dv_preset; +}; + +/* + * struct vpbe_enc_mode_info + * @name: ptr to name string of the standard, "NTSC", "PAL" etc + * @std: standard or non-standard mode. 1 - standard, 0 - nonstandard + * @interlaced: 1 - interlaced, 0 - non interlaced/progressive + * @xres: x or horizontal resolution of the display + * @yres: y or vertical resolution of the display + * @fps: frame per second + * @left_margin: left margin of the display + * @right_margin: right margin of the display + * @upper_margin: upper margin of the display + * @lower_margin: lower margin of the display + * @hsync_len: h-sync length + * @vsync_len: v-sync length + * @flags: bit field: bit usage is documented below + * + * Description: + * Structure holding timing and resolution information of a standard. + * Used by vpbe_device to set required non-standard timing in the + * venc when lcd controller output is connected to a external encoder. + * A table of timings is maintained in vpbe device to set this in + * venc when external encoder is connected to lcd controller output. + * Encoder may provide a g_dv_timings() API to override these values + * as needed. + * + * Notes + * ------ + * if_type should be used only by encoder manager and encoder. + * flags usage + * b0 (LSB) - hsync polarity, 0 - negative, 1 - positive + * b1 - vsync polarity, 0 - negative, 1 - positive + * b2 - field id polarity, 0 - negative, 1 - positive + */ +struct vpbe_enc_mode_info { + unsigned char *name; + enum vpbe_enc_timings_type timings_type; + union vpbe_timings timings; + unsigned int interlaced; + unsigned int xres; + unsigned int yres; + struct v4l2_fract aspect; + struct v4l2_fract fps; + unsigned int left_margin; + unsigned int right_margin; + unsigned int upper_margin; + unsigned int lower_margin; + unsigned int hsync_len; + unsigned int vsync_len; + unsigned int flags; +}; + +#endif -- cgit v1.1 From 66715cdc3224a4e241c1a92856b9a4af3b70e06d Mon Sep 17 00:00:00 2001 From: Manjunath Hadli Date: Fri, 17 Jun 2011 04:01:32 -0300 Subject: [media] davinci vpbe: VPBE display driver This patch implements the core functionality of the display driver, mainly controlling the VENC and other encoders, and acting as the one point interface for the main V4L2 driver. This implements the core of each of the V4L2 IOCTLs. Signed-off-by: Manjunath Hadli Acked-by: Muralidharan Karicheri Acked-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- include/media/davinci/vpbe.h | 184 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 184 insertions(+) create mode 100644 include/media/davinci/vpbe.h (limited to 'include/media') diff --git a/include/media/davinci/vpbe.h b/include/media/davinci/vpbe.h new file mode 100644 index 0000000..8b11fb0 --- /dev/null +++ b/include/media/davinci/vpbe.h @@ -0,0 +1,184 @@ +/* + * Copyright (C) 2010 Texas Instruments Inc + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation version 2. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef _VPBE_H +#define _VPBE_H + +#include +#include + +#include +#include +#include +#include +#include +#include + +/* OSD configuration info */ +struct osd_config_info { + char module_name[32]; +}; + +struct vpbe_output { + struct v4l2_output output; + /* + * If output capabilities include dv_preset, list supported presets + * below + */ + char *subdev_name; + /* + * defualt_mode identifies the default timings set at the venc or + * external encoder. + */ + char *default_mode; + /* + * Fields below are used for supporting multiple modes. For example, + * LCD panel might support different modes and they are listed here. + * Similarly for supporting external encoders, lcd controller port + * requires a set of non-standard timing values to be listed here for + * each supported mode since venc is used in non-standard timing mode + * for interfacing with external encoder similar to configuring lcd + * panel timings + */ + unsigned int num_modes; + struct vpbe_enc_mode_info *modes; + /* + * Bus configuration goes here for external encoders. Some encoders + * may require multiple interface types for each of the output. For + * example, SD modes would use YCC8 where as HD mode would use YCC16. + * Not sure if this is needed on a per mode basis instead of per + * output basis. If per mode is needed, we may have to move this to + * mode_info structure + */ +}; + +/* encoder configuration info */ +struct encoder_config_info { + char module_name[32]; + /* Is this an i2c device ? */ + unsigned int is_i2c:1; + /* i2c subdevice board info */ + struct i2c_board_info board_info; +}; + +/* structure for defining vpbe display subsystem components */ +struct vpbe_config { + char module_name[32]; + /* i2c bus adapter no */ + int i2c_adapter_id; + struct osd_config_info osd; + struct encoder_config_info venc; + /* external encoder information goes here */ + int num_ext_encoders; + struct encoder_config_info *ext_encoders; + int num_outputs; + /* Order is venc outputs followed by LCD and then external encoders */ + struct vpbe_output *outputs; +}; + +struct vpbe_device; + +struct vpbe_device_ops { + /* crop cap for the display */ + int (*g_cropcap)(struct vpbe_device *vpbe_dev, + struct v4l2_cropcap *cropcap); + + /* Enumerate the outputs */ + int (*enum_outputs)(struct vpbe_device *vpbe_dev, + struct v4l2_output *output); + + /* Set output to the given index */ + int (*set_output)(struct vpbe_device *vpbe_dev, + int index); + + /* Get current output */ + unsigned int (*get_output)(struct vpbe_device *vpbe_dev); + + /* Set DV preset at current output */ + int (*s_dv_preset)(struct vpbe_device *vpbe_dev, + struct v4l2_dv_preset *dv_preset); + + /* Get DV presets supported at the output */ + int (*g_dv_preset)(struct vpbe_device *vpbe_dev, + struct v4l2_dv_preset *dv_preset); + + /* Enumerate the DV Presets supported at the output */ + int (*enum_dv_presets)(struct vpbe_device *vpbe_dev, + struct v4l2_dv_enum_preset *preset_info); + + /* Set std at the output */ + int (*s_std)(struct vpbe_device *vpbe_dev, v4l2_std_id *std_id); + + /* Get the current std at the output */ + int (*g_std)(struct vpbe_device *vpbe_dev, v4l2_std_id *std_id); + + /* initialize the device */ + int (*initialize)(struct device *dev, struct vpbe_device *vpbe_dev); + + /* De-initialize the device */ + void (*deinitialize)(struct device *dev, struct vpbe_device *vpbe_dev); + + /* Get the current mode info */ + int (*get_mode_info)(struct vpbe_device *vpbe_dev, + struct vpbe_enc_mode_info*); + + /* + * Set the current mode in the encoder. Alternate way of setting + * standard or DV preset or custom timings in the encoder + */ + int (*set_mode)(struct vpbe_device *vpbe_dev, + struct vpbe_enc_mode_info*); + /* Power management operations */ + int (*suspend)(struct vpbe_device *vpbe_dev); + int (*resume)(struct vpbe_device *vpbe_dev); +}; + +/* struct for vpbe device */ +struct vpbe_device { + /* V4l2 device */ + struct v4l2_device v4l2_dev; + /* vpbe dispay controller cfg */ + struct vpbe_config *cfg; + /* parent device */ + struct device *pdev; + /* external encoder v4l2 sub devices */ + struct v4l2_subdev **encoders; + /* current encoder index */ + int current_sd_index; + struct mutex lock; + /* device initialized */ + int initialized; + /* vpbe dac clock */ + struct clk *dac_clk; + /* osd_device pointer */ + struct osd_state *osd_device; + /* + * fields below are accessed by users of vpbe_device. Not the + * ones above + */ + + /* current output */ + int current_out_index; + /* lock used by caller to do atomic operation on vpbe device */ + /* current timings set in the controller */ + struct vpbe_enc_mode_info current_timings; + /* venc sub device */ + struct v4l2_subdev *venc; + /* device operations below */ + struct vpbe_device_ops ops; +}; + +#endif -- cgit v1.1 From ff0f23dd0edf4a5bd5fa3ee0eda71d8a1c8201d4 Mon Sep 17 00:00:00 2001 From: Manjunath Hadli Date: Fri, 17 Jun 2011 04:01:33 -0300 Subject: [media] davinci vpbe: OSD(On Screen Display) block This patch implements the functionality of the OSD block of the VPBE. The OSD in total supports 4 planes or Video sources - 2 mainly RGB and 2 Video. The patch implements general handling of all the planes, with specific emphasis on the Video plane capabilities as the Video planes are supported through the V4L2 driver. Signed-off-by: Manjunath Hadli Acked-by: Muralidharan Karicheri Acked-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- include/media/davinci/vpbe_osd.h | 394 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 394 insertions(+) create mode 100644 include/media/davinci/vpbe_osd.h (limited to 'include/media') diff --git a/include/media/davinci/vpbe_osd.h b/include/media/davinci/vpbe_osd.h new file mode 100644 index 0000000..d7e397a --- /dev/null +++ b/include/media/davinci/vpbe_osd.h @@ -0,0 +1,394 @@ +/* + * Copyright (C) 2007-2009 Texas Instruments Inc + * Copyright (C) 2007 MontaVista Software, Inc. + * + * Andy Lowe (alowe@mvista.com), MontaVista Software + * - Initial version + * Murali Karicheri (mkaricheri@gmail.com), Texas Instruments Ltd. + * - ported to sub device interface + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation version 2.. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ +#ifndef _OSD_H +#define _OSD_H + +#include + +#define VPBE_OSD_SUBDEV_NAME "vpbe-osd" + +/** + * enum osd_layer + * @WIN_OSD0: On-Screen Display Window 0 + * @WIN_VID0: Video Window 0 + * @WIN_OSD1: On-Screen Display Window 1 + * @WIN_VID1: Video Window 1 + * + * Description: + * An enumeration of the osd display layers. + */ +enum osd_layer { + WIN_OSD0, + WIN_VID0, + WIN_OSD1, + WIN_VID1, +}; + +/** + * enum osd_win_layer + * @OSDWIN_OSD0: On-Screen Display Window 0 + * @OSDWIN_OSD1: On-Screen Display Window 1 + * + * Description: + * An enumeration of the OSD Window layers. + */ +enum osd_win_layer { + OSDWIN_OSD0, + OSDWIN_OSD1, +}; + +/** + * enum osd_pix_format + * @PIXFMT_1BPP: 1-bit-per-pixel bitmap + * @PIXFMT_2BPP: 2-bits-per-pixel bitmap + * @PIXFMT_4BPP: 4-bits-per-pixel bitmap + * @PIXFMT_8BPP: 8-bits-per-pixel bitmap + * @PIXFMT_RGB565: 16-bits-per-pixel RGB565 + * @PIXFMT_YCbCrI: YUV 4:2:2 + * @PIXFMT_RGB888: 24-bits-per-pixel RGB888 + * @PIXFMT_YCrCbI: YUV 4:2:2 with chroma swap + * @PIXFMT_NV12: YUV 4:2:0 planar + * @PIXFMT_OSD_ATTR: OSD Attribute Window pixel format (4bpp) + * + * Description: + * An enumeration of the DaVinci pixel formats. + */ +enum osd_pix_format { + PIXFMT_1BPP = 0, + PIXFMT_2BPP, + PIXFMT_4BPP, + PIXFMT_8BPP, + PIXFMT_RGB565, + PIXFMT_YCbCrI, + PIXFMT_RGB888, + PIXFMT_YCrCbI, + PIXFMT_NV12, + PIXFMT_OSD_ATTR, +}; + +/** + * enum osd_h_exp_ratio + * @H_EXP_OFF: no expansion (1/1) + * @H_EXP_9_OVER_8: 9/8 expansion ratio + * @H_EXP_3_OVER_2: 3/2 expansion ratio + * + * Description: + * An enumeration of the available horizontal expansion ratios. + */ +enum osd_h_exp_ratio { + H_EXP_OFF, + H_EXP_9_OVER_8, + H_EXP_3_OVER_2, +}; + +/** + * enum osd_v_exp_ratio + * @V_EXP_OFF: no expansion (1/1) + * @V_EXP_6_OVER_5: 6/5 expansion ratio + * + * Description: + * An enumeration of the available vertical expansion ratios. + */ +enum osd_v_exp_ratio { + V_EXP_OFF, + V_EXP_6_OVER_5, +}; + +/** + * enum osd_zoom_factor + * @ZOOM_X1: no zoom (x1) + * @ZOOM_X2: x2 zoom + * @ZOOM_X4: x4 zoom + * + * Description: + * An enumeration of the available zoom factors. + */ +enum osd_zoom_factor { + ZOOM_X1, + ZOOM_X2, + ZOOM_X4, +}; + +/** + * enum osd_clut + * @ROM_CLUT: ROM CLUT + * @RAM_CLUT: RAM CLUT + * + * Description: + * An enumeration of the available Color Lookup Tables (CLUTs). + */ +enum osd_clut { + ROM_CLUT, + RAM_CLUT, +}; + +/** + * enum osd_rom_clut + * @ROM_CLUT0: Macintosh CLUT + * @ROM_CLUT1: CLUT from DM270 and prior devices + * + * Description: + * An enumeration of the ROM Color Lookup Table (CLUT) options. + */ +enum osd_rom_clut { + ROM_CLUT0, + ROM_CLUT1, +}; + +/** + * enum osd_blending_factor + * @OSD_0_VID_8: OSD pixels are fully transparent + * @OSD_1_VID_7: OSD pixels contribute 1/8, video pixels contribute 7/8 + * @OSD_2_VID_6: OSD pixels contribute 2/8, video pixels contribute 6/8 + * @OSD_3_VID_5: OSD pixels contribute 3/8, video pixels contribute 5/8 + * @OSD_4_VID_4: OSD pixels contribute 4/8, video pixels contribute 4/8 + * @OSD_5_VID_3: OSD pixels contribute 5/8, video pixels contribute 3/8 + * @OSD_6_VID_2: OSD pixels contribute 6/8, video pixels contribute 2/8 + * @OSD_8_VID_0: OSD pixels are fully opaque + * + * Description: + * An enumeration of the DaVinci pixel blending factor options. + */ +enum osd_blending_factor { + OSD_0_VID_8, + OSD_1_VID_7, + OSD_2_VID_6, + OSD_3_VID_5, + OSD_4_VID_4, + OSD_5_VID_3, + OSD_6_VID_2, + OSD_8_VID_0, +}; + +/** + * enum osd_blink_interval + * @BLINK_X1: blink interval is 1 vertical refresh cycle + * @BLINK_X2: blink interval is 2 vertical refresh cycles + * @BLINK_X3: blink interval is 3 vertical refresh cycles + * @BLINK_X4: blink interval is 4 vertical refresh cycles + * + * Description: + * An enumeration of the DaVinci pixel blinking interval options. + */ +enum osd_blink_interval { + BLINK_X1, + BLINK_X2, + BLINK_X3, + BLINK_X4, +}; + +/** + * enum osd_cursor_h_width + * @H_WIDTH_1: horizontal line width is 1 pixel + * @H_WIDTH_4: horizontal line width is 4 pixels + * @H_WIDTH_8: horizontal line width is 8 pixels + * @H_WIDTH_12: horizontal line width is 12 pixels + * @H_WIDTH_16: horizontal line width is 16 pixels + * @H_WIDTH_20: horizontal line width is 20 pixels + * @H_WIDTH_24: horizontal line width is 24 pixels + * @H_WIDTH_28: horizontal line width is 28 pixels + */ +enum osd_cursor_h_width { + H_WIDTH_1, + H_WIDTH_4, + H_WIDTH_8, + H_WIDTH_12, + H_WIDTH_16, + H_WIDTH_20, + H_WIDTH_24, + H_WIDTH_28, +}; + +/** + * enum davinci_cursor_v_width + * @V_WIDTH_1: vertical line width is 1 line + * @V_WIDTH_2: vertical line width is 2 lines + * @V_WIDTH_4: vertical line width is 4 lines + * @V_WIDTH_6: vertical line width is 6 lines + * @V_WIDTH_8: vertical line width is 8 lines + * @V_WIDTH_10: vertical line width is 10 lines + * @V_WIDTH_12: vertical line width is 12 lines + * @V_WIDTH_14: vertical line width is 14 lines + */ +enum osd_cursor_v_width { + V_WIDTH_1, + V_WIDTH_2, + V_WIDTH_4, + V_WIDTH_6, + V_WIDTH_8, + V_WIDTH_10, + V_WIDTH_12, + V_WIDTH_14, +}; + +/** + * struct osd_cursor_config + * @xsize: horizontal size in pixels + * @ysize: vertical size in lines + * @xpos: horizontal offset in pixels from the left edge of the display + * @ypos: vertical offset in lines from the top of the display + * @interlaced: Non-zero if the display is interlaced, or zero otherwise + * @h_width: horizontal line width + * @v_width: vertical line width + * @clut: the CLUT selector (ROM or RAM) for the cursor color + * @clut_index: an index into the CLUT for the cursor color + * + * Description: + * A structure describing the configuration parameters of the hardware + * rectangular cursor. + */ +struct osd_cursor_config { + unsigned xsize; + unsigned ysize; + unsigned xpos; + unsigned ypos; + int interlaced; + enum osd_cursor_h_width h_width; + enum osd_cursor_v_width v_width; + enum osd_clut clut; + unsigned char clut_index; +}; + +/** + * struct osd_layer_config + * @pixfmt: pixel format + * @line_length: offset in bytes between start of each line in memory + * @xsize: number of horizontal pixels displayed per line + * @ysize: number of lines displayed + * @xpos: horizontal offset in pixels from the left edge of the display + * @ypos: vertical offset in lines from the top of the display + * @interlaced: Non-zero if the display is interlaced, or zero otherwise + * + * Description: + * A structure describing the configuration parameters of an On-Screen Display + * (OSD) or video layer related to how the image is stored in memory. + * @line_length must be a multiple of the cache line size (32 bytes). + */ +struct osd_layer_config { + enum osd_pix_format pixfmt; + unsigned line_length; + unsigned xsize; + unsigned ysize; + unsigned xpos; + unsigned ypos; + int interlaced; +}; + +/* parameters that apply on a per-window (OSD or video) basis */ +struct osd_window_state { + int is_allocated; + int is_enabled; + unsigned long fb_base_phys; + enum osd_zoom_factor h_zoom; + enum osd_zoom_factor v_zoom; + struct osd_layer_config lconfig; +}; + +/* parameters that apply on a per-OSD-window basis */ +struct osd_osdwin_state { + enum osd_clut clut; + enum osd_blending_factor blend; + int colorkey_blending; + unsigned colorkey; + int rec601_attenuation; + /* index is pixel value */ + unsigned char palette_map[16]; +}; + +/* hardware rectangular cursor parameters */ +struct osd_cursor_state { + int is_enabled; + struct osd_cursor_config config; +}; + +struct osd_state; + +struct vpbe_osd_ops { + int (*initialize)(struct osd_state *sd); + int (*request_layer)(struct osd_state *sd, enum osd_layer layer); + void (*release_layer)(struct osd_state *sd, enum osd_layer layer); + int (*enable_layer)(struct osd_state *sd, enum osd_layer layer, + int otherwin); + void (*disable_layer)(struct osd_state *sd, enum osd_layer layer); + int (*set_layer_config)(struct osd_state *sd, enum osd_layer layer, + struct osd_layer_config *lconfig); + void (*get_layer_config)(struct osd_state *sd, enum osd_layer layer, + struct osd_layer_config *lconfig); + void (*start_layer)(struct osd_state *sd, enum osd_layer layer, + unsigned long fb_base_phys, + unsigned long cbcr_ofst); + void (*set_left_margin)(struct osd_state *sd, u32 val); + void (*set_top_margin)(struct osd_state *sd, u32 val); + void (*set_interpolation_filter)(struct osd_state *sd, int filter); + int (*set_vid_expansion)(struct osd_state *sd, + enum osd_h_exp_ratio h_exp, + enum osd_v_exp_ratio v_exp); + void (*get_vid_expansion)(struct osd_state *sd, + enum osd_h_exp_ratio *h_exp, + enum osd_v_exp_ratio *v_exp); + void (*set_zoom)(struct osd_state *sd, enum osd_layer layer, + enum osd_zoom_factor h_zoom, + enum osd_zoom_factor v_zoom); +}; + +struct osd_state { + enum vpbe_version vpbe_type; + spinlock_t lock; + struct device *dev; + dma_addr_t osd_base_phys; + unsigned long osd_base; + unsigned long osd_size; + /* 1-->the isr will toggle the VID0 ping-pong buffer */ + int pingpong; + int interpolation_filter; + int field_inversion; + enum osd_h_exp_ratio osd_h_exp; + enum osd_v_exp_ratio osd_v_exp; + enum osd_h_exp_ratio vid_h_exp; + enum osd_v_exp_ratio vid_v_exp; + enum osd_clut backg_clut; + unsigned backg_clut_index; + enum osd_rom_clut rom_clut; + int is_blinking; + /* attribute window blinking enabled */ + enum osd_blink_interval blink; + /* YCbCrI or YCrCbI */ + enum osd_pix_format yc_pixfmt; + /* columns are Y, Cb, Cr */ + unsigned char clut_ram[256][3]; + struct osd_cursor_state cursor; + /* OSD0, VID0, OSD1, VID1 */ + struct osd_window_state win[4]; + /* OSD0, OSD1 */ + struct osd_osdwin_state osdwin[2]; + /* OSD device Operations */ + struct vpbe_osd_ops ops; +}; + +struct osd_platform_data { + enum vpbe_version vpbe_type; + int field_inv_wa_enable; +}; + +#endif -- cgit v1.1 From 606b69e9b9442dc283cc2ed1ed73c39f3c5d0ca5 Mon Sep 17 00:00:00 2001 From: Manjunath Hadli Date: Fri, 17 Jun 2011 04:01:34 -0300 Subject: [media] davinci vpbe: VENC( Video Encoder) implementation This patch adds the VENC or the Video encoder, which is responsible for the blending of all source planes and timing generation for Video modes like NTSC, PAL and other digital outputs. the VENC implementation currently supports COMPOSITE and COMPONENT outputs and NTSC and PAL resolutions through the analog DACs. The venc block is implemented as a subdevice, allowing for additional external and internal encoders of other kind to plug-in. Signed-off-by: Manjunath Hadli Acked-by: Muralidharan Karicheri Acked-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- include/media/davinci/vpbe_venc.h | 45 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 include/media/davinci/vpbe_venc.h (limited to 'include/media') diff --git a/include/media/davinci/vpbe_venc.h b/include/media/davinci/vpbe_venc.h new file mode 100644 index 0000000..426c205 --- /dev/null +++ b/include/media/davinci/vpbe_venc.h @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2010 Texas Instruments Inc + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation version 2. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef _VPBE_VENC_H +#define _VPBE_VENC_H + +#include +#include + +#define VPBE_VENC_SUBDEV_NAME "vpbe-venc" + +/* venc events */ +#define VENC_END_OF_FRAME BIT(0) +#define VENC_FIRST_FIELD BIT(1) +#define VENC_SECOND_FIELD BIT(2) + +struct venc_platform_data { + enum vpbe_version venc_type; + int (*setup_clock)(enum vpbe_enc_timings_type type, + unsigned int mode); + /* Number of LCD outputs supported */ + int num_lcd_outputs; +}; + +enum venc_ioctls { + VENC_GET_FLD = 1, +}; + +/* exported functions */ +struct v4l2_subdev *venc_sub_dev_init(struct v4l2_device *v4l2_dev, + const char *venc_name); +#endif -- cgit v1.1 From 2d28b686adc18567b388362e1f7b86658cfd81fc Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sat, 12 Mar 2011 08:54:43 -0300 Subject: [media] v4l2-ioctl: add ctrl_handler to v4l2_fh This is required to implement control events and is also needed to allow for per-filehandle control handlers. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- include/media/v4l2-fh.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/media') diff --git a/include/media/v4l2-fh.h b/include/media/v4l2-fh.h index 0206aa5..d247111 100644 --- a/include/media/v4l2-fh.h +++ b/include/media/v4l2-fh.h @@ -30,11 +30,13 @@ struct video_device; struct v4l2_events; +struct v4l2_ctrl_handler; struct v4l2_fh { struct list_head list; struct video_device *vdev; struct v4l2_events *events; /* events, pending and subscribed */ + struct v4l2_ctrl_handler *ctrl_handler; enum v4l2_priority prio; }; -- cgit v1.1 From 72d877cac07c8d996918977c3162dd78b8097ca8 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Fri, 10 Jun 2011 05:44:36 -0300 Subject: [media] v4l2-ctrls: add v4l2_ctrl_auto_cluster to simplify autogain/gain scenarios It is a bit tricky to handle autogain/gain type scenerios correctly. Such controls need to be clustered and the V4L2_CTRL_FLAG_UPDATE should be set on the autofoo controls. In addition, the manual controls should be marked inactive when the automatic mode is on, and active when the manual mode is on. This also requires specialized volatile handling. The chances of drivers doing all these things correctly are pretty remote. So a new v4l2_ctrl_auto_cluster function was added that takes care of these issues. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- include/media/v4l2-ctrls.h | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'include/media') diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h index 97d0638..56323e3 100644 --- a/include/media/v4l2-ctrls.h +++ b/include/media/v4l2-ctrls.h @@ -65,6 +65,15 @@ struct v4l2_ctrl_ops { * control's current value cannot be cached and needs to be * retrieved through the g_volatile_ctrl op. Drivers can set * this flag. + * @is_auto: If set, then this control selects whether the other cluster + * members are in 'automatic' mode or 'manual' mode. This is + * used for autogain/gain type clusters. Drivers should never + * set this flag directly. + * @manual_mode_value: If the is_auto flag is set, then this is the value + * of the auto control that determines if that control is in + * manual mode. So if the value of the auto control equals this + * value, then the whole cluster is in manual mode. Drivers should + * never set this flag directly. * @ops: The control ops. * @id: The control ID. * @name: The control name. @@ -105,6 +114,8 @@ struct v4l2_ctrl { unsigned int is_new:1; unsigned int is_private:1; unsigned int is_volatile:1; + unsigned int is_auto:1; + unsigned int manual_mode_value:5; const struct v4l2_ctrl_ops *ops; u32 id; @@ -363,6 +374,40 @@ int v4l2_ctrl_add_handler(struct v4l2_ctrl_handler *hdl, void v4l2_ctrl_cluster(unsigned ncontrols, struct v4l2_ctrl **controls); +/** v4l2_ctrl_auto_cluster() - Mark all controls in the cluster as belonging to + * that cluster and set it up for autofoo/foo-type handling. + * @ncontrols: The number of controls in this cluster. + * @controls: The cluster control array of size @ncontrols. The first control + * must be the 'auto' control (e.g. autogain, autoexposure, etc.) + * @manual_val: The value for the first control in the cluster that equals the + * manual setting. + * @set_volatile: If true, then all controls except the first auto control will + * have is_volatile set to true. If false, then is_volatile will not + * be touched. + * + * Use for control groups where one control selects some automatic feature and + * the other controls are only active whenever the automatic feature is turned + * off (manual mode). Typical examples: autogain vs gain, auto-whitebalance vs + * red and blue balance, etc. + * + * The behavior of such controls is as follows: + * + * When the autofoo control is set to automatic, then any manual controls + * are set to inactive and any reads will call g_volatile_ctrl (if the control + * was marked volatile). + * + * When the autofoo control is set to manual, then any manual controls will + * be marked active, and any reads will just return the current value without + * going through g_volatile_ctrl. + * + * In addition, this function will set the V4L2_CTRL_FLAG_UPDATE flag + * on the autofoo control and V4L2_CTRL_FLAG_INACTIVE on the foo control(s) + * if autofoo is in auto mode. + */ +void v4l2_ctrl_auto_cluster(unsigned ncontrols, struct v4l2_ctrl **controls, + u8 manual_val, bool set_volatile); + + /** v4l2_ctrl_find() - Find a control with the given ID. * @hdl: The control handler. * @id: The control ID to find. -- cgit v1.1 From ab892bac8438c5c2ff09a60d765d9b0c14941ba9 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Tue, 7 Jun 2011 06:47:18 -0300 Subject: [media] v4l2-ctrls: add v4l2_fh pointer to the set control functions When an application changes a control you want to generate an event. However, you want to avoid sending such an event back to the application (file handle) that caused the change. Add the filehandle to the various set control functions. The filehandle isn't used yet, but the control event patches will need this. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- include/media/v4l2-ctrls.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'include/media') diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h index 56323e3..e720f11 100644 --- a/include/media/v4l2-ctrls.h +++ b/include/media/v4l2-ctrls.h @@ -28,6 +28,7 @@ /* forward references */ struct v4l2_ctrl_handler; struct v4l2_ctrl; +struct v4l2_fh; struct video_device; struct v4l2_subdev; @@ -485,15 +486,16 @@ s32 v4l2_ctrl_g_ctrl(struct v4l2_ctrl *ctrl); */ int v4l2_ctrl_s_ctrl(struct v4l2_ctrl *ctrl, s32 val); - /* Helpers for ioctl_ops. If hdl == NULL then they will all return -EINVAL. */ int v4l2_queryctrl(struct v4l2_ctrl_handler *hdl, struct v4l2_queryctrl *qc); int v4l2_querymenu(struct v4l2_ctrl_handler *hdl, struct v4l2_querymenu *qm); int v4l2_g_ctrl(struct v4l2_ctrl_handler *hdl, struct v4l2_control *ctrl); -int v4l2_s_ctrl(struct v4l2_ctrl_handler *hdl, struct v4l2_control *ctrl); +int v4l2_s_ctrl(struct v4l2_fh *fh, struct v4l2_ctrl_handler *hdl, + struct v4l2_control *ctrl); int v4l2_g_ext_ctrls(struct v4l2_ctrl_handler *hdl, struct v4l2_ext_controls *c); int v4l2_try_ext_ctrls(struct v4l2_ctrl_handler *hdl, struct v4l2_ext_controls *c); -int v4l2_s_ext_ctrls(struct v4l2_ctrl_handler *hdl, struct v4l2_ext_controls *c); +int v4l2_s_ext_ctrls(struct v4l2_fh *fh, struct v4l2_ctrl_handler *hdl, + struct v4l2_ext_controls *c); /* Helpers for subdevices. If the associated ctrl_handler == NULL then they will all return -EINVAL. */ -- cgit v1.1 From 6e239399e5807132f86f64af6c659411c6a3d1a5 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Tue, 7 Jun 2011 11:13:44 -0300 Subject: [media] v4l2-ctrls: add control events Whenever a control changes value or state an event is sent to anyone that subscribed to it. This functionality is useful for control panels but also for applications that need to wait for (usually status) controls to change value. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- include/media/v4l2-ctrls.h | 23 ++++++++++++++++++----- include/media/v4l2-event.h | 2 ++ 2 files changed, 20 insertions(+), 5 deletions(-) (limited to 'include/media') diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h index e720f11..c45bf40 100644 --- a/include/media/v4l2-ctrls.h +++ b/include/media/v4l2-ctrls.h @@ -28,9 +28,10 @@ /* forward references */ struct v4l2_ctrl_handler; struct v4l2_ctrl; -struct v4l2_fh; struct video_device; struct v4l2_subdev; +struct v4l2_event_subscription; +struct v4l2_fh; /** struct v4l2_ctrl_ops - The control operations that the driver has to provide. * @g_volatile_ctrl: Get a new value for this control. Generally only relevant @@ -107,6 +108,7 @@ struct v4l2_ctrl_ops { struct v4l2_ctrl { /* Administrative fields */ struct list_head node; + struct list_head fhs; struct v4l2_ctrl_handler *handler; struct v4l2_ctrl **cluster; unsigned ncontrols; @@ -180,6 +182,11 @@ struct v4l2_ctrl_handler { int error; }; +struct v4l2_ctrl_fh { + struct list_head node; + struct v4l2_fh *fh; +}; + /** struct v4l2_ctrl_config - Control configuration structure. * @ops: The control ops. * @id: The control ID. @@ -425,9 +432,9 @@ struct v4l2_ctrl *v4l2_ctrl_find(struct v4l2_ctrl_handler *hdl, u32 id); * This sets or clears the V4L2_CTRL_FLAG_INACTIVE flag atomically. * Does nothing if @ctrl == NULL. * This will usually be called from within the s_ctrl op. + * The V4L2_EVENT_CTRL event will be generated afterwards. * - * This function can be called regardless of whether the control handler - * is locked or not. + * This function assumes that the control handler is locked. */ void v4l2_ctrl_activate(struct v4l2_ctrl *ctrl, bool active); @@ -437,11 +444,12 @@ void v4l2_ctrl_activate(struct v4l2_ctrl *ctrl, bool active); * * This sets or clears the V4L2_CTRL_FLAG_GRABBED flag atomically. * Does nothing if @ctrl == NULL. + * The V4L2_EVENT_CTRL event will be generated afterwards. * This will usually be called when starting or stopping streaming in the * driver. * - * This function can be called regardless of whether the control handler - * is locked or not. + * This function assumes that the control handler is not locked and will + * take the lock itself. */ void v4l2_ctrl_grab(struct v4l2_ctrl *ctrl, bool grabbed); @@ -486,6 +494,11 @@ s32 v4l2_ctrl_g_ctrl(struct v4l2_ctrl *ctrl); */ int v4l2_ctrl_s_ctrl(struct v4l2_ctrl *ctrl, s32 val); +void v4l2_ctrl_add_fh(struct v4l2_ctrl_handler *hdl, + struct v4l2_ctrl_fh *ctrl_fh, + struct v4l2_event_subscription *sub); +void v4l2_ctrl_del_fh(struct v4l2_ctrl *ctrl, struct v4l2_fh *fh); + /* Helpers for ioctl_ops. If hdl == NULL then they will all return -EINVAL. */ int v4l2_queryctrl(struct v4l2_ctrl_handler *hdl, struct v4l2_queryctrl *qc); int v4l2_querymenu(struct v4l2_ctrl_handler *hdl, struct v4l2_querymenu *qm); diff --git a/include/media/v4l2-event.h b/include/media/v4l2-event.h index 3b86177..45e9c1e 100644 --- a/include/media/v4l2-event.h +++ b/include/media/v4l2-event.h @@ -40,6 +40,7 @@ struct v4l2_kevent { struct v4l2_subscribed_event { struct list_head list; u32 type; + u32 id; }; struct v4l2_events { @@ -58,6 +59,7 @@ void v4l2_event_free(struct v4l2_fh *fh); int v4l2_event_dequeue(struct v4l2_fh *fh, struct v4l2_event *event, int nonblocking); void v4l2_event_queue(struct video_device *vdev, const struct v4l2_event *ev); +void v4l2_event_queue_fh(struct v4l2_fh *fh, const struct v4l2_event *ev); int v4l2_event_pending(struct v4l2_fh *fh); int v4l2_event_subscribe(struct v4l2_fh *fh, struct v4l2_event_subscription *sub); -- cgit v1.1 From ce7275747bd548e0da7425ba0b7edb6f2c7657a2 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Fri, 10 Jun 2011 05:56:39 -0300 Subject: [media] v4l2-ctrls: simplify event subscription Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- include/media/v4l2-ctrls.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'include/media') diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h index c45bf40..de68a59 100644 --- a/include/media/v4l2-ctrls.h +++ b/include/media/v4l2-ctrls.h @@ -169,6 +169,7 @@ struct v4l2_ctrl_ref { * control is needed multiple times, so this is a simple * optimization. * @buckets: Buckets for the hashing. Allows for quick control lookup. + * @nr_of_refs: Total number of control references in the list. * @nr_of_buckets: Total number of buckets in the array. * @error: The error code of the first failed control addition. */ @@ -178,6 +179,7 @@ struct v4l2_ctrl_handler { struct list_head ctrl_refs; struct v4l2_ctrl_ref *cached; struct v4l2_ctrl_ref **buckets; + u16 nr_of_refs; u16 nr_of_buckets; int error; }; @@ -494,11 +496,29 @@ s32 v4l2_ctrl_g_ctrl(struct v4l2_ctrl *ctrl); */ int v4l2_ctrl_s_ctrl(struct v4l2_ctrl *ctrl, s32 val); +/* Internal helper functions that deal with control events. */ void v4l2_ctrl_add_fh(struct v4l2_ctrl_handler *hdl, struct v4l2_ctrl_fh *ctrl_fh, struct v4l2_event_subscription *sub); void v4l2_ctrl_del_fh(struct v4l2_ctrl *ctrl, struct v4l2_fh *fh); +/** v4l2_ctrl_subscribe_fh() - Helper function that subscribes a control event. + * @fh: The file handler that subscribed the control event. + * @sub: The event to subscribe (type must be V4L2_EVENT_CTRL). + * @n: How many events should be allocated? (Passed to v4l2_event_alloc). + * Recommended to set to twice the number of controls plus whatever + * is needed for other events. This function will set n to + * max(n, 2 * fh->ctrl_handler->nr_of_refs). + * + * A helper function that initializes the fh for events, allocates the + * list of events and subscribes the control event. + * + * Typically called in the handler of VIDIOC_SUBSCRIBE_EVENT in the + * V4L2_EVENT_CTRL case. + */ +int v4l2_ctrl_subscribe_fh(struct v4l2_fh *fh, + struct v4l2_event_subscription *sub, unsigned n); + /* Helpers for ioctl_ops. If hdl == NULL then they will all return -EINVAL. */ int v4l2_queryctrl(struct v4l2_ctrl_handler *hdl, struct v4l2_queryctrl *qc); int v4l2_querymenu(struct v4l2_ctrl_handler *hdl, struct v4l2_querymenu *qm); -- cgit v1.1 From 82a7c049449ec5a2194249da341ec8bde14e968b Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Tue, 28 Jun 2011 10:43:13 -0300 Subject: [media] v4l2-ctrls: make manual_mode_value 8 bits and check against control range Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- include/media/v4l2-ctrls.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/media') diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h index de68a59..8f08c6e 100644 --- a/include/media/v4l2-ctrls.h +++ b/include/media/v4l2-ctrls.h @@ -118,7 +118,7 @@ struct v4l2_ctrl { unsigned int is_private:1; unsigned int is_volatile:1; unsigned int is_auto:1; - unsigned int manual_mode_value:5; + unsigned int manual_mode_value:8; const struct v4l2_ctrl_ops *ops; u32 id; -- cgit v1.1 From b7ccdba02aaa5100eec85d41c56c37c78d3ab407 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Sat, 4 Jun 2011 17:24:22 -0300 Subject: [media] V4L: soc-camera: MIPI flags are not sensor flags SOCAM_MIPI_[1234]LANE flags are not board-specific sensor flags, they are bus configuration flags. Signed-off-by: Guennadi Liakhovetski Signed-off-by: Mauro Carvalho Chehab --- include/media/soc_camera.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'include/media') diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h index 238bd33..e34b5e6 100644 --- a/include/media/soc_camera.h +++ b/include/media/soc_camera.h @@ -109,12 +109,6 @@ struct soc_camera_host_ops { #define SOCAM_SENSOR_INVERT_HSYNC (1 << 2) #define SOCAM_SENSOR_INVERT_VSYNC (1 << 3) #define SOCAM_SENSOR_INVERT_DATA (1 << 4) -#define SOCAM_MIPI_1LANE (1 << 5) -#define SOCAM_MIPI_2LANE (1 << 6) -#define SOCAM_MIPI_3LANE (1 << 7) -#define SOCAM_MIPI_4LANE (1 << 8) -#define SOCAM_MIPI (SOCAM_MIPI_1LANE | SOCAM_MIPI_2LANE | \ - SOCAM_MIPI_3LANE | SOCAM_MIPI_4LANE) struct i2c_board_info; struct regulator_bulk_data; @@ -270,6 +264,12 @@ static inline struct v4l2_queryctrl const *soc_camera_find_qctrl( #define SOCAM_PCLK_SAMPLE_FALLING (1 << 13) #define SOCAM_DATA_ACTIVE_HIGH (1 << 14) #define SOCAM_DATA_ACTIVE_LOW (1 << 15) +#define SOCAM_MIPI_1LANE (1 << 16) +#define SOCAM_MIPI_2LANE (1 << 17) +#define SOCAM_MIPI_3LANE (1 << 18) +#define SOCAM_MIPI_4LANE (1 << 19) +#define SOCAM_MIPI (SOCAM_MIPI_1LANE | SOCAM_MIPI_2LANE | \ + SOCAM_MIPI_3LANE | SOCAM_MIPI_4LANE) #define SOCAM_DATAWIDTH_MASK (SOCAM_DATAWIDTH_4 | SOCAM_DATAWIDTH_8 | \ SOCAM_DATAWIDTH_9 | SOCAM_DATAWIDTH_10 | \ -- cgit v1.1 From 8318a64b892a4de629c3365b3acd8f7d2d7e6100 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Tue, 7 Jun 2011 06:24:32 -0300 Subject: [media] V4L: soc-camera: remove several now unused soc-camera client operations This patch removes .enum_input(), .suspend() and .resume() soc-camera client operations. Functionality, provided by .enum_input(), if needed, can be implemented using the v4l2-subdev API. As for .suspend() and .resume(), the only client driver, implementing these methods has been mt9m111, and the only host driver, using them has been pxa-camera. Now that both those drivers have been converted to the standard subdev .s_power() operation, .suspend() and .resume() can be removed. Signed-off-by: Guennadi Liakhovetski Signed-off-by: Mauro Carvalho Chehab --- include/media/soc_camera.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'include/media') diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h index e34b5e6..21dd8a4 100644 --- a/include/media/soc_camera.h +++ b/include/media/soc_camera.h @@ -201,11 +201,8 @@ struct soc_camera_format_xlate { }; struct soc_camera_ops { - int (*suspend)(struct soc_camera_device *, pm_message_t state); - int (*resume)(struct soc_camera_device *); unsigned long (*query_bus_param)(struct soc_camera_device *); int (*set_bus_param)(struct soc_camera_device *, unsigned long); - int (*enum_input)(struct soc_camera_device *, struct v4l2_input *); const struct v4l2_queryctrl *controls; int num_controls; }; -- cgit v1.1 From 195ebc43bf76df2232d8c55ae284725e73d7a80e Mon Sep 17 00:00:00 2001 From: Josh Wu Date: Tue, 7 Jun 2011 22:40:19 -0300 Subject: [media] V4L: at91: add Atmel Image Sensor Interface (ISI) support This patch is to enable Atmel Image Sensor Interface (ISI) driver support. Signed-off-by: Josh Wu Acked-by: Jean-Christophe PLAGNIOL-VILLARD Signed-off-by: Guennadi Liakhovetski Signed-off-by: Mauro Carvalho Chehab --- include/media/atmel-isi.h | 119 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 include/media/atmel-isi.h (limited to 'include/media') diff --git a/include/media/atmel-isi.h b/include/media/atmel-isi.h new file mode 100644 index 0000000..26cece5 --- /dev/null +++ b/include/media/atmel-isi.h @@ -0,0 +1,119 @@ +/* + * Register definitions for the Atmel Image Sensor Interface. + * + * Copyright (C) 2011 Atmel Corporation + * Josh Wu, + * + * Based on previous work by Lars Haring, + * and Sedji Gaouaou + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +#ifndef __ATMEL_ISI_H__ +#define __ATMEL_ISI_H__ + +#include + +/* ISI_V2 register offsets */ +#define ISI_CFG1 0x0000 +#define ISI_CFG2 0x0004 +#define ISI_PSIZE 0x0008 +#define ISI_PDECF 0x000c +#define ISI_Y2R_SET0 0x0010 +#define ISI_Y2R_SET1 0x0014 +#define ISI_R2Y_SET0 0x0018 +#define ISI_R2Y_SET1 0x001C +#define ISI_R2Y_SET2 0x0020 +#define ISI_CTRL 0x0024 +#define ISI_STATUS 0x0028 +#define ISI_INTEN 0x002C +#define ISI_INTDIS 0x0030 +#define ISI_INTMASK 0x0034 +#define ISI_DMA_CHER 0x0038 +#define ISI_DMA_CHDR 0x003C +#define ISI_DMA_CHSR 0x0040 +#define ISI_DMA_P_ADDR 0x0044 +#define ISI_DMA_P_CTRL 0x0048 +#define ISI_DMA_P_DSCR 0x004C +#define ISI_DMA_C_ADDR 0x0050 +#define ISI_DMA_C_CTRL 0x0054 +#define ISI_DMA_C_DSCR 0x0058 + +/* Bitfields in CFG1 */ +#define ISI_CFG1_HSYNC_POL_ACTIVE_LOW (1 << 2) +#define ISI_CFG1_VSYNC_POL_ACTIVE_LOW (1 << 3) +#define ISI_CFG1_PIXCLK_POL_ACTIVE_FALLING (1 << 4) +#define ISI_CFG1_EMB_SYNC (1 << 6) +#define ISI_CFG1_CRC_SYNC (1 << 7) +/* Constants for FRATE(ISI_V2) */ +#define ISI_CFG1_FRATE_CAPTURE_ALL (0 << 8) +#define ISI_CFG1_FRATE_DIV_2 (1 << 8) +#define ISI_CFG1_FRATE_DIV_3 (2 << 8) +#define ISI_CFG1_FRATE_DIV_4 (3 << 8) +#define ISI_CFG1_FRATE_DIV_5 (4 << 8) +#define ISI_CFG1_FRATE_DIV_6 (5 << 8) +#define ISI_CFG1_FRATE_DIV_7 (6 << 8) +#define ISI_CFG1_FRATE_DIV_8 (7 << 8) +#define ISI_CFG1_DISCR (1 << 11) +#define ISI_CFG1_FULL_MODE (1 << 12) + +/* Bitfields in CFG2 */ +#define ISI_CFG2_GRAYSCALE (1 << 13) +/* Constants for YCC_SWAP(ISI_V2) */ +#define ISI_CFG2_YCC_SWAP_DEFAULT (0 << 28) +#define ISI_CFG2_YCC_SWAP_MODE_1 (1 << 28) +#define ISI_CFG2_YCC_SWAP_MODE_2 (2 << 28) +#define ISI_CFG2_YCC_SWAP_MODE_3 (3 << 28) +#define ISI_CFG2_IM_VSIZE_OFFSET 0 +#define ISI_CFG2_IM_HSIZE_OFFSET 16 +#define ISI_CFG2_IM_VSIZE_MASK (0x7FF << ISI_CFG2_IM_VSIZE_OFFSET) +#define ISI_CFG2_IM_HSIZE_MASK (0x7FF << ISI_CFG2_IM_HSIZE_OFFSET) + +/* Bitfields in CTRL */ +/* Also using in SR(ISI_V2) */ +#define ISI_CTRL_EN (1 << 0) +#define ISI_CTRL_CDC (1 << 8) +/* Also using in SR/IER/IDR/IMR(ISI_V2) */ +#define ISI_CTRL_DIS (1 << 1) +#define ISI_CTRL_SRST (1 << 2) + +/* Bitfields in SR */ +#define ISI_SR_SIP (1 << 19) +/* Also using in SR/IER/IDR/IMR */ +#define ISI_SR_VSYNC (1 << 10) +#define ISI_SR_PXFR_DONE (1 << 16) +#define ISI_SR_CXFR_DONE (1 << 17) +#define ISI_SR_P_OVR (1 << 24) +#define ISI_SR_C_OVR (1 << 25) +#define ISI_SR_CRC_ERR (1 << 26) +#define ISI_SR_FR_OVR (1 << 27) + +/* Bitfields in DMA_C_CTRL & in DMA_P_CTRL */ +#define ISI_DMA_CTRL_FETCH (1 << 0) +#define ISI_DMA_CTRL_WB (1 << 1) +#define ISI_DMA_CTRL_IEN (1 << 2) +#define ISI_DMA_CTRL_DONE (1 << 3) + +/* Bitfields in DMA_CHSR/CHER/CHDR */ +#define ISI_DMA_CHSR_P_CH (1 << 0) +#define ISI_DMA_CHSR_C_CH (1 << 1) + +/* Definition for isi_platform_data */ +#define ISI_DATAWIDTH_8 0x01 +#define ISI_DATAWIDTH_10 0x02 + +struct isi_platform_data { + u8 has_emb_sync; + u8 emb_crc_sync; + u8 hsync_act_low; + u8 vsync_act_low; + u8 pclk_act_falling; + u8 isi_full_mode; + u32 data_width_flags; + /* Using for ISI_CFG1 */ + u32 frate; +}; + +#endif /* __ATMEL_ISI_H__ */ -- cgit v1.1 From 523f46d6aba9dcb0a2d0fc474ca884e93a7cf198 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Mon, 13 Jun 2011 17:44:42 -0300 Subject: [media] v4l2-events/fh: merge v4l2_events into v4l2_fh Drivers that supported events used to be rare, but now that controls can also raise events this will become much more common since almost all drivers have controls. This means that keeping struct v4l2_events as a separate struct make no more sense. Merging it into struct v4l2_fh simplifies things substantially as it is now an integral part of the filehandle struct. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- include/media/v4l2-event.h | 11 ----------- include/media/v4l2-fh.h | 13 ++++++++++--- 2 files changed, 10 insertions(+), 14 deletions(-) (limited to 'include/media') diff --git a/include/media/v4l2-event.h b/include/media/v4l2-event.h index 45e9c1e..042b893 100644 --- a/include/media/v4l2-event.h +++ b/include/media/v4l2-event.h @@ -43,17 +43,6 @@ struct v4l2_subscribed_event { u32 id; }; -struct v4l2_events { - wait_queue_head_t wait; - struct list_head subscribed; /* Subscribed events */ - struct list_head free; /* Events ready for use */ - struct list_head available; /* Dequeueable event */ - unsigned int navailable; - unsigned int nallocated; /* Number of allocated events */ - u32 sequence; -}; - -int v4l2_event_init(struct v4l2_fh *fh); int v4l2_event_alloc(struct v4l2_fh *fh, unsigned int n); void v4l2_event_free(struct v4l2_fh *fh); int v4l2_event_dequeue(struct v4l2_fh *fh, struct v4l2_event *event, diff --git a/include/media/v4l2-fh.h b/include/media/v4l2-fh.h index d247111..bfc0457 100644 --- a/include/media/v4l2-fh.h +++ b/include/media/v4l2-fh.h @@ -29,15 +29,22 @@ #include struct video_device; -struct v4l2_events; struct v4l2_ctrl_handler; struct v4l2_fh { struct list_head list; struct video_device *vdev; - struct v4l2_events *events; /* events, pending and subscribed */ struct v4l2_ctrl_handler *ctrl_handler; enum v4l2_priority prio; + + /* Events */ + wait_queue_head_t wait; + struct list_head subscribed; /* Subscribed events */ + struct list_head free; /* Events ready for use */ + struct list_head available; /* Dequeueable event */ + unsigned int navailable; + unsigned int nallocated; /* Number of allocated events */ + u32 sequence; }; /* @@ -46,7 +53,7 @@ struct v4l2_fh { * from driver's v4l2_file_operations->open() handler if the driver * uses v4l2_fh. */ -int v4l2_fh_init(struct v4l2_fh *fh, struct video_device *vdev); +void v4l2_fh_init(struct v4l2_fh *fh, struct video_device *vdev); /* * Add the fh to the list of file handles on a video_device. The file * handle must be initialised first. -- cgit v1.1 From 77068d36d8b9e9902a89b4bb01011d41926f5420 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Mon, 13 Jun 2011 18:55:58 -0300 Subject: [media] v4l2-ctrls/event: remove struct v4l2_ctrl_fh, instead use v4l2_subscribed_event The v4l2_ctrl_fh struct connected v4l2_ctrl with v4l2_fh so the control would know which filehandles subscribed to it. However, it is much easier to use struct v4l2_subscribed_event directly for that and get rid of that intermediate struct. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- include/media/v4l2-ctrls.h | 17 +++++++---------- include/media/v4l2-event.h | 9 +++++++++ 2 files changed, 16 insertions(+), 10 deletions(-) (limited to 'include/media') diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h index 8f08c6e..a15e909 100644 --- a/include/media/v4l2-ctrls.h +++ b/include/media/v4l2-ctrls.h @@ -31,6 +31,7 @@ struct v4l2_ctrl; struct video_device; struct v4l2_subdev; struct v4l2_event_subscription; +struct v4l2_subscribed_event; struct v4l2_fh; /** struct v4l2_ctrl_ops - The control operations that the driver has to provide. @@ -53,6 +54,7 @@ struct v4l2_ctrl_ops { /** struct v4l2_ctrl - The control structure. * @node: The list node. + * @ev_subs: The list of control event subscriptions. * @handler: The handler that owns the control. * @cluster: Point to start of cluster array. * @ncontrols: Number of controls in cluster array. @@ -108,7 +110,7 @@ struct v4l2_ctrl_ops { struct v4l2_ctrl { /* Administrative fields */ struct list_head node; - struct list_head fhs; + struct list_head ev_subs; struct v4l2_ctrl_handler *handler; struct v4l2_ctrl **cluster; unsigned ncontrols; @@ -184,11 +186,6 @@ struct v4l2_ctrl_handler { int error; }; -struct v4l2_ctrl_fh { - struct list_head node; - struct v4l2_fh *fh; -}; - /** struct v4l2_ctrl_config - Control configuration structure. * @ops: The control ops. * @id: The control ID. @@ -497,10 +494,10 @@ s32 v4l2_ctrl_g_ctrl(struct v4l2_ctrl *ctrl); int v4l2_ctrl_s_ctrl(struct v4l2_ctrl *ctrl, s32 val); /* Internal helper functions that deal with control events. */ -void v4l2_ctrl_add_fh(struct v4l2_ctrl_handler *hdl, - struct v4l2_ctrl_fh *ctrl_fh, - struct v4l2_event_subscription *sub); -void v4l2_ctrl_del_fh(struct v4l2_ctrl *ctrl, struct v4l2_fh *fh); +void v4l2_ctrl_add_event(struct v4l2_ctrl *ctrl, + struct v4l2_subscribed_event *sev); +void v4l2_ctrl_del_event(struct v4l2_ctrl *ctrl, + struct v4l2_subscribed_event *sev); /** v4l2_ctrl_subscribe_fh() - Helper function that subscribes a control event. * @fh: The file handler that subscribed the control event. diff --git a/include/media/v4l2-event.h b/include/media/v4l2-event.h index 042b893..eda17f8 100644 --- a/include/media/v4l2-event.h +++ b/include/media/v4l2-event.h @@ -38,9 +38,18 @@ struct v4l2_kevent { }; struct v4l2_subscribed_event { + /* list node for the v4l2_fh->subscribed list */ struct list_head list; + /* event type */ u32 type; + /* associated object ID (e.g. control ID) */ u32 id; + /* copy of v4l2_event_subscription->flags */ + u32 flags; + /* filehandle that subscribed to this event */ + struct v4l2_fh *fh; + /* list node that hooks into the object's event list (if there is one) */ + struct list_head node; }; int v4l2_event_alloc(struct v4l2_fh *fh, unsigned int n); -- cgit v1.1 From f1e393de382af9b9bd2462a42bfa16b8c501d81b Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Mon, 13 Jun 2011 19:24:17 -0300 Subject: [media] v4l2-event/ctrls/fh: allocate events per fh and per type instead of just per-fh The driver had to decide how many events to allocate when the v4l2_fh struct was created. It was possible to add more events afterwards, but there was no way to ensure that you wouldn't miss important events if the event queue would fill up for that filehandle. In addition, once there were no more free events, any new events were simply dropped on the floor. For the control event in particular this made life very difficult since control status/value changes could just be missed if the number of allocated events and the speed at which the application read events was too low to keep up with the number of generated events. The application would have no idea what the latest state was for a control since it could have missed the latest control change. So this patch makes some major changes in how events are allocated. Instead of allocating events per-filehandle they are now allocated when subscribing an event. So for that particular event type N events (determined by the driver) are allocated. Those events are reserved for that particular event type. This ensures that you will not miss events for a particular type altogether. In addition, if there are N events in use and a new event is raised, then the oldest event is dropped and the new one is added. So the latest event is always available. This can be further improved by adding the ability to merge the state of two events together, ensuring that no data is lost at all. This will be added in the next patch. This also makes it possible to allow the user to determine the number of events that will be allocated. This is not implemented at the moment, but would be trivial. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- include/media/v4l2-ctrls.h | 19 ------------------- include/media/v4l2-event.h | 18 +++++++++++++++--- include/media/v4l2-fh.h | 2 -- include/media/v4l2-subdev.h | 2 -- 4 files changed, 15 insertions(+), 26 deletions(-) (limited to 'include/media') diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h index a15e909..6966291 100644 --- a/include/media/v4l2-ctrls.h +++ b/include/media/v4l2-ctrls.h @@ -171,7 +171,6 @@ struct v4l2_ctrl_ref { * control is needed multiple times, so this is a simple * optimization. * @buckets: Buckets for the hashing. Allows for quick control lookup. - * @nr_of_refs: Total number of control references in the list. * @nr_of_buckets: Total number of buckets in the array. * @error: The error code of the first failed control addition. */ @@ -181,7 +180,6 @@ struct v4l2_ctrl_handler { struct list_head ctrl_refs; struct v4l2_ctrl_ref *cached; struct v4l2_ctrl_ref **buckets; - u16 nr_of_refs; u16 nr_of_buckets; int error; }; @@ -499,23 +497,6 @@ void v4l2_ctrl_add_event(struct v4l2_ctrl *ctrl, void v4l2_ctrl_del_event(struct v4l2_ctrl *ctrl, struct v4l2_subscribed_event *sev); -/** v4l2_ctrl_subscribe_fh() - Helper function that subscribes a control event. - * @fh: The file handler that subscribed the control event. - * @sub: The event to subscribe (type must be V4L2_EVENT_CTRL). - * @n: How many events should be allocated? (Passed to v4l2_event_alloc). - * Recommended to set to twice the number of controls plus whatever - * is needed for other events. This function will set n to - * max(n, 2 * fh->ctrl_handler->nr_of_refs). - * - * A helper function that initializes the fh for events, allocates the - * list of events and subscribes the control event. - * - * Typically called in the handler of VIDIOC_SUBSCRIBE_EVENT in the - * V4L2_EVENT_CTRL case. - */ -int v4l2_ctrl_subscribe_fh(struct v4l2_fh *fh, - struct v4l2_event_subscription *sub, unsigned n); - /* Helpers for ioctl_ops. If hdl == NULL then they will all return -EINVAL. */ int v4l2_queryctrl(struct v4l2_ctrl_handler *hdl, struct v4l2_queryctrl *qc); int v4l2_querymenu(struct v4l2_ctrl_handler *hdl, struct v4l2_querymenu *qm); diff --git a/include/media/v4l2-event.h b/include/media/v4l2-event.h index eda17f8..8d681e5 100644 --- a/include/media/v4l2-event.h +++ b/include/media/v4l2-event.h @@ -30,10 +30,15 @@ #include struct v4l2_fh; +struct v4l2_subscribed_event; struct video_device; struct v4l2_kevent { + /* list node for the v4l2_fh->available list */ struct list_head list; + /* pointer to parent v4l2_subscribed_event */ + struct v4l2_subscribed_event *sev; + /* event itself */ struct v4l2_event event; }; @@ -50,18 +55,25 @@ struct v4l2_subscribed_event { struct v4l2_fh *fh; /* list node that hooks into the object's event list (if there is one) */ struct list_head node; + /* the number of elements in the events array */ + unsigned elems; + /* the index of the events containing the oldest available event */ + unsigned first; + /* the number of queued events */ + unsigned in_use; + /* an array of elems events */ + struct v4l2_kevent events[]; }; -int v4l2_event_alloc(struct v4l2_fh *fh, unsigned int n); -void v4l2_event_free(struct v4l2_fh *fh); int v4l2_event_dequeue(struct v4l2_fh *fh, struct v4l2_event *event, int nonblocking); void v4l2_event_queue(struct video_device *vdev, const struct v4l2_event *ev); void v4l2_event_queue_fh(struct v4l2_fh *fh, const struct v4l2_event *ev); int v4l2_event_pending(struct v4l2_fh *fh); int v4l2_event_subscribe(struct v4l2_fh *fh, - struct v4l2_event_subscription *sub); + struct v4l2_event_subscription *sub, unsigned elems); int v4l2_event_unsubscribe(struct v4l2_fh *fh, struct v4l2_event_subscription *sub); +void v4l2_event_unsubscribe_all(struct v4l2_fh *fh); #endif /* V4L2_EVENT_H */ diff --git a/include/media/v4l2-fh.h b/include/media/v4l2-fh.h index bfc0457..52513c2 100644 --- a/include/media/v4l2-fh.h +++ b/include/media/v4l2-fh.h @@ -40,10 +40,8 @@ struct v4l2_fh { /* Events */ wait_queue_head_t wait; struct list_head subscribed; /* Subscribed events */ - struct list_head free; /* Events ready for use */ struct list_head available; /* Dequeueable event */ unsigned int navailable; - unsigned int nallocated; /* Number of allocated events */ u32 sequence; }; diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index 2884e3e..b05579b 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h @@ -513,8 +513,6 @@ struct v4l2_subdev { void *host_priv; /* subdev device node */ struct video_device devnode; - /* number of events to be allocated on open */ - unsigned int nevents; }; #define media_entity_to_v4l2_subdev(ent) \ -- cgit v1.1 From 2151bdc887acfd6dc2c931b4d3c01f95e30b7df8 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sat, 18 Jun 2011 07:02:20 -0300 Subject: [media] v4l2-event: add optional merge and replace callbacks When the event queue for a subscribed event is full, then the oldest event is dropped. It would be nice if the contents of that oldest event could be merged with the next-oldest. That way no information is lost, only intermediate steps are lost. This patch adds optional replace() (called when only one kevent was allocated) and merge() (called when more than one kevent was allocated) callbacks that will be called to do this job. These two callbacks are implemented for the V4L2_EVENT_CTRL event. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- include/media/v4l2-event.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/media') diff --git a/include/media/v4l2-event.h b/include/media/v4l2-event.h index 8d681e5..6da793f 100644 --- a/include/media/v4l2-event.h +++ b/include/media/v4l2-event.h @@ -55,6 +55,12 @@ struct v4l2_subscribed_event { struct v4l2_fh *fh; /* list node that hooks into the object's event list (if there is one) */ struct list_head node; + /* Optional callback that can replace event 'old' with event 'new'. */ + void (*replace)(struct v4l2_event *old, + const struct v4l2_event *new); + /* Optional callback that can merge event 'old' into event 'new'. */ + void (*merge)(const struct v4l2_event *old, + struct v4l2_event *new); /* the number of elements in the events array */ unsigned elems; /* the index of the events containing the oldest available event */ -- cgit v1.1 From eb5b16efb26ff5b2d0ba25a114394db69c433f86 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Tue, 14 Jun 2011 10:04:06 -0300 Subject: [media] v4l2-ctrls: improve discovery of controls of the same cluster The implementation of VIDIOC_G/S/TRY_EXT_CTRLS in the control framework has to figure out which controls in the control list belong to the same cluster. Since controls belonging to the same cluster need to be handled as a unit, this is important information. It did that by going over the controls in the list and for each control that belonged to a multi-control cluster it would walk the remainder of the list to try and find controls that belong to that same cluster. This approach has two disadvantages: 1) it was a potentially quadratic algorithm (although highly unlikely that it would ever be that bad in practice). 2) it took place with the control handler's lock held. Since we want to make it possible in the future to change control values from interrupt context, doing a lot of work while holding a lock is not a good idea. In the new code the algorithm is no longer quadratic but linear in the number of controls in the list. Also, it now can be done beforehand. Another change that was made was to so the try and set at the same time. Before when S_TRY_EXT_CTRLS was called it would 'try' the controls first, and then it would 'set' them. The idea was that any 'try' errors would prevent the 'set' from happening, thus avoiding having partially set control lists. However, this caused more problems than it solved because between the 'try' and the 'set' changes might have happened, so it had to try a second time, and since actual controls with a try_ctrl op are very rare (and those that we have just adjust values and do not return an error), I've decided to drop that two-stage approach and just combine try and set. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- include/media/v4l2-ctrls.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/media') diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h index 6966291..fe55a4e 100644 --- a/include/media/v4l2-ctrls.h +++ b/include/media/v4l2-ctrls.h @@ -27,6 +27,7 @@ /* forward references */ struct v4l2_ctrl_handler; +struct v4l2_ctrl_helper; struct v4l2_ctrl; struct video_device; struct v4l2_subdev; @@ -150,6 +151,7 @@ struct v4l2_ctrl { * @node: List node for the sorted list. * @next: Single-link list node for the hash. * @ctrl: The actual control information. + * @helper: Pointer to helper struct. Used internally in prepare_ext_ctrls(). * * Each control handler has a list of these refs. The list_head is used to * keep a sorted-by-control-ID list of all controls, while the next pointer @@ -159,6 +161,7 @@ struct v4l2_ctrl_ref { struct list_head node; struct v4l2_ctrl_ref *next; struct v4l2_ctrl *ctrl; + struct v4l2_ctrl_helper *helper; }; /** struct v4l2_ctrl_handler - The control handler keeps track of all the -- cgit v1.1 From 3f66f0ed319505555f45ceac04775b23f9279ee6 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Mon, 20 Jun 2011 11:56:24 -0300 Subject: [media] v4l2-ctrls/v4l2-events: small coding style cleanups Thanks to Laurent Pinchart . Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- include/media/v4l2-ctrls.h | 1 - include/media/v4l2-event.h | 34 +++++++++++++++++++--------------- 2 files changed, 19 insertions(+), 16 deletions(-) (limited to 'include/media') diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h index fe55a4e..13fe4d7 100644 --- a/include/media/v4l2-ctrls.h +++ b/include/media/v4l2-ctrls.h @@ -31,7 +31,6 @@ struct v4l2_ctrl_helper; struct v4l2_ctrl; struct video_device; struct v4l2_subdev; -struct v4l2_event_subscription; struct v4l2_subscribed_event; struct v4l2_fh; diff --git a/include/media/v4l2-event.h b/include/media/v4l2-event.h index 6da793f..7abeb39 100644 --- a/include/media/v4l2-event.h +++ b/include/media/v4l2-event.h @@ -33,41 +33,45 @@ struct v4l2_fh; struct v4l2_subscribed_event; struct video_device; +/** struct v4l2_kevent - Internal kernel event struct. + * @list: List node for the v4l2_fh->available list. + * @sev: Pointer to parent v4l2_subscribed_event. + * @event: The event itself. + */ struct v4l2_kevent { - /* list node for the v4l2_fh->available list */ struct list_head list; - /* pointer to parent v4l2_subscribed_event */ struct v4l2_subscribed_event *sev; - /* event itself */ struct v4l2_event event; }; +/** struct v4l2_subscribed_event - Internal struct representing a subscribed event. + * @list: List node for the v4l2_fh->subscribed list. + * @type: Event type. + * @id: Associated object ID (e.g. control ID). 0 if there isn't any. + * @flags: Copy of v4l2_event_subscription->flags. + * @fh: Filehandle that subscribed to this event. + * @node: List node that hooks into the object's event list (if there is one). + * @replace: Optional callback that can replace event 'old' with event 'new'. + * @merge: Optional callback that can merge event 'old' into event 'new'. + * @elems: The number of elements in the events array. + * @first: The index of the events containing the oldest available event. + * @in_use: The number of queued events. + * @events: An array of @elems events. + */ struct v4l2_subscribed_event { - /* list node for the v4l2_fh->subscribed list */ struct list_head list; - /* event type */ u32 type; - /* associated object ID (e.g. control ID) */ u32 id; - /* copy of v4l2_event_subscription->flags */ u32 flags; - /* filehandle that subscribed to this event */ struct v4l2_fh *fh; - /* list node that hooks into the object's event list (if there is one) */ struct list_head node; - /* Optional callback that can replace event 'old' with event 'new'. */ void (*replace)(struct v4l2_event *old, const struct v4l2_event *new); - /* Optional callback that can merge event 'old' into event 'new'. */ void (*merge)(const struct v4l2_event *old, struct v4l2_event *new); - /* the number of elements in the events array */ unsigned elems; - /* the index of the events containing the oldest available event */ unsigned first; - /* the number of queued events */ unsigned in_use; - /* an array of elems events */ struct v4l2_kevent events[]; }; -- cgit v1.1 From 3ad57c33846d884cfeed770238b27f3dcf3742f1 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Mon, 20 Jun 2011 12:00:36 -0300 Subject: [media] v4l2-event.h: add overview documentation to the header It's getting confusing who is linking to what, so add an overview at the start of the header. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- include/media/v4l2-event.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'include/media') diff --git a/include/media/v4l2-event.h b/include/media/v4l2-event.h index 7abeb39..5f14e88 100644 --- a/include/media/v4l2-event.h +++ b/include/media/v4l2-event.h @@ -29,6 +29,40 @@ #include #include +/* + * Overview: + * + * Events are subscribed per-filehandle. An event specification consists of a + * type and is optionally associated with an object identified through the + * 'id' field. So an event is uniquely identified by the (type, id) tuple. + * + * The v4l2-fh struct has a list of subscribed events. The v4l2_subscribed_event + * struct is added to that list, one for every subscribed event. + * + * Each v4l2_subscribed_event struct ends with an array of v4l2_kevent structs. + * This array (ringbuffer, really) is used to store any events raised by the + * driver. The v4l2_kevent struct links into the 'available' list of the + * v4l2_fh struct so VIDIOC_DQEVENT will know which event to dequeue first. + * + * Finally, if the event subscription is associated with a particular object + * such as a V4L2 control, then that object needs to know about that as well + * so that an event can be raised by that object. So the 'node' field can + * be used to link the v4l2_subscribed_event struct into a list of that + * object. + * + * So to summarize: + * + * struct v4l2_fh has two lists: one of the subscribed events, and one of the + * pending events. + * + * struct v4l2_subscribed_event has a ringbuffer of raised (pending) events of + * that particular type. + * + * If struct v4l2_subscribed_event is associated with a specific object, then + * that object will have an internal list of struct v4l2_subscribed_event so + * it knows who subscribed an event to that object. + */ + struct v4l2_fh; struct v4l2_subscribed_event; struct video_device; -- cgit v1.1 From 13abadad177074b84f6697639e1d4f64a55b1773 Mon Sep 17 00:00:00 2001 From: Sakari Ailus Date: Thu, 5 May 2011 15:39:25 -0300 Subject: [media] adp1653: Add driver for LED flash controller This patch adds the driver for the adp1653 LED flash controller. This controller supports a high power led in flash and torch modes and an indicator light, sometimes also called privacy light. The adp1653 is used on the Nokia N900. Signed-off-by: Sakari Ailus Signed-off-by: Tuukka Toivonen Signed-off-by: Laurent Pinchart Signed-off-by: David Cohen Acked-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab --- include/media/adp1653.h | 126 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 include/media/adp1653.h (limited to 'include/media') diff --git a/include/media/adp1653.h b/include/media/adp1653.h new file mode 100644 index 0000000..50a1af8 --- /dev/null +++ b/include/media/adp1653.h @@ -0,0 +1,126 @@ +/* + * include/media/adp1653.h + * + * Copyright (C) 2008--2011 Nokia Corporation + * + * Contact: Sakari Ailus + * + * Contributors: + * Sakari Ailus + * Tuukka Toivonen + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + * + */ + +#ifndef ADP1653_H +#define ADP1653_H + +#include +#include +#include +#include +#include + +#define ADP1653_NAME "adp1653" +#define ADP1653_I2C_ADDR (0x60 >> 1) + +/* Register definitions */ +#define ADP1653_REG_OUT_SEL 0x00 +#define ADP1653_REG_OUT_SEL_HPLED_TORCH_MIN 0x01 +#define ADP1653_REG_OUT_SEL_HPLED_TORCH_MAX 0x0b +#define ADP1653_REG_OUT_SEL_HPLED_FLASH_MIN 0x0c +#define ADP1653_REG_OUT_SEL_HPLED_FLASH_MAX 0x1f +#define ADP1653_REG_OUT_SEL_HPLED_SHIFT 3 +#define ADP1653_REG_OUT_SEL_ILED_MAX 0x07 +#define ADP1653_REG_OUT_SEL_ILED_SHIFT 0 + +#define ADP1653_REG_CONFIG 0x01 +#define ADP1653_REG_CONFIG_TMR_CFG (1 << 4) +#define ADP1653_REG_CONFIG_TMR_SET_MAX 0x0f +#define ADP1653_REG_CONFIG_TMR_SET_SHIFT 0 + +#define ADP1653_REG_SW_STROBE 0x02 +#define ADP1653_REG_SW_STROBE_SW_STROBE (1 << 0) + +#define ADP1653_REG_FAULT 0x03 +#define ADP1653_REG_FAULT_FLT_SCP (1 << 3) +#define ADP1653_REG_FAULT_FLT_OT (1 << 2) +#define ADP1653_REG_FAULT_FLT_TMR (1 << 1) +#define ADP1653_REG_FAULT_FLT_OV (1 << 0) + +#define ADP1653_INDICATOR_INTENSITY_MIN 0 +#define ADP1653_INDICATOR_INTENSITY_STEP 2500 +#define ADP1653_INDICATOR_INTENSITY_MAX \ + (ADP1653_REG_OUT_SEL_ILED_MAX * ADP1653_INDICATOR_INTENSITY_STEP) +#define ADP1653_INDICATOR_INTENSITY_uA_TO_REG(a) \ + ((a) / ADP1653_INDICATOR_INTENSITY_STEP) +#define ADP1653_INDICATOR_INTENSITY_REG_TO_uA(a) \ + ((a) * ADP1653_INDICATOR_INTENSITY_STEP) + +#define ADP1653_FLASH_INTENSITY_BASE 35 +#define ADP1653_FLASH_INTENSITY_STEP 15 +#define ADP1653_FLASH_INTENSITY_MIN \ + (ADP1653_FLASH_INTENSITY_BASE \ + + ADP1653_REG_OUT_SEL_HPLED_FLASH_MIN * ADP1653_FLASH_INTENSITY_STEP) +#define ADP1653_FLASH_INTENSITY_MAX \ + (ADP1653_FLASH_INTENSITY_MIN + \ + (ADP1653_REG_OUT_SEL_HPLED_FLASH_MAX - \ + ADP1653_REG_OUT_SEL_HPLED_FLASH_MIN + 1) * \ + ADP1653_FLASH_INTENSITY_STEP) + +#define ADP1653_FLASH_INTENSITY_mA_TO_REG(a) \ + ((a) < ADP1653_FLASH_INTENSITY_BASE ? 0 : \ + (((a) - ADP1653_FLASH_INTENSITY_BASE) / ADP1653_FLASH_INTENSITY_STEP)) +#define ADP1653_FLASH_INTENSITY_REG_TO_mA(a) \ + ((a) * ADP1653_FLASH_INTENSITY_STEP + ADP1653_FLASH_INTENSITY_BASE) + +#define ADP1653_TORCH_INTENSITY_MIN \ + (ADP1653_FLASH_INTENSITY_BASE \ + + ADP1653_REG_OUT_SEL_HPLED_TORCH_MIN * ADP1653_FLASH_INTENSITY_STEP) +#define ADP1653_TORCH_INTENSITY_MAX \ + (ADP1653_TORCH_INTENSITY_MIN + \ + (ADP1653_REG_OUT_SEL_HPLED_TORCH_MAX - \ + ADP1653_REG_OUT_SEL_HPLED_TORCH_MIN + 1) * \ + ADP1653_FLASH_INTENSITY_STEP) + +struct adp1653_platform_data { + int (*power)(struct v4l2_subdev *sd, int on); + + u32 max_flash_timeout; /* flash light timeout in us */ + u32 max_flash_intensity; /* led intensity, flash mode */ + u32 max_torch_intensity; /* led intensity, torch mode */ + u32 max_indicator_intensity; /* indicator led intensity */ +}; + +#define to_adp1653_flash(sd) container_of(sd, struct adp1653_flash, subdev) + +struct adp1653_flash { + struct v4l2_subdev subdev; + struct adp1653_platform_data *platform_data; + + struct v4l2_ctrl_handler ctrls; + struct v4l2_ctrl *led_mode; + struct v4l2_ctrl *flash_timeout; + struct v4l2_ctrl *flash_intensity; + struct v4l2_ctrl *torch_intensity; + struct v4l2_ctrl *indicator_intensity; + + struct mutex power_lock; + int power_count; + int fault; +}; + +#endif /* ADP1653_H */ -- cgit v1.1 From f5f2cc646af13b0cf74b9d676408473123c9ea76 Mon Sep 17 00:00:00 2001 From: Jarod Wilson Date: Wed, 13 Jul 2011 18:09:48 -0300 Subject: [media] rc-core support for Microsoft IR keyboard/mouse This is a custom IR protocol decoder, for the RC-6-ish protocol used by the Microsoft Remote Keyboard, apparently developed internally at Microsoft, and officially dubbed MCIR-2, per their March 2011 remote and transceiver requirements and specifications document, which also touches on this IR keyboard/mouse device. Its a standard keyboard with embedded thumb stick mouse pointer and mouse buttons, along with a number of media keys. The media keys are standard RC-6, identical to the signals from the stock MCE remotes, and will be handled as such. The keyboard and mouse signals will be decoded and delivered to the system by an input device registered specifically by this driver. Successfully tested with multiple mceusb-driven transceivers, as well as with fintek-cir and redrat3 hardware. Essentially, any raw IR hardware with enough sampling resolution should be able to use this decoder, nothing about it is at all receiver-hardware-specific. This work is inspired by lirc_mod_mce: The documentation there and code aided in understanding and decoding the protocol, but the bulk of the code is actually borrowed more from the existing in-kernel decoders than anything. I did recycle the keyboard keycode table, a few defines, and some of the keyboard and mouse data parsing bits from lirc_mod_mce though. Special thanks to James Meyer for providing the hardware, and being patient with me as I took forever to get around to writing this. callback routine to ensure we don't get any stuck keys, and used symbolic names for the keytable. Also cc'ing Florian this time, who I believe is the original mod-mce author... CC: Florian Demski Signed-off-by: Jarod Wilson Signed-off-by: Mauro Carvalho Chehab --- include/media/rc-map.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/media') diff --git a/include/media/rc-map.h b/include/media/rc-map.h index 4e1409e..17c9759 100644 --- a/include/media/rc-map.h +++ b/include/media/rc-map.h @@ -18,12 +18,13 @@ #define RC_TYPE_JVC (1 << 3) /* JVC protocol */ #define RC_TYPE_SONY (1 << 4) /* Sony12/15/20 protocol */ #define RC_TYPE_RC5_SZ (1 << 5) /* RC5 variant used by Streamzap */ +#define RC_TYPE_MCE_KBD (1 << 29) /* RC6-ish MCE keyboard/mouse */ #define RC_TYPE_LIRC (1 << 30) /* Pass raw IR to lirc userspace */ #define RC_TYPE_OTHER (1u << 31) #define RC_TYPE_ALL (RC_TYPE_RC5 | RC_TYPE_NEC | RC_TYPE_RC6 | \ RC_TYPE_JVC | RC_TYPE_SONY | RC_TYPE_LIRC | \ - RC_TYPE_RC5_SZ | RC_TYPE_OTHER) + RC_TYPE_RC5_SZ | RC_TYPE_MCE_KBD | RC_TYPE_OTHER) struct rc_map_table { u32 scancode; -- cgit v1.1 From 839cf81346b5145f0959b28652612eabaed48d47 Mon Sep 17 00:00:00 2001 From: Tomasz Stanislawski Date: Wed, 2 Mar 2011 13:16:37 -0300 Subject: [media] v4l: add g_tvnorms_output callback to V4L2 subdev Callback is used to acquire TV norms supported by a subdev. It is used to avoid having standards in top-level driver. Signed-off-by: Tomasz Stanislawski Signed-off-by: Kyungmin Park Reviewed-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- include/media/v4l2-subdev.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/media') diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index b05579b..44a5ddb 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h @@ -229,6 +229,9 @@ struct v4l2_subdev_audio_ops { s_std_output: set v4l2_std_id for video OUTPUT devices. This is ignored by video input devices. + g_tvnorms_output: get v4l2_std_id with all standards supported by video + OUTPUT device. This is ignored by video input devices. + s_crystal_freq: sets the frequency of the crystal used to generate the clocks in Hz. An extra flags field allows device specific configuration regarding clock frequency dividers, etc. If not used, then set flags @@ -265,6 +268,7 @@ struct v4l2_subdev_video_ops { int (*s_crystal_freq)(struct v4l2_subdev *sd, u32 freq, u32 flags); int (*s_std_output)(struct v4l2_subdev *sd, v4l2_std_id std); int (*querystd)(struct v4l2_subdev *sd, v4l2_std_id *std); + int (*g_tvnorms_output)(struct v4l2_subdev *sd, v4l2_std_id *std); int (*g_input_status)(struct v4l2_subdev *sd, u32 *status); int (*s_stream)(struct v4l2_subdev *sd, int enable); int (*cropcap)(struct v4l2_subdev *sd, struct v4l2_cropcap *cc); -- cgit v1.1 From 8b32dd0d3f9221719507700fa396d280143b4da1 Mon Sep 17 00:00:00 2001 From: Tomasz Stanislawski Date: Wed, 29 Jun 2011 07:01:28 -0300 Subject: [media] v4l: add g_dv_preset callback to V4L2 subdev Callback is used to acquire current digital video preset from a subdev. It is used to avoid keeping dv preset in top-level driver. Signed-off-by: Tomasz Stanislawski Signed-off-by: Kyungmin Park Signed-off-by: Mauro Carvalho Chehab --- include/media/v4l2-subdev.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/media') diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index 44a5ddb..3bc7f92 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h @@ -246,6 +246,8 @@ struct v4l2_subdev_audio_ops { s_dv_preset: set dv (Digital Video) preset in the sub device. Similar to s_std() + g_dv_preset: get current dv (Digital Video) preset in the sub device. + query_dv_preset: query dv preset in the sub device. This is similar to querystd() @@ -286,6 +288,8 @@ struct v4l2_subdev_video_ops { struct v4l2_dv_enum_preset *preset); int (*s_dv_preset)(struct v4l2_subdev *sd, struct v4l2_dv_preset *preset); + int (*g_dv_preset)(struct v4l2_subdev *sd, + struct v4l2_dv_preset *preset); int (*query_dv_preset)(struct v4l2_subdev *sd, struct v4l2_dv_preset *preset); int (*s_dv_timings)(struct v4l2_subdev *sd, -- cgit v1.1 From 5930ab2ba089e05c8de594c36836724f8df7725e Mon Sep 17 00:00:00 2001 From: Tomasz Stanislawski Date: Wed, 29 Jun 2011 07:16:15 -0300 Subject: [media] v4l: add g_std_output callback to V4L2 subdev Callback is used to acquire current analog TV standard from a subdev. It is used to avoid keeping current standard in top-level driver. Signed-off-by: Tomasz Stanislawski Signed-off-by: Kyungmin Park Signed-off-by: Mauro Carvalho Chehab --- include/media/v4l2-subdev.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/media') diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index 3bc7f92..9ff0ab9 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h @@ -229,6 +229,9 @@ struct v4l2_subdev_audio_ops { s_std_output: set v4l2_std_id for video OUTPUT devices. This is ignored by video input devices. + g_std_output: get current standard for video OUTPUT devices. This is ignored + by video input devices. + g_tvnorms_output: get v4l2_std_id with all standards supported by video OUTPUT device. This is ignored by video input devices. @@ -269,6 +272,7 @@ struct v4l2_subdev_video_ops { int (*s_routing)(struct v4l2_subdev *sd, u32 input, u32 output, u32 config); int (*s_crystal_freq)(struct v4l2_subdev *sd, u32 freq, u32 flags); int (*s_std_output)(struct v4l2_subdev *sd, v4l2_std_id std); + int (*g_std_output)(struct v4l2_subdev *sd, v4l2_std_id *std); int (*querystd)(struct v4l2_subdev *sd, v4l2_std_id *std); int (*g_tvnorms_output)(struct v4l2_subdev *sd, v4l2_std_id *std); int (*g_input_status)(struct v4l2_subdev *sd, u32 *status); -- cgit v1.1 From 033d7463f816315308ffec6f69576d820bfbab0c Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Wed, 29 Jun 2011 07:43:48 -0300 Subject: [media] V4L: soc-camera: remove now unused soc-camera specific PM hooks soc-camera host drivers shall be implementing their PM, using standard kernel methods, soc-camera specific hooks can die. Signed-off-by: Guennadi Liakhovetski Signed-off-by: Mauro Carvalho Chehab --- include/media/soc_camera.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include/media') diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h index 21dd8a4..70c4ea5 100644 --- a/include/media/soc_camera.h +++ b/include/media/soc_camera.h @@ -66,8 +66,6 @@ struct soc_camera_host_ops { struct module *owner; int (*add)(struct soc_camera_device *); void (*remove)(struct soc_camera_device *); - int (*suspend)(struct soc_camera_device *, pm_message_t); - int (*resume)(struct soc_camera_device *); /* * .get_formats() is called for each client device format, but * .put_formats() is only called once. Further, if any of the calls to -- cgit v1.1 From 91c7953005247c9563408bbdbf35e27de33e6ec3 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Fri, 1 Jul 2011 14:31:17 -0300 Subject: [media] V4L: add media bus configuration subdev operations Add media bus configuration types and two subdev operations to get supported mediabus configurations and to set a specific configuration. Subdevs can support several configurations, e.g., they can send video data on 1 or several lanes, can be configured to use a specific CSI-2 channel, in such cases subdevice drivers return bitmasks with all respective bits set. When a set-configuration operation is called, it has to specify a non-ambiguous configuration. Signed-off-by: Stanimir Varbanov Signed-off-by: Guennadi Liakhovetski Signed-off-by: Mauro Carvalho Chehab --- include/media/v4l2-mediabus.h | 63 +++++++++++++++++++++++++++++++++++++++++++ include/media/v4l2-subdev.h | 10 +++++++ 2 files changed, 73 insertions(+) (limited to 'include/media') diff --git a/include/media/v4l2-mediabus.h b/include/media/v4l2-mediabus.h index 971c7fa..6114007 100644 --- a/include/media/v4l2-mediabus.h +++ b/include/media/v4l2-mediabus.h @@ -13,6 +13,69 @@ #include +/* 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) { diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index 9ff0ab9..257da1a 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h @@ -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); @@ -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); }; /* -- cgit v1.1 From 6b526fed0e688e3926bd43a09f2f36cba3983ce2 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Fri, 1 Jul 2011 11:19:58 -0300 Subject: [media] V4L: sh_mobile_csi2: switch away from using the soc-camera bus notifier This moves us one more step closer to eliminating the soc-camera bus and devices on it. Besides, as a side effect, CSI-2 runtime PM on sh-mobile secomes finer grained now: we only have to power on the interface, when the device nodes are open. Signed-off-by: Guennadi Liakhovetski Acked-by: Paul Mundt Signed-off-by: Mauro Carvalho Chehab --- include/media/sh_mobile_ceu.h | 10 +++++++++- include/media/sh_mobile_csi2.h | 8 +++++--- 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'include/media') diff --git a/include/media/sh_mobile_ceu.h b/include/media/sh_mobile_ceu.h index 80346a6..48413b4 100644 --- a/include/media/sh_mobile_ceu.h +++ b/include/media/sh_mobile_ceu.h @@ -7,10 +7,18 @@ #define SH_CEU_FLAG_VSYNC_LOW (1 << 3) /* default High if possible */ struct device; +struct resource; + +struct sh_mobile_ceu_companion { + u32 num_resources; + struct resource *resource; + int id; + void *platform_data; +}; struct sh_mobile_ceu_info { unsigned long flags; - struct device *csi2_dev; + struct sh_mobile_ceu_companion *csi2; }; #endif /* __ASM_SH_MOBILE_CEU_H__ */ diff --git a/include/media/sh_mobile_csi2.h b/include/media/sh_mobile_csi2.h index 4d26151..c586c4f 100644 --- a/include/media/sh_mobile_csi2.h +++ b/include/media/sh_mobile_csi2.h @@ -11,6 +11,8 @@ #ifndef SH_MIPI_CSI #define SH_MIPI_CSI +#include + enum sh_csi2_phy { SH_CSI2_PHY_MAIN, SH_CSI2_PHY_SUB, @@ -33,14 +35,14 @@ struct sh_csi2_client_config { struct platform_device *pdev; /* client platform device */ }; +struct v4l2_device; + struct sh_csi2_pdata { enum sh_csi2_type type; unsigned int flags; struct sh_csi2_client_config *clients; int num_clients; + struct v4l2_device *v4l2_dev; }; -struct device; -struct v4l2_device; - #endif -- cgit v1.1 From d33b290a149dafe2e3cc2901ec726bea09a2c0f4 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Fri, 1 Jul 2011 11:31:35 -0300 Subject: [media] V4L: soc-camera: un-export the soc-camera bus The soc-camera bus is now completely local again. Signed-off-by: Guennadi Liakhovetski Signed-off-by: Mauro Carvalho Chehab --- include/media/soc_camera.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'include/media') diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h index 70c4ea5..c31d55b 100644 --- a/include/media/soc_camera.h +++ b/include/media/soc_camera.h @@ -20,12 +20,10 @@ #include #include -extern struct bus_type soc_camera_bus_type; - struct file; struct soc_camera_device { - struct list_head list; + struct list_head list; /* list of all registered devices */ struct device dev; struct device *pdev; /* Platform device */ s32 user_width; @@ -126,8 +124,8 @@ struct soc_camera_link { int num_regulators; /* - * For non-I2C devices platform platform has to provide methods to - * add a device to the system and to remove + * For non-I2C devices platform has to provide methods to add a device + * to the system and to remove it */ int (*add_device)(struct soc_camera_link *, struct device *); void (*del_device)(struct soc_camera_link *); -- cgit v1.1 From 7dfff95366f48bf66f77c17cdc9ebd8be696ac5d Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Fri, 15 Jul 2011 20:03:38 -0300 Subject: [media] V4L: soc-camera: remove soc-camera bus and devices on it Now that v4l2 subdevices have got their own device objects, having one more device in soc-camera clients became redundant and confusing. This patch removes those devices and the soc-camera bus, they used to reside on. Signed-off-by: Guennadi Liakhovetski Acked-by: Paul Mundt Signed-off-by: Mauro Carvalho Chehab --- include/media/soc_camera.h | 19 ++++++++----------- include/media/soc_camera_platform.h | 15 +++++++-------- 2 files changed, 15 insertions(+), 19 deletions(-) (limited to 'include/media') diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h index c31d55b..7582952 100644 --- a/include/media/soc_camera.h +++ b/include/media/soc_camera.h @@ -21,11 +21,14 @@ #include struct file; +struct soc_camera_link; struct soc_camera_device { struct list_head list; /* list of all registered devices */ - struct device dev; + struct soc_camera_link *link; struct device *pdev; /* Platform device */ + struct device *parent; /* Camera host device */ + struct device *control; /* E.g., the i2c client */ s32 user_width; s32 user_height; u32 bytesperline; /* for padding, zero if unused */ @@ -127,8 +130,8 @@ struct soc_camera_link { * For non-I2C devices platform has to provide methods to add a device * to the system and to remove it */ - int (*add_device)(struct soc_camera_link *, struct device *); - void (*del_device)(struct soc_camera_link *); + int (*add_device)(struct soc_camera_device *); + void (*del_device)(struct soc_camera_device *); /* Optional callbacks to power on or off and reset the sensor */ int (*power)(struct device *, int); int (*reset)(struct device *); @@ -142,12 +145,6 @@ struct soc_camera_link { void (*free_bus)(struct soc_camera_link *); }; -static inline struct soc_camera_device *to_soc_camera_dev( - const struct device *dev) -{ - return container_of(dev, struct soc_camera_device, dev); -} - static inline struct soc_camera_host *to_soc_camera_host( const struct device *dev) { @@ -159,13 +156,13 @@ static inline struct soc_camera_host *to_soc_camera_host( static inline struct soc_camera_link *to_soc_camera_link( const struct soc_camera_device *icd) { - return icd->dev.platform_data; + return icd->link; } static inline struct device *to_soc_camera_control( const struct soc_camera_device *icd) { - return dev_get_drvdata(&icd->dev); + return icd->control; } static inline struct v4l2_subdev *soc_camera_to_subdev( diff --git a/include/media/soc_camera_platform.h b/include/media/soc_camera_platform.h index 6d7a4fd..74f0fa1 100644 --- a/include/media/soc_camera_platform.h +++ b/include/media/soc_camera_platform.h @@ -21,7 +21,7 @@ struct soc_camera_platform_info { unsigned long format_depth; struct v4l2_mbus_framefmt format; unsigned long bus_param; - struct device *dev; + struct soc_camera_device *icd; int (*set_capture)(struct soc_camera_platform_info *info, int enable); }; @@ -30,8 +30,7 @@ static inline void soc_camera_platform_release(struct platform_device **pdev) *pdev = NULL; } -static inline int soc_camera_platform_add(const struct soc_camera_link *icl, - struct device *dev, +static inline int soc_camera_platform_add(struct soc_camera_device *icd, struct platform_device **pdev, struct soc_camera_link *plink, void (*release)(struct device *dev), @@ -40,7 +39,7 @@ static inline int soc_camera_platform_add(const struct soc_camera_link *icl, struct soc_camera_platform_info *info = plink->priv; int ret; - if (icl != plink) + if (icd->link != plink) return -ENODEV; if (*pdev) @@ -50,7 +49,7 @@ static inline int soc_camera_platform_add(const struct soc_camera_link *icl, if (!*pdev) return -ENOMEM; - info->dev = dev; + info->icd = icd; (*pdev)->dev.platform_data = info; (*pdev)->dev.release = release; @@ -59,17 +58,17 @@ static inline int soc_camera_platform_add(const struct soc_camera_link *icl, if (ret < 0) { platform_device_put(*pdev); *pdev = NULL; - info->dev = NULL; + info->icd = NULL; } return ret; } -static inline void soc_camera_platform_del(const struct soc_camera_link *icl, +static inline void soc_camera_platform_del(const struct soc_camera_device *icd, struct platform_device *pdev, const struct soc_camera_link *plink) { - if (icl != plink || !pdev) + if (icd->link != plink || !pdev) return; platform_device_unregister(pdev); -- cgit v1.1 From b52a851d9182e8a20704152d537c7e19ed34cc99 Mon Sep 17 00:00:00 2001 From: Bastian Hecht Date: Fri, 24 Jun 2011 07:57:36 -0300 Subject: [media] V4L: initial driver for ov5642 CMOS sensor This is an initial driver release for the Omnivision 5642 CMOS sensor. Signed-off-by: Bastian Hecht Signed-off-by: Guennadi Liakhovetski Signed-off-by: Mauro Carvalho Chehab --- include/media/v4l2-chip-ident.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/media') diff --git a/include/media/v4l2-chip-ident.h b/include/media/v4l2-chip-ident.h index 8717045..63fd9d3 100644 --- a/include/media/v4l2-chip-ident.h +++ b/include/media/v4l2-chip-ident.h @@ -76,6 +76,7 @@ enum { V4L2_IDENT_OV6650 = 258, V4L2_IDENT_OV2640 = 259, V4L2_IDENT_OV9740 = 260, + V4L2_IDENT_OV5642 = 261, /* module saa7146: reserved range 300-309 */ V4L2_IDENT_SAA7146 = 300, -- cgit v1.1