static int gb_camera_configure_streams(struct gb_camera *gcam,
unsigned int nstreams,
+ unsigned int flags,
struct gb_camera_stream_config *streams)
{
struct gb_camera_configure_streams_request *req;
goto done;
}
- req->num_streams = cpu_to_le16(nstreams);
+ req->num_streams = nstreams;
+ req->flags = flags;
req->padding = 0;
for (i = 0; i < nstreams; ++i) {
if (ret < 0)
goto done;
- if (le16_to_cpu(resp->num_streams) > nstreams) {
+ if (resp->num_streams > nstreams) {
gcam_dbg(gcam, "got #streams %u > request %u\n",
- le16_to_cpu(resp->num_streams), nstreams);
+ resp->num_streams, nstreams);
ret = -EIO;
goto done;
}
gcam_err(gcam, "failed to %s the CSI transmitter\n",
nstreams ? "start" : "stop");
- ret = le16_to_cpu(resp->num_streams);
+ ret = resp->num_streams;
done:
kfree(req);
&gcam->debugfs.buffers[GB_CAMERA_DEBUGFS_BUFFER_STREAMS];
struct gb_camera_stream_config *streams;
unsigned int nstreams;
- const char *sep = ";";
+ unsigned int flags;
unsigned int i;
char *token;
int ret;
/* Retrieve number of streams to configure */
- token = strsep(&buf, sep);
+ token = strsep(&buf, ";");
if (token == NULL)
return -EINVAL;
if (nstreams > GB_CAMERA_MAX_STREAMS)
return -EINVAL;
+ token = strsep(&buf, ";");
+ if (token == NULL)
+ return -EINVAL;
+
+ ret = kstrtouint(token, 10, &flags);
+ if (ret < 0)
+ return ret;
+
/* For each stream to configure parse width, height and format */
streams = kzalloc(nstreams * sizeof(*streams), GFP_KERNEL);
if (!streams)
goto done;
}
- ret = gb_camera_configure_streams(gcam, nstreams, streams);
+ ret = gb_camera_configure_streams(gcam, nstreams, flags, streams);
if (ret < 0)
goto done;
} __packed;
struct gb_camera_configure_streams_request {
- __le16 num_streams;
+ __u8 num_streams;
+ __u8 flags;
+#define GB_CAMERA_CONFIGURE_STREAMS_TEST_ONLY 0x01
__le16 padding;
struct gb_camera_stream_config_request config[0];
} __packed;
} __packed;
struct gb_camera_configure_streams_response {
- __le16 num_streams;
-#define GB_CAMERA_CONFIGURE_STREAMS_ADJUSTED 0x01
+ __u8 num_streams;
__u8 flags;
- __u8 padding;
+#define GB_CAMERA_CONFIGURE_STREAMS_ADJUSTED 0x01
+ __le16 padding;
struct gb_camera_stream_config_response config[0];
} __packed;