From patchwork Wed Mar 2 22:02:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Scally X-Patchwork-Id: 15397 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 749B8BE08A for ; Wed, 2 Mar 2022 22:03:16 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id CB96F61166; Wed, 2 Mar 2022 23:03:15 +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="WDQzRXrN"; dkim-atps=neutral Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3D48D601F2 for ; Wed, 2 Mar 2022 23:03:14 +0100 (CET) Received: by mail-wr1-x42d.google.com with SMTP id u1so4882475wrg.11 for ; Wed, 02 Mar 2022 14:03:14 -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=SkCBctUs8JfByOI5AquYb2jZIIcNNXfx8mnbNeZyZnU=; b=WDQzRXrN85g6mwz3tIqkHAG0hcDYZVxyc8vF8+pXinCAuJsq9JLN2LQsQX/2TvPrrU EdY3KD+ZbezHtJGUgkQxkINCqnmkJV7OdJGGQWE69c+8AbzNGy1/fdgN9+UrCTL3YZs0 nxvfwcLaGqWvmG+L4mKvhYWxYMqJdXiHVqFhoXBMymVd+u97UpS//iPRbBHfWUVgGwKr v7oFTeAJ3mluG6GU5pogXi9fu2LVKwyuIpl77Dwnoevef2Te3j/fdlQKhwd0imjxyQZb wO7Rmus9AtMWYzE7d1bGf/uI5iZ3ockcr0dGH6xt6hIEWPqVrSlBbhY/4nIZ21n991Zr e3Iw== 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=SkCBctUs8JfByOI5AquYb2jZIIcNNXfx8mnbNeZyZnU=; b=7q022p/1JDlgepAKRENViepw+31L/UVzg4vNk9BOl6eJKNUn/KXiMWpZ67roW2F3ZD e7FCYNCijSyMxHOFvgXtonN+qNHsklOLog3xNVWfpHvefFlgTy7jvQIC9ai8+teX9QE/ jgaHnXbKPNDInSduHwUh5R26K6bFeNZECCvralq+focVLr/s22/ewsZAHr/ap1O2MtGv c9xwOBrVAnN8QwAMvkoCIpqSxnD1KC7jWG6pb8HNtaDegkfhvjyrJoqe+pzVIIdkz5H0 vLgqk+jILI3y7YJPw62orbxPeDZiCJMJwhsVbSITgmOP9eal/zr4km+VQNZ/ATmCmfT6 dAqQ== X-Gm-Message-State: AOAM531wlx85t/XOzaCFMrlmep3ZNAwD78LYmVT7deLkBZsm+lO0XcIx 7WEJdtHz8o33Dl+XcdV6RTQ= X-Google-Smtp-Source: ABdhPJzDwjeA47SG87rvfvl42EjBHeb+TOX3Ic7MZOYrnT612yka5DFntyEpPAy7XKDifIvJDGNliA== X-Received: by 2002:a5d:64ed:0:b0:1ef:e1e2:1fcb with SMTP id g13-20020a5d64ed000000b001efe1e21fcbmr11446154wri.37.1646258593772; Wed, 02 Mar 2022 14:03:13 -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 l16-20020a05600c4f1000b0033383cdeea1sm229258wmq.10.2022.03.02.14.03.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 14:03:13 -0800 (PST) From: Daniel Scally To: linux-media@vger.kernel.org, libcamera-devel@lists.libcamera.org Date: Wed, 2 Mar 2022 22:02:59 +0000 Message-Id: <20220302220304.1327896-1-djrscally@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 0/5] 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. 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 v2: - Squashed #2 and #3 Series-level changes since v1: - New patch adding some documentation to the uAPI pages. Dan Daniel Scally (5): media: entity: Skip non-data links in graph iteration media: media.h: Add new media link type 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 | 17 +++++-- drivers/media/mc/mc-entity.c | 46 +++++++++++++++++-- drivers/media/v4l2-core/v4l2-async.c | 31 +++++++++++++ include/media/media-entity.h | 19 ++++++++ include/uapi/linux/media.h | 1 + 6 files changed, 112 insertions(+), 8 deletions(-)