diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2015-12-18 21:23:25 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@google.com> | 2015-12-21 16:35:27 -0800 |
commit | 142b21fee07e858a85bb1b8091d9803cf9fa13e3 (patch) | |
tree | 5e851a94fba6121b4c705766c81b96d093ef08b6 /drivers/staging/greybus/camera.c | |
parent | 8e2b7daa23760e7be642e87b2ea5fea78a18fd79 (diff) | |
download | op-kernel-dev-142b21fee07e858a85bb1b8091d9803cf9fa13e3.zip op-kernel-dev-142b21fee07e858a85bb1b8091d9803cf9fa13e3.tar.gz |
greybus: camera: Configure the bridge CSI transmitter
Start or stop the CSI transmitter when configuring and unconfiguring the
streams respectively. The CSI configuration parameters are currently
hardcoded.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/camera.c')
-rw-r--r-- | drivers/staging/greybus/camera.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/staging/greybus/camera.c b/drivers/staging/greybus/camera.c index f163689..556226a 100644 --- a/drivers/staging/greybus/camera.c +++ b/drivers/staging/greybus/camera.c @@ -16,6 +16,7 @@ #include <linux/uaccess.h> #include <linux/vmalloc.h> +#include "es2.h" #include "greybus.h" #include "greybus_protocols.h" @@ -79,6 +80,7 @@ static int gb_camera_configure_streams(struct gb_camera *gcam, { struct gb_camera_configure_streams_request *req; struct gb_camera_configure_streams_response *resp; + struct es2_ap_csi_config csi_cfg; unsigned int i; size_t req_size; size_t resp_size; @@ -146,6 +148,27 @@ static int gb_camera_configure_streams(struct gb_camera *gcam, } } + /* Configure the CSI transmitter. Hardcode the parameters for now. */ + if (nstreams && !(resp->flags & GB_CAMERA_CONFIGURE_STREAMS_ADJUSTED)) { + csi_cfg.csi_id = 1; + csi_cfg.clock_mode = 0; + csi_cfg.num_lanes = 2; + csi_cfg.bus_freq = 250000000; + + ret = es2_ap_csi_setup(gcam->connection->hd, true, &csi_cfg); + } else if (nstreams == 0) { + csi_cfg.csi_id = 1; + csi_cfg.clock_mode = 0; + csi_cfg.num_lanes = 0; + csi_cfg.bus_freq = 0; + + ret = es2_ap_csi_setup(gcam->connection->hd, false, &csi_cfg); + } + + if (ret < 0) + gcam_err(gcam, "failed to %s the CSI transmitter\n", + nstreams ? "start" : "stop"); + ret = resp->num_streams; done: |