diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2016-02-14 02:33:07 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@google.com> | 2016-02-15 14:55:17 -0800 |
commit | 640924d2172da9b6f8a0c9372c3ea3b83f68e2f8 (patch) | |
tree | eb7c94dbb7cf7febbde09ee914ebc97f3acfc1e3 /drivers/staging | |
parent | 66c3607076e7e801ab20077dc2d0ed45693eea10 (diff) |
greybus: camera: Don't configure CSI TX in test only mode
When the GB_CAMERA_CONFIGURE_STREAMS_TEST_ONLY flag is set by the caller
the configure streams operation should only test the requested settings
without modifying the hardware state. This applies for both the module,
the UniPro links power modes and the AP bridge settings. Return early
when the flag is set to avoid modifying the AP bridge CSI TX settings.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Gjorgji Rosikopulos <grosikopulos@mm-sol.com>
Tested-by: Jacopo Mondi <jacopo.mondi@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/greybus/camera.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/staging/greybus/camera.c b/drivers/staging/greybus/camera.c index 7eef6eceec6c..bb8bc175dc0a 100644 --- a/drivers/staging/greybus/camera.c +++ b/drivers/staging/greybus/camera.c @@ -242,26 +242,21 @@ static int gb_camera_configure_streams(struct gb_camera *gcam, } } - if (nstreams && resp->flags & GB_CAMERA_CONFIGURE_STREAMS_ADJUSTED) { + if ((resp->flags & GB_CAMERA_CONFIGURE_STREAMS_ADJUSTED) || + (*flags & GB_CAMERA_CONFIGURE_STREAMS_TEST_ONLY)) { *flags = resp->flags; *num_streams = resp->num_streams; goto done; } /* Setup unipro link speed. */ - if (nstreams && !(*flags & GB_CAMERA_CONFIGURE_STREAMS_TEST_ONLY)) { - ret = gb_camera_set_power_mode(gcam, true); - if (ret < 0) - goto done; - } else if (nstreams == 0) { - ret = gb_camera_set_power_mode(gcam, false); - if (ret < 0) - goto done; - } + ret = gb_camera_set_power_mode(gcam, nstreams != 0); + if (ret < 0) + goto done; + /* Configure the CSI transmitter. Hardcode the parameters for now. */ memset(&csi_cfg, 0, sizeof(csi_cfg)); - /* Configure the CSI transmitter. Hardcode the parameters for now. */ if (nstreams) { csi_cfg.csi_id = 1; csi_cfg.clock_mode = 0; |