From patchwork Thu Apr 27 22:33:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 9703545 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 65E59602CC for ; Thu, 27 Apr 2017 22:34:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 36A812863D for ; Thu, 27 Apr 2017 22:34:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2B1DC2865C; Thu, 27 Apr 2017 22:34:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C9EB82863D for ; Thu, 27 Apr 2017 22:34:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932121AbdD0WeE (ORCPT ); Thu, 27 Apr 2017 18:34:04 -0400 Received: from smtp-4.sys.kth.se ([130.237.48.193]:55447 "EHLO smtp-4.sys.kth.se" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753748AbdD0WeD (ORCPT ); Thu, 27 Apr 2017 18:34:03 -0400 Received: from smtp-4.sys.kth.se (localhost.localdomain [127.0.0.1]) by smtp-4.sys.kth.se (Postfix) with ESMTP id 2071475D; Fri, 28 Apr 2017 00:34:02 +0200 (CEST) X-Virus-Scanned: by amavisd-new at kth.se Received: from smtp-4.sys.kth.se ([127.0.0.1]) by smtp-4.sys.kth.se (smtp-4.sys.kth.se [127.0.0.1]) (amavisd-new, port 10024) with LMTP id puzxEj32OpKc; Fri, 28 Apr 2017 00:34:01 +0200 (CEST) X-KTH-Auth: niso [89.233.230.99] X-KTH-mail-from: niklas.soderlund+renesas@ragnatech.se Received: from bismarck.berto.se (unknown [89.233.230.99]) by smtp-4.sys.kth.se (Postfix) with ESMTPSA id 2B6A924D4; Fri, 28 Apr 2017 00:34:01 +0200 (CEST) From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= To: Mauro Carvalho Chehab , Sakari Ailus , linux-media@vger.kernel.org Cc: Kieran Bingham , linux-renesas-soc@vger.kernel.org, Laurent Pinchart , =?UTF-8?q?Niklas=20S=C3=B6derlund?= Subject: [PATCH 1/2] media: entity: Add pad_from_dt_regs entity operation Date: Fri, 28 Apr 2017 00:33:22 +0200 Message-Id: <20170427223323.13861-2-niklas.soderlund+renesas@ragnatech.se> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170427223323.13861-1-niklas.soderlund+renesas@ragnatech.se> References: <20170427223323.13861-1-niklas.soderlund+renesas@ragnatech.se> MIME-Version: 1.0 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The optional operation can be used by entities to report how it maps its DT node ports and endpoints to media pad numbers. This is useful for devices which require more advanced mappings of pads then DT port number is equivalent with media port number. Signed-off-by: Niklas Söderlund --- include/media/media-entity.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/media/media-entity.h b/include/media/media-entity.h index c7c254c5bca1761b..47efaf4d825e671b 100644 --- a/include/media/media-entity.h +++ b/include/media/media-entity.h @@ -171,6 +171,9 @@ struct media_pad { /** * struct media_entity_operations - Media entity operations + * @pad_from_dt_regs: Return the pad number based on DT port and reg + * properties. This operation can be used to map a + * DT port and reg to a media pad number. Optional. * @link_setup: Notify the entity of link changes. The operation can * return an error, in which case link setup will be * cancelled. Optional. @@ -184,6 +187,7 @@ struct media_pad { * mutex held. */ struct media_entity_operations { + int (*pad_from_dt_regs)(int port_reg, int reg, unsigned int *pad); int (*link_setup)(struct media_entity *entity, const struct media_pad *local, const struct media_pad *remote, u32 flags);