From patchwork Wed Jul 22 22:42:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 6847701 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id AFDF7C05AC for ; Wed, 22 Jul 2015 22:47:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 995EC20686 for ; Wed, 22 Jul 2015 22:47:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A42AF2066E for ; Wed, 22 Jul 2015 22:47:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752203AbbGVWrm (ORCPT ); Wed, 22 Jul 2015 18:47:42 -0400 Received: from resqmta-po-04v.sys.comcast.net ([96.114.154.163]:52726 "EHLO resqmta-po-04v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752125AbbGVWrm (ORCPT ); Wed, 22 Jul 2015 18:47:42 -0400 Received: from resomta-po-13v.sys.comcast.net ([96.114.154.237]) by resqmta-po-04v.sys.comcast.net with comcast id vait1q00A57bBgG01aiwiz; Wed, 22 Jul 2015 22:42:56 +0000 Received: from mail.gonehiking.org ([73.181.52.62]) by resomta-po-13v.sys.comcast.net with comcast id vaiu1q00C1LXgTt01aiuGv; Wed, 22 Jul 2015 22:42:55 +0000 Received: from lorien.internal (lorien-wl.internal [192.168.1.40]) by mail.gonehiking.org (Postfix) with ESMTP id 29472120447; Wed, 22 Jul 2015 16:42:54 -0600 (MDT) From: Shuah Khan To: mchehab@osg.samsung.com, hans.verkuil@cisco.com, laurent.pinchart@ideasonboard.com, tiwai@suse.de, sakari.ailus@linux.intel.com, perex@perex.cz, crope@iki.fi, arnd@arndb.de, stefanr@s5r6.in-berlin.de, ruchandani.tina@gmail.com, chehabrafael@gmail.com, dan.carpenter@oracle.com, prabhakar.csengg@gmail.com, chris.j.arges@canonical.com, agoode@google.com, pierre-louis.bossart@linux.intel.com, gtmkramer@xs4all.nl, clemens@ladisch.de, daniel@zonque.org, vladcatoi@gmail.com, misterpib@gmail.com, damien@zamaudio.com, pmatilai@laiskiainen.org, takamichiho@gmail.com, normalperson@yhbt.net, bugzilla.frnkcg@spamgourmet.com, joe@oampo.co.uk, calcprogrammer1@gmail.com, jussi@sonarnerd.net, kyungmin.park@samsung.com, s.nawrocki@samsung.com, kgene@kernel.org, hyun.kwon@xilinx.com, michal.simek@xilinx.com, soren.brinkmann@xilinx.com, pawel@osciak.com, m.szyprowski@samsung.com, gregkh@linuxfoundation.org, skd08@gmail.com, nsekhar@ti.com, boris.brezillon@free-electrons.com, Julia.Lawall@lip6.fr, elfring@users.sourceforge.net, p.zabel@pengutronix.de, ricardo.ribalda@gmail.com Cc: Shuah Khan , linux-media@vger.kernel.org, alsa-devel@alsa-project.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devel@driverdev.osuosl.org Subject: [PATCH v2 14/19] media: Add enable_source handler field to struct media_device Date: Wed, 22 Jul 2015 16:42:15 -0600 Message-Id: <352c24377393df058cf5e72dc988a02029e3bbda.1437599281.git.shuahkh@osg.samsung.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20140121; t=1437604976; bh=SqJSnhN1YrTKArLUfitHIgqSMujROY7/5ksBp/13N24=; h=Received:Received:Received:From:To:Subject:Date:Message-Id; b=OvfkOyuTXtiJA/naOyANt3v6volohI+p5qw4VBbkZpK2wZR9ZQVv2YXnXczXnIvqT Oi7/ABHvVRJGF3DQex/nNF05AbPLncV/jJMONlA66rt8JeSk917o5iBGZhGsWxIdeh JEvqzVfqw4ZSseQzY2kdLZQtdnYa1uWikKDv06TXaCYsIypThll9R2e0fMaL5muSxR TJX+ELqVa2DSOWC7n9Rxvwcd0L6vquqO2+Tg7TzX5evLw1tdtRpfVUh3J+gkt4hAGc sfWI35Ocm+yuwqc1ulo4JfSQPyHHQtJUKDziNV8z7cpTIqn5Fqluj3DQUEFHaGbLCg YYt9Mv5ULKbAg== Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add a new field to enable_source handler to find source entity for the sink entity and check if it is available, and activate the link using media_entity_setup_link() interface. Bridge driver is expected to implement and set the handler when media_device is registered or when bridge driver finds the media_device during probe. This is to enable the use-case to find tuner entity connected to the decoder entity and check if it is available, and activate the using media_entity_setup_link() if it is available. This hanlder can be invoked from media core (v4l-core, dvb-core) as well as other drivers such as ALSA that control the media device. Signed-off-by: Shuah Khan --- include/media/media-device.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/media/media-device.h b/include/media/media-device.h index e73642c..377102b 100644 --- a/include/media/media-device.h +++ b/include/media/media-device.h @@ -84,6 +84,18 @@ struct media_device { /* Serializes graph operations. */ spinlock_t graph_lock; + /* Handler to find source entity for the sink entity and + * check if it is available, and activate the link using + * media_entity_setup_link() interface. + * Bridge driver is expected to implement and set the + * handler when media_device is registered or when + * bridge driver finds the media_device during probe. + * + * Use-case: find tuner entity connected to the decoder + * entity and check if it is available, and activate the + * using media_entity_setup_link() if it is available. + */ + int (*enable_source)(struct media_entity *sink); int (*link_notify)(struct media_link *link, u32 flags, unsigned int notification); };