Merge tag 'br-v6.2i' of git://linuxtv.org/hverkuil/media_tree into media_stage
authorMauro Carvalho Chehab <mchehab@kernel.org>
Tue, 6 Dec 2022 07:28:26 +0000 (07:28 +0000)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Wed, 7 Dec 2022 16:58:47 +0000 (17:58 +0100)
Tag branch

Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
* tag 'br-v6.2i' of git://linuxtv.org/hverkuil/media_tree: (31 commits)
  media: s5c73m3: Switch to GPIO descriptors
  media: i2c: s5k5baf: switch to using gpiod API
  media: i2c: s5k6a3: switch to using gpiod API
  media: imx: remove code for non-existing config IMX_GPT_ICAP
  media: si470x: Fix use-after-free in si470x_int_in_callback()
  media: staging: stkwebcam: Restore MEDIA_{USB,CAMERA}_SUPPORT dependencies
  media: coda: Add check for kmalloc
  media: coda: Add check for dcoda_iram_alloc
  dt-bindings: media: s5c73m3: Fix reset-gpio descriptor
  media: dt-bindings: allwinner: h6-vpu-g2: Add IOMMU reference property
  media: s5k4ecgx: Delete driver
  media: s5k4ecgx: Switch to GPIO descriptors
  media: Switch to use dev_err_probe() helper
  headers: Remove some left-over license text in include/uapi/linux/v4l2-*
  headers: Remove some left-over license text in include/uapi/linux/dvb/
  media: usb: pwc-uncompress: Use flex array destination for memcpy()
  media: s5p-mfc: Fix to handle reference queue during finishing
  media: s5p-mfc: Clear workbit to handle error condition
  media: s5p-mfc: Fix in register read and write for H264
  media: imx: Use get_mbus_config instead of parsing upstream DT endpoints
  ...

28 files changed:
Documentation/devicetree/bindings/media/i2c/ovti,ov9282.yaml
Documentation/userspace-api/media/frontend.h.rst.exceptions
drivers/media/common/videobuf2/frame_vector.c
drivers/media/common/videobuf2/videobuf2-dma-contig.c
drivers/media/common/videobuf2/videobuf2-dma-sg.c
drivers/media/common/videobuf2/videobuf2-memops.c
drivers/media/common/videobuf2/videobuf2-vmalloc.c
drivers/media/dvb-core/dvbdev.c
drivers/media/dvb-frontends/drx39xyj/drxj.c
drivers/media/i2c/imx208.c
drivers/media/i2c/imx319.c
drivers/media/i2c/imx355.c
drivers/media/i2c/ov08d10.c
drivers/media/i2c/ov2680.c
drivers/media/i2c/ov5640.c
drivers/media/i2c/ov5693.c
drivers/media/i2c/ov9282.c
drivers/media/i2c/tc358746.c
drivers/media/pci/saa7164/saa7164-core.c
drivers/media/platform/renesas/rzg2l-cru/rzg2l-cru.h
drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c
drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c
drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_bridge.c
drivers/media/usb/dvb-usb/m920x.c
include/media/dvbdev.h
include/media/frame_vector.h
include/media/videobuf2-memops.h
include/uapi/linux/dvb/frontend.h

index 652b4cfeded7fbb0eb783767321dffb5c64e61db..0c4654e70d463fd490364c9193fa1e2159ae9334 100644 (file)
@@ -16,10 +16,13 @@ description:
   sensor with an active array size of 1296H x 816V. It is programmable through
   I2C interface. The I2C client address is fixed to 0x60/0x70 as per sensor data
   sheet. Image data is sent through MIPI CSI-2.
+  OV9281 has a different lens chief ray angle.
 
 properties:
   compatible:
-    const: ovti,ov9282
+    enum:
+      - ovti,ov9281
+      - ovti,ov9282
   reg:
     description: I2C address
     maxItems: 1
index 6283702c08c8c8354f5e1b2df409dbe663616d58..8b73fee11a79744abb4f5789168c15ccd72ce919 100644 (file)
@@ -86,6 +86,13 @@ ignore symbol APSK_16
 ignore symbol APSK_32
 ignore symbol DQPSK
 ignore symbol QAM_4_NR
+ignore symbol QAM_1024
+ignore symbol QAM_4096
+ignore symbol APSK_8_L
+ignore symbol APSK_16_L
+ignore symbol APSK_32_L
+ignore symbol APSK_64
+ignore symbol APSK_64_L
 
 ignore symbol SEC_VOLTAGE_13
 ignore symbol SEC_VOLTAGE_18
@@ -119,6 +126,22 @@ ignore symbol FEC_AUTO
 ignore symbol FEC_3_5
 ignore symbol FEC_9_10
 ignore symbol FEC_2_5
+ignore symbol FEC_1_3
+ignore symbol FEC_1_4
+ignore symbol FEC_5_9
+ignore symbol FEC_7_9
+ignore symbol FEC_8_15
+ignore symbol FEC_11_15
+ignore symbol FEC_13_18
+ignore symbol FEC_9_20
+ignore symbol FEC_11_20
+ignore symbol FEC_23_36
+ignore symbol FEC_25_36
+ignore symbol FEC_13_45
+ignore symbol FEC_26_45
+ignore symbol FEC_28_45
+ignore symbol FEC_32_45
+ignore symbol FEC_77_90
 
 ignore symbol TRANSMISSION_MODE_AUTO
 ignore symbol TRANSMISSION_MODE_1K
@@ -143,6 +166,7 @@ ignore symbol GUARD_INTERVAL_19_256
 ignore symbol GUARD_INTERVAL_PN420
 ignore symbol GUARD_INTERVAL_PN595
 ignore symbol GUARD_INTERVAL_PN945
+ignore symbol GUARD_INTERVAL_1_64
 
 ignore symbol HIERARCHY_NONE
 ignore symbol HIERARCHY_AUTO
@@ -163,6 +187,9 @@ ignore symbol ROLLOFF_35
 ignore symbol ROLLOFF_20
 ignore symbol ROLLOFF_25
 ignore symbol ROLLOFF_AUTO
+ignore symbol ROLLOFF_15
+ignore symbol ROLLOFF_10
+ignore symbol ROLLOFF_5
 
 ignore symbol INVERSION_ON
 ignore symbol INVERSION_OFF
@@ -187,6 +214,7 @@ ignore symbol SYS_DAB
 ignore symbol SYS_DSS
 ignore symbol SYS_CMMB
 ignore symbol SYS_DVBH
+ignore symbol SYS_DVBC2
 
 ignore symbol ATSCMH_SCCC_BLK_SEP
 ignore symbol ATSCMH_SCCC_BLK_COMB
index 542dde9d2609be07700f6cf63d46f7a9b4557444..aad72640f055dca8a75dbd9ca2062fee91e6dc12 100644 (file)
@@ -14,6 +14,7 @@
  * get_vaddr_frames() - map virtual addresses to pfns
  * @start:     starting user address
  * @nr_frames: number of pages / pfns from start to map
+ * @write:     the mapped address has write permission
  * @vec:       structure which receives pages / pfns of the addresses mapped.
  *             It should have space for at least nr_frames entries.
  *
@@ -32,7 +33,7 @@
  *
  * This function takes care of grabbing mmap_lock as necessary.
  */
-int get_vaddr_frames(unsigned long start, unsigned int nr_frames,
+int get_vaddr_frames(unsigned long start, unsigned int nr_frames, bool write,
                     struct frame_vector *vec)
 {
        struct mm_struct *mm = current->mm;
@@ -40,6 +41,7 @@ int get_vaddr_frames(unsigned long start, unsigned int nr_frames,
        int ret_pin_user_pages_fast = 0;
        int ret = 0;
        int err;
+       unsigned int gup_flags = FOLL_FORCE | FOLL_LONGTERM;
 
        if (nr_frames == 0)
                return 0;
@@ -49,8 +51,10 @@ int get_vaddr_frames(unsigned long start, unsigned int nr_frames,
 
        start = untagged_addr(start);
 
-       ret = pin_user_pages_fast(start, nr_frames,
-                                 FOLL_FORCE | FOLL_WRITE | FOLL_LONGTERM,
+       if (write)
+               gup_flags |= FOLL_WRITE;
+
+       ret = pin_user_pages_fast(start, nr_frames, gup_flags,
                                  (struct page **)(vec->ptrs));
        if (ret > 0) {
                vec->got_ref = true;
index 678b359717c4857d17d2bd8870fe9cda483f1a88..8e55468cb60d1443f04f436eb97d29e22eb6a6ae 100644 (file)
@@ -603,7 +603,8 @@ static void *vb2_dc_get_userptr(struct vb2_buffer *vb, struct device *dev,
        buf->vb = vb;
 
        offset = lower_32_bits(offset_in_page(vaddr));
-       vec = vb2_create_framevec(vaddr, size);
+       vec = vb2_create_framevec(vaddr, size, buf->dma_dir == DMA_FROM_DEVICE ||
+                                              buf->dma_dir == DMA_BIDIRECTIONAL);
        if (IS_ERR(vec)) {
                ret = PTR_ERR(vec);
                goto fail_buf;
index fa69158a65b1fd2311946e7bec189e1bf4b6e35a..099693e42bc68fe1eb67ab623b982755ac86ed83 100644 (file)
@@ -241,7 +241,9 @@ static void *vb2_dma_sg_get_userptr(struct vb2_buffer *vb, struct device *dev,
        buf->size = size;
        buf->dma_sgt = &buf->sg_table;
        buf->vb = vb;
-       vec = vb2_create_framevec(vaddr, size);
+       vec = vb2_create_framevec(vaddr, size,
+                                 buf->dma_dir == DMA_FROM_DEVICE ||
+                                 buf->dma_dir == DMA_BIDIRECTIONAL);
        if (IS_ERR(vec))
                goto userptr_fail_pfnvec;
        buf->vec = vec;
index 9dd6c27162f433e1a279893267f54cd72f497046..f9a4ec44422eb36ffe9c1a9758b7d71d8c9dcb9a 100644 (file)
@@ -26,6 +26,7 @@
  * vb2_create_framevec() - map virtual addresses to pfns
  * @start:     Virtual user address where we start mapping
  * @length:    Length of a range to map
+ * @write:     Should we map for writing into the area
  *
  * This function allocates and fills in a vector with pfns corresponding to
  * virtual address range passed in arguments. If pfns have corresponding pages,
@@ -34,7 +35,8 @@
  * failure. Returned vector needs to be freed via vb2_destroy_pfnvec().
  */
 struct frame_vector *vb2_create_framevec(unsigned long start,
-                                        unsigned long length)
+                                        unsigned long length,
+                                        bool write)
 {
        int ret;
        unsigned long first, last;
@@ -47,7 +49,7 @@ struct frame_vector *vb2_create_framevec(unsigned long start,
        vec = frame_vector_create(nr);
        if (!vec)
                return ERR_PTR(-ENOMEM);
-       ret = get_vaddr_frames(start & PAGE_MASK, nr, vec);
+       ret = get_vaddr_frames(start & PAGE_MASK, nr, write, vec);
        if (ret < 0)
                goto out_destroy;
        /* We accept only complete set of PFNs */
index 948152f1596b496d0286c9ccf02e7a8d02309be9..67d0b89e701b5efe5a71b9c30406d02b0bfa4c33 100644 (file)
@@ -85,7 +85,9 @@ static void *vb2_vmalloc_get_userptr(struct vb2_buffer *vb, struct device *dev,
        buf->dma_dir = vb->vb2_queue->dma_dir;
        offset = vaddr & ~PAGE_MASK;
        buf->size = size;
-       vec = vb2_create_framevec(vaddr, size);
+       vec = vb2_create_framevec(vaddr, size,
+                                 buf->dma_dir == DMA_FROM_DEVICE ||
+                                 buf->dma_dir == DMA_BIDIRECTIONAL);
        if (IS_ERR(vec)) {
                ret = PTR_ERR(vec);
                goto fail_pfnvec_create;
index d45673cb3ce177ad2113c0a472ad7192f8581d00..2a857cf70c944eb386d49274c3cbd84fbb8734cf 100644 (file)
@@ -482,8 +482,8 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,
                return -ENOMEM;
        }
 
-       kref_init(&dvbdev->ref);
        memcpy(dvbdev, template, sizeof(struct dvb_device));
+       kref_init(&dvbdev->ref);
        dvbdev->type = type;
        dvbdev->id = id;
        dvbdev->adapter = adap;
index bf9e4ef35684b933c66fe474e6cbd7dc0f096a20..1dff59ca21a17891ed1a5d79bcc4fbd42150cbc6 100644 (file)
@@ -2347,6 +2347,7 @@ hi_command(struct i2c_device_addr *dev_addr, const struct drxj_hi_cmd *cmd, u16
                do {
                        nr_retries++;
                        if (nr_retries > DRXJ_MAX_RETRIES) {
+                               rc = -ETIMEDOUT;
                                pr_err("timeout\n");
                                goto rw_error;
                        }
index a0e17bb9d4ca4724669b701376a315399d6d7f85..64c70ebf9869c71e02af65b3f25deb4f0e11fcac 100644 (file)
@@ -937,8 +937,12 @@ static int imx208_init_controls(struct imx208 *imx208)
 
        imx208->hflip = v4l2_ctrl_new_std(ctrl_hdlr, &imx208_ctrl_ops,
                                          V4L2_CID_HFLIP, 0, 1, 1, 0);
+       if (imx208->hflip)
+               imx208->hflip->flags |= V4L2_CTRL_FLAG_MODIFY_LAYOUT;
        imx208->vflip = v4l2_ctrl_new_std(ctrl_hdlr, &imx208_ctrl_ops,
                                          V4L2_CID_VFLIP, 0, 1, 1, 0);
+       if (imx208->vflip)
+               imx208->vflip->flags |= V4L2_CTRL_FLAG_MODIFY_LAYOUT;
 
        v4l2_ctrl_new_std(ctrl_hdlr, &imx208_ctrl_ops, V4L2_CID_ANALOGUE_GAIN,
                          IMX208_ANA_GAIN_MIN, IMX208_ANA_GAIN_MAX,
index 245a18fb40ad0d0e7321c170cd3bb67f76c95854..45b1b61b2880d94c23254186b4f111982e7759e3 100644 (file)
@@ -2328,8 +2328,12 @@ static int imx319_init_controls(struct imx319 *imx319)
 
        imx319->hflip = v4l2_ctrl_new_std(ctrl_hdlr, &imx319_ctrl_ops,
                                          V4L2_CID_HFLIP, 0, 1, 1, 0);
+       if (imx319->hflip)
+               imx319->hflip->flags |= V4L2_CTRL_FLAG_MODIFY_LAYOUT;
        imx319->vflip = v4l2_ctrl_new_std(ctrl_hdlr, &imx319_ctrl_ops,
                                          V4L2_CID_VFLIP, 0, 1, 1, 0);
+       if (imx319->vflip)
+               imx319->vflip->flags |= V4L2_CTRL_FLAG_MODIFY_LAYOUT;
 
        v4l2_ctrl_new_std(ctrl_hdlr, &imx319_ctrl_ops, V4L2_CID_ANALOGUE_GAIN,
                          IMX319_ANA_GAIN_MIN, IMX319_ANA_GAIN_MAX,
index b46178681c0564f51310eaddc366f276ab270b2f..25d4dbb6041eaa1c785371ca608fd6829b2521db 100644 (file)
@@ -1617,8 +1617,12 @@ static int imx355_init_controls(struct imx355 *imx355)
 
        imx355->hflip = v4l2_ctrl_new_std(ctrl_hdlr, &imx355_ctrl_ops,
                                          V4L2_CID_HFLIP, 0, 1, 1, 0);
+       if (imx355->hflip)
+               imx355->hflip->flags |= V4L2_CTRL_FLAG_MODIFY_LAYOUT;
        imx355->vflip = v4l2_ctrl_new_std(ctrl_hdlr, &imx355_ctrl_ops,
                                          V4L2_CID_VFLIP, 0, 1, 1, 0);
+       if (imx355->vflip)
+               imx355->vflip->flags |= V4L2_CTRL_FLAG_MODIFY_LAYOUT;
 
        v4l2_ctrl_new_std(ctrl_hdlr, &imx355_ctrl_ops, V4L2_CID_ANALOGUE_GAIN,
                          IMX355_ANA_GAIN_MIN, IMX355_ANA_GAIN_MAX,
index c1703596c3dc8500c615c6a2e8d4e7570c4d03a1..a39e086a51c538494a002c4fa46c19638e7c4b9e 100644 (file)
@@ -990,8 +990,13 @@ static int ov08d10_init_controls(struct ov08d10 *ov08d10)
 
        ov08d10->hflip = v4l2_ctrl_new_std(ctrl_hdlr, &ov08d10_ctrl_ops,
                                           V4L2_CID_HFLIP, 0, 1, 1, 0);
+       if (ov08d10->hflip)
+               ov08d10->hflip->flags |= V4L2_CTRL_FLAG_MODIFY_LAYOUT;
        ov08d10->vflip = v4l2_ctrl_new_std(ctrl_hdlr, &ov08d10_ctrl_ops,
                                           V4L2_CID_VFLIP, 0, 1, 1, 0);
+       if (ov08d10->vflip)
+               ov08d10->vflip->flags |= V4L2_CTRL_FLAG_MODIFY_LAYOUT;
+
        if (ctrl_hdlr->error)
                return ctrl_hdlr->error;
 
index de66d3395a4dd97b7c687d024b96766225fe3f22..54153bf66bddc045dff145032bd16a6b60077e8e 100644 (file)
@@ -967,6 +967,8 @@ static int ov2680_v4l2_register(struct ov2680_dev *sensor)
 
        ctrls->gain->flags |= V4L2_CTRL_FLAG_VOLATILE;
        ctrls->exposure->flags |= V4L2_CTRL_FLAG_VOLATILE;
+       ctrls->vflip->flags |= V4L2_CTRL_FLAG_MODIFY_LAYOUT;
+       ctrls->hflip->flags |= V4L2_CTRL_FLAG_MODIFY_LAYOUT;
 
        v4l2_ctrl_auto_cluster(2, &ctrls->auto_gain, 0, true);
        v4l2_ctrl_auto_cluster(2, &ctrls->auto_exp, 1, true);
index 2d740397a5d4d6bebf5e991c35db28effe04ac84..e0f908af581b831f84b04c53d067f68b8e4b597b 100644 (file)
@@ -2715,20 +2715,20 @@ static int ov5640_sensor_resume(struct device *dev)
 
 static int ov5640_try_frame_interval(struct ov5640_dev *sensor,
                                     struct v4l2_fract *fi,
-                                    u32 width, u32 height)
+                                    const struct ov5640_mode_info *mode_info)
 {
-       const struct ov5640_mode_info *mode;
+       const struct ov5640_mode_info *mode = mode_info;
        enum ov5640_frame_rate rate = OV5640_15_FPS;
        int minfps, maxfps, best_fps, fps;
        int i;
 
        minfps = ov5640_framerates[OV5640_15_FPS];
-       maxfps = ov5640_framerates[OV5640_60_FPS];
+       maxfps = ov5640_framerates[mode->max_fps];
 
        if (fi->numerator == 0) {
                fi->denominator = maxfps;
                fi->numerator = 1;
-               rate = OV5640_60_FPS;
+               rate = mode->max_fps;
                goto find_mode;
        }
 
@@ -2749,7 +2749,7 @@ static int ov5640_try_frame_interval(struct ov5640_dev *sensor,
        fi->denominator = best_fps;
 
 find_mode:
-       mode = ov5640_find_mode(sensor, width, height, false);
+       mode = ov5640_find_mode(sensor, mode->width, mode->height, false);
        return mode ? rate : -EINVAL;
 }
 
@@ -3554,6 +3554,7 @@ static int ov5640_enum_frame_interval(
        struct v4l2_subdev_frame_interval_enum *fie)
 {
        struct ov5640_dev *sensor = to_ov5640_dev(sd);
+       const struct ov5640_mode_info *mode;
        struct v4l2_fract tpf;
        int ret;
 
@@ -3562,11 +3563,14 @@ static int ov5640_enum_frame_interval(
        if (fie->index >= OV5640_NUM_FRAMERATES)
                return -EINVAL;
 
+       mode = ov5640_find_mode(sensor, fie->width, fie->height, false);
+       if (!mode)
+               return -EINVAL;
+
        tpf.numerator = 1;
        tpf.denominator = ov5640_framerates[fie->index];
 
-       ret = ov5640_try_frame_interval(sensor, &tpf,
-                                       fie->width, fie->height);
+       ret = ov5640_try_frame_interval(sensor, &tpf, mode);
        if (ret < 0)
                return -EINVAL;
 
@@ -3605,9 +3609,7 @@ static int ov5640_s_frame_interval(struct v4l2_subdev *sd,
 
        mode = sensor->current_mode;
 
-       frame_rate = ov5640_try_frame_interval(sensor, &fi->interval,
-                                              mode->width,
-                                              mode->height);
+       frame_rate = ov5640_try_frame_interval(sensor, &fi->interval, mode);
        if (frame_rate < 0) {
                /* Always return a valid frame interval value */
                fi->interval = sensor->frame_interval;
@@ -3817,7 +3819,8 @@ static int ov5640_probe(struct i2c_client *client)
        sensor->current_mode =
                &ov5640_mode_data[OV5640_MODE_VGA_640_480];
        sensor->last_mode = sensor->current_mode;
-       sensor->current_link_freq = OV5640_DEFAULT_LINK_FREQ;
+       sensor->current_link_freq =
+               ov5640_csi2_link_freqs[OV5640_DEFAULT_LINK_FREQ];
 
        sensor->ae_target = 52;
 
index a97ec132ba3a70765125411a5b58a54fddd90df0..e3c3bed69ad66f415caf2a73384da7a70d70fd19 100644 (file)
@@ -156,6 +156,7 @@ struct ov5693_device {
 
        struct gpio_desc *reset;
        struct gpio_desc *powerdown;
+       struct gpio_desc *privacy_led;
        struct regulator_bulk_data supplies[OV5693_NUM_SUPPLIES];
        struct clk *xvclk;
 
@@ -789,6 +790,7 @@ static int ov5693_sensor_init(struct ov5693_device *ov5693)
 
 static void ov5693_sensor_powerdown(struct ov5693_device *ov5693)
 {
+       gpiod_set_value_cansleep(ov5693->privacy_led, 0);
        gpiod_set_value_cansleep(ov5693->reset, 1);
        gpiod_set_value_cansleep(ov5693->powerdown, 1);
 
@@ -818,6 +820,7 @@ static int ov5693_sensor_powerup(struct ov5693_device *ov5693)
 
        gpiod_set_value_cansleep(ov5693->powerdown, 0);
        gpiod_set_value_cansleep(ov5693->reset, 0);
+       gpiod_set_value_cansleep(ov5693->privacy_led, 1);
 
        usleep_range(5000, 7500);
 
@@ -1325,6 +1328,13 @@ static int ov5693_configure_gpios(struct ov5693_device *ov5693)
                return PTR_ERR(ov5693->powerdown);
        }
 
+       ov5693->privacy_led = devm_gpiod_get_optional(ov5693->dev, "privacy-led",
+                                                     GPIOD_OUT_LOW);
+       if (IS_ERR(ov5693->privacy_led)) {
+               dev_err(ov5693->dev, "Error fetching privacy-led GPIO\n");
+               return PTR_ERR(ov5693->privacy_led);
+       }
+
        return 0;
 }
 
index 4ee93daa23c6cdbe7313623f85485bcabe5178b7..37a55d53af56a0a8b139a400b652a5ca85748743 100644 (file)
@@ -130,6 +130,7 @@ struct ov9282_reg_list {
  * @vblank_min: Minimum vertical blanking in lines
  * @vblank_max: Maximum vertical blanking in lines
  * @link_freq_idx: Link frequency index
+ * @crop: on-sensor cropping for this mode
  * @reg_list: Register list for sensor mode
  */
 struct ov9282_mode {
@@ -152,13 +153,16 @@ struct ov9282_mode {
  * @pad: Media pad. Only one pad supported
  * @reset_gpio: Sensor reset gpio
  * @inclk: Sensor input clock
+ * @supplies: Regulator supplies for the sensor
  * @ctrl_handler: V4L2 control handler
  * @link_freq_ctrl: Pointer to link frequency control
  * @hblank_ctrl: Pointer to horizontal blanking control
  * @vblank_ctrl: Pointer to vertical blanking control
  * @exp_ctrl: Pointer to exposure control
  * @again_ctrl: Pointer to analog gain control
+ * @pixel_rate: Pointer to pixel rate control
  * @vblank: Vertical blanking in lines
+ * @noncontinuous_clock: Selection of CSI2 noncontinuous clock mode
  * @cur_mode: Pointer to current selected sensor mode
  * @code: Mbus code currently selected
  * @mutex: Mutex for serializing sensor controls
@@ -264,7 +268,7 @@ static const struct ov9282_reg common_regs[] = {
        {0x5a08, 0x84},
 };
 
-struct ov9282_reg_list common_regs_list = {
+static struct ov9282_reg_list common_regs_list = {
        .num_of_regs = ARRAY_SIZE(common_regs),
        .regs = common_regs,
 };
@@ -1249,11 +1253,13 @@ static int ov9282_power_on(struct device *dev)
                                        OV9282_GATED_CLOCK : 0);
        if (ret) {
                dev_err(ov9282->dev, "fail to write MIPI_CTRL00");
-               return ret;
+               goto error_clk;
        }
 
        return 0;
 
+error_clk:
+       clk_disable_unprepare(ov9282->inclk);
 error_reset:
        gpiod_set_value_cansleep(ov9282->reset_gpio, 0);
 
@@ -1400,6 +1406,8 @@ static int ov9282_probe(struct i2c_client *client)
 
        /* Initialize subdev */
        v4l2_i2c_subdev_init(&ov9282->sd, client, &ov9282_subdev_ops);
+       v4l2_i2c_subdev_set_name(&ov9282->sd, client,
+                                device_get_match_data(ov9282->dev), NULL);
 
        ret = ov9282_parse_hw_config(ov9282);
        if (ret) {
@@ -1499,7 +1507,8 @@ static const struct dev_pm_ops ov9282_pm_ops = {
 };
 
 static const struct of_device_id ov9282_of_match[] = {
-       { .compatible = "ovti,ov9282" },
+       { .compatible = "ovti,ov9281", .data = "ov9281" },
+       { .compatible = "ovti,ov9282", .data = "ov9282" },
        { }
 };
 
index 171309c62bb863bd0c880a9bd5578652fd377d32..d1f552bd81d42eba042f600dc8bf82576becd3fd 100644 (file)
@@ -1668,8 +1668,8 @@ err:
        return err;
 }
 
-DEFINE_RUNTIME_DEV_PM_OPS(tc358746_pm_ops, tc358746_suspend,
-                         tc358746_resume, NULL);
+static DEFINE_RUNTIME_DEV_PM_OPS(tc358746_pm_ops, tc358746_suspend,
+                                tc358746_resume, NULL);
 
 static const struct of_device_id __maybe_unused tc358746_of_match[] = {
        { .compatible = "toshiba,tc358746" },
index 01d75ef2342d1ce83188daabc5c3f2f6acfb3d43..a8a004f28ca0e227764dfc60fe99d85e33a6dc60 100644 (file)
@@ -1257,7 +1257,7 @@ static int saa7164_initdev(struct pci_dev *pci_dev,
 
        if (saa7164_dev_setup(dev) < 0) {
                err = -EINVAL;
-               goto fail_free;
+               goto fail_dev;
        }
 
        /* print pci info */
@@ -1425,6 +1425,8 @@ fail_fw:
 
 fail_irq:
        saa7164_dev_unregister(dev);
+fail_dev:
+       pci_disable_device(pci_dev);
 fail_free:
        v4l2_device_unregister(&dev->v4l2_dev);
        kfree(dev);
index 5cb4fad6d6e0c20aca18cabe95157a4930eb8059..0b682cbae3eb51c367d4bd90a9f6756118fd5de3 100644 (file)
@@ -68,6 +68,8 @@ struct rzg2l_cru_ip {
  *
  * @vclk:              CRU Main clock
  *
+ * @image_conv_irq:    Holds image conversion interrupt number
+ *
  * @vdev:              V4L2 video device associated with CRU
  * @v4l2_dev:          V4L2 device
  * @num_buf:           Holds the current number of buffers enabled
index aa752b80574c03a85aa85e8841b35a4134f737ee..33e08efa3039c286661943df899a23b4e599c1c2 100644 (file)
@@ -402,7 +402,7 @@ static void rzg2l_csi2_mipi_link_disable(struct rzg2l_csi2 *csi2)
        rzg2l_csi2_write(csi2, CSI2nRTCT, CSI2nRTCT_VSRST);
 
        /* Make sure CSI2nRTST.VSRSTS bit is cleared */
-       while (timeout--) {
+       while (--timeout) {
                if (!(rzg2l_csi2_read(csi2, CSI2nRTST) & CSI2nRTST_VSRSTS))
                        break;
                usleep_range(100, 200);
@@ -431,8 +431,6 @@ static int rzg2l_csi2_s_stream(struct v4l2_subdev *sd, int enable)
        int ret;
 
        if (enable) {
-               int ret;
-
                ret = pm_runtime_resume_and_get(csi2->dev);
                if (ret)
                        return ret;
index 9533e4069ecd345dfc3b8aa4f5e16985593a6abc..91b57c7c2e564c9beee32498489b275a6b1f9b3f 100644 (file)
@@ -673,6 +673,7 @@ static int rzg2l_cru_start_streaming_vq(struct vb2_queue *vq, unsigned int count
        if (!cru->scratch) {
                return_unused_buffers(cru, VB2_BUF_STATE_QUEUED);
                dev_err(cru->dev, "Failed to allocate scratch buffer\n");
+               ret = -ENOMEM;
                goto free_image_conv_irq;
        }
 
index 86d20c1c35edefcdbc6b63db519326652f9c1f92..ebfc870d2af50cecc618699376fd2b1b1a206051 100644 (file)
@@ -415,8 +415,7 @@ static int sun6i_csi_bridge_s_stream(struct v4l2_subdev *subdev, int on)
        struct sun6i_csi_bridge_source *source;
        struct v4l2_subdev *source_subdev;
        struct media_pad *remote_pad;
-       /* Initialize to 0 to use both in disable label (ret != 0) and off. */
-       int ret = 0;
+       int ret;
 
        /* Source */
 
@@ -436,6 +435,7 @@ static int sun6i_csi_bridge_s_stream(struct v4l2_subdev *subdev, int on)
 
        if (!on) {
                v4l2_subdev_call(source_subdev, video, s_stream, 0);
+               ret = 0;
                goto disable;
        }
 
@@ -587,7 +587,7 @@ static const struct v4l2_subdev_pad_ops sun6i_csi_bridge_pad_ops = {
        .set_fmt        = sun6i_csi_bridge_set_fmt,
 };
 
-const struct v4l2_subdev_ops sun6i_csi_bridge_subdev_ops = {
+static const struct v4l2_subdev_ops sun6i_csi_bridge_subdev_ops = {
        .video  = &sun6i_csi_bridge_video_ops,
        .pad    = &sun6i_csi_bridge_pad_ops,
 };
@@ -652,7 +652,7 @@ sun6i_csi_bridge_notifier_bound(struct v4l2_async_notifier *notifier,
                             async_subdev);
        struct sun6i_csi_bridge *bridge = &csi_dev->bridge;
        struct sun6i_csi_bridge_source *source = bridge_async_subdev->source;
-       bool enabled;
+       bool enabled = false;
        int ret;
 
        switch (source->endpoint.base.port) {
index 548199cd86f60be48aa9f3d80594ece8747a328d..fea5bcf72a31a608ac65f4945ce53cc89c44860f 100644 (file)
@@ -485,14 +485,14 @@ static int m920x_identify_state(struct usb_device *udev,
 static int m920x_mt352_demod_init(struct dvb_frontend *fe)
 {
        int ret;
-       u8 config[] = { CONFIG, 0x3d };
-       u8 clock[] = { CLOCK_CTL, 0x30 };
-       u8 reset[] = { RESET, 0x80 };
-       u8 adc_ctl[] = { ADC_CTL_1, 0x40 };
-       u8 agc[] = { AGC_TARGET, 0x1c, 0x20 };
-       u8 sec_agc[] = { 0x69, 0x00, 0xff, 0xff, 0x40, 0xff, 0x00, 0x40, 0x40 };
-       u8 unk1[] = { 0x93, 0x1a };
-       u8 unk2[] = { 0xb5, 0x7a };
+       static const u8 config[] = { CONFIG, 0x3d };
+       static const u8 clock[] = { CLOCK_CTL, 0x30 };
+       static const u8 reset[] = { RESET, 0x80 };
+       static const u8 adc_ctl[] = { ADC_CTL_1, 0x40 };
+       static const u8 agc[] = { AGC_TARGET, 0x1c, 0x20 };
+       static const u8 sec_agc[] = { 0x69, 0x00, 0xff, 0xff, 0x40, 0xff, 0x00, 0x40, 0x40 };
+       static const u8 unk1[] = { 0x93, 0x1a };
+       static const u8 unk2[] = { 0xb5, 0x7a };
 
        deb("Demod init!\n");
 
index fad9871157e2af779ed99c8c7242c363afac4ecc..29d25c8a6f13fa09d7f0b1a48b2dab299d90ba7d 100644 (file)
@@ -130,6 +130,7 @@ struct dvb_adapter {
  * struct dvb_device - represents a DVB device node
  *
  * @list_head: List head with all DVB devices
+ * @ref:       reference counter
  * @fops:      pointer to struct file_operations
  * @adapter:   pointer to the adapter that holds this device node
  * @type:      type of the device, as defined by &enum dvb_device_type.
@@ -200,7 +201,7 @@ struct dvb_device {
 struct dvb_device *dvb_device_get(struct dvb_device *dvbdev);
 
 /**
- * dvb_device_get - Decrease dvb_device reference
+ * dvb_device_put - Decrease dvb_device reference
  *
  * @dvbdev:    pointer to struct dvb_device
  */
index bfed1710dc2485f0546f93c094d5b297ef73085c..541c71a2c7be1f85eae3764f95a0116018ac0d8a 100644 (file)
@@ -16,7 +16,7 @@ struct frame_vector {
 struct frame_vector *frame_vector_create(unsigned int nr_frames);
 void frame_vector_destroy(struct frame_vector *vec);
 int get_vaddr_frames(unsigned long start, unsigned int nr_pfns,
-                    struct frame_vector *vec);
+                    bool write, struct frame_vector *vec);
 void put_vaddr_frames(struct frame_vector *vec);
 int frame_vector_to_pages(struct frame_vector *vec);
 void frame_vector_to_pfns(struct frame_vector *vec);
index cd4a463315313410a75b98b2a567d5f75925824e..4b5b84f93538ed4cc808dbc6cfdf18a448a5abab 100644 (file)
@@ -34,7 +34,8 @@ struct vb2_vmarea_handler {
 extern const struct vm_operations_struct vb2_common_vm_ops;
 
 struct frame_vector *vb2_create_framevec(unsigned long start,
-                                        unsigned long length);
+                                        unsigned long length,
+                                        bool write);
 void vb2_destroy_framevec(struct frame_vector *vec);
 
 #endif
index 53f4fb8043e34a9330b28913a6a73a549e74ef50..326f6a53f1f2492b5e634ad530ef92458a70ea80 100644 (file)
@@ -267,7 +267,6 @@ enum fe_spectral_inversion {
 /**
  * enum fe_code_rate - Type of Forward Error Correction (FEC)
  *
- *
  * @FEC_NONE: No Forward Error Correction Code
  * @FEC_1_2:  Forward Error Correction Code 1/2
  * @FEC_2_3:  Forward Error Correction Code 2/3
@@ -348,8 +347,8 @@ enum fe_code_rate {
  * @APSK_32:   32-APSK modulation
  * @DQPSK:     DQPSK modulation
  * @QAM_4_NR:  4-QAM-NR modulation
- * @QAM-1024:  1024-QAM modulation
- * @QAM-4096:  4096-QAM modulation
+ * @QAM_1024:  1024-QAM modulation
+ * @QAM_4096:  4096-QAM modulation
  * @APSK_8_L:  8APSK-L modulation
  * @APSK_16_L: 16APSK-L modulation
  * @APSK_32_L: 32APSK-L modulation
@@ -762,7 +761,7 @@ enum atscmh_rs_frame_mode {
 };
 
 /**
- * enum atscmh_rs_code_mode
+ * enum atscmh_rs_code_mode - ATSC-M/H Reed Solomon modes
  * @ATSCMH_RSCODE_211_187:     Reed Solomon code (211,187).
  * @ATSCMH_RSCODE_223_187:     Reed Solomon code (223,187).
  * @ATSCMH_RSCODE_235_187:     Reed Solomon code (235,187).