From patchwork Thu Aug 23 13:45:07 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 1367181 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id A4DB73FCAE for ; Thu, 23 Aug 2012 13:45:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933018Ab2HWNph (ORCPT ); Thu, 23 Aug 2012 09:45:37 -0400 Received: from na3sys009aog126.obsmtp.com ([74.125.149.155]:55883 "EHLO na3sys009aog126.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758889Ab2HWNpf (ORCPT ); Thu, 23 Aug 2012 09:45:35 -0400 Received: from mail-lpp01m010-f42.google.com ([209.85.215.42]) (using TLSv1) by na3sys009aob126.postini.com ([74.125.148.12]) with SMTP ID DSNKUDYz/vBhQa0LuJgbMz9zKyklNfbkXwdR@postini.com; Thu, 23 Aug 2012 06:45:35 PDT Received: by lahl5 with SMTP id l5so437508lah.29 for ; Thu, 23 Aug 2012 06:45:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=5Iqs1s/p/sFsBGz05myzI3TnZc+1CQxFM1QNjtmIzzA=; b=i34zJaxhHHgR1AiNmSKVVyLwS5RIkMr/+amWpnNwp6UoT22LDT48Dd6kXdTm4igXuX GAqGIVXH5imo5WPBAunBoAs5aoMDc3tqCxoMlcRn3trS+b+Ksg6ZG77GrokjtSZC1Szu MREAcAUqdcob59Dv72a1fzEdbYMAvRn1UdUcXuUwy07UfRupynfUE55J7s2cY+dupg6c GjRLpC5QcUMV20jaL9Ef4/g61hmhiSi+Wh0lxlxdydlQMw1X3RPvVS7aNAItBD0i+iBZ NZkXK/g5ZrhxIwBv4MzmQ5H9/YQQPUHqERpB9oObtEZbCL3UOqZIP87SH2knoDNsfvHR dWug== Received: by 10.112.42.225 with SMTP id r1mr912682lbl.102.1345729532851; Thu, 23 Aug 2012 06:45:32 -0700 (PDT) Received: from localhost.localdomain (a91-156-160-115.elisa-laajakaista.fi. [91.156.160.115]) by mx.google.com with ESMTPS id fz8sm466816lbb.9.2012.08.23.06.45.30 (version=SSLv3 cipher=OTHER); Thu, 23 Aug 2012 06:45:31 -0700 (PDT) From: Tomi Valkeinen To: archit@ti.com Cc: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org, Tomi Valkeinen , Tony Lindgren Subject: [PATCH 1/8] OMAPDSS: HDMI: Move GPIO handling to HDMI driver Date: Thu, 23 Aug 2012 16:45:07 +0300 Message-Id: <1345729514-2441-2-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1345729514-2441-1-git-send-email-tomi.valkeinen@ti.com> References: <1345729514-2441-1-git-send-email-tomi.valkeinen@ti.com> X-Gm-Message-State: ALoCoQlph/9pkGSXIrB8p/4VbBrgPkKYwbpVUOG/OU0EVAPV3MYlzntkneCqKs1jMHqEUUbYa5Pa Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org We currently manage HDMI GPIOs in the board files via platform_enable/disable calls. This won't work with device tree, and in any case the correct place to manage the GPIOs is in the HDMI driver. This patch moves the handling of the GPIOs to the HDMI driver. The GPIO handling is moved to the common hdmi.c file, and this probably needs to be revisited when adding OMAP5 HDMI support to see if the GPIO handling needs to be moved to IP specific files. Signed-off-by: Tomi Valkeinen Cc: Tony Lindgren Acked-by: Tony Lindgren --- arch/arm/mach-omap2/board-4430sdp.c | 27 +----------- arch/arm/mach-omap2/board-omap4panda.c | 27 +----------- drivers/video/omap2/dss/hdmi.c | 75 +++++++++++++++++++++++--------- include/video/omapdss.h | 2 + 4 files changed, 61 insertions(+), 70 deletions(-) diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c index 8e17284..852e05c 100644 --- a/arch/arm/mach-omap2/board-4430sdp.c +++ b/arch/arm/mach-omap2/board-4430sdp.c @@ -601,29 +601,6 @@ static void __init omap_sfh7741prox_init(void) __func__, OMAP4_SFH7741_ENABLE_GPIO, error); } -static struct gpio sdp4430_hdmi_gpios[] = { - { HDMI_GPIO_CT_CP_HPD, GPIOF_OUT_INIT_HIGH, "hdmi_gpio_ct_cp_hpd" }, - { HDMI_GPIO_LS_OE, GPIOF_OUT_INIT_HIGH, "hdmi_gpio_ls_oe" }, - { HDMI_GPIO_HPD, GPIOF_DIR_IN, "hdmi_gpio_hpd" }, -}; - -static int sdp4430_panel_enable_hdmi(struct omap_dss_device *dssdev) -{ - int status; - - status = gpio_request_array(sdp4430_hdmi_gpios, - ARRAY_SIZE(sdp4430_hdmi_gpios)); - if (status) - pr_err("%s: Cannot request HDMI GPIOs\n", __func__); - - return status; -} - -static void sdp4430_panel_disable_hdmi(struct omap_dss_device *dssdev) -{ - gpio_free_array(sdp4430_hdmi_gpios, ARRAY_SIZE(sdp4430_hdmi_gpios)); -} - static struct nokia_dsi_panel_data dsi1_panel = { .name = "taal", .reset_gpio = 102, @@ -718,6 +695,8 @@ static struct omap_dss_device sdp4430_lcd2_device = { }; static struct omap_dss_hdmi_data sdp4430_hdmi_data = { + .ct_cp_hpd_gpio = HDMI_GPIO_CT_CP_HPD, + .ls_oe_gpio = HDMI_GPIO_LS_OE, .hpd_gpio = HDMI_GPIO_HPD, }; @@ -725,8 +704,6 @@ static struct omap_dss_device sdp4430_hdmi_device = { .name = "hdmi", .driver_name = "hdmi_panel", .type = OMAP_DISPLAY_TYPE_HDMI, - .platform_enable = sdp4430_panel_enable_hdmi, - .platform_disable = sdp4430_panel_disable_hdmi, .channel = OMAP_DSS_CHANNEL_DIGIT, .data = &sdp4430_hdmi_data, }; diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c index 982fb26..5415faa 100644 --- a/arch/arm/mach-omap2/board-omap4panda.c +++ b/arch/arm/mach-omap2/board-omap4panda.c @@ -405,30 +405,9 @@ static struct omap_dss_device omap4_panda_dvi_device = { .channel = OMAP_DSS_CHANNEL_LCD2, }; -static struct gpio panda_hdmi_gpios[] = { - { HDMI_GPIO_CT_CP_HPD, GPIOF_OUT_INIT_HIGH, "hdmi_gpio_ct_cp_hpd" }, - { HDMI_GPIO_LS_OE, GPIOF_OUT_INIT_HIGH, "hdmi_gpio_ls_oe" }, - { HDMI_GPIO_HPD, GPIOF_DIR_IN, "hdmi_gpio_hpd" }, -}; - -static int omap4_panda_panel_enable_hdmi(struct omap_dss_device *dssdev) -{ - int status; - - status = gpio_request_array(panda_hdmi_gpios, - ARRAY_SIZE(panda_hdmi_gpios)); - if (status) - pr_err("Cannot request HDMI GPIOs\n"); - - return status; -} - -static void omap4_panda_panel_disable_hdmi(struct omap_dss_device *dssdev) -{ - gpio_free_array(panda_hdmi_gpios, ARRAY_SIZE(panda_hdmi_gpios)); -} - static struct omap_dss_hdmi_data omap4_panda_hdmi_data = { + .ct_cp_hpd_gpio = HDMI_GPIO_CT_CP_HPD, + .ls_oe_gpio = HDMI_GPIO_LS_OE, .hpd_gpio = HDMI_GPIO_HPD, }; @@ -436,8 +415,6 @@ static struct omap_dss_device omap4_panda_hdmi_device = { .name = "hdmi", .driver_name = "hdmi_panel", .type = OMAP_DISPLAY_TYPE_HDMI, - .platform_enable = omap4_panda_panel_enable_hdmi, - .platform_disable = omap4_panda_panel_disable_hdmi, .channel = OMAP_DSS_CHANNEL_DIGIT, .data = &omap4_panda_hdmi_data, }; diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c index 0cdf246..4fbe271 100644 --- a/drivers/video/omap2/dss/hdmi.c +++ b/drivers/video/omap2/dss/hdmi.c @@ -32,6 +32,7 @@ #include #include #include +#include #include