From patchwork Sun Jan 30 23:58:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Scally X-Patchwork-Id: 15297 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 370AFBDCBF for ; Sun, 30 Jan 2022 23:59:10 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 38231609DB; Mon, 31 Jan 2022 00:59:09 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="fXFZPEaN"; dkim-atps=neutral Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B2FF96017A for ; Mon, 31 Jan 2022 00:59:06 +0100 (CET) Received: by mail-wr1-x42e.google.com with SMTP id c23so22070430wrb.5 for ; Sun, 30 Jan 2022 15:59:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=gLOEgQy+6fnYykIS57HacmY2euW9Rqx5gnDk9sWPE3o=; b=fXFZPEaNqLykfj+IbzSldxb5HanlEQkH3SirkncG/5jloq7+4t+VeXQO/JhHtpeR58 V405WXSER17CofiwqzAF/ECcaIllW82tF8JWk40C6mtCeID+L82RfLHhDCy0pMQKOZ7M 6qk+TWd72t0BlM4C+ZyisvlGiWnXJKo7Ap31dd2yscGT3w2XE6nKsYcYRRi6RQYHs9ET VhnhYIlWRQMMmQLs1ebzEfQZ3Zq4DhOiiGTOYK3Nb7mggmUbbBCSq7Fjas3OG/WcZuhf bORBJMBj4fBp7eX0jeJ2q3SiTBhbyAX+RUcsqHi0TnbQmobrsxltUVO4GcuMG745ln8K vFnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=gLOEgQy+6fnYykIS57HacmY2euW9Rqx5gnDk9sWPE3o=; b=bsZuLYHr9B/oyhqMTmMiv12rb0xs04057Mohj+ZoePy5YK53mCYl/GHJdw6w4lq6QE EJ3H9FFBo8nvreI02nA1zoCZIgVRWa7HLeQFw2a4uPYv0MMu2ycYi2wlQ1PXqGobci3U B6myDNtYgvTq5xyTpuzRTkeGW9JPHHKHSmX7kxQ4FUDzHD+/8sfUcXYsoQGM87dKqgv7 kaGmmpJ8ZvY9e1Vey5BS8ZeDODfhbbxdEtSsMmCh9OaJzDueFXBnGeBqThYZ6juLY3qL uNrM/9N90JB0C1dyeeIVgHitu4jLcoQSJhEc2MySW5VtWxoqDL+xNXc5yUqJicqcQOjY yQlA== X-Gm-Message-State: AOAM530gDhRQnVN7svYQjZNeq1iAeSQJFhGcibBnJM/0dDWXze27vE/T WJ7R69L8y2ZM6xvY7dZF0yk= X-Google-Smtp-Source: ABdhPJwhWAN27A+oReR/o+9UM+QyaKv2W+gvqUCQFSTn1tBteihZLvqm2spcIWz95bJ/ZNRNe7sKMA== X-Received: by 2002:a05:6000:18f:: with SMTP id p15mr15039180wrx.436.1643587146282; Sun, 30 Jan 2022 15:59:06 -0800 (PST) Received: from localhost.localdomain (cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net. [86.13.91.161]) by smtp.gmail.com with ESMTPSA id 11sm11993663wrb.30.2022.01.30.15.59.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Jan 2022 15:59:05 -0800 (PST) From: Daniel Scally To: linux-media@vger.kernel.org, libcamera-devel@lists.libcamera.org Date: Sun, 30 Jan 2022 23:58:15 +0000 Message-Id: <20220130235821.48076-1-djrscally@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 0/6] Introduce ancillary links X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sakari.ailus@linux.intel.com Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Hello all At present there's no means in the kernel of describing the supporting relationship between subdevices that work together to form an effective single unit - the type example in this case being a camera sensor and its corresponding vcm. To attempt to solve that, this series adds a new type of media link called MEDIA_LNK_FL_ANCILLARY_LINK, which connects two instances of struct media_entity. The mechanism of connection I have modelled as a notifier and async subdev, which seemed the best route since sensor drivers already typically will call v4l2_async_register_subdev_sensor() on probe, and that function already looks for a reference to a firmware node with the reference named "lens-focus". To avoid boilerplate in the sensor drivers, I added some new functions in v4l2-async that are called in v4l2_async_match_notify() to create the ancillary links - checking the entity.function of both notifier and subdev to make sure that's appropriate. I haven't gone further than that yet, but I suspect we could cut down on code elsewhere by, for example, also creating pad-to-pad links in the same place. Series-level changes since v1: - New patch adding some documentation to the uAPI pages. Dan Daniel Scally (6): media: entity: Skip non-data links in graph iteration media: media.h: Add new media link type media: docs: Add entries documenting ancillary links media: entity: Add link_type_name() helper media: entity: Add support for ancillary links media: v4l2-async: Create links during v4l2_async_match_notify() .../media/mediactl/media-controller-model.rst | 6 ++ .../media/mediactl/media-types.rst | 9 ++- drivers/media/mc/mc-entity.c | 46 ++++++++++++++- drivers/media/v4l2-core/v4l2-async.c | 56 +++++++++++++++++++ include/media/media-entity.h | 21 +++++++ include/uapi/linux/media.h | 1 + 6 files changed, 135 insertions(+), 4 deletions(-)