From patchwork Mon Dec 13 23:28:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Scally X-Patchwork-Id: 15155 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 86EC6BF415 for ; Mon, 13 Dec 2021 23:29:08 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2C91E60894; Tue, 14 Dec 2021 00:29:07 +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="kgXIMqdv"; dkim-atps=neutral Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0D3DE60822 for ; Tue, 14 Dec 2021 00:29:05 +0100 (CET) Received: by mail-wr1-x430.google.com with SMTP id d9so29676181wrw.4 for ; Mon, 13 Dec 2021 15:29:05 -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=tBpQi8cixIriWZXygdYGQQ2YRLpWurHN+imQRdozMOI=; b=kgXIMqdv2RWUG4WccPY1SWXsXCYKuJNgQKNeFLu0394mYclDC+Xv3f9jY7p8/tbzAv s55fud/z8Erfdh2VZPVCuPzvJua4XHkEIF+Uso8cjss33M+yzS+FPb+d5F4axRdMznaT CK/W0FS1Dbz7qYpKi7ExOv3vLHaYZFiOHYA2glKOq1O3ihrpf2XIoKTGIFR3tsIhso5M BA0gmooThwhosRdGYTftjBWCFgb8P88Gz92eRlkjCOG5Kzvmi98gvYweNAa90Os1jWk9 JgvCDhDbnTP/nfHrBTH14acF+Ve/XJpuBsg2Tlt7iikZSRAuw7HiSxf3x0bt1RGDy14n LS0w== 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=tBpQi8cixIriWZXygdYGQQ2YRLpWurHN+imQRdozMOI=; b=FNI8UPKufvTTjCUrlU9W8nEES74r4u+udNm58f9FlOget8d5dL3XcMt0NF78oZHJRO mCXxmpOYWFHnpjxWrrlBNdkRq0c4/cOxoPJOSCdCntCocdP5ohV4NdvpfwUgcKDl1xyb 1SDM5Ime1kulqZSQQK8AojCo1s25NSOAeSONNUObv3ErVuPQF+T3ZqQsC+GdKMx0BJ3D lOFqlBVqd9gDzqadvnwyJtbdOoY5qyEAjwgvxdrega9nCVzDVNvQhteSZvGjysBhPMGH +U2B/2xwZNyUkRd1loteslQif6qJ+H3AIk7WKDe2UjA5CfwV/f9cfiwyybFtr9WMkys+ h6Aw== X-Gm-Message-State: AOAM530LQPweFdnuURisvs5W9a3K6k/gOc+4wuRCns2Zpza0EgARpMfi /LgaJrixiQvsXqnLllpvEYE= X-Google-Smtp-Source: ABdhPJxADSgDVQM2574ZSuDqBA+wHjAjUYG7xkxLWGEpVe2/nVa3wj8HXS0+CVx6tA/C7fB6BwzHCQ== X-Received: by 2002:adf:a193:: with SMTP id u19mr1692722wru.563.1639438144603; Mon, 13 Dec 2021 15:29:04 -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 38sm12551643wrc.1.2021.12.13.15.29.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Dec 2021 15:29:04 -0800 (PST) From: Daniel Scally To: linux-media@vger.kernel.org, libcamera-devel@lists.libcamera.org Date: Mon, 13 Dec 2021 23:28:44 +0000 Message-Id: <20211213232849.40071-1-djrscally@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 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 - 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. Thoughts and comments very welcome Dan Daniel Scally (5): media: media.h: Add new media link type media: entity: Add link_type() helper media: entity: Skip non-data links in graph iteration media: entity: Add support for ancillary links media: v4l2-async: Create links during v4l2_async_match_notify() drivers/media/mc/mc-entity.c | 56 ++++++++++++++++++++++++++-- drivers/media/v4l2-core/v4l2-async.c | 51 +++++++++++++++++++++++++ include/media/media-entity.h | 29 ++++++++++++++ include/uapi/linux/media.h | 1 + 4 files changed, 134 insertions(+), 3 deletions(-)