Show a patch.

GET /api/1.1/patches/15402/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 15402,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/15402/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/15402/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api",
        "name": "libcamera",
        "link_name": "libcamera",
        "list_id": "libcamera_core",
        "list_email": "libcamera-devel@lists.libcamera.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20220302220304.1327896-6-djrscally@gmail.com>",
    "date": "2022-03-02T22:03:04",
    "name": "[libcamera-devel,v3,5/5] media: v4l2-async: Create links during v4l2_async_match_notify()",
    "commit_ref": null,
    "pull_url": null,
    "state": "not-applicable",
    "archived": false,
    "hash": "3b545e2de9927b3884b3c5f5ac52cf4aceb6df82",
    "submitter": {
        "id": 90,
        "url": "https://patchwork.libcamera.org/api/1.1/people/90/?format=api",
        "name": "Daniel Scally",
        "email": "djrscally@gmail.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/15402/mbox/",
    "series": [
        {
            "id": 2946,
            "url": "https://patchwork.libcamera.org/api/1.1/series/2946/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2946",
            "date": "2022-03-02T22:02:59",
            "name": "Introduce ancillary links",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/2946/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/15402/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/15402/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<libcamera-devel-bounces@lists.libcamera.org>",
        "X-Original-To": "parsemail@patchwork.libcamera.org",
        "Delivered-To": "parsemail@patchwork.libcamera.org",
        "Received": [
            "from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 21A89BE08A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  2 Mar 2022 22:03:23 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C918861185;\n\tWed,  2 Mar 2022 23:03:22 +0100 (CET)",
            "from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com\n\t[IPv6:2a00:1450:4864:20::42b])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 05BE661176\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  2 Mar 2022 23:03:19 +0100 (CET)",
            "by mail-wr1-x42b.google.com with SMTP id b5so4927730wrr.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 02 Mar 2022 14:03:19 -0800 (PST)",
            "from localhost.localdomain\n\t(cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net. [86.13.91.161])\n\tby smtp.gmail.com with ESMTPSA id\n\tl16-20020a05600c4f1000b0033383cdeea1sm229258wmq.10.2022.03.02.14.03.17\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 02 Mar 2022 14:03:18 -0800 (PST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"XUyuvemJ\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=7+FTeVrGz7SDdPY4UPOaMR4mAYUB8c53cmn+nXuAyMQ=;\n\tb=XUyuvemJYa0uAPOj7k1G9IzitT9VXfDcKWXDcEhdYDSJCfn/HU7OkbxGM5iO6MemUb\n\tlV3mCqItMcPQB0EK6wYMqh7ToMdUlCmyNIhbOWG1fJ/aru63wO0k/xKZwjJS2/QDq4dk\n\tRopjcHiTUEMSXcJhj/x9l16gFI7wpJ7hI/zdL++voTzJR3Gy18mSFaXypTqxOcByPaao\n\tXzD4+mib6HCoy6psPvbeTt4gr8KJ6sMpsmMSN8i5ccTPLm3R6h6K/iHrT3v03XaaSJKo\n\te20Gjg7+bHyOjUWXiSB0dF5XWNH0ftXbJ1PdvkypVpJCMhg5aAM6efH1HSus13BfdXOV\n\tPuiA==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=7+FTeVrGz7SDdPY4UPOaMR4mAYUB8c53cmn+nXuAyMQ=;\n\tb=FEIUURXgSgsiHl0xlad1d6k0DOTa1fItURr0dJworN0zbOyj3x+MU/IOiGMvsX4YNq\n\trZTLu/rFR/tKaRE2BEdfyeORAOOa58vIu/bTfWQFO/IZcAxTXelC1EKxBhM4FGyhTtwd\n\t8MDlj1FOHjnai6ZrWq+42uxpreEcJYEKGCSZagoRS4cQJ6DqjzRIoriT6Ut2Yqg81ufU\n\tkz5pZqfh1b1LYu2hUOFttiA7ym3sPYBZCHIwIY4p7LDxV/1E4S0patZTWGBMyMOHW+St\n\tXLg+KdnjdMuCyT9oOvSYfNF5z0CxrNeaheYgx/gdYw8bHuCVRE1lxFKz4SK1lqOQoSal\n\tzOjQ==",
        "X-Gm-Message-State": "AOAM533qOC8R6+dQNQYq+hlcKcW1+KBcHVdjC1+VQb9Ghv+BewROkVEg\n\t3wN0sMZdSqX4Sx3FQO4FB58=",
        "X-Google-Smtp-Source": "ABdhPJz1z6DPBD7bhcCCeO9fFebsmUH9yJLSFoHKDSYe79QR+HkAQD7iFfp63LfGerWLD27PjJv+Hg==",
        "X-Received": "by 2002:a5d:4310:0:b0:1ef:fb60:e1d8 with SMTP id\n\th16-20020a5d4310000000b001effb60e1d8mr9095465wrq.92.1646258598715; \n\tWed, 02 Mar 2022 14:03:18 -0800 (PST)",
        "From": "Daniel Scally <djrscally@gmail.com>",
        "To": "linux-media@vger.kernel.org,\n\tlibcamera-devel@lists.libcamera.org",
        "Date": "Wed,  2 Mar 2022 22:03:04 +0000",
        "Message-Id": "<20220302220304.1327896-6-djrscally@gmail.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20220302220304.1327896-1-djrscally@gmail.com>",
        "References": "<20220302220304.1327896-1-djrscally@gmail.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v3 5/5] media: v4l2-async: Create links\n\tduring v4l2_async_match_notify()",
        "X-BeenThere": "libcamera-devel@lists.libcamera.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "<libcamera-devel.lists.libcamera.org>",
        "List-Unsubscribe": "<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>",
        "List-Archive": "<https://lists.libcamera.org/pipermail/libcamera-devel/>",
        "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>",
        "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>",
        "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>",
        "Cc": "sakari.ailus@linux.intel.com",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Upon an async fwnode match, there's some typical behaviour that the\nnotifier and matching subdev will want to do. For example, a notifier\nrepresenting a sensor matching to an async subdev representing its\nVCM will want to create an ancillary link to expose that relationship\nto userspace.\n\nTo avoid lots of code in individual drivers, try to build these links\nwithin v4l2 core.\n\nSigned-off-by: Daniel Scally <djrscally@gmail.com>\n---\n\nChanges since v2:\n\n\t- Stopped checking the notifier entity's function when creating the new\n\tlinks, and just create them whenever the subdev entity's function is either\n\ta lens controller or a flash. (Sakari)\n\nChanges since v1:\n\n\t- Added #ifdef guards for CONFIG_MEDIA_CONTROLLER\n\t- Some spelling and nomenclature cleanup (Laurent)\n\nChanges since the rfc:\n\n\t- None\n\n drivers/media/v4l2-core/v4l2-async.c | 31 ++++++++++++++++++++++++++++\n 1 file changed, 31 insertions(+)",
    "diff": "diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c\nindex 0404267f1ae4..436bd6900fd8 100644\n--- a/drivers/media/v4l2-core/v4l2-async.c\n+++ b/drivers/media/v4l2-core/v4l2-async.c\n@@ -275,6 +275,24 @@ v4l2_async_nf_try_complete(struct v4l2_async_notifier *notifier)\n static int\n v4l2_async_nf_try_all_subdevs(struct v4l2_async_notifier *notifier);\n \n+static int v4l2_async_create_ancillary_links(struct v4l2_async_notifier *n,\n+\t\t\t\t\t     struct v4l2_subdev *sd)\n+{\n+\tstruct media_link *link = NULL;\n+\n+#if IS_ENABLED(CONFIG_MEDIA_CONTROLLER)\n+\n+\tif (sd->entity.function != MEDIA_ENT_F_LENS &&\n+\t    sd->entity.function != MEDIA_ENT_F_FLASH)\n+\t\treturn 0;\n+\n+\tlink = media_create_ancillary_link(&n->sd->entity, &sd->entity);\n+\n+#endif\n+\n+\treturn IS_ERR(link) ? PTR_ERR(link) : 0;\n+}\n+\n static int v4l2_async_match_notify(struct v4l2_async_notifier *notifier,\n \t\t\t\t   struct v4l2_device *v4l2_dev,\n \t\t\t\t   struct v4l2_subdev *sd,\n@@ -293,6 +311,19 @@ static int v4l2_async_match_notify(struct v4l2_async_notifier *notifier,\n \t\treturn ret;\n \t}\n \n+\t/*\n+\t * Depending of the function of the entities involved, we may want to\n+\t * create links between them (for example between a sensor and its lens\n+\t * or between a sensor's source pad and the connected device's sink\n+\t * pad).\n+\t */\n+\tret = v4l2_async_create_ancillary_links(notifier, sd);\n+\tif (ret) {\n+\t\tv4l2_async_nf_call_unbind(notifier, sd, asd);\n+\t\tv4l2_device_unregister_subdev(sd);\n+\t\treturn ret;\n+\t}\n+\n \t/* Remove from the waiting list */\n \tlist_del(&asd->list);\n \tsd->asd = asd;\n",
    "prefixes": [
        "libcamera-devel",
        "v3",
        "5/5"
    ]
}