From patchwork Mon Feb 6 09:37:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Machek X-Patchwork-Id: 9557353 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 94F826021C for ; Mon, 6 Feb 2017 09:38:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6069926247 for ; Mon, 6 Feb 2017 09:38:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 54CA427CF3; Mon, 6 Feb 2017 09:38: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, T_TVD_MIME_EPI 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 062EC26247 for ; Mon, 6 Feb 2017 09:38:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751093AbdBFJhw (ORCPT ); Mon, 6 Feb 2017 04:37:52 -0500 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:51435 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750949AbdBFJhw (ORCPT ); Mon, 6 Feb 2017 04:37:52 -0500 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 72B87817DB; Mon, 6 Feb 2017 10:37:49 +0100 (CET) Date: Mon, 6 Feb 2017 10:37:48 +0100 From: Pavel Machek To: Sebastian Reichel , mchehab@s-opensource.com Cc: Sakari Ailus , laurent.pinchart@ideasonboard.com, ivo.g.dimitrov.75@gmail.com, pali.rohar@gmail.com, linux-media@vger.kernel.org, galak@codeaurora.org, mchehab@osg.samsung.com, linux-kernel@vger.kernel.org Subject: [PATCH] media: add operation to get configuration of "the other side" of the link Message-ID: <20170206093748.GA17017@amd> References: <20161222133938.GA30259@amd> <20161224152031.GA8420@amd> <20170203123508.GA10286@amd> <20170203130740.GB12291@valkosipuli.retiisi.org.uk> <20170203210610.GA18379@amd> <20170203213454.GD12291@valkosipuli.retiisi.org.uk> <20170204215610.GA9243@amd> <20170204223350.GF12291@valkosipuli.retiisi.org.uk> <20170205211219.GA27072@amd> <20170205234011.nyttcpurodvoztor@earth> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20170205234011.nyttcpurodvoztor@earth> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Normally, link configuration can be determined at probe time... but Nokia N900 has two cameras, and can switch between them at runtime, so that mechanism is not suitable here. Add a hook that tells us link configuration. Signed-off-by: Pavel Machek diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index cf778c5..74148b9 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h @@ -25,6 +25,7 @@ #include #include #include +#include /* generic v4l2_device notify callback notification values */ #define V4L2_SUBDEV_IR_RX_NOTIFY _IOW('v', 0, u32) @@ -383,6 +384,8 @@ struct v4l2_mbus_frame_desc { * @s_rx_buffer: set a host allocated memory buffer for the subdev. The subdev * can adjust @size to a lower value and must not write more data to the * buffer starting at @data than the original value of @size. + * + * @g_endpoint_config: get link configuration required by this device. */ struct v4l2_subdev_video_ops { int (*s_routing)(struct v4l2_subdev *sd, u32 input, u32 output, u32 config); @@ -415,6 +418,8 @@ struct v4l2_subdev_video_ops { const struct v4l2_mbus_config *cfg); int (*s_rx_buffer)(struct v4l2_subdev *sd, void *buf, unsigned int *size); + int (*g_endpoint_config)(struct v4l2_subdev *sd, + struct v4l2_of_endpoint *cfg); }; /**