OSDN Git Service

media: staging: media: rkisp1: make links immutable by default
authorHelen Koike <helen.koike@collabora.com>
Fri, 17 Jan 2020 20:12:18 +0000 (21:12 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Mon, 24 Feb 2020 16:16:15 +0000 (17:16 +0100)
The only places which make sese to allow users to enable or disable
links are:

* between sensors and isp:
So users can select which sensor should be used while streaming

* between isp and the resizers:
              |
              v here
rkisp1_isp:2 -> rkisp1_resizer_mainpath -> rkisp1_mainpath (capture)
            \-> rkisp1_resizer_selfpath -> rkisp1_selfpath (capture)
              ^ here
              |

So users can disable one of the capture paths when unused, to avoid
worring about matching formats.

Make the following links immutable to simplify userspace:

rkisp1_resizer_mainpath -> rkisp1_mainpath
rkisp1_resizer_selfpath -> rkisp1_selfpath
rkisp1_params           -> rkisp1_isp
rkisp1_isp              -> rkisp1_stats

Signed-off-by: Helen Koike <helen.koike@collabora.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/staging/media/rkisp1/rkisp1-dev.c

index 558126e..4030d5e 100644 (file)
@@ -145,14 +145,15 @@ static int rkisp1_create_links(struct rkisp1_device *rkisp1)
                flags = 0;
        }
 
-       flags = MEDIA_LNK_FL_ENABLED;
+       flags = MEDIA_LNK_FL_ENABLED | MEDIA_LNK_FL_IMMUTABLE;
 
        /* create ISP->RSZ->CAP links */
        for (i = 0; i < 2; i++) {
                source = &rkisp1->isp.sd.entity;
                sink = &rkisp1->resizer_devs[i].sd.entity;
                ret = media_create_pad_link(source, RKISP1_ISP_PAD_SOURCE_VIDEO,
-                                           sink, RKISP1_RSZ_PAD_SINK, flags);
+                                           sink, RKISP1_RSZ_PAD_SINK,
+                                           MEDIA_LNK_FL_ENABLED);
                if (ret)
                        return ret;