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

static int ioctl_s_power ( struct v4l2_int_device *  s,
int  on 
) [static]

Sets the camera power.

s pointer to the camera device on if 1, power is to be turned on. 0 means power is to be turned off

ioctl_s_power - V4L2 sensor interface handler for vidioc_int_s_power_num : pointer to standard V4L2 device structure : power state to which device is to be set

Sets devices power state to requrested state, if possible. This is called on open, close, suspend and resume.

Definition at line 330 of file adv7180.c.

References adv7180_data, adv7180_write_reg(), gpio_sensor_active(), gpio_sensor_inactive(), sensor::i2c_client, and sensor::on.

      struct sensor *sensor = s->priv;

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

      if (on && !sensor->on) {
            if (adv7180_write_reg(ADV7180_PWR_MNG, 0) != 0)
                  return -EIO;
      } else if (!on && sensor->on) {
            if (adv7180_write_reg(ADV7180_PWR_MNG, 0x24) != 0)
                  return -EIO;

      sensor->on = on;

      return 0;

Generated by  Doxygen 1.6.0   Back to index