]> Git Repo - linux.git/commitdiff
Merge remote-tracking branch 'linus/master' into staging/for_v3.5
authorMauro Carvalho Chehab <[email protected]>
Tue, 15 May 2012 11:39:25 +0000 (08:39 -0300)
committerMauro Carvalho Chehab <[email protected]>
Tue, 15 May 2012 11:39:25 +0000 (08:39 -0300)
* linus/master: (805 commits)
  tty: Fix LED error return
  openvswitch: checking wrong variable in queue_userspace_packet()
  bonding: Fix LACPDU rx_dropped commit.
  Linux 3.4-rc7
  ARM: EXYNOS: fix ctrlbit for exynos5_clk_pdma1
  ARM: EXYNOS: use s5p-timer for UniversalC210 board
  ARM / mach-shmobile: Invalidate caches when booting secondary cores
  ARM / mach-shmobile: sh73a0 SMP TWD boot regression fix
  ARM / mach-shmobile: r8a7779 SMP TWD boot regression fix
  ARM: mach-shmobile: convert ag5evm to use the generic MMC GPIO hotplug helper
  ARM: mach-shmobile: convert mackerel to use the generic MMC GPIO hotplug helper
  MAINTAINERS: Add myself as the cpufreq maintainer
  dm mpath: check if scsi_dh module already loaded before trying to load
  dm thin: correct module description
  dm thin: fix unprotected use of prepared_discards list
  dm thin: reinstate missing mempool_free in cell_release_singleton
  gpio/exynos: Fix compiler warnings when non-exynos machines are selected
  gpio: pch9: Use proper flow type handlers
  powerpc/irq: Fix another case of lazy IRQ state getting out of sync
  ks8851: Update link status during link change interrupt
  ...

Conflicts:
drivers/media/common/tuners/xc5000.c
drivers/media/common/tuners/xc5000.h
drivers/usb/gadget/uvc_queue.c

1  2 
MAINTAINERS
drivers/media/dvb/frontends/drxk_hard.c
drivers/media/video/gspca/sonixj.c
drivers/media/video/s5p-fimc/fimc-capture.c
drivers/media/video/s5p-fimc/fimc-core.c
drivers/media/video/s5p-fimc/fimc-core.h
drivers/media/video/soc_camera.c
drivers/usb/gadget/uvc_v4l2.c

diff --combined MAINTAINERS
index f3d7e16b90edaf9daf7d96978152912c8726a1bc,b36270986501dd41fe33280388ea2f7e9c3c9720..f175f444cb55af00fcd0f301a8deb220fe74bed6
@@@ -1968,10 -1968,9 +1968,9 @@@ S:     Maintaine
  F:    drivers/net/ethernet/ti/cpmac.c
  
  CPU FREQUENCY DRIVERS
- M:    Dave Jones <[email protected]>
+ M:    Rafael J. Wysocki <[email protected]>
  L:    [email protected]
- W:    http://www.codemonkey.org.uk/projects/cpufreq/
- T:    git git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq.git
+ L:    [email protected]
  S:    Maintained
  F:    drivers/cpufreq/
  F:    include/linux/cpufreq.h
@@@ -2321,9 -2320,9 +2320,9 @@@ S:      Supporte
  F:    drivers/acpi/dock.c
  
  DOCUMENTATION
- M:    Randy Dunlap <rdunlap@xenotime.net>
+ M:    Rob Landley <rob@landley.net>
  L:    [email protected]
- T:    quilt http://xenotime.net/kernel-doc-patches/current/
+ T:    TBD
  S:    Maintained
  F:    Documentation/
  
@@@ -2696,13 -2695,6 +2695,13 @@@ S:    Maintaine
  F:    Documentation/hwmon/f71805f
  F:    drivers/hwmon/f71805f.c
  
 +FC0011 TUNER DRIVER
 +M:    Michael Buesch <[email protected]>
 +L:    [email protected]
 +S:    Maintained
 +F:    drivers/media/common/tuners/fc0011.h
 +F:    drivers/media/common/tuners/fc0011.c
 +
  FANOTIFY
  M:    Eric Paris <[email protected]>
  S:    Maintained
@@@ -3599,6 -3591,7 +3598,7 @@@ S:      Supporte
  F:    drivers/net/wireless/iwlegacy/
  
  INTEL WIRELESS WIFI LINK (iwlwifi)
+ M:    Johannes Berg <[email protected]>
  M:    Wey-Yi Guy <[email protected]>
  M:    Intel Linux Wireless <[email protected]>
  L:    [email protected]
@@@ -4043,6 -4036,7 +4043,7 @@@ F:      Documentation/scsi/53c700.tx
  F:    drivers/scsi/53c700*
  
  LED SUBSYSTEM
+ M:    Bryan Wu <[email protected]>
  M:    Richard Purdie <[email protected]>
  S:    Maintained
  F:    drivers/leds/
@@@ -5898,11 -5892,11 +5899,11 @@@ F:   Documentation/scsi/st.tx
  F:    drivers/scsi/st*
  
  SCTP PROTOCOL
- M:    Vlad Yasevich <vladislav.yasevich@hp.com>
+ M:    Vlad Yasevich <vyasevich@gmail.com>
  M:    Sridhar Samudrala <[email protected]>
  L:    [email protected]
  W:    http://lksctp.sourceforge.net
- S:    Supported
+ S:    Maintained
  F:    Documentation/networking/sctp.txt
  F:    include/linux/sctp.h
  F:    include/net/sctp/
@@@ -7148,7 -7142,7 +7149,7 @@@ F:      include/linux/usb/usbnet.
  
  USB VIDEO CLASS
  M:    Laurent Pinchart <[email protected]>
 -L:    linux-uvc-devel@lists.berlios.de (subscribers-only)
 +L:    linux-uvc-devel@lists.sourceforge.net (subscribers-only)
  L:    [email protected]
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media.git
  W:    http://www.ideasonboard.org/uvc/
@@@ -7585,8 -7579,8 +7586,8 @@@ F:      Documentation/filesystems/xfs.tx
  F:    fs/xfs/
  
  XILINX AXI ETHERNET DRIVER
- M:    Ariane Keller <[email protected]>
- M:    Daniel Borkmann <[email protected]>
+ M:    Anirudha Sarangi <[email protected]>
+ M:    John Linn <[email protected]>
  S:    Maintained
  F:    drivers/net/ethernet/xilinx/xilinx_axienet*
  
index 88bd1c888ca8e5a109dde658b01992d0cef2c5fd,a414b1f2b6a5a0f2cd1c4dcfef210ea45189f912..8d99ac1598aef310b6b3986f62a52b04a988df7a
@@@ -1380,20 -1380,20 +1380,20 @@@ static int DownloadMicrocode(struct drx
                             const u8 pMCImage[], u32 Length)
  {
        const u8 *pSrc = pMCImage;
 -      u16 Flags;
 -      u16 Drain;
        u32 Address;
        u16 nBlocks;
        u16 BlockSize;
 -      u16 BlockCRC;
        u32 offset = 0;
        u32 i;
        int status = 0;
  
        dprintk(1, "\n");
  
 -      /* down the drain (we don care about MAGIC_WORD) */
 +      /* down the drain (we don't care about MAGIC_WORD) */
 +#if 0
 +      /* For future reference */
        Drain = (pSrc[0] << 8) | pSrc[1];
 +#endif
        pSrc += sizeof(u16);
        offset += sizeof(u16);
        nBlocks = (pSrc[0] << 8) | pSrc[1];
                pSrc += sizeof(u16);
                offset += sizeof(u16);
  
 +#if 0
 +              /* For future reference */
                Flags = (pSrc[0] << 8) | pSrc[1];
 +#endif
                pSrc += sizeof(u16);
                offset += sizeof(u16);
  
 +#if 0
 +              /* For future reference */
                BlockCRC = (pSrc[0] << 8) | pSrc[1];
 +#endif
                pSrc += sizeof(u16);
                offset += sizeof(u16);
  
@@@ -1526,8 -1520,10 +1526,10 @@@ static int scu_command(struct drxk_stat
        dprintk(1, "\n");
  
        if ((cmd == 0) || ((parameterLen > 0) && (parameter == NULL)) ||
-           ((resultLen > 0) && (result == NULL)))
-               goto error;
+           ((resultLen > 0) && (result == NULL))) {
+               printk(KERN_ERR "drxk: Error %d on %s\n", status, __func__);
+               return status;
+       }
  
        mutex_lock(&state->mutex);
  
index 05c6d0c004d4f67a155c2d42f111781841e28b9b,863c755dd2b7a16866a3e5329b47a9507831bc9d..4d1696d1a7f4022d0cca06a90f40f6a912a5b877
@@@ -2800,7 -2800,10 +2800,7 @@@ static void sd_stop0(struct gspca_dev *
        }
  }
  
 -/* !! coarse_grained_expo_autogain is not used !! */
 -#define exp_too_low_cnt bridge
 -#define exp_too_high_cnt sensor
 -
 +#define WANT_REGULAR_AUTOGAIN
  #include "autogain_functions.h"
  
  static void do_autogain(struct gspca_dev *gspca_dev)
@@@ -2920,6 -2923,10 +2920,10 @@@ static void sd_pkt_scan(struct gspca_de
         * not the JPEG end of frame ('ff d9').
         */
  
+       /* count the packets and their size */
+       sd->npkt++;
+       sd->pktsz += len;
  /*fixme: assumption about the following code:
   *    - there can be only one marker in a packet
   */
                data += i;
        }
  
-       /* count the packets and their size */
-       sd->npkt++;
-       sd->pktsz += len;
        /* search backwards if there is a marker in the packet */
        for (i = len - 1; --i >= 0; ) {
                if (data[i] != 0xff) {
index 520217758c04cd6fe9ed3b94a8e60e0363f138cb,7e9b2c612b03e9ccccb5a03883169f376876e272..be5e4e237297b60b8605ad0017603e2fcce24553
@@@ -83,9 -83,7 +83,9 @@@ static int fimc_capture_state_cleanup(s
  
        fimc->state &= ~(1 << ST_CAPT_RUN | 1 << ST_CAPT_SHUT |
                         1 << ST_CAPT_STREAM | 1 << ST_CAPT_ISP_STREAM);
 -      if (!suspend)
 +      if (suspend)
 +              fimc->state |= (1 << ST_CAPT_SUSPENDED);
 +      else
                fimc->state &= ~(1 << ST_CAPT_PEND | 1 << ST_CAPT_SUSPENDED);
  
        /* Release unused buffers */
                else
                        vb2_buffer_done(&buf->vb, VB2_BUF_STATE_ERROR);
        }
 -      set_bit(ST_CAPT_SUSPENDED, &fimc->state);
  
        fimc_hw_reset(fimc);
        cap->buf_index = 0;
@@@ -147,22 -146,21 +147,22 @@@ int fimc_capture_config_update(struct f
        if (!test_bit(ST_CAPT_APPLY_CFG, &fimc->state))
                return 0;
  
 -      spin_lock(&ctx->slock);
        fimc_hw_set_camera_offset(fimc, &ctx->s_frame);
 +
        ret = fimc_set_scaler_info(ctx);
 -      if (ret == 0) {
 -              fimc_hw_set_prescaler(ctx);
 -              fimc_hw_set_mainscaler(ctx);
 -              fimc_hw_set_target_format(ctx);
 -              fimc_hw_set_rotation(ctx);
 -              fimc_prepare_dma_offset(ctx, &ctx->d_frame);
 -              fimc_hw_set_out_dma(ctx);
 -              if (fimc->variant->has_alpha)
 -                      fimc_hw_set_rgb_alpha(ctx);
 -              clear_bit(ST_CAPT_APPLY_CFG, &fimc->state);
 -      }
 -      spin_unlock(&ctx->slock);
 +      if (ret)
 +              return ret;
 +
 +      fimc_hw_set_prescaler(ctx);
 +      fimc_hw_set_mainscaler(ctx);
 +      fimc_hw_set_target_format(ctx);
 +      fimc_hw_set_rotation(ctx);
 +      fimc_prepare_dma_offset(ctx, &ctx->d_frame);
 +      fimc_hw_set_out_dma(ctx);
 +      if (fimc->variant->has_alpha)
 +              fimc_hw_set_rgb_alpha(ctx);
 +
 +      clear_bit(ST_CAPT_APPLY_CFG, &fimc->state);
        return ret;
  }
  
@@@ -248,28 -246,37 +248,37 @@@ int fimc_capture_resume(struct fimc_de
  
  }
  
- static unsigned int get_plane_size(struct fimc_frame *fr, unsigned int plane)
- {
-       if (!fr || plane >= fr->fmt->memplanes)
-               return 0;
-       return fr->f_width * fr->f_height * fr->fmt->depth[plane] / 8;
- }
- static int queue_setup(struct vb2_queue *vq,  const struct v4l2_format *pfmt,
+ static int queue_setup(struct vb2_queue *vq, const struct v4l2_format *pfmt,
                       unsigned int *num_buffers, unsigned int *num_planes,
                       unsigned int sizes[], void *allocators[])
  {
+       const struct v4l2_pix_format_mplane *pixm = NULL;
        struct fimc_ctx *ctx = vq->drv_priv;
-       struct fimc_fmt *fmt = ctx->d_frame.fmt;
+       struct fimc_frame *frame = &ctx->d_frame;
+       struct fimc_fmt *fmt = frame->fmt;
+       unsigned long wh;
        int i;
  
-       if (!fmt)
+       if (pfmt) {
+               pixm = &pfmt->fmt.pix_mp;
+               fmt = fimc_find_format(&pixm->pixelformat, NULL,
+                                      FMT_FLAGS_CAM | FMT_FLAGS_M2M, -1);
+               wh = pixm->width * pixm->height;
+       } else {
+               wh = frame->f_width * frame->f_height;
+       }
+       if (fmt == NULL)
                return -EINVAL;
  
        *num_planes = fmt->memplanes;
  
        for (i = 0; i < fmt->memplanes; i++) {
-               sizes[i] = get_plane_size(&ctx->d_frame, i);
+               unsigned int size = (wh * fmt->depth[i]) / 8;
+               if (pixm)
+                       sizes[i] = max(size, pixm->plane_fmt[i].sizeimage);
+               else
+                       sizes[i] = size;
                allocators[i] = ctx->fimc_dev->alloc_ctx;
        }
  
@@@ -1516,10 -1523,6 +1525,10 @@@ int fimc_register_capture_device(struc
        vfd->minor      = -1;
        vfd->release    = video_device_release;
        vfd->lock       = &fimc->lock;
 +      /* Locking in file operations other than ioctl should be done
 +         by the driver, not the V4L2 core.
 +         This driver needs auditing so that this flag can be removed. */
 +      set_bit(V4L2_FL_LOCK_ALL_FOPS, &vfd->flags);
        video_set_drvdata(vfd, fimc);
  
        vid_cap = &fimc->vid_cap;
  
        INIT_LIST_HEAD(&vid_cap->pending_buf_q);
        INIT_LIST_HEAD(&vid_cap->active_buf_q);
 -      spin_lock_init(&ctx->slock);
        vid_cap->ctx = ctx;
  
        q = &fimc->vid_cap.vbq;
index c58dd9f8ce67d505a7303428b21211f3e6beb066,e09ba7b0076ed5806f4ee17952f4bbacde53096a..f6b9060a0c0f6373bf100c3c237c3a52d58a0351
@@@ -320,7 -320,7 +320,7 @@@ static int fimc_m2m_shutdown(struct fim
        if (!fimc_m2m_pending(fimc))
                return 0;
  
 -      fimc_ctx_state_lock_set(FIMC_CTX_SHUT, ctx);
 +      fimc_ctx_state_set(FIMC_CTX_SHUT, ctx);
  
        ret = wait_event_timeout(fimc->irq_queue,
                           !fimc_ctx_state_is_set(FIMC_CTX_SHUT, ctx),
@@@ -430,12 -430,14 +430,12 @@@ static irqreturn_t fimc_irq_handler(in
                        spin_unlock(&fimc->slock);
                        fimc_m2m_job_finish(ctx, VB2_BUF_STATE_DONE);
  
 -                      spin_lock(&ctx->slock);
                        if (ctx->state & FIMC_CTX_SHUT) {
                                ctx->state &= ~FIMC_CTX_SHUT;
                                wake_up(&fimc->irq_queue);
                        }
 -                      spin_unlock(&ctx->slock);
 +                      return IRQ_HANDLED;
                }
 -              return IRQ_HANDLED;
        } else if (test_bit(ST_CAPT_PEND, &fimc->state)) {
                fimc_capture_irq_handler(fimc,
                                 !test_bit(ST_CAPT_JPEG, &fimc->state));
@@@ -582,11 -584,55 +582,11 @@@ void fimc_prepare_dma_offset(struct fim
            f->fmt->color, f->dma_offset.y_h, f->dma_offset.y_v);
  }
  
 -/**
 - * fimc_prepare_config - check dimensions, operation and color mode
 - *                     and pre-calculate offset and the scaling coefficients.
 - *
 - * @ctx: hardware context information
 - * @flags: flags indicating which parameters to check/update
 - *
 - * Return: 0 if dimensions are valid or non zero otherwise.
 - */
 -int fimc_prepare_config(struct fimc_ctx *ctx, u32 flags)
 -{
 -      struct fimc_frame *s_frame, *d_frame;
 -      struct vb2_buffer *vb = NULL;
 -      int ret = 0;
 -
 -      s_frame = &ctx->s_frame;
 -      d_frame = &ctx->d_frame;
 -
 -      if (flags & FIMC_PARAMS) {
 -              /* Prepare the DMA offset ratios for scaler. */
 -              fimc_prepare_dma_offset(ctx, &ctx->s_frame);
 -              fimc_prepare_dma_offset(ctx, &ctx->d_frame);
 -
 -              if (s_frame->height > (SCALER_MAX_VRATIO * d_frame->height) ||
 -                  s_frame->width > (SCALER_MAX_HRATIO * d_frame->width)) {
 -                      err("out of scaler range");
 -                      return -EINVAL;
 -              }
 -              fimc_set_yuv_order(ctx);
 -      }
 -
 -      if (flags & FIMC_SRC_ADDR) {
 -              vb = v4l2_m2m_next_src_buf(ctx->m2m_ctx);
 -              ret = fimc_prepare_addr(ctx, vb, s_frame, &s_frame->paddr);
 -              if (ret)
 -                      return ret;
 -      }
 -
 -      if (flags & FIMC_DST_ADDR) {
 -              vb = v4l2_m2m_next_dst_buf(ctx->m2m_ctx);
 -              ret = fimc_prepare_addr(ctx, vb, d_frame, &d_frame->paddr);
 -      }
 -
 -      return ret;
 -}
 -
  static void fimc_dma_run(void *priv)
  {
 +      struct vb2_buffer *vb = NULL;
        struct fimc_ctx *ctx = priv;
 +      struct fimc_frame *sf, *df;
        struct fimc_dev *fimc;
        unsigned long flags;
        u32 ret;
        fimc = ctx->fimc_dev;
        spin_lock_irqsave(&fimc->slock, flags);
        set_bit(ST_M2M_PEND, &fimc->state);
 +      sf = &ctx->s_frame;
 +      df = &ctx->d_frame;
 +
 +      if (ctx->state & FIMC_PARAMS) {
 +              /* Prepare the DMA offsets for scaler */
 +              fimc_prepare_dma_offset(ctx, sf);
 +              fimc_prepare_dma_offset(ctx, df);
 +      }
 +
 +      vb = v4l2_m2m_next_src_buf(ctx->m2m_ctx);
 +      ret = fimc_prepare_addr(ctx, vb, sf, &sf->paddr);
 +      if (ret)
 +              goto dma_unlock;
  
 -      spin_lock(&ctx->slock);
 -      ctx->state |= (FIMC_SRC_ADDR | FIMC_DST_ADDR);
 -      ret = fimc_prepare_config(ctx, ctx->state);
 +      vb = v4l2_m2m_next_dst_buf(ctx->m2m_ctx);
 +      ret = fimc_prepare_addr(ctx, vb, df, &df->paddr);
        if (ret)
                goto dma_unlock;
  
                ctx->state |= FIMC_PARAMS;
                fimc->m2m.ctx = ctx;
        }
 -      fimc_hw_set_input_addr(fimc, &ctx->s_frame.paddr);
  
        if (ctx->state & FIMC_PARAMS) {
 +              fimc_set_yuv_order(ctx);
                fimc_hw_set_input_path(ctx);
                fimc_hw_set_in_dma(ctx);
                ret = fimc_set_scaler_info(ctx);
 -              if (ret) {
 -                      spin_unlock(&fimc->slock);
 +              if (ret)
                        goto dma_unlock;
 -              }
                fimc_hw_set_prescaler(ctx);
                fimc_hw_set_mainscaler(ctx);
                fimc_hw_set_target_format(ctx);
                fimc_hw_set_rotation(ctx);
                fimc_hw_set_effect(ctx, false);
 -      }
 -
 -      fimc_hw_set_output_path(ctx);
 -      if (ctx->state & (FIMC_DST_ADDR | FIMC_PARAMS))
 -              fimc_hw_set_output_addr(fimc, &ctx->d_frame.paddr, -1);
 -
 -      if (ctx->state & FIMC_PARAMS) {
                fimc_hw_set_out_dma(ctx);
                if (fimc->variant->has_alpha)
                        fimc_hw_set_rgb_alpha(ctx);
 +              fimc_hw_set_output_path(ctx);
        }
 +      fimc_hw_set_input_addr(fimc, &sf->paddr);
 +      fimc_hw_set_output_addr(fimc, &df->paddr, -1);
  
        fimc_activate_capture(ctx);
  
                       FIMC_SRC_FMT | FIMC_DST_FMT);
        fimc_hw_activate_input_dma(fimc, true);
  dma_unlock:
 -      spin_unlock(&ctx->slock);
        spin_unlock_irqrestore(&fimc->slock, flags);
  }
  
@@@ -786,9 -827,9 +786,9 @@@ static int fimc_s_ctrl(struct v4l2_ctr
        unsigned long flags;
        int ret;
  
 -      spin_lock_irqsave(&ctx->slock, flags);
 +      spin_lock_irqsave(&ctx->fimc_dev->slock, flags);
        ret = __fimc_s_ctrl(ctx, ctrl);
 -      spin_unlock_irqrestore(&ctx->slock, flags);
 +      spin_unlock_irqrestore(&ctx->fimc_dev->slock, flags);
  
        return ret;
  }
@@@ -1007,14 -1048,14 +1007,14 @@@ static int fimc_m2m_g_fmt_mplane(struc
   * @mask: the color flags to match
   * @index: offset in the fimc_formats array, ignored if negative
   */
- struct fimc_fmt *fimc_find_format(u32 *pixelformat, u32 *mbus_code,
+ struct fimc_fmt *fimc_find_format(const u32 *pixelformat, const u32 *mbus_code,
                                  unsigned int mask, int index)
  {
        struct fimc_fmt *fmt, *def_fmt = NULL;
        unsigned int i;
        int id = 0;
  
-       if (index >= ARRAY_SIZE(fimc_formats))
+       if (index >= (int)ARRAY_SIZE(fimc_formats))
                return NULL;
  
        for (i = 0; i < ARRAY_SIZE(fimc_formats); ++i) {
@@@ -1133,9 -1174,9 +1133,9 @@@ static int fimc_m2m_s_fmt_mplane(struc
        ctx->scaler.enabled = 1;
  
        if (f->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE)
 -              fimc_ctx_state_lock_set(FIMC_PARAMS | FIMC_DST_FMT, ctx);
 +              fimc_ctx_state_set(FIMC_PARAMS | FIMC_DST_FMT, ctx);
        else
 -              fimc_ctx_state_lock_set(FIMC_PARAMS | FIMC_SRC_FMT, ctx);
 +              fimc_ctx_state_set(FIMC_PARAMS | FIMC_SRC_FMT, ctx);
  
        dbg("f_w: %d, f_h: %d", frame->f_width, frame->f_height);
  
@@@ -1322,7 -1363,7 +1322,7 @@@ static int fimc_m2m_s_crop(struct file 
        f->width  = cr->c.width;
        f->height = cr->c.height;
  
 -      fimc_ctx_state_lock_set(FIMC_PARAMS, ctx);
 +      fimc_ctx_state_set(FIMC_PARAMS, ctx);
  
        return 0;
  }
@@@ -1426,6 -1467,7 +1426,6 @@@ static int fimc_m2m_open(struct file *f
        ctx->flags = 0;
        ctx->in_path = FIMC_DMA;
        ctx->out_path = FIMC_DMA;
 -      spin_lock_init(&ctx->slock);
  
        ctx->m2m_ctx = v4l2_m2m_ctx_init(fimc->m2m.m2m_dev, ctx, queue_init);
        if (IS_ERR(ctx->m2m_ctx)) {
@@@ -1520,10 -1562,6 +1520,10 @@@ int fimc_register_m2m_device(struct fim
        vfd->minor      = -1;
        vfd->release    = video_device_release;
        vfd->lock       = &fimc->lock;
 +      /* Locking in file operations other than ioctl should be done
 +         by the driver, not the V4L2 core.
 +         This driver needs auditing so that this flag can be removed. */
 +      set_bit(V4L2_FL_LOCK_ALL_FOPS, &vfd->flags);
  
        snprintf(vfd->name, sizeof(vfd->name), "%s.m2m", dev_name(&pdev->dev));
        video_set_drvdata(vfd, fimc);
@@@ -1563,7 -1601,7 +1563,7 @@@ void fimc_unregister_m2m_device(struct 
  static void fimc_clk_put(struct fimc_dev *fimc)
  {
        int i;
 -      for (i = 0; i < fimc->num_clocks; i++) {
 +      for (i = 0; i < MAX_FIMC_CLOCKS; i++) {
                if (IS_ERR_OR_NULL(fimc->clock[i]))
                        continue;
                clk_unprepare(fimc->clock[i]);
@@@ -1576,7 -1614,7 +1576,7 @@@ static int fimc_clk_get(struct fimc_de
  {
        int i, ret;
  
 -      for (i = 0; i < fimc->num_clocks; i++) {
 +      for (i = 0; i < MAX_FIMC_CLOCKS; i++) {
                fimc->clock[i] = clk_get(&fimc->pdev->dev, fimc_clocks[i]);
                if (IS_ERR(fimc->clock[i]))
                        goto err;
@@@ -1676,7 -1714,9 +1676,7 @@@ static int fimc_probe(struct platform_d
                dev_err(&pdev->dev, "Failed to get IRQ resource\n");
                return -ENXIO;
        }
 -      fimc->irq = res->start;
  
 -      fimc->num_clocks = MAX_FIMC_CLOCKS;
        ret = fimc_clk_get(fimc);
        if (ret)
                return ret;
  
        platform_set_drvdata(pdev, fimc);
  
 -      ret = devm_request_irq(&pdev->dev, fimc->irq, fimc_irq_handler,
 +      ret = devm_request_irq(&pdev->dev, res->start, fimc_irq_handler,
                               0, pdev->name, fimc);
        if (ret) {
                dev_err(&pdev->dev, "failed to install irq (%d)\n", ret);
@@@ -1996,7 -2036,7 +1996,7 @@@ static struct platform_driver fimc_driv
  
  int __init fimc_register_driver(void)
  {
 -      return platform_driver_probe(&fimc_driver, fimc_probe);
 +      return platform_driver_register(&fimc_driver);
  }
  
  void __exit fimc_unregister_driver(void)
index 193e8f603949509ae003af7b36d23a757b896dc2,84fd83550bd7fcdbc5f76399c054bb7e2ca09837..7afabb0e19070adc36b41dcc6fe98822c5613072
@@@ -119,6 -119,8 +119,6 @@@ enum fimc_color_fmt 
  
  /* The hardware context state. */
  #define       FIMC_PARAMS             (1 << 0)
 -#define       FIMC_SRC_ADDR           (1 << 1)
 -#define       FIMC_DST_ADDR           (1 << 2)
  #define       FIMC_SRC_FMT            (1 << 3)
  #define       FIMC_DST_FMT            (1 << 4)
  #define       FIMC_DST_CROP           (1 << 5)
@@@ -429,8 -431,10 +429,8 @@@ struct fimc_ctx
   * @pdata:    pointer to the device platform data
   * @variant:  the IP variant information
   * @id:               FIMC device index (0..FIMC_MAX_DEVS)
 - * @num_clocks: the number of clocks managed by this device instance
   * @clock:    clocks required for FIMC operation
   * @regs:     the mapped hardware registers
 - * @irq:      FIMC interrupt number
   * @irq_queue:        interrupt handler waitqueue
   * @v4l2_dev: root v4l2_device
   * @m2m:      memory-to-memory V4L2 device information
@@@ -446,8 -450,10 +446,8 @@@ struct fimc_dev 
        struct s5p_platform_fimc        *pdata;
        struct samsung_fimc_variant     *variant;
        u16                             id;
 -      u16                             num_clocks;
        struct clk                      *clock[MAX_FIMC_CLOCKS];
        void __iomem                    *regs;
 -      int                             irq;
        wait_queue_head_t               irq_queue;
        struct v4l2_device              *v4l2_dev;
        struct fimc_m2m_device          m2m;
  
  /**
   * fimc_ctx - the device context data
 - * @slock:            spinlock protecting this data structure
   * @s_frame:          source frame properties
   * @d_frame:          destination frame properties
   * @out_order_1p:     output 1-plane YCBCR order
   * @ctrls_rdy:                true if the control handler is initialized
   */
  struct fimc_ctx {
 -      spinlock_t              slock;
        struct fimc_frame       s_frame;
        struct fimc_frame       d_frame;
        u32                     out_order_1p;
@@@ -552,13 -560,13 +552,13 @@@ static inline bool fimc_capture_active(
        return ret;
  }
  
 -static inline void fimc_ctx_state_lock_set(u32 state, struct fimc_ctx *ctx)
 +static inline void fimc_ctx_state_set(u32 state, struct fimc_ctx *ctx)
  {
        unsigned long flags;
  
 -      spin_lock_irqsave(&ctx->slock, flags);
 +      spin_lock_irqsave(&ctx->fimc_dev->slock, flags);
        ctx->state |= state;
 -      spin_unlock_irqrestore(&ctx->slock, flags);
 +      spin_unlock_irqrestore(&ctx->fimc_dev->slock, flags);
  }
  
  static inline bool fimc_ctx_state_is_set(u32 mask, struct fimc_ctx *ctx)
        unsigned long flags;
        bool ret;
  
 -      spin_lock_irqsave(&ctx->slock, flags);
 +      spin_lock_irqsave(&ctx->fimc_dev->slock, flags);
        ret = (ctx->state & mask) == mask;
 -      spin_unlock_irqrestore(&ctx->slock, flags);
 +      spin_unlock_irqrestore(&ctx->fimc_dev->slock, flags);
        return ret;
  }
  
@@@ -710,7 -718,7 +710,7 @@@ void fimc_alpha_ctrl_update(struct fimc
  int fimc_fill_format(struct fimc_frame *frame, struct v4l2_format *f);
  void fimc_adjust_mplane_format(struct fimc_fmt *fmt, u32 width, u32 height,
                               struct v4l2_pix_format_mplane *pix);
- struct fimc_fmt *fimc_find_format(u32 *pixelformat, u32 *mbus_code,
+ struct fimc_fmt *fimc_find_format(const u32 *pixelformat, const u32 *mbus_code,
                                  unsigned int mask, int index);
  
  int fimc_check_scaler_ratio(struct fimc_ctx *ctx, int sw, int sh,
index c27bb6d0a13658c7a0aa2c6ee83a574062510811,aedb970d13f6a8c962f274484bb52e64f876fc0d..c3ab55883c2de2dddeaf0eae68a552fa8b5582ba
@@@ -530,7 -530,10 +530,10 @@@ static int soc_camera_open(struct file 
                if (icl->reset)
                        icl->reset(icd->pdev);
  
+               /* Don't mess with the host during probe */
+               mutex_lock(&ici->host_lock);
                ret = ici->ops->add(icd);
+               mutex_unlock(&ici->host_lock);
                if (ret < 0) {
                        dev_err(icd->pdev, "Couldn't activate the camera: %d\n", ret);
                        goto eiciadd;
@@@ -956,7 -959,7 +959,7 @@@ static void scan_add_host(struct soc_ca
  {
        struct soc_camera_device *icd;
  
-       mutex_lock(&list_lock);
+       mutex_lock(&ici->host_lock);
  
        list_for_each_entry(icd, &devices, list) {
                if (icd->iface == ici->nr) {
                }
        }
  
-       mutex_unlock(&list_lock);
+       mutex_unlock(&ici->host_lock);
  }
  
  #ifdef CONFIG_I2C_BOARDINFO
@@@ -1313,6 -1316,7 +1316,7 @@@ int soc_camera_host_register(struct soc
        list_add_tail(&ici->list, &hosts);
        mutex_unlock(&list_lock);
  
+       mutex_init(&ici->host_lock);
        scan_add_host(ici);
  
        return 0;
@@@ -1425,10 -1429,6 +1429,10 @@@ static int video_dev_create(struct soc_
        vdev->tvnorms           = V4L2_STD_UNKNOWN;
        vdev->ctrl_handler      = &icd->ctrl_handler;
        vdev->lock              = &icd->video_lock;
 +      /* Locking in file operations other than ioctl should be done
 +         by the driver, not the V4L2 core.
 +         This driver needs auditing so that this flag can be removed. */
 +      set_bit(V4L2_FL_LOCK_ALL_FOPS, &vdev->flags);
  
        icd->vdev = vdev;
  
index 90db5fe9c56eda0bcde9b86b58d271305aea0d1e,54d7ca559cb215f5fc963d10cdd0b99d6367c777..2ca9386d655bc69fa5b02f55b14e5bcae3b0d4ad
@@@ -39,7 -39,7 +39,7 @@@ uvc_send_response(struct uvc_device *uv
        if (data->length < 0)
                return usb_ep_set_halt(cdev->gadget->ep0);
  
-       req->length = min(uvc->event_length, data->length);
+       req->length = min_t(unsigned int, uvc->event_length, data->length);
        req->zero = data->length < uvc->event_length;
        req->dma = DMA_ADDR_INVALID;
  
@@@ -296,7 -296,7 +296,7 @@@ uvc_v4l2_do_ioctl(struct file *file, un
                if (sub->type < UVC_EVENT_FIRST || sub->type > UVC_EVENT_LAST)
                        return -EINVAL;
  
 -              return v4l2_event_subscribe(&handle->vfh, arg, 2);
 +              return v4l2_event_subscribe(&handle->vfh, arg, 2, NULL);
        }
  
        case VIDIOC_UNSUBSCRIBE_EVENT:
This page took 0.158909 seconds and 4 git commands to generate.