Logo Search packages:      
Sourcecode: linux-fsl-imx51 version File versions  Download package

static void adv7180_get_std ( v4l2_std_id *  std  )  [static]

Return attributes of current video standard. Since this device autodetects the current standard, this function also sets the values that need to be changed if the standard changes. There is no set std equivalent function.

Returns:
None.

Definition at line 242 of file adv7180.c.

References adv7180_data, ADV7180_NOT_LOCKED, ADV7180_NTSC, ADV7180_PAL, adv7180_read(), sensor::i2c_client, sensor::pix, video_fmt_t::raw_height, video_fmt_t::raw_width, and sensor::std_id.

Referenced by ioctl_g_fmt_cap().

{
      int tmp;
      int idx;

      dev_dbg(&adv7180_data.i2c_client->dev, "In adv7180_get_std\n");

      /* Read the AD_RESULT to get the detect output video standard */
      tmp = adv7180_read(ADV7180_STATUS_1) & 0x70;

      down(&mutex);
      if (tmp == 0x40) {
            /* PAL */
            *std = V4L2_STD_PAL;
            idx = ADV7180_PAL;
      } else if (tmp == 0) {
            /*NTSC*/
            *std = V4L2_STD_NTSC;
            idx = ADV7180_NTSC;
      } else {
            *std = V4L2_STD_ALL;
            idx = ADV7180_NOT_LOCKED;
            dev_dbg(&adv7180_data.i2c_client->dev,
                  "Got invalid video standard! \n");
      }
      up(&mutex);

      /* This assumes autodetect which this device uses. */
      if (*std != adv7180_data.std_id) {
            video_idx = idx;
            adv7180_data.std_id = *std;
            adv7180_data.pix.width = video_fmts[video_idx].raw_width;
            adv7180_data.pix.height = video_fmts[video_idx].raw_height;
      }
}


Generated by  Doxygen 1.6.0   Back to index