From patchwork Thu May 30 09:34:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 2634271 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 4B032DF2A1 for ; Thu, 30 May 2013 09:35:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S968066Ab3E3Jf3 (ORCPT ); Thu, 30 May 2013 05:35:29 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:49793 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S968062Ab3E3Jf1 (ORCPT ); Thu, 30 May 2013 05:35:27 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id r4U9ZQe1003277; Thu, 30 May 2013 04:35:26 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id r4U9ZQ6v005402; Thu, 30 May 2013 04:35:26 -0500 Received: from dlelxv22.itg.ti.com (172.17.1.197) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.2.342.3; Thu, 30 May 2013 04:35:26 -0500 Received: from deskari.tieu.ti.com (h64-9.vpn.ti.com [172.24.64.9]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id r4U9ZJ1c002669; Thu, 30 May 2013 04:35:25 -0500 From: Tomi Valkeinen To: , , Archit Taneja CC: Tomi Valkeinen Subject: [PATCH 04/32] OMAPDSS: add omap_dss_find_output_by_node() Date: Thu, 30 May 2013 12:34:25 +0300 Message-ID: <1369906493-27538-5-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1369906493-27538-1-git-send-email-tomi.valkeinen@ti.com> References: <1369906493-27538-1-git-send-email-tomi.valkeinen@ti.com> MIME-Version: 1.0 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org Add a support function to find a DSS output by given DT node. This is used in later patches to link the panels to DSS outputs. Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/dss/output.c | 13 +++++++++++++ include/video/omapdss.h | 1 + 2 files changed, 14 insertions(+) diff --git a/drivers/video/omap2/dss/output.c b/drivers/video/omap2/dss/output.c index 3274628..4d01001 100644 --- a/drivers/video/omap2/dss/output.c +++ b/drivers/video/omap2/dss/output.c @@ -128,6 +128,19 @@ struct omap_dss_output *omap_dss_find_output(const char *name) } EXPORT_SYMBOL(omap_dss_find_output); +struct omap_dss_output *omap_dss_find_output_by_node(struct device_node *node) +{ + struct omap_dss_output *out; + + list_for_each_entry(out, &output_list, list) { + if (out->pdev->dev.of_node == node) + return out; + } + + return NULL; +} +EXPORT_SYMBOL(omap_dss_find_output_by_node); + static const struct dss_mgr_ops *dss_mgr_ops; int dss_install_mgr_ops(const struct dss_mgr_ops *mgr_ops) diff --git a/include/video/omapdss.h b/include/video/omapdss.h index aad47a2..7fe6144 100644 --- a/include/video/omapdss.h +++ b/include/video/omapdss.h @@ -780,6 +780,7 @@ struct omap_overlay *omap_dss_get_overlay(int num); struct omap_dss_output *omap_dss_get_output(enum omap_dss_output_id id); struct omap_dss_output *omap_dss_find_output(const char *name); +struct omap_dss_output *omap_dss_find_output_by_node(struct device_node *node); int omapdss_output_set_device(struct omap_dss_output *out, struct omap_dss_device *dssdev); int omapdss_output_unset_device(struct omap_dss_output *out);