@@ -693,6 +693,55 @@ int PipelineHandlerIPU3::start(Camera *camera)
ImgUDevice *imgu = data->imgu_;
int ret;
+ /* --- Get control values --- */
+ V4L2Controls controls;
+ controls.add(V4L2_CID_EXPOSURE);
+ controls.add(V4L2_CID_ANALOGUE_GAIN);
+ ret = cio2->sensor_->getControls(&controls);
+ if (ret) {
+ LOG(Error) << "Failed to get control values";
+ return -EINVAL;
+ }
+
+ for (const V4L2Control &ctrl : controls) {
+ unsigned int id = ctrl.id();
+ V4L2ControlInfo *info = cio2->sensor_->getControlInfo(id);
+ if (!info)
+ continue;
+
+ int val = controls.get(id);
+ LOG(Error) << "Control : " << id << " - name : " << info->name()
+ << " - value: " << val;
+ }
+
+ /* --- Set control values --- */
+ controls.set(V4L2_CID_EXPOSURE, 2046);
+ controls.set(V4L2_CID_ANALOGUE_GAIN, 1024);
+
+ ret = cio2->sensor_->setControls(&controls);
+ if (ret) {
+ LOG(IPU3, Error) << "Failed to set controls";
+ return ret;
+ }
+
+ /* --- Get control values back again and verify they have changed --- */
+ ret = cio2->sensor_->getControls(&controls);
+ if (ret) {
+ LOG(Error) << "Failed to get control values";
+ return -EINVAL;
+ }
+
+ for (const V4L2Control &ctrl : controls) {
+ unsigned int id = ctrl.id();
+ V4L2ControlInfo *info = cio2->sensor_->getControlInfo(id);
+ if (!info)
+ continue;
+
+ int val = controls.get(id);
+ LOG(Error) << "Control : " << id << " - name : " << info->name()
+ << " - value: " << val;
+ }
+
/*
* Start the ImgU video devices, buffers will be queued to the
* ImgU output and viewfinder when requests will be queued.