From patchwork Wed Mar 2 22:03:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Scally X-Patchwork-Id: 15399 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 83414BE08A for ; Wed, 2 Mar 2022 22:03:19 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A6CF961171; Wed, 2 Mar 2022 23:03:18 +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="FyNOhyuG"; dkim-atps=neutral Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4685F6047A for ; Wed, 2 Mar 2022 23:03:16 +0100 (CET) Received: by mail-wr1-x42a.google.com with SMTP id i8so4898684wrr.8 for ; Wed, 02 Mar 2022 14:03:16 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=YKGA5UWMc55hY8HA5b3tbE4nKkQsSj8ptMeMEZUkbOw=; b=FyNOhyuG177UMLONMDCkT7x1indfKOMwgZGDMdOAPOfUD0Ll9euA0UUs2CazupxXrS /NWQWn2s+9QmZTeIasfnn3NsJqnnCFsTS+4FSqAoz+vR4UPddTSLiGUqGFxrS32ydk9e VAyfCLsoqGbhStNAtB2w4nk5Bs45IXGCuBl6UM9cyOExslfHmLEfHldoH4bpmxhMNWgf Yf3TESV3ARtc7pPz6K/zy+B9ZWWjywRZbiu/dSffhmFrTbKogoZFU9XdRxDLqyuE1k58 FKm34QApLLThQdxaIdhOwvaz24T3/E61Ul86gR8ukF5+08tNyFdkqRUAPyCwdWnJlUIP JIZg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=YKGA5UWMc55hY8HA5b3tbE4nKkQsSj8ptMeMEZUkbOw=; b=ll/gNguxlYnjutFfsUNZVPGQ+O1id0wG2bUcus8FBdZJBEOFUta68oWZEgtA5O4SuA ZgSY7YQGr4vjGbkBpTZHI/F8QQ0s49M8oXyVYb27k4+FXaUXCw6+L3LU1+zZ3RYrpYTU AgD3qA+EiPE7lZFERMLUI9BOl/S2qql7iM/6R7nEXELIyK0ZDw2fPfTf35lcaYbHvxpE YXCB1k9rlmW0qEKtAMPTKnt3wf24bkYBT53WjH/rxmr9MF9r4kGlaEQJt3VGiZkFfJwP vO6DNxyLY5bTU0AM0ONivOB4yu0q5FyR2baE8I+UEmwoCtOgqxgTlE9PX1+xRtX4gclL Q5mg== X-Gm-Message-State: AOAM533Xz21E0oM25zq2EEe3n5MGKxrE0fEn49jNyBeCwyqqwI1sx7bQ 0zepN0ip26m+bZfFah7kDTI= X-Google-Smtp-Source: ABdhPJxMIKajnWlXcuk2d3gJQvUNhBChqqzdVAPi4G9BEEW5cx63o05khjLd0WO6nNYWfzYFjL4tuw== X-Received: by 2002:adf:d1c2:0:b0:1f0:435a:14ae with SMTP id b2-20020adfd1c2000000b001f0435a14aemr3242140wrd.404.1646258595890; Wed, 02 Mar 2022 14:03:15 -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.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 14:03:15 -0800 (PST) From: Daniel Scally To: linux-media@vger.kernel.org, libcamera-devel@lists.libcamera.org Date: Wed, 2 Mar 2022 22:03:01 +0000 Message-Id: <20220302220304.1327896-3-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 Subject: [libcamera-devel] [PATCH v3 2/5] media: media.h: Add new media link type 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" To describe in the kernel the connection between devices and their supporting peripherals (for example, a camera sensor and the vcm driving the focusing lens for it), add a new type of media link to introduce the concept of these ancillary links. Add some elements to the uAPI documentation to explain the new link type, their purpose and some aspects of their current implementation. Reviewed-by: Laurent Pinchart Signed-off-by: Daniel Scally Reviewed-by: Jean-Michel Hautbois --- Changes since v1: - None changes since the rfc: - Split out into its own patch (mostly so it can be followed by patch #3, which corrects some media-core code that is otherwise broken by the new links) .../media/mediactl/media-controller-model.rst | 6 ++++++ .../media/mediactl/media-types.rst | 17 ++++++++++++----- include/uapi/linux/media.h | 1 + 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/Documentation/userspace-api/media/mediactl/media-controller-model.rst b/Documentation/userspace-api/media/mediactl/media-controller-model.rst index 222cb99debb5..78bfdfb2a322 100644 --- a/Documentation/userspace-api/media/mediactl/media-controller-model.rst +++ b/Documentation/userspace-api/media/mediactl/media-controller-model.rst @@ -33,3 +33,9 @@ are: - An **interface link** is a point-to-point bidirectional control connection between a Linux Kernel interface and an entity. + +- An **ancillary link** is a point-to-point connection denoting that two + entities form a single logical unit. For example this could represent the + fact that a particular camera sensor and lens controller form a single + physical module, meaning this lens controller drives the lens for this + camera sensor. \ No newline at end of file diff --git a/Documentation/userspace-api/media/mediactl/media-types.rst b/Documentation/userspace-api/media/mediactl/media-types.rst index 0a26397bd01d..60747251d409 100644 --- a/Documentation/userspace-api/media/mediactl/media-types.rst +++ b/Documentation/userspace-api/media/mediactl/media-types.rst @@ -412,14 +412,21 @@ must be set for every pad. is set by drivers and is read-only for applications. * - ``MEDIA_LNK_FL_LINK_TYPE`` - - This is a bitmask that defines the type of the link. Currently, - two types of links are supported: + - This is a bitmask that defines the type of the link. The following + link types are currently supported: .. _MEDIA-LNK-FL-DATA-LINK: - ``MEDIA_LNK_FL_DATA_LINK`` if the link is between two pads + ``MEDIA_LNK_FL_DATA_LINK`` for links that represent a data connection + between two pads. .. _MEDIA-LNK-FL-INTERFACE-LINK: - ``MEDIA_LNK_FL_INTERFACE_LINK`` if the link is between an - interface and an entity + ``MEDIA_LNK_FL_INTERFACE_LINK`` for links that associate an entity to its + interface. + + .. _MEDIA-LNK-FL-ANCILLARY-LINK: + + ``MEDIA_LNK_FL_ANCILLARY_LINK`` for links that represent a physical + relationship between two entities. The link may or may not be ummutable, so + applications must not assume either case. \ No newline at end of file diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h index 200fa8462b90..afbae7213d35 100644 --- a/include/uapi/linux/media.h +++ b/include/uapi/linux/media.h @@ -226,6 +226,7 @@ struct media_pad_desc { #define MEDIA_LNK_FL_LINK_TYPE (0xf << 28) # define MEDIA_LNK_FL_DATA_LINK (0 << 28) # define MEDIA_LNK_FL_INTERFACE_LINK (1 << 28) +# define MEDIA_LNK_FL_ANCILLARY_LINK (2 << 28) struct media_link_desc { struct media_pad_desc source;