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: 1367171 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 CDB29DF2AB for ; Thu, 23 Aug 2012 13:45:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758892Ab2HWNph (ORCPT ); Thu, 23 Aug 2012 09:45:37 -0400 Received: from na3sys009aog108.obsmtp.com ([74.125.149.199]:47230 "EHLO na3sys009aog108.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758852Ab2HWNpf (ORCPT ); Thu, 23 Aug 2012 09:45:35 -0400 Received: from mail-lb0-f172.google.com ([209.85.217.172]) (using TLSv1) by na3sys009aob108.postini.com ([74.125.148.12]) with SMTP ID DSNKUDYz/vBhQa0LuJgbMz9zKyklNfbkXwdR@postini.com; Thu, 23 Aug 2012 06:45:35 PDT Received: by lbbgg6 with SMTP id gg6so553804lbb.17 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=WVNsfbnb/zp1jzLOcLBqZv5Z71svDdsFMEkONc4j1Z/hlXytVG4gVkpQv56r6PWbx4 QZUaRGJuXl5tq5vZd4FpRFaXc+wYhrFH7OXVqFEf4Vh9/DS3gl522STx9+xBU2Hfnopd aGXxHV+M+NpxIQxtE2Ahh6di5s7HlzNx47acmU7/C13LpU0PybW6djlBxTnMkIub0gqs rS/xf3Ncq44H8IH9Lrv6vxTD3neX9cgudnIyEdQJMMQId3PGvyENIxdaLWgxaTv5aVV0 p3PD639b19qPOSID+jEpcn0vWMYCo+kF/9nYAC61CCp/ztt77AcrjXi5PRgG73Rysr+a Fhzw== 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: ALoCoQn8GoswX8dPl3BcfTAS8ZA7vFvrSU32aJ5gHmdGxlvZZogSPm3DY/rIps/PebjgvVNFabEh Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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