aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2023-03-05 15:05:52 +0000
committerMauro Carvalho Chehab <mchehab@kernel.org>2023-04-15 10:41:37 +0100
commit401e0e41aca7af8f5dfd4296b2ab13470a82c4d3 (patch)
tree28bd593bb58133f3d79aaea300ae25a7f5923432 /drivers/staging/media/atomisp/pci/atomisp_ioctl.c
parentmedia: atomisp: Remove atomisp_try_fmt() call from atomisp_set_fmt() (diff)
downloadwireguard-linux-401e0e41aca7af8f5dfd4296b2ab13470a82c4d3.tar.xz
wireguard-linux-401e0e41aca7af8f5dfd4296b2ab13470a82c4d3.zip
media: atomisp: Drop support for streaming from 2 sensors at once
With support for depth mode gone there really is no need to support streaming from 2 sensors at once. As discussed and acked on the list (see Link tag) it is desirable to drop support for this since it involves quite a lot of special handling / hacks in the code. This initial commit limits itself to a minimum set of changes to switch to 1 struct atomisp_sub_device / 1 stream. Further commits will actually remove / cleanup much of the special handling. Likewise this initial commit also deliberately skips the opportunity to turn some multi-line statements into single-line statements, so as to keep the diff small / easier to review. Link: https://lore.kernel.org/linux-media/5309d845-063b-6dd9-529d-0f82654290f2@redhat.com/ Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/staging/media/atomisp/pci/atomisp_ioctl.c')
-rw-r--r--drivers/staging/media/atomisp/pci/atomisp_ioctl.c41
1 files changed, 16 insertions, 25 deletions
diff --git a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
index 99cfe8a80bb1..14700afd92c2 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
@@ -626,13 +626,7 @@ atomisp_subdev_streaming_count(struct atomisp_sub_device *asd)
unsigned int atomisp_streaming_count(struct atomisp_device *isp)
{
- unsigned int i, sum;
-
- for (i = 0, sum = 0; i < isp->num_of_streams; i++)
- sum += isp->asd[i].streaming ==
- ATOMISP_DEVICE_STREAMING_ENABLED;
-
- return sum;
+ return isp->asd.streaming == ATOMISP_DEVICE_STREAMING_ENABLED;
}
/*
@@ -1318,11 +1312,11 @@ void atomisp_stop_streaming(struct vb2_queue *vq)
struct video_device *vdev = &pipe->vdev;
struct atomisp_device *isp = asd->isp;
struct pci_dev *pdev = to_pci_dev(isp->dev);
- bool recreate_streams[MAX_STREAM_NUM] = {0};
enum ia_css_pipe_id css_pipe_id;
+ bool recreate_stream = false;
bool first_streamoff = false;
unsigned long flags;
- int i, ret;
+ int ret;
mutex_lock(&isp->mutex);
@@ -1409,11 +1403,9 @@ stopsensor:
*
* So force stream destroy here.
*/
- for (i = 0; i < isp->num_of_streams; i++) {
- if (isp->asd[i].stream_prepared) {
- atomisp_destroy_pipes_stream_force(&isp->asd[i]);
- recreate_streams[i] = true;
- }
+ if (isp->asd.stream_prepared) {
+ atomisp_destroy_pipes_stream_force(&isp->asd);
+ recreate_stream = true;
}
/* disable PUNIT/ISP acknowlede/handshake - SRSE=3 */
@@ -1421,19 +1413,18 @@ stopsensor:
isp->saved_regs.i_control | MRFLD_PCI_I_CONTROL_SRSE_RESET_MASK);
dev_err(isp->dev, "atomisp_reset");
atomisp_reset(isp);
- for (i = 0; i < isp->num_of_streams; i++) {
- if (recreate_streams[i]) {
- int ret2;
-
- ret2 = atomisp_create_pipes_stream(&isp->asd[i]);
- if (ret2) {
- dev_err(isp->dev, "%s error re-creating streams: %d\n",
- __func__, ret2);
- if (!ret)
- ret = ret2;
- }
+
+ if (recreate_stream) {
+ int ret2;
+
+ ret2 = atomisp_create_pipes_stream(&isp->asd);
+ if (ret2) {
+ dev_err(isp->dev, "%s error re-creating streams: %d\n", __func__, ret2);
+ if (!ret)
+ ret = ret2;
}
}
+
isp->isp_timeout = false;
out_unlock:
mutex_unlock(&isp->mutex);