diff options
Diffstat (limited to 'include/media')
| -rw-r--r-- | include/media/media-entity.h | 5 | ||||
| -rw-r--r-- | include/media/mt9p031.h | 19 | ||||
| -rw-r--r-- | include/media/omap3isp.h | 29 | ||||
| -rw-r--r-- | include/media/rc-map.h | 3 | ||||
| -rw-r--r-- | include/media/s5p_fimc.h | 16 | ||||
| -rw-r--r-- | include/media/saa7146.h | 4 | ||||
| -rw-r--r-- | include/media/saa7146_vv.h | 25 | ||||
| -rw-r--r-- | include/media/sh_mobile_ceu.h | 1 | ||||
| -rw-r--r-- | include/media/smiapp.h | 84 | ||||
| -rw-r--r-- | include/media/soc_camera.h | 9 | ||||
| -rw-r--r-- | include/media/soc_mediabus.h | 21 | ||||
| -rw-r--r-- | include/media/v4l2-ctrls.h | 40 | ||||
| -rw-r--r-- | include/media/v4l2-dev.h | 25 | ||||
| -rw-r--r-- | include/media/v4l2-event.h | 24 | ||||
| -rw-r--r-- | include/media/v4l2-ioctl.h | 6 | ||||
| -rw-r--r-- | include/media/v4l2-subdev.h | 55 | ||||
| -rw-r--r-- | include/media/videobuf-dma-contig.h | 10 |
17 files changed, 320 insertions, 56 deletions
diff --git a/include/media/media-entity.h b/include/media/media-entity.h index 29e7bba78ffe..0c16f518ee09 100644 --- a/include/media/media-entity.h +++ b/include/media/media-entity.h | |||
| @@ -46,6 +46,7 @@ struct media_entity_operations { | |||
| 46 | int (*link_setup)(struct media_entity *entity, | 46 | int (*link_setup)(struct media_entity *entity, |
| 47 | const struct media_pad *local, | 47 | const struct media_pad *local, |
| 48 | const struct media_pad *remote, u32 flags); | 48 | const struct media_pad *remote, u32 flags); |
| 49 | int (*link_validate)(struct media_link *link); | ||
| 49 | }; | 50 | }; |
| 50 | 51 | ||
| 51 | struct media_entity { | 52 | struct media_entity { |
| @@ -140,8 +141,8 @@ void media_entity_graph_walk_start(struct media_entity_graph *graph, | |||
| 140 | struct media_entity *entity); | 141 | struct media_entity *entity); |
| 141 | struct media_entity * | 142 | struct media_entity * |
| 142 | media_entity_graph_walk_next(struct media_entity_graph *graph); | 143 | media_entity_graph_walk_next(struct media_entity_graph *graph); |
| 143 | void media_entity_pipeline_start(struct media_entity *entity, | 144 | __must_check int media_entity_pipeline_start(struct media_entity *entity, |
| 144 | struct media_pipeline *pipe); | 145 | struct media_pipeline *pipe); |
| 145 | void media_entity_pipeline_stop(struct media_entity *entity); | 146 | void media_entity_pipeline_stop(struct media_entity *entity); |
| 146 | 147 | ||
| 147 | #define media_entity_call(entity, operation, args...) \ | 148 | #define media_entity_call(entity, operation, args...) \ |
diff --git a/include/media/mt9p031.h b/include/media/mt9p031.h index 96448c7a318b..0c97b19af293 100644 --- a/include/media/mt9p031.h +++ b/include/media/mt9p031.h | |||
| @@ -3,17 +3,18 @@ | |||
| 3 | 3 | ||
| 4 | struct v4l2_subdev; | 4 | struct v4l2_subdev; |
| 5 | 5 | ||
| 6 | enum { | 6 | /* |
| 7 | MT9P031_COLOR_VERSION, | 7 | * struct mt9p031_platform_data - MT9P031 platform data |
| 8 | MT9P031_MONOCHROME_VERSION, | 8 | * @set_xclk: Clock frequency set callback |
| 9 | }; | 9 | * @reset: Chip reset GPIO (set to -1 if not used) |
| 10 | 10 | * @ext_freq: Input clock frequency | |
| 11 | * @target_freq: Pixel clock frequency | ||
| 12 | */ | ||
| 11 | struct mt9p031_platform_data { | 13 | struct mt9p031_platform_data { |
| 12 | int (*set_xclk)(struct v4l2_subdev *subdev, int hz); | 14 | int (*set_xclk)(struct v4l2_subdev *subdev, int hz); |
| 13 | int (*reset)(struct v4l2_subdev *subdev, int active); | 15 | int reset; |
| 14 | int ext_freq; /* input frequency to the mt9p031 for PLL dividers */ | 16 | int ext_freq; |
| 15 | int target_freq; /* frequency target for the PLL */ | 17 | int target_freq; |
| 16 | int version; /* MT9P031_COLOR_VERSION or MT9P031_MONOCHROME_VERSION */ | ||
| 17 | }; | 18 | }; |
| 18 | 19 | ||
| 19 | #endif | 20 | #endif |
diff --git a/include/media/omap3isp.h b/include/media/omap3isp.h index 042849a34640..4d94be5226af 100644 --- a/include/media/omap3isp.h +++ b/include/media/omap3isp.h | |||
| @@ -29,6 +29,10 @@ | |||
| 29 | struct i2c_board_info; | 29 | struct i2c_board_info; |
| 30 | struct isp_device; | 30 | struct isp_device; |
| 31 | 31 | ||
| 32 | #define ISP_XCLK_NONE 0 | ||
| 33 | #define ISP_XCLK_A 1 | ||
| 34 | #define ISP_XCLK_B 2 | ||
| 35 | |||
| 32 | enum isp_interface_type { | 36 | enum isp_interface_type { |
| 33 | ISP_INTERFACE_PARALLEL, | 37 | ISP_INTERFACE_PARALLEL, |
| 34 | ISP_INTERFACE_CSI2A_PHY2, | 38 | ISP_INTERFACE_CSI2A_PHY2, |
| @@ -87,6 +91,29 @@ enum { | |||
| 87 | }; | 91 | }; |
| 88 | 92 | ||
| 89 | /** | 93 | /** |
| 94 | * struct isp_csiphy_lane: CCP2/CSI2 lane position and polarity | ||
| 95 | * @pos: position of the lane | ||
| 96 | * @pol: polarity of the lane | ||
| 97 | */ | ||
| 98 | struct isp_csiphy_lane { | ||
| 99 | u8 pos; | ||
| 100 | u8 pol; | ||
| 101 | }; | ||
| 102 | |||
| 103 | #define ISP_CSIPHY1_NUM_DATA_LANES 1 | ||
| 104 | #define ISP_CSIPHY2_NUM_DATA_LANES 2 | ||
| 105 | |||
| 106 | /** | ||
| 107 | * struct isp_csiphy_lanes_cfg - CCP2/CSI2 lane configuration | ||
| 108 | * @data: Configuration of one or two data lanes | ||
| 109 | * @clk: Clock lane configuration | ||
| 110 | */ | ||
| 111 | struct isp_csiphy_lanes_cfg { | ||
| 112 | struct isp_csiphy_lane data[ISP_CSIPHY2_NUM_DATA_LANES]; | ||
| 113 | struct isp_csiphy_lane clk; | ||
| 114 | }; | ||
| 115 | |||
| 116 | /** | ||
| 90 | * struct isp_ccp2_platform_data - CCP2 interface platform data | 117 | * struct isp_ccp2_platform_data - CCP2 interface platform data |
| 91 | * @strobe_clk_pol: Strobe/clock polarity | 118 | * @strobe_clk_pol: Strobe/clock polarity |
| 92 | * 0 - Non Inverted, 1 - Inverted | 119 | * 0 - Non Inverted, 1 - Inverted |
| @@ -105,6 +132,7 @@ struct isp_ccp2_platform_data { | |||
| 105 | unsigned int ccp2_mode:1; | 132 | unsigned int ccp2_mode:1; |
| 106 | unsigned int phy_layer:1; | 133 | unsigned int phy_layer:1; |
| 107 | unsigned int vpclk_div:2; | 134 | unsigned int vpclk_div:2; |
| 135 | struct isp_csiphy_lanes_cfg lanecfg; | ||
| 108 | }; | 136 | }; |
| 109 | 137 | ||
| 110 | /** | 138 | /** |
| @@ -115,6 +143,7 @@ struct isp_ccp2_platform_data { | |||
| 115 | struct isp_csi2_platform_data { | 143 | struct isp_csi2_platform_data { |
| 116 | unsigned crc:1; | 144 | unsigned crc:1; |
| 117 | unsigned vpclk_div:2; | 145 | unsigned vpclk_div:2; |
| 146 | struct isp_csiphy_lanes_cfg lanecfg; | ||
| 118 | }; | 147 | }; |
| 119 | 148 | ||
| 120 | struct isp_subdev_i2c_board_info { | 149 | struct isp_subdev_i2c_board_info { |
diff --git a/include/media/rc-map.h b/include/media/rc-map.h index 8db6741c1256..cfd5163ff7f3 100644 --- a/include/media/rc-map.h +++ b/include/media/rc-map.h | |||
| @@ -62,6 +62,7 @@ void rc_map_init(void); | |||
| 62 | #define RC_MAP_ANYSEE "rc-anysee" | 62 | #define RC_MAP_ANYSEE "rc-anysee" |
| 63 | #define RC_MAP_APAC_VIEWCOMP "rc-apac-viewcomp" | 63 | #define RC_MAP_APAC_VIEWCOMP "rc-apac-viewcomp" |
| 64 | #define RC_MAP_ASUS_PC39 "rc-asus-pc39" | 64 | #define RC_MAP_ASUS_PC39 "rc-asus-pc39" |
| 65 | #define RC_MAP_ASUS_PS3_100 "rc-asus-ps3-100" | ||
| 65 | #define RC_MAP_ATI_TV_WONDER_HD_600 "rc-ati-tv-wonder-hd-600" | 66 | #define RC_MAP_ATI_TV_WONDER_HD_600 "rc-ati-tv-wonder-hd-600" |
| 66 | #define RC_MAP_ATI_X10 "rc-ati-x10" | 67 | #define RC_MAP_ATI_X10 "rc-ati-x10" |
| 67 | #define RC_MAP_AVERMEDIA_A16D "rc-avermedia-a16d" | 68 | #define RC_MAP_AVERMEDIA_A16D "rc-avermedia-a16d" |
| @@ -113,6 +114,8 @@ void rc_map_init(void); | |||
| 113 | #define RC_MAP_LME2510 "rc-lme2510" | 114 | #define RC_MAP_LME2510 "rc-lme2510" |
| 114 | #define RC_MAP_MANLI "rc-manli" | 115 | #define RC_MAP_MANLI "rc-manli" |
| 115 | #define RC_MAP_MEDION_X10 "rc-medion-x10" | 116 | #define RC_MAP_MEDION_X10 "rc-medion-x10" |
| 117 | #define RC_MAP_MEDION_X10_DIGITAINER "rc-medion-x10-digitainer" | ||
| 118 | #define RC_MAP_MEDION_X10_OR2X "rc-medion-x10-or2x" | ||
| 116 | #define RC_MAP_MSI_DIGIVOX_II "rc-msi-digivox-ii" | 119 | #define RC_MAP_MSI_DIGIVOX_II "rc-msi-digivox-ii" |
| 117 | #define RC_MAP_MSI_DIGIVOX_III "rc-msi-digivox-iii" | 120 | #define RC_MAP_MSI_DIGIVOX_III "rc-msi-digivox-iii" |
| 118 | #define RC_MAP_MSI_TVANYWHERE_PLUS "rc-msi-tvanywhere-plus" | 121 | #define RC_MAP_MSI_TVANYWHERE_PLUS "rc-msi-tvanywhere-plus" |
diff --git a/include/media/s5p_fimc.h b/include/media/s5p_fimc.h index 688fb3f1dc35..8587aaf73646 100644 --- a/include/media/s5p_fimc.h +++ b/include/media/s5p_fimc.h | |||
| @@ -64,4 +64,20 @@ struct s5p_platform_fimc { | |||
| 64 | */ | 64 | */ |
| 65 | #define S5P_FIMC_TX_END_NOTIFY _IO('e', 0) | 65 | #define S5P_FIMC_TX_END_NOTIFY _IO('e', 0) |
| 66 | 66 | ||
| 67 | enum fimc_subdev_index { | ||
| 68 | IDX_SENSOR, | ||
| 69 | IDX_CSIS, | ||
| 70 | IDX_FLITE, | ||
| 71 | IDX_FIMC, | ||
| 72 | IDX_MAX, | ||
| 73 | }; | ||
| 74 | |||
| 75 | struct media_pipeline; | ||
| 76 | struct v4l2_subdev; | ||
| 77 | |||
| 78 | struct fimc_pipeline { | ||
| 79 | struct v4l2_subdev *subdevs[IDX_MAX]; | ||
| 80 | struct media_pipeline *m_pipeline; | ||
| 81 | }; | ||
| 82 | |||
| 67 | #endif /* S5P_FIMC_H_ */ | 83 | #endif /* S5P_FIMC_H_ */ |
diff --git a/include/media/saa7146.h b/include/media/saa7146.h index 0f037e8edf9a..773e527deabe 100644 --- a/include/media/saa7146.h +++ b/include/media/saa7146.h | |||
| @@ -13,12 +13,11 @@ | |||
| 13 | #include <linux/mutex.h> | 13 | #include <linux/mutex.h> |
| 14 | #include <linux/scatterlist.h> | 14 | #include <linux/scatterlist.h> |
| 15 | #include <media/v4l2-device.h> | 15 | #include <media/v4l2-device.h> |
| 16 | #include <media/v4l2-ctrls.h> | ||
| 16 | 17 | ||
| 17 | #include <linux/vmalloc.h> /* for vmalloc() */ | 18 | #include <linux/vmalloc.h> /* for vmalloc() */ |
| 18 | #include <linux/mm.h> /* for vmalloc_to_page() */ | 19 | #include <linux/mm.h> /* for vmalloc_to_page() */ |
| 19 | 20 | ||
| 20 | #define SAA7146_VERSION_CODE 0x000600 /* 0.6.0 */ | ||
| 21 | |||
| 22 | #define saa7146_write(sxy,adr,dat) writel((dat),(sxy->mem+(adr))) | 21 | #define saa7146_write(sxy,adr,dat) writel((dat),(sxy->mem+(adr))) |
| 23 | #define saa7146_read(sxy,adr) readl(sxy->mem+(adr)) | 22 | #define saa7146_read(sxy,adr) readl(sxy->mem+(adr)) |
| 24 | 23 | ||
| @@ -121,6 +120,7 @@ struct saa7146_dev | |||
| 121 | struct list_head item; | 120 | struct list_head item; |
| 122 | 121 | ||
| 123 | struct v4l2_device v4l2_dev; | 122 | struct v4l2_device v4l2_dev; |
| 123 | struct v4l2_ctrl_handler ctrl_handler; | ||
| 124 | 124 | ||
| 125 | /* different device locks */ | 125 | /* different device locks */ |
| 126 | spinlock_t slock; | 126 | spinlock_t slock; |
diff --git a/include/media/saa7146_vv.h b/include/media/saa7146_vv.h index 4aeff96ff7d8..944ecdf3530f 100644 --- a/include/media/saa7146_vv.h +++ b/include/media/saa7146_vv.h | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | #include <media/v4l2-common.h> | 4 | #include <media/v4l2-common.h> |
| 5 | #include <media/v4l2-ioctl.h> | 5 | #include <media/v4l2-ioctl.h> |
| 6 | #include <media/v4l2-fh.h> | ||
| 6 | #include <media/saa7146.h> | 7 | #include <media/saa7146.h> |
| 7 | #include <media/videobuf-dma-sg.h> | 8 | #include <media/videobuf-dma-sg.h> |
| 8 | 9 | ||
| @@ -84,21 +85,15 @@ struct saa7146_overlay { | |||
| 84 | 85 | ||
| 85 | /* per open data */ | 86 | /* per open data */ |
| 86 | struct saa7146_fh { | 87 | struct saa7146_fh { |
| 88 | /* Must be the first field! */ | ||
| 89 | struct v4l2_fh fh; | ||
| 87 | struct saa7146_dev *dev; | 90 | struct saa7146_dev *dev; |
| 88 | /* if this is a vbi or capture open */ | ||
| 89 | enum v4l2_buf_type type; | ||
| 90 | |||
| 91 | /* video overlay */ | ||
| 92 | struct saa7146_overlay ov; | ||
| 93 | 91 | ||
| 94 | /* video capture */ | 92 | /* video capture */ |
| 95 | struct videobuf_queue video_q; | 93 | struct videobuf_queue video_q; |
| 96 | struct v4l2_pix_format video_fmt; | ||
| 97 | 94 | ||
| 98 | /* vbi capture */ | 95 | /* vbi capture */ |
| 99 | struct videobuf_queue vbi_q; | 96 | struct videobuf_queue vbi_q; |
| 100 | struct v4l2_vbi_format vbi_fmt; | ||
| 101 | struct timer_list vbi_read_timeout; | ||
| 102 | 97 | ||
| 103 | unsigned int resources; /* resource management for device open */ | 98 | unsigned int resources; /* resource management for device open */ |
| 104 | }; | 99 | }; |
| @@ -109,7 +104,9 @@ struct saa7146_fh { | |||
| 109 | struct saa7146_vv | 104 | struct saa7146_vv |
| 110 | { | 105 | { |
| 111 | /* vbi capture */ | 106 | /* vbi capture */ |
| 112 | struct saa7146_dmaqueue vbi_q; | 107 | struct saa7146_dmaqueue vbi_dmaq; |
| 108 | struct v4l2_vbi_format vbi_fmt; | ||
| 109 | struct timer_list vbi_read_timeout; | ||
| 113 | /* vbi workaround interrupt queue */ | 110 | /* vbi workaround interrupt queue */ |
| 114 | wait_queue_head_t vbi_wq; | 111 | wait_queue_head_t vbi_wq; |
| 115 | int vbi_fieldcount; | 112 | int vbi_fieldcount; |
| @@ -119,13 +116,14 @@ struct saa7146_vv | |||
| 119 | struct saa7146_fh *video_fh; | 116 | struct saa7146_fh *video_fh; |
| 120 | 117 | ||
| 121 | /* video overlay */ | 118 | /* video overlay */ |
| 119 | struct saa7146_overlay ov; | ||
| 122 | struct v4l2_framebuffer ov_fb; | 120 | struct v4l2_framebuffer ov_fb; |
| 123 | struct saa7146_format *ov_fmt; | 121 | struct saa7146_format *ov_fmt; |
| 124 | struct saa7146_overlay *ov_data; | ||
| 125 | struct saa7146_fh *ov_suspend; | 122 | struct saa7146_fh *ov_suspend; |
| 126 | 123 | ||
| 127 | /* video capture */ | 124 | /* video capture */ |
| 128 | struct saa7146_dmaqueue video_q; | 125 | struct saa7146_dmaqueue video_dmaq; |
| 126 | struct v4l2_pix_format video_fmt; | ||
| 129 | enum v4l2_field last_field; | 127 | enum v4l2_field last_field; |
| 130 | 128 | ||
| 131 | /* common: fixme? shouldn't this be in saa7146_fh? | 129 | /* common: fixme? shouldn't this be in saa7146_fh? |
| @@ -163,7 +161,8 @@ struct saa7146_ext_vv | |||
| 163 | int (*std_callback)(struct saa7146_dev*, struct saa7146_standard *); | 161 | int (*std_callback)(struct saa7146_dev*, struct saa7146_standard *); |
| 164 | 162 | ||
| 165 | /* the extension can override this */ | 163 | /* the extension can override this */ |
| 166 | struct v4l2_ioctl_ops ops; | 164 | struct v4l2_ioctl_ops vid_ops; |
| 165 | struct v4l2_ioctl_ops vbi_ops; | ||
| 167 | /* pointer to the saa7146 core ops */ | 166 | /* pointer to the saa7146 core ops */ |
| 168 | const struct v4l2_ioctl_ops *core_ops; | 167 | const struct v4l2_ioctl_ops *core_ops; |
| 169 | 168 | ||
| @@ -202,10 +201,12 @@ void saa7146_set_gpio(struct saa7146_dev *saa, u8 pin, u8 data); | |||
| 202 | 201 | ||
| 203 | /* from saa7146_video.c */ | 202 | /* from saa7146_video.c */ |
| 204 | extern const struct v4l2_ioctl_ops saa7146_video_ioctl_ops; | 203 | extern const struct v4l2_ioctl_ops saa7146_video_ioctl_ops; |
| 204 | extern const struct v4l2_ioctl_ops saa7146_vbi_ioctl_ops; | ||
| 205 | extern struct saa7146_use_ops saa7146_video_uops; | 205 | extern struct saa7146_use_ops saa7146_video_uops; |
| 206 | int saa7146_start_preview(struct saa7146_fh *fh); | 206 | int saa7146_start_preview(struct saa7146_fh *fh); |
| 207 | int saa7146_stop_preview(struct saa7146_fh *fh); | 207 | int saa7146_stop_preview(struct saa7146_fh *fh); |
| 208 | long saa7146_video_do_ioctl(struct file *file, unsigned int cmd, void *arg); | 208 | long saa7146_video_do_ioctl(struct file *file, unsigned int cmd, void *arg); |
| 209 | int saa7146_s_ctrl(struct v4l2_ctrl *ctrl); | ||
| 209 | 210 | ||
| 210 | /* from saa7146_vbi.c */ | 211 | /* from saa7146_vbi.c */ |
| 211 | extern struct saa7146_use_ops saa7146_vbi_uops; | 212 | extern struct saa7146_use_ops saa7146_vbi_uops; |
diff --git a/include/media/sh_mobile_ceu.h b/include/media/sh_mobile_ceu.h index a90a765f18da..6fdb6adf6b2b 100644 --- a/include/media/sh_mobile_ceu.h +++ b/include/media/sh_mobile_ceu.h | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | #define SH_CEU_FLAG_USE_16BIT_BUS (1 << 1) /* use 16bit bus width */ | 5 | #define SH_CEU_FLAG_USE_16BIT_BUS (1 << 1) /* use 16bit bus width */ |
| 6 | #define SH_CEU_FLAG_HSYNC_LOW (1 << 2) /* default High if possible */ | 6 | #define SH_CEU_FLAG_HSYNC_LOW (1 << 2) /* default High if possible */ |
| 7 | #define SH_CEU_FLAG_VSYNC_LOW (1 << 3) /* default High if possible */ | 7 | #define SH_CEU_FLAG_VSYNC_LOW (1 << 3) /* default High if possible */ |
| 8 | #define SH_CEU_FLAG_LOWER_8BIT (1 << 4) /* default upper 8bit */ | ||
| 8 | 9 | ||
| 9 | struct device; | 10 | struct device; |
| 10 | struct resource; | 11 | struct resource; |
diff --git a/include/media/smiapp.h b/include/media/smiapp.h new file mode 100644 index 000000000000..9ab07fd45d5c --- /dev/null +++ b/include/media/smiapp.h | |||
| @@ -0,0 +1,84 @@ | |||
| 1 | /* | ||
| 2 | * include/media/smiapp.h | ||
| 3 | * | ||
| 4 | * Generic driver for SMIA/SMIA++ compliant camera modules | ||
| 5 | * | ||
| 6 | * Copyright (C) 2011--2012 Nokia Corporation | ||
| 7 | * Contact: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com> | ||
| 8 | * | ||
| 9 | * This program is free software; you can redistribute it and/or | ||
| 10 | * modify it under the terms of the GNU General Public License | ||
| 11 | * version 2 as published by the Free Software Foundation. | ||
| 12 | * | ||
| 13 | * This program is distributed in the hope that it will be useful, but | ||
| 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 16 | * General Public License for more details. | ||
| 17 | * | ||
| 18 | * You should have received a copy of the GNU General Public License | ||
| 19 | * along with this program; if not, write to the Free Software | ||
| 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
| 21 | * 02110-1301 USA | ||
| 22 | * | ||
| 23 | */ | ||
| 24 | |||
| 25 | #ifndef __SMIAPP_H_ | ||
| 26 | #define __SMIAPP_H_ | ||
| 27 | |||
| 28 | #include <media/v4l2-subdev.h> | ||
| 29 | |||
| 30 | #define SMIAPP_NAME "smiapp" | ||
| 31 | |||
| 32 | #define SMIAPP_DFL_I2C_ADDR (0x20 >> 1) /* Default I2C Address */ | ||
| 33 | #define SMIAPP_ALT_I2C_ADDR (0x6e >> 1) /* Alternate I2C Address */ | ||
| 34 | |||
| 35 | #define SMIAPP_CSI_SIGNALLING_MODE_CCP2_DATA_CLOCK 0 | ||
| 36 | #define SMIAPP_CSI_SIGNALLING_MODE_CCP2_DATA_STROBE 1 | ||
| 37 | #define SMIAPP_CSI_SIGNALLING_MODE_CSI2 2 | ||
| 38 | |||
| 39 | #define SMIAPP_NO_XSHUTDOWN -1 | ||
| 40 | |||
| 41 | /* | ||
| 42 | * Sometimes due to board layout considerations the camera module can be | ||
| 43 | * mounted rotated. The typical rotation used is 180 degrees which can be | ||
| 44 | * corrected by giving a default H-FLIP and V-FLIP in the sensor readout. | ||
| 45 | * FIXME: rotation also changes the bayer pattern. | ||
| 46 | */ | ||
| 47 | enum smiapp_module_board_orient { | ||
| 48 | SMIAPP_MODULE_BOARD_ORIENT_0 = 0, | ||
| 49 | SMIAPP_MODULE_BOARD_ORIENT_180, | ||
| 50 | }; | ||
| 51 | |||
| 52 | struct smiapp_flash_strobe_parms { | ||
| 53 | u8 mode; | ||
| 54 | u32 strobe_width_high_us; | ||
| 55 | u16 strobe_delay; | ||
| 56 | u16 stobe_start_point; | ||
| 57 | u8 trigger; | ||
| 58 | }; | ||
| 59 | |||
| 60 | struct smiapp_platform_data { | ||
| 61 | /* | ||
| 62 | * Change the cci address if i2c_addr_alt is set. | ||
| 63 | * Both default and alternate cci addr need to be present | ||
| 64 | */ | ||
| 65 | unsigned short i2c_addr_dfl; /* Default i2c addr */ | ||
| 66 | unsigned short i2c_addr_alt; /* Alternate i2c addr */ | ||
| 67 | |||
| 68 | unsigned int nvm_size; /* bytes */ | ||
| 69 | unsigned int ext_clk; /* sensor external clk */ | ||
| 70 | |||
| 71 | unsigned int lanes; /* Number of CSI-2 lanes */ | ||
| 72 | u8 csi_signalling_mode; /* SMIAPP_CSI_SIGNALLING_MODE_* */ | ||
| 73 | const s64 *op_sys_clock; | ||
| 74 | |||
| 75 | enum smiapp_module_board_orient module_board_orient; | ||
| 76 | |||
| 77 | struct smiapp_flash_strobe_parms *strobe_setup; | ||
| 78 | |||
| 79 | int (*set_xclk)(struct v4l2_subdev *sd, int hz); | ||
| 80 | char *ext_clk_name; | ||
| 81 | int xshutdown; /* gpio or SMIAPP_NO_XSHUTDOWN */ | ||
| 82 | }; | ||
| 83 | |||
| 84 | #endif /* __SMIAPP_H_ */ | ||
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h index b5c2b6cb0d81..d865dcf9879f 100644 --- a/include/media/soc_camera.h +++ b/include/media/soc_camera.h | |||
| @@ -56,10 +56,15 @@ struct soc_camera_device { | |||
| 56 | }; | 56 | }; |
| 57 | }; | 57 | }; |
| 58 | 58 | ||
| 59 | /* Host supports programmable stride */ | ||
| 60 | #define SOCAM_HOST_CAP_STRIDE (1 << 0) | ||
| 61 | |||
| 59 | struct soc_camera_host { | 62 | struct soc_camera_host { |
| 60 | struct v4l2_device v4l2_dev; | 63 | struct v4l2_device v4l2_dev; |
| 61 | struct list_head list; | 64 | struct list_head list; |
| 62 | unsigned char nr; /* Host number */ | 65 | struct mutex host_lock; /* Protect during probing */ |
| 66 | unsigned char nr; /* Host number */ | ||
| 67 | u32 capabilities; | ||
| 63 | void *priv; | 68 | void *priv; |
| 64 | const char *drv_name; | 69 | const char *drv_name; |
| 65 | struct soc_camera_host_ops *ops; | 70 | struct soc_camera_host_ops *ops; |
| @@ -97,7 +102,7 @@ struct soc_camera_host_ops { | |||
| 97 | int (*set_bus_param)(struct soc_camera_device *); | 102 | int (*set_bus_param)(struct soc_camera_device *); |
| 98 | int (*get_parm)(struct soc_camera_device *, struct v4l2_streamparm *); | 103 | int (*get_parm)(struct soc_camera_device *, struct v4l2_streamparm *); |
| 99 | int (*set_parm)(struct soc_camera_device *, struct v4l2_streamparm *); | 104 | int (*set_parm)(struct soc_camera_device *, struct v4l2_streamparm *); |
| 100 | int (*enum_fsizes)(struct soc_camera_device *, struct v4l2_frmsizeenum *); | 105 | int (*enum_framesizes)(struct soc_camera_device *, struct v4l2_frmsizeenum *); |
| 101 | unsigned int (*poll)(struct file *, poll_table *); | 106 | unsigned int (*poll)(struct file *, poll_table *); |
| 102 | }; | 107 | }; |
| 103 | 108 | ||
diff --git a/include/media/soc_mediabus.h b/include/media/soc_mediabus.h index 73f1e7eb60f3..0dc6f4625b92 100644 --- a/include/media/soc_mediabus.h +++ b/include/media/soc_mediabus.h | |||
| @@ -47,6 +47,24 @@ enum soc_mbus_order { | |||
| 47 | }; | 47 | }; |
| 48 | 48 | ||
| 49 | /** | 49 | /** |
| 50 | * enum soc_mbus_layout - planes layout in memory | ||
| 51 | * @SOC_MBUS_LAYOUT_PACKED: color components packed | ||
| 52 | * @SOC_MBUS_LAYOUT_PLANAR_2Y_U_V: YUV components stored in 3 planes (4:2:2) | ||
| 53 | * @SOC_MBUS_LAYOUT_PLANAR_2Y_C: YUV components stored in a luma and a | ||
| 54 | * chroma plane (C plane is half the size | ||
| 55 | * of Y plane) | ||
| 56 | * @SOC_MBUS_LAYOUT_PLANAR_Y_C: YUV components stored in a luma and a | ||
| 57 | * chroma plane (C plane is the same size | ||
| 58 | * as Y plane) | ||
| 59 | */ | ||
| 60 | enum soc_mbus_layout { | ||
| 61 | SOC_MBUS_LAYOUT_PACKED = 0, | ||
| 62 | SOC_MBUS_LAYOUT_PLANAR_2Y_U_V, | ||
| 63 | SOC_MBUS_LAYOUT_PLANAR_2Y_C, | ||
| 64 | SOC_MBUS_LAYOUT_PLANAR_Y_C, | ||
| 65 | }; | ||
| 66 | |||
| 67 | /** | ||
| 50 | * struct soc_mbus_pixelfmt - Data format on the media bus | 68 | * struct soc_mbus_pixelfmt - Data format on the media bus |
| 51 | * @name: Name of the format | 69 | * @name: Name of the format |
| 52 | * @fourcc: Fourcc code, that will be obtained if the data is | 70 | * @fourcc: Fourcc code, that will be obtained if the data is |
| @@ -60,6 +78,7 @@ struct soc_mbus_pixelfmt { | |||
| 60 | u32 fourcc; | 78 | u32 fourcc; |
| 61 | enum soc_mbus_packing packing; | 79 | enum soc_mbus_packing packing; |
| 62 | enum soc_mbus_order order; | 80 | enum soc_mbus_order order; |
| 81 | enum soc_mbus_layout layout; | ||
| 63 | u8 bits_per_sample; | 82 | u8 bits_per_sample; |
| 64 | }; | 83 | }; |
| 65 | 84 | ||
| @@ -80,6 +99,8 @@ const struct soc_mbus_pixelfmt *soc_mbus_find_fmtdesc( | |||
| 80 | const struct soc_mbus_pixelfmt *soc_mbus_get_fmtdesc( | 99 | const struct soc_mbus_pixelfmt *soc_mbus_get_fmtdesc( |
| 81 | enum v4l2_mbus_pixelcode code); | 100 | enum v4l2_mbus_pixelcode code); |
| 82 | s32 soc_mbus_bytes_per_line(u32 width, const struct soc_mbus_pixelfmt *mf); | 101 | s32 soc_mbus_bytes_per_line(u32 width, const struct soc_mbus_pixelfmt *mf); |
| 102 | s32 soc_mbus_image_size(const struct soc_mbus_pixelfmt *mf, | ||
| 103 | u32 bytes_per_line, u32 height); | ||
| 83 | int soc_mbus_samples_per_pixel(const struct soc_mbus_pixelfmt *mf, | 104 | int soc_mbus_samples_per_pixel(const struct soc_mbus_pixelfmt *mf, |
| 84 | unsigned int *numerator, unsigned int *denominator); | 105 | unsigned int *numerator, unsigned int *denominator); |
| 85 | unsigned int soc_mbus_config_compatible(const struct v4l2_mbus_config *cfg, | 106 | unsigned int soc_mbus_config_compatible(const struct v4l2_mbus_config *cfg, |
diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h index 11e67562b3ac..776605f1cbe2 100644 --- a/include/media/v4l2-ctrls.h +++ b/include/media/v4l2-ctrls.h | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | #include <linux/videodev2.h> | 25 | #include <linux/videodev2.h> |
| 26 | 26 | ||
| 27 | /* forward references */ | 27 | /* forward references */ |
| 28 | struct file; | ||
| 28 | struct v4l2_ctrl_handler; | 29 | struct v4l2_ctrl_handler; |
| 29 | struct v4l2_ctrl_helper; | 30 | struct v4l2_ctrl_helper; |
| 30 | struct v4l2_ctrl; | 31 | struct v4l2_ctrl; |
| @@ -129,7 +130,10 @@ struct v4l2_ctrl { | |||
| 129 | u32 step; | 130 | u32 step; |
| 130 | u32 menu_skip_mask; | 131 | u32 menu_skip_mask; |
| 131 | }; | 132 | }; |
| 132 | const char * const *qmenu; | 133 | union { |
| 134 | const char * const *qmenu; | ||
| 135 | const s64 *qmenu_int; | ||
| 136 | }; | ||
| 133 | unsigned long flags; | 137 | unsigned long flags; |
| 134 | union { | 138 | union { |
| 135 | s32 val; | 139 | s32 val; |
| @@ -164,7 +168,9 @@ struct v4l2_ctrl_ref { | |||
| 164 | /** struct v4l2_ctrl_handler - The control handler keeps track of all the | 168 | /** struct v4l2_ctrl_handler - The control handler keeps track of all the |
| 165 | * controls: both the controls owned by the handler and those inherited | 169 | * controls: both the controls owned by the handler and those inherited |
| 166 | * from other handlers. | 170 | * from other handlers. |
| 171 | * @_lock: Default for "lock". | ||
| 167 | * @lock: Lock to control access to this handler and its controls. | 172 | * @lock: Lock to control access to this handler and its controls. |
| 173 | * May be replaced by the user right after init. | ||
| 168 | * @ctrls: The list of controls owned by this handler. | 174 | * @ctrls: The list of controls owned by this handler. |
| 169 | * @ctrl_refs: The list of control references. | 175 | * @ctrl_refs: The list of control references. |
| 170 | * @cached: The last found control reference. It is common that the same | 176 | * @cached: The last found control reference. It is common that the same |
| @@ -175,7 +181,8 @@ struct v4l2_ctrl_ref { | |||
| 175 | * @error: The error code of the first failed control addition. | 181 | * @error: The error code of the first failed control addition. |
| 176 | */ | 182 | */ |
| 177 | struct v4l2_ctrl_handler { | 183 | struct v4l2_ctrl_handler { |
| 178 | struct mutex lock; | 184 | struct mutex _lock; |
| 185 | struct mutex *lock; | ||
| 179 | struct list_head ctrls; | 186 | struct list_head ctrls; |
| 180 | struct list_head ctrl_refs; | 187 | struct list_head ctrl_refs; |
| 181 | struct v4l2_ctrl_ref *cached; | 188 | struct v4l2_ctrl_ref *cached; |
| @@ -219,6 +226,7 @@ struct v4l2_ctrl_config { | |||
| 219 | u32 flags; | 226 | u32 flags; |
| 220 | u32 menu_skip_mask; | 227 | u32 menu_skip_mask; |
| 221 | const char * const *qmenu; | 228 | const char * const *qmenu; |
| 229 | const s64 *qmenu_int; | ||
| 222 | unsigned int is_private:1; | 230 | unsigned int is_private:1; |
| 223 | }; | 231 | }; |
| 224 | 232 | ||
| @@ -343,6 +351,23 @@ struct v4l2_ctrl *v4l2_ctrl_new_std_menu(struct v4l2_ctrl_handler *hdl, | |||
| 343 | const struct v4l2_ctrl_ops *ops, | 351 | const struct v4l2_ctrl_ops *ops, |
| 344 | u32 id, s32 max, s32 mask, s32 def); | 352 | u32 id, s32 max, s32 mask, s32 def); |
| 345 | 353 | ||
| 354 | /** v4l2_ctrl_new_int_menu() - Create a new standard V4L2 integer menu control. | ||
| 355 | * @hdl: The control handler. | ||
| 356 | * @ops: The control ops. | ||
| 357 | * @id: The control ID. | ||
| 358 | * @max: The control's maximum value. | ||
| 359 | * @def: The control's default value. | ||
| 360 | * @qmenu_int: The control's menu entries. | ||
| 361 | * | ||
| 362 | * Same as v4l2_ctrl_new_std_menu(), but @mask is set to 0 and it additionaly | ||
| 363 | * takes as an argument an array of integers determining the menu items. | ||
| 364 | * | ||
| 365 | * If @id refers to a non-integer-menu control, then this function will return NULL. | ||
| 366 | */ | ||
| 367 | struct v4l2_ctrl *v4l2_ctrl_new_int_menu(struct v4l2_ctrl_handler *hdl, | ||
| 368 | const struct v4l2_ctrl_ops *ops, | ||
| 369 | u32 id, s32 max, s32 def, const s64 *qmenu_int); | ||
| 370 | |||
| 346 | /** v4l2_ctrl_add_ctrl() - Add a control from another handler to this handler. | 371 | /** v4l2_ctrl_add_ctrl() - Add a control from another handler to this handler. |
| 347 | * @hdl: The control handler. | 372 | * @hdl: The control handler. |
| 348 | * @ctrl: The control to add. | 373 | * @ctrl: The control to add. |
| @@ -451,7 +476,7 @@ void v4l2_ctrl_grab(struct v4l2_ctrl *ctrl, bool grabbed); | |||
| 451 | */ | 476 | */ |
| 452 | static inline void v4l2_ctrl_lock(struct v4l2_ctrl *ctrl) | 477 | static inline void v4l2_ctrl_lock(struct v4l2_ctrl *ctrl) |
| 453 | { | 478 | { |
| 454 | mutex_lock(&ctrl->handler->lock); | 479 | mutex_lock(ctrl->handler->lock); |
| 455 | } | 480 | } |
| 456 | 481 | ||
| 457 | /** v4l2_ctrl_lock() - Helper function to unlock the handler | 482 | /** v4l2_ctrl_lock() - Helper function to unlock the handler |
| @@ -460,7 +485,7 @@ static inline void v4l2_ctrl_lock(struct v4l2_ctrl *ctrl) | |||
| 460 | */ | 485 | */ |
| 461 | static inline void v4l2_ctrl_unlock(struct v4l2_ctrl *ctrl) | 486 | static inline void v4l2_ctrl_unlock(struct v4l2_ctrl *ctrl) |
| 462 | { | 487 | { |
| 463 | mutex_unlock(&ctrl->handler->lock); | 488 | mutex_unlock(ctrl->handler->lock); |
| 464 | } | 489 | } |
| 465 | 490 | ||
| 466 | /** v4l2_ctrl_g_ctrl() - Helper function to get the control's value from within a driver. | 491 | /** v4l2_ctrl_g_ctrl() - Helper function to get the control's value from within a driver. |
| @@ -487,10 +512,9 @@ s32 v4l2_ctrl_g_ctrl(struct v4l2_ctrl *ctrl); | |||
| 487 | int v4l2_ctrl_s_ctrl(struct v4l2_ctrl *ctrl, s32 val); | 512 | int v4l2_ctrl_s_ctrl(struct v4l2_ctrl *ctrl, s32 val); |
| 488 | 513 | ||
| 489 | /* Internal helper functions that deal with control events. */ | 514 | /* Internal helper functions that deal with control events. */ |
| 490 | void v4l2_ctrl_add_event(struct v4l2_ctrl *ctrl, | 515 | extern const struct v4l2_subscribed_event_ops v4l2_ctrl_sub_ev_ops; |
| 491 | struct v4l2_subscribed_event *sev); | 516 | void v4l2_ctrl_replace(struct v4l2_event *old, const struct v4l2_event *new); |
| 492 | void v4l2_ctrl_del_event(struct v4l2_ctrl *ctrl, | 517 | void v4l2_ctrl_merge(const struct v4l2_event *old, struct v4l2_event *new); |
| 493 | struct v4l2_subscribed_event *sev); | ||
| 494 | 518 | ||
| 495 | /* Can be used as a vidioc_log_status function that just dumps all controls | 519 | /* Can be used as a vidioc_log_status function that just dumps all controls |
| 496 | associated with the filehandle. */ | 520 | associated with the filehandle. */ |
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h index 96d22215cc88..a056e6ee1b68 100644 --- a/include/media/v4l2-dev.h +++ b/include/media/v4l2-dev.h | |||
| @@ -39,6 +39,9 @@ struct v4l2_ctrl_handler; | |||
| 39 | #define V4L2_FL_USES_V4L2_FH (1) | 39 | #define V4L2_FL_USES_V4L2_FH (1) |
| 40 | /* Use the prio field of v4l2_fh for core priority checking */ | 40 | /* Use the prio field of v4l2_fh for core priority checking */ |
| 41 | #define V4L2_FL_USE_FH_PRIO (2) | 41 | #define V4L2_FL_USE_FH_PRIO (2) |
| 42 | /* If ioctl core locking is in use, then apply that also to all | ||
| 43 | file operations. Don't use this flag in new drivers! */ | ||
| 44 | #define V4L2_FL_LOCK_ALL_FOPS (3) | ||
| 42 | 45 | ||
| 43 | /* Priority helper functions */ | 46 | /* Priority helper functions */ |
| 44 | 47 | ||
| @@ -126,8 +129,10 @@ struct video_device | |||
| 126 | 129 | ||
| 127 | /* ioctl callbacks */ | 130 | /* ioctl callbacks */ |
| 128 | const struct v4l2_ioctl_ops *ioctl_ops; | 131 | const struct v4l2_ioctl_ops *ioctl_ops; |
| 132 | DECLARE_BITMAP(valid_ioctls, BASE_VIDIOC_PRIVATE); | ||
| 129 | 133 | ||
| 130 | /* serialization lock */ | 134 | /* serialization lock */ |
| 135 | DECLARE_BITMAP(disable_locking, BASE_VIDIOC_PRIVATE); | ||
| 131 | struct mutex *lock; | 136 | struct mutex *lock; |
| 132 | }; | 137 | }; |
| 133 | 138 | ||
| @@ -173,6 +178,26 @@ void video_device_release(struct video_device *vdev); | |||
| 173 | a dubious construction at best. */ | 178 | a dubious construction at best. */ |
| 174 | void video_device_release_empty(struct video_device *vdev); | 179 | void video_device_release_empty(struct video_device *vdev); |
| 175 | 180 | ||
| 181 | /* returns true if cmd is a known V4L2 ioctl */ | ||
| 182 | bool v4l2_is_known_ioctl(unsigned int cmd); | ||
| 183 | |||
| 184 | /* mark that this command shouldn't use core locking */ | ||
| 185 | static inline void v4l2_disable_ioctl_locking(struct video_device *vdev, unsigned int cmd) | ||
| 186 | { | ||
| 187 | if (_IOC_NR(cmd) < BASE_VIDIOC_PRIVATE) | ||
| 188 | set_bit(_IOC_NR(cmd), vdev->disable_locking); | ||
| 189 | } | ||
| 190 | |||
| 191 | /* Mark that this command isn't implemented. This must be called before | ||
| 192 | video_device_register. See also the comments in determine_valid_ioctls(). | ||
| 193 | This function allows drivers to provide just one v4l2_ioctl_ops struct, but | ||
| 194 | disable ioctls based on the specific card that is actually found. */ | ||
| 195 | static inline void v4l2_disable_ioctl(struct video_device *vdev, unsigned int cmd) | ||
| 196 | { | ||
| 197 | if (_IOC_NR(cmd) < BASE_VIDIOC_PRIVATE) | ||
| 198 | set_bit(_IOC_NR(cmd), vdev->valid_ioctls); | ||
| 199 | } | ||
| 200 | |||
| 176 | /* helper functions to access driver private data. */ | 201 | /* helper functions to access driver private data. */ |
| 177 | static inline void *video_get_drvdata(struct video_device *vdev) | 202 | static inline void *video_get_drvdata(struct video_device *vdev) |
| 178 | { | 203 | { |
diff --git a/include/media/v4l2-event.h b/include/media/v4l2-event.h index 5f14e8895ce2..2885a810a128 100644 --- a/include/media/v4l2-event.h +++ b/include/media/v4l2-event.h | |||
| @@ -78,6 +78,19 @@ struct v4l2_kevent { | |||
| 78 | struct v4l2_event event; | 78 | struct v4l2_event event; |
| 79 | }; | 79 | }; |
| 80 | 80 | ||
| 81 | /** struct v4l2_subscribed_event_ops - Subscribed event operations. | ||
| 82 | * @add: Optional callback, called when a new listener is added | ||
| 83 | * @del: Optional callback, called when a listener stops listening | ||
| 84 | * @replace: Optional callback that can replace event 'old' with event 'new'. | ||
| 85 | * @merge: Optional callback that can merge event 'old' into event 'new'. | ||
| 86 | */ | ||
| 87 | struct v4l2_subscribed_event_ops { | ||
| 88 | int (*add)(struct v4l2_subscribed_event *sev, unsigned elems); | ||
| 89 | void (*del)(struct v4l2_subscribed_event *sev); | ||
| 90 | void (*replace)(struct v4l2_event *old, const struct v4l2_event *new); | ||
| 91 | void (*merge)(const struct v4l2_event *old, struct v4l2_event *new); | ||
| 92 | }; | ||
| 93 | |||
| 81 | /** struct v4l2_subscribed_event - Internal struct representing a subscribed event. | 94 | /** struct v4l2_subscribed_event - Internal struct representing a subscribed event. |
| 82 | * @list: List node for the v4l2_fh->subscribed list. | 95 | * @list: List node for the v4l2_fh->subscribed list. |
| 83 | * @type: Event type. | 96 | * @type: Event type. |
| @@ -85,8 +98,7 @@ struct v4l2_kevent { | |||
| 85 | * @flags: Copy of v4l2_event_subscription->flags. | 98 | * @flags: Copy of v4l2_event_subscription->flags. |
| 86 | * @fh: Filehandle that subscribed to this event. | 99 | * @fh: Filehandle that subscribed to this event. |
| 87 | * @node: List node that hooks into the object's event list (if there is one). | 100 | * @node: List node that hooks into the object's event list (if there is one). |
| 88 | * @replace: Optional callback that can replace event 'old' with event 'new'. | 101 | * @ops: v4l2_subscribed_event_ops |
| 89 | * @merge: Optional callback that can merge event 'old' into event 'new'. | ||
| 90 | * @elems: The number of elements in the events array. | 102 | * @elems: The number of elements in the events array. |
| 91 | * @first: The index of the events containing the oldest available event. | 103 | * @first: The index of the events containing the oldest available event. |
| 92 | * @in_use: The number of queued events. | 104 | * @in_use: The number of queued events. |
| @@ -99,10 +111,7 @@ struct v4l2_subscribed_event { | |||
| 99 | u32 flags; | 111 | u32 flags; |
| 100 | struct v4l2_fh *fh; | 112 | struct v4l2_fh *fh; |
| 101 | struct list_head node; | 113 | struct list_head node; |
| 102 | void (*replace)(struct v4l2_event *old, | 114 | const struct v4l2_subscribed_event_ops *ops; |
| 103 | const struct v4l2_event *new); | ||
| 104 | void (*merge)(const struct v4l2_event *old, | ||
| 105 | struct v4l2_event *new); | ||
| 106 | unsigned elems; | 115 | unsigned elems; |
| 107 | unsigned first; | 116 | unsigned first; |
| 108 | unsigned in_use; | 117 | unsigned in_use; |
| @@ -115,7 +124,8 @@ void v4l2_event_queue(struct video_device *vdev, const struct v4l2_event *ev); | |||
| 115 | void v4l2_event_queue_fh(struct v4l2_fh *fh, const struct v4l2_event *ev); | 124 | void v4l2_event_queue_fh(struct v4l2_fh *fh, const struct v4l2_event *ev); |
| 116 | int v4l2_event_pending(struct v4l2_fh *fh); | 125 | int v4l2_event_pending(struct v4l2_fh *fh); |
| 117 | int v4l2_event_subscribe(struct v4l2_fh *fh, | 126 | int v4l2_event_subscribe(struct v4l2_fh *fh, |
| 118 | struct v4l2_event_subscription *sub, unsigned elems); | 127 | struct v4l2_event_subscription *sub, unsigned elems, |
| 128 | const struct v4l2_subscribed_event_ops *ops); | ||
| 119 | int v4l2_event_unsubscribe(struct v4l2_fh *fh, | 129 | int v4l2_event_unsubscribe(struct v4l2_fh *fh, |
| 120 | struct v4l2_event_subscription *sub); | 130 | struct v4l2_event_subscription *sub); |
| 121 | void v4l2_event_unsubscribe_all(struct v4l2_fh *fh); | 131 | void v4l2_event_unsubscribe_all(struct v4l2_fh *fh); |
diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h index 3cb939cd03f9..d8b76f7392f8 100644 --- a/include/media/v4l2-ioctl.h +++ b/include/media/v4l2-ioctl.h | |||
| @@ -271,6 +271,12 @@ struct v4l2_ioctl_ops { | |||
| 271 | struct v4l2_dv_timings *timings); | 271 | struct v4l2_dv_timings *timings); |
| 272 | int (*vidioc_g_dv_timings) (struct file *file, void *fh, | 272 | int (*vidioc_g_dv_timings) (struct file *file, void *fh, |
| 273 | struct v4l2_dv_timings *timings); | 273 | struct v4l2_dv_timings *timings); |
| 274 | int (*vidioc_query_dv_timings) (struct file *file, void *fh, | ||
| 275 | struct v4l2_dv_timings *timings); | ||
| 276 | int (*vidioc_enum_dv_timings) (struct file *file, void *fh, | ||
| 277 | struct v4l2_enum_dv_timings *timings); | ||
| 278 | int (*vidioc_dv_timings_cap) (struct file *file, void *fh, | ||
| 279 | struct v4l2_dv_timings_cap *cap); | ||
| 274 | 280 | ||
| 275 | int (*vidioc_subscribe_event) (struct v4l2_fh *fh, | 281 | int (*vidioc_subscribe_event) (struct v4l2_fh *fh, |
| 276 | struct v4l2_event_subscription *sub); | 282 | struct v4l2_event_subscription *sub); |
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index f0f3358d1b1b..c35a3545e273 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h | |||
| @@ -307,6 +307,12 @@ struct v4l2_subdev_video_ops { | |||
| 307 | struct v4l2_dv_timings *timings); | 307 | struct v4l2_dv_timings *timings); |
| 308 | int (*g_dv_timings)(struct v4l2_subdev *sd, | 308 | int (*g_dv_timings)(struct v4l2_subdev *sd, |
| 309 | struct v4l2_dv_timings *timings); | 309 | struct v4l2_dv_timings *timings); |
| 310 | int (*enum_dv_timings)(struct v4l2_subdev *sd, | ||
| 311 | struct v4l2_enum_dv_timings *timings); | ||
| 312 | int (*query_dv_timings)(struct v4l2_subdev *sd, | ||
| 313 | struct v4l2_dv_timings *timings); | ||
| 314 | int (*dv_timings_cap)(struct v4l2_subdev *sd, | ||
| 315 | struct v4l2_dv_timings_cap *cap); | ||
| 310 | int (*enum_mbus_fmt)(struct v4l2_subdev *sd, unsigned int index, | 316 | int (*enum_mbus_fmt)(struct v4l2_subdev *sd, unsigned int index, |
| 311 | enum v4l2_mbus_pixelcode *code); | 317 | enum v4l2_mbus_pixelcode *code); |
| 312 | int (*enum_mbus_fsizes)(struct v4l2_subdev *sd, | 318 | int (*enum_mbus_fsizes)(struct v4l2_subdev *sd, |
| @@ -466,6 +472,15 @@ struct v4l2_subdev_pad_ops { | |||
| 466 | struct v4l2_subdev_crop *crop); | 472 | struct v4l2_subdev_crop *crop); |
| 467 | int (*get_crop)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, | 473 | int (*get_crop)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, |
| 468 | struct v4l2_subdev_crop *crop); | 474 | struct v4l2_subdev_crop *crop); |
| 475 | int (*get_selection)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, | ||
| 476 | struct v4l2_subdev_selection *sel); | ||
| 477 | int (*set_selection)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, | ||
| 478 | struct v4l2_subdev_selection *sel); | ||
| 479 | #ifdef CONFIG_MEDIA_CONTROLLER | ||
| 480 | int (*link_validate)(struct v4l2_subdev *sd, struct media_link *link, | ||
| 481 | struct v4l2_subdev_format *source_fmt, | ||
| 482 | struct v4l2_subdev_format *sink_fmt); | ||
| 483 | #endif /* CONFIG_MEDIA_CONTROLLER */ | ||
| 469 | }; | 484 | }; |
| 470 | 485 | ||
| 471 | struct v4l2_subdev_ops { | 486 | struct v4l2_subdev_ops { |
| @@ -541,7 +556,7 @@ struct v4l2_subdev { | |||
| 541 | #define media_entity_to_v4l2_subdev(ent) \ | 556 | #define media_entity_to_v4l2_subdev(ent) \ |
| 542 | container_of(ent, struct v4l2_subdev, entity) | 557 | container_of(ent, struct v4l2_subdev, entity) |
| 543 | #define vdev_to_v4l2_subdev(vdev) \ | 558 | #define vdev_to_v4l2_subdev(vdev) \ |
| 544 | video_get_drvdata(vdev) | 559 | ((struct v4l2_subdev *)video_get_drvdata(vdev)) |
| 545 | 560 | ||
| 546 | /* | 561 | /* |
| 547 | * Used for storing subdev information per file handle | 562 | * Used for storing subdev information per file handle |
| @@ -549,8 +564,11 @@ struct v4l2_subdev { | |||
| 549 | struct v4l2_subdev_fh { | 564 | struct v4l2_subdev_fh { |
| 550 | struct v4l2_fh vfh; | 565 | struct v4l2_fh vfh; |
| 551 | #if defined(CONFIG_VIDEO_V4L2_SUBDEV_API) | 566 | #if defined(CONFIG_VIDEO_V4L2_SUBDEV_API) |
| 552 | struct v4l2_mbus_framefmt *try_fmt; | 567 | struct { |
| 553 | struct v4l2_rect *try_crop; | 568 | struct v4l2_mbus_framefmt try_fmt; |
| 569 | struct v4l2_rect try_crop; | ||
| 570 | struct v4l2_rect try_compose; | ||
| 571 | } *pad; | ||
| 554 | #endif | 572 | #endif |
| 555 | }; | 573 | }; |
| 556 | 574 | ||
| @@ -558,17 +576,19 @@ struct v4l2_subdev_fh { | |||
| 558 | container_of(fh, struct v4l2_subdev_fh, vfh) | 576 | container_of(fh, struct v4l2_subdev_fh, vfh) |
| 559 | 577 | ||
| 560 | #if defined(CONFIG_VIDEO_V4L2_SUBDEV_API) | 578 | #if defined(CONFIG_VIDEO_V4L2_SUBDEV_API) |
| 561 | static inline struct v4l2_mbus_framefmt * | 579 | #define __V4L2_SUBDEV_MK_GET_TRY(rtype, fun_name, field_name) \ |
| 562 | v4l2_subdev_get_try_format(struct v4l2_subdev_fh *fh, unsigned int pad) | 580 | static inline struct rtype * \ |
| 563 | { | 581 | v4l2_subdev_get_try_##fun_name(struct v4l2_subdev_fh *fh, \ |
| 564 | return &fh->try_fmt[pad]; | 582 | unsigned int pad) \ |
| 565 | } | 583 | { \ |
| 566 | 584 | BUG_ON(unlikely(pad >= vdev_to_v4l2_subdev( \ | |
| 567 | static inline struct v4l2_rect * | 585 | fh->vfh.vdev)->entity.num_pads)); \ |
| 568 | v4l2_subdev_get_try_crop(struct v4l2_subdev_fh *fh, unsigned int pad) | 586 | return &fh->pad[pad].field_name; \ |
| 569 | { | 587 | } |
| 570 | return &fh->try_crop[pad]; | 588 | |
| 571 | } | 589 | __V4L2_SUBDEV_MK_GET_TRY(v4l2_mbus_framefmt, format, try_fmt) |
| 590 | __V4L2_SUBDEV_MK_GET_TRY(v4l2_rect, crop, try_compose) | ||
| 591 | __V4L2_SUBDEV_MK_GET_TRY(v4l2_rect, compose, try_compose) | ||
| 572 | #endif | 592 | #endif |
| 573 | 593 | ||
| 574 | extern const struct v4l2_file_operations v4l2_subdev_fops; | 594 | extern const struct v4l2_file_operations v4l2_subdev_fops; |
| @@ -593,6 +613,13 @@ static inline void *v4l2_get_subdev_hostdata(const struct v4l2_subdev *sd) | |||
| 593 | return sd->host_priv; | 613 | return sd->host_priv; |
| 594 | } | 614 | } |
| 595 | 615 | ||
| 616 | #ifdef CONFIG_MEDIA_CONTROLLER | ||
| 617 | int v4l2_subdev_link_validate_default(struct v4l2_subdev *sd, | ||
| 618 | struct media_link *link, | ||
| 619 | struct v4l2_subdev_format *source_fmt, | ||
| 620 | struct v4l2_subdev_format *sink_fmt); | ||
| 621 | int v4l2_subdev_link_validate(struct media_link *link); | ||
| 622 | #endif /* CONFIG_MEDIA_CONTROLLER */ | ||
| 596 | void v4l2_subdev_init(struct v4l2_subdev *sd, | 623 | void v4l2_subdev_init(struct v4l2_subdev *sd, |
| 597 | const struct v4l2_subdev_ops *ops); | 624 | const struct v4l2_subdev_ops *ops); |
| 598 | 625 | ||
diff --git a/include/media/videobuf-dma-contig.h b/include/media/videobuf-dma-contig.h index f0ed82543d9f..f473aeb86d3f 100644 --- a/include/media/videobuf-dma-contig.h +++ b/include/media/videobuf-dma-contig.h | |||
| @@ -26,6 +26,16 @@ void videobuf_queue_dma_contig_init(struct videobuf_queue *q, | |||
| 26 | void *priv, | 26 | void *priv, |
| 27 | struct mutex *ext_lock); | 27 | struct mutex *ext_lock); |
| 28 | 28 | ||
| 29 | void videobuf_queue_dma_contig_init_cached(struct videobuf_queue *q, | ||
| 30 | const struct videobuf_queue_ops *ops, | ||
| 31 | struct device *dev, | ||
| 32 | spinlock_t *irqlock, | ||
| 33 | enum v4l2_buf_type type, | ||
| 34 | enum v4l2_field field, | ||
| 35 | unsigned int msize, | ||
| 36 | void *priv, | ||
| 37 | struct mutex *ext_lock); | ||
| 38 | |||
| 29 | dma_addr_t videobuf_to_dma_contig(struct videobuf_buffer *buf); | 39 | dma_addr_t videobuf_to_dma_contig(struct videobuf_buffer *buf); |
| 30 | void videobuf_dma_contig_free(struct videobuf_queue *q, | 40 | void videobuf_dma_contig_free(struct videobuf_queue *q, |
| 31 | struct videobuf_buffer *buf); | 41 | struct videobuf_buffer *buf); |
