From patchwork Thu Aug 29 13:31:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 2851393 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CB9FEBF546 for ; Thu, 29 Aug 2013 13:33:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C11E420254 for ; Thu, 29 Aug 2013 13:33:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 76AFE20161 for ; Thu, 29 Aug 2013 13:33:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754689Ab3H2Ncq (ORCPT ); Thu, 29 Aug 2013 09:32:46 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:56371 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754552Ab3H2NcU (ORCPT ); Thu, 29 Aug 2013 09:32:20 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id r7TDWKwe017619; Thu, 29 Aug 2013 08:32:20 -0500 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id r7TDWK5b017689; Thu, 29 Aug 2013 08:32:20 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.2.342.3; Thu, 29 Aug 2013 08:32:19 -0500 Received: from deskari.tieu.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id r7TDW75E015728; Thu, 29 Aug 2013 08:32:18 -0500 From: Tomi Valkeinen To: , CC: Archit Taneja , Tomi Valkeinen Subject: [PATCH 08/15] OMAPDSS: HDMI: remove code related to old panel model Date: Thu, 29 Aug 2013 16:31:53 +0300 Message-ID: <1377783120-14001-9-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1377783120-14001-1-git-send-email-tomi.valkeinen@ti.com> References: <1377783120-14001-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 X-Spam-Status: No, score=-9.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Now that the old panel drivers have been removed, we can remove the old-model API and related code from the DSS encoder drivers. This patch removes the code from the HDMI driver. Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/dss/Makefile | 3 +- drivers/video/omap2/dss/dss.h | 20 -- drivers/video/omap2/dss/hdmi.c | 303 ++++--------------------- drivers/video/omap2/dss/hdmi_panel.c | 414 ----------------------------------- 4 files changed, 44 insertions(+), 696 deletions(-) delete mode 100644 drivers/video/omap2/dss/hdmi_panel.c diff --git a/drivers/video/omap2/dss/Makefile b/drivers/video/omap2/dss/Makefile index 61949ff..e022ed1 100644 --- a/drivers/video/omap2/dss/Makefile +++ b/drivers/video/omap2/dss/Makefile @@ -10,6 +10,5 @@ omapdss-$(CONFIG_OMAP2_DSS_RFBI) += rfbi.o omapdss-$(CONFIG_OMAP2_DSS_VENC) += venc.o venc_panel.o omapdss-$(CONFIG_OMAP2_DSS_SDI) += sdi.o omapdss-$(CONFIG_OMAP2_DSS_DSI) += dsi.o -omapdss-$(CONFIG_OMAP4_DSS_HDMI) += hdmi.o \ - hdmi_panel.o ti_hdmi_4xxx_ip.o +omapdss-$(CONFIG_OMAP4_DSS_HDMI) += hdmi.o ti_hdmi_4xxx_ip.o ccflags-$(CONFIG_OMAP2_DSS_DEBUG) += -DDEBUG diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h index 146349f..6142885 100644 --- a/drivers/video/omap2/dss/dss.h +++ b/drivers/video/omap2/dss/dss.h @@ -452,26 +452,6 @@ void venc_panel_exit(void); /* HDMI */ int hdmi_init_platform_driver(void) __init; void hdmi_uninit_platform_driver(void) __exit; -int omapdss_hdmi_display_enable(struct omap_dss_device *dssdev); -void omapdss_hdmi_display_disable(struct omap_dss_device *dssdev); -int omapdss_hdmi_core_enable(struct omap_dss_device *dssdev); -void omapdss_hdmi_core_disable(struct omap_dss_device *dssdev); -void omapdss_hdmi_display_set_timing(struct omap_dss_device *dssdev, - struct omap_video_timings *timings); -int omapdss_hdmi_display_check_timing(struct omap_dss_device *dssdev, - struct omap_video_timings *timings); -int omapdss_hdmi_read_edid(u8 *buf, int len); -bool omapdss_hdmi_detect(void); -int hdmi_panel_init(void); -void hdmi_panel_exit(void); -#ifdef CONFIG_OMAP4_DSS_HDMI_AUDIO -int hdmi_audio_enable(void); -void hdmi_audio_disable(void); -int hdmi_audio_start(void); -void hdmi_audio_stop(void); -bool hdmi_mode_has_audio(void); -int hdmi_audio_config(struct omap_dss_audio *audio); -#endif /* RFBI */ int rfbi_init_platform_driver(void) __init; diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c index 44a885b..0b8e4de 100644 --- a/drivers/video/omap2/dss/hdmi.c +++ b/drivers/video/omap2/dss/hdmi.c @@ -66,10 +66,6 @@ static struct { struct clk *sys_clk; struct regulator *vdda_hdmi_dac_reg; - int ct_cp_hpd_gpio; - int ls_oe_gpio; - int hpd_gpio; - bool core_enabled; struct omap_dss_device output; @@ -353,40 +349,6 @@ static int hdmi_init_regulator(void) return 0; } -static int hdmi_init_display(struct omap_dss_device *dssdev) -{ - int r; - - struct gpio gpios[] = { - { hdmi.ct_cp_hpd_gpio, GPIOF_OUT_INIT_LOW, "hdmi_ct_cp_hpd" }, - { hdmi.ls_oe_gpio, GPIOF_OUT_INIT_LOW, "hdmi_ls_oe" }, - { hdmi.hpd_gpio, GPIOF_DIR_IN, "hdmi_hpd" }, - }; - - DSSDBG("init_display\n"); - - dss_init_hdmi_ip_ops(&hdmi.ip_data, omapdss_get_version()); - - r = hdmi_init_regulator(); - if (r) - return r; - - r = gpio_request_array(gpios, ARRAY_SIZE(gpios)); - if (r) - return r; - - return 0; -} - -static void hdmi_uninit_display(struct omap_dss_device *dssdev) -{ - DSSDBG("uninit_display\n"); - - gpio_free(hdmi.ct_cp_hpd_gpio); - gpio_free(hdmi.ls_oe_gpio); - gpio_free(hdmi.hpd_gpio); -} - static const struct hdmi_config *hdmi_find_timing( const struct hdmi_config *timings_arr, int len) @@ -517,17 +479,9 @@ static int hdmi_power_on_core(struct omap_dss_device *dssdev) { int r; - if (gpio_is_valid(hdmi.ct_cp_hpd_gpio)) - gpio_set_value(hdmi.ct_cp_hpd_gpio, 1); - if (gpio_is_valid(hdmi.ls_oe_gpio)) - gpio_set_value(hdmi.ls_oe_gpio, 1); - - /* wait 300us after CT_CP_HPD for the 5V power output to reach 90% */ - udelay(300); - r = regulator_enable(hdmi.vdda_hdmi_dac_reg); if (r) - goto err_vdac_enable; + return r; r = hdmi_runtime_get(); if (r) @@ -542,11 +496,7 @@ static int hdmi_power_on_core(struct omap_dss_device *dssdev) err_runtime_get: regulator_disable(hdmi.vdda_hdmi_dac_reg); -err_vdac_enable: - if (gpio_is_valid(hdmi.ct_cp_hpd_gpio)) - gpio_set_value(hdmi.ct_cp_hpd_gpio, 0); - if (gpio_is_valid(hdmi.ls_oe_gpio)) - gpio_set_value(hdmi.ls_oe_gpio, 0); + return r; } @@ -556,10 +506,6 @@ static void hdmi_power_off_core(struct omap_dss_device *dssdev) hdmi_runtime_put(); regulator_disable(hdmi.vdda_hdmi_dac_reg); - if (gpio_is_valid(hdmi.ct_cp_hpd_gpio)) - gpio_set_value(hdmi.ct_cp_hpd_gpio, 0); - if (gpio_is_valid(hdmi.ls_oe_gpio)) - gpio_set_value(hdmi.ls_oe_gpio, 0); } static int hdmi_power_on_full(struct omap_dss_device *dssdev) @@ -640,7 +586,7 @@ static void hdmi_power_off_full(struct omap_dss_device *dssdev) hdmi_power_off_core(dssdev); } -int omapdss_hdmi_display_check_timing(struct omap_dss_device *dssdev, +static int hdmi_display_check_timing(struct omap_dss_device *dssdev, struct omap_video_timings *timings) { struct hdmi_cm cm; @@ -654,7 +600,7 @@ int omapdss_hdmi_display_check_timing(struct omap_dss_device *dssdev, } -void omapdss_hdmi_display_set_timing(struct omap_dss_device *dssdev, +static void hdmi_display_set_timing(struct omap_dss_device *dssdev, struct omap_video_timings *timings) { struct hdmi_cm cm; @@ -674,7 +620,7 @@ void omapdss_hdmi_display_set_timing(struct omap_dss_device *dssdev, mutex_unlock(&hdmi.lock); } -static void omapdss_hdmi_display_get_timings(struct omap_dss_device *dssdev, +static void hdmi_display_get_timings(struct omap_dss_device *dssdev, struct omap_video_timings *timings) { const struct hdmi_config *cfg; @@ -704,7 +650,7 @@ static void hdmi_dump_regs(struct seq_file *s) mutex_unlock(&hdmi.lock); } -int omapdss_hdmi_read_edid(u8 *buf, int len) +static int read_edid(u8 *buf, int len) { int r; @@ -721,24 +667,7 @@ int omapdss_hdmi_read_edid(u8 *buf, int len) return r; } -bool omapdss_hdmi_detect(void) -{ - int r; - - mutex_lock(&hdmi.lock); - - r = hdmi_runtime_get(); - BUG_ON(r); - - r = gpio_get_value(hdmi.hpd_gpio); - - hdmi_runtime_put(); - mutex_unlock(&hdmi.lock); - - return r == 1; -} - -int omapdss_hdmi_display_enable(struct omap_dss_device *dssdev) +static int hdmi_display_enable(struct omap_dss_device *dssdev) { struct omap_dss_device *out = &hdmi.output; int r = 0; @@ -767,7 +696,7 @@ err0: return r; } -void omapdss_hdmi_display_disable(struct omap_dss_device *dssdev) +static void hdmi_display_disable(struct omap_dss_device *dssdev) { DSSDBG("Enter hdmi_display_disable\n"); @@ -778,7 +707,7 @@ void omapdss_hdmi_display_disable(struct omap_dss_device *dssdev) mutex_unlock(&hdmi.lock); } -int omapdss_hdmi_core_enable(struct omap_dss_device *dssdev) +static int hdmi_core_enable(struct omap_dss_device *dssdev) { int r = 0; @@ -800,7 +729,7 @@ err0: return r; } -void omapdss_hdmi_core_disable(struct omap_dss_device *dssdev) +static void hdmi_core_disable(struct omap_dss_device *dssdev) { DSSDBG("Enter omapdss_hdmi_core_disable\n"); @@ -927,35 +856,7 @@ int hdmi_compute_acr(u32 sample_freq, u32 *n, u32 *cts) return 0; } -int hdmi_audio_enable(void) -{ - DSSDBG("audio_enable\n"); - - return hdmi.ip_data.ops->audio_enable(&hdmi.ip_data); -} - -void hdmi_audio_disable(void) -{ - DSSDBG("audio_disable\n"); - - hdmi.ip_data.ops->audio_disable(&hdmi.ip_data); -} - -int hdmi_audio_start(void) -{ - DSSDBG("audio_start\n"); - - return hdmi.ip_data.ops->audio_start(&hdmi.ip_data); -} - -void hdmi_audio_stop(void) -{ - DSSDBG("audio_stop\n"); - - hdmi.ip_data.ops->audio_stop(&hdmi.ip_data); -} - -bool hdmi_mode_has_audio(void) +static bool hdmi_mode_has_audio(void) { if (hdmi.ip_data.cfg.cm.mode == HDMI_HDMI) return true; @@ -963,92 +864,8 @@ bool hdmi_mode_has_audio(void) return false; } -int hdmi_audio_config(struct omap_dss_audio *audio) -{ - return hdmi.ip_data.ops->audio_config(&hdmi.ip_data, audio); -} - #endif -static struct omap_dss_device *hdmi_find_dssdev(struct platform_device *pdev) -{ - struct omap_dss_board_info *pdata = pdev->dev.platform_data; - const char *def_disp_name = omapdss_get_default_display_name(); - struct omap_dss_device *def_dssdev; - int i; - - def_dssdev = NULL; - - for (i = 0; i < pdata->num_devices; ++i) { - struct omap_dss_device *dssdev = pdata->devices[i]; - - if (dssdev->type != OMAP_DISPLAY_TYPE_HDMI) - continue; - - if (def_dssdev == NULL) - def_dssdev = dssdev; - - if (def_disp_name != NULL && - strcmp(dssdev->name, def_disp_name) == 0) { - def_dssdev = dssdev; - break; - } - } - - return def_dssdev; -} - -static int hdmi_probe_pdata(struct platform_device *pdev) -{ - struct omap_dss_device *plat_dssdev; - struct omap_dss_device *dssdev; - struct omap_dss_hdmi_data *priv; - int r; - - plat_dssdev = hdmi_find_dssdev(pdev); - - if (!plat_dssdev) - return 0; - - dssdev = dss_alloc_and_init_device(&pdev->dev); - if (!dssdev) - return -ENOMEM; - - dss_copy_device_pdata(dssdev, plat_dssdev); - - priv = dssdev->data; - - hdmi.ct_cp_hpd_gpio = priv->ct_cp_hpd_gpio; - hdmi.ls_oe_gpio = priv->ls_oe_gpio; - hdmi.hpd_gpio = priv->hpd_gpio; - - r = hdmi_init_display(dssdev); - if (r) { - DSSERR("device %s init failed: %d\n", dssdev->name, r); - dss_put_device(dssdev); - return r; - } - - r = omapdss_output_set_device(&hdmi.output, dssdev); - if (r) { - DSSERR("failed to connect output to new device: %s\n", - dssdev->name); - dss_put_device(dssdev); - return r; - } - - r = dss_add_device(dssdev); - if (r) { - DSSERR("device %s register failed: %d\n", dssdev->name, r); - omapdss_output_unset_device(&hdmi.output); - hdmi_uninit_display(dssdev); - dss_put_device(dssdev); - return r; - } - - return 0; -} - static int hdmi_connect(struct omap_dss_device *dssdev, struct omap_dss_device *dst) { @@ -1103,21 +920,21 @@ static int hdmi_read_edid(struct omap_dss_device *dssdev, need_enable = hdmi.core_enabled == false; if (need_enable) { - r = omapdss_hdmi_core_enable(dssdev); + r = hdmi_core_enable(dssdev); if (r) return r; } - r = omapdss_hdmi_read_edid(edid, len); + r = read_edid(edid, len); if (need_enable) - omapdss_hdmi_core_disable(dssdev); + hdmi_core_disable(dssdev); return r; } #if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO) -static int omapdss_hdmi_audio_enable(struct omap_dss_device *dssdev) +static int hdmi_audio_enable(struct omap_dss_device *dssdev) { int r; @@ -1128,7 +945,8 @@ static int omapdss_hdmi_audio_enable(struct omap_dss_device *dssdev) goto err; } - r = hdmi_audio_enable(); + + r = hdmi.ip_data.ops->audio_enable(&hdmi.ip_data); if (r) goto err; @@ -1140,22 +958,22 @@ err: return r; } -static void omapdss_hdmi_audio_disable(struct omap_dss_device *dssdev) +static void hdmi_audio_disable(struct omap_dss_device *dssdev) { - hdmi_audio_disable(); + hdmi.ip_data.ops->audio_disable(&hdmi.ip_data); } -static int omapdss_hdmi_audio_start(struct omap_dss_device *dssdev) +static int hdmi_audio_start(struct omap_dss_device *dssdev) { - return hdmi_audio_start(); + return hdmi.ip_data.ops->audio_start(&hdmi.ip_data); } -static void omapdss_hdmi_audio_stop(struct omap_dss_device *dssdev) +static void hdmi_audio_stop(struct omap_dss_device *dssdev) { - hdmi_audio_stop(); + hdmi.ip_data.ops->audio_stop(&hdmi.ip_data); } -static bool omapdss_hdmi_audio_supported(struct omap_dss_device *dssdev) +static bool hdmi_audio_supported(struct omap_dss_device *dssdev) { bool r; @@ -1167,7 +985,7 @@ static bool omapdss_hdmi_audio_supported(struct omap_dss_device *dssdev) return r; } -static int omapdss_hdmi_audio_config(struct omap_dss_device *dssdev, +static int hdmi_audio_config(struct omap_dss_device *dssdev, struct omap_dss_audio *audio) { int r; @@ -1179,7 +997,7 @@ static int omapdss_hdmi_audio_config(struct omap_dss_device *dssdev, goto err; } - r = hdmi_audio_config(audio); + r = hdmi.ip_data.ops->audio_config(&hdmi.ip_data, audio); if (r) goto err; @@ -1191,30 +1009,30 @@ err: return r; } #else -static int omapdss_hdmi_audio_enable(struct omap_dss_device *dssdev) +static int hdmi_audio_enable(struct omap_dss_device *dssdev) { return -EPERM; } -static void omapdss_hdmi_audio_disable(struct omap_dss_device *dssdev) +static void hdmi_audio_disable(struct omap_dss_device *dssdev) { } -static int omapdss_hdmi_audio_start(struct omap_dss_device *dssdev) +static int hdmi_audio_start(struct omap_dss_device *dssdev) { return -EPERM; } -static void omapdss_hdmi_audio_stop(struct omap_dss_device *dssdev) +static void hdmi_audio_stop(struct omap_dss_device *dssdev) { } -static bool omapdss_hdmi_audio_supported(struct omap_dss_device *dssdev) +static bool hdmi_audio_supported(struct omap_dss_device *dssdev) { return false; } -static int omapdss_hdmi_audio_config(struct omap_dss_device *dssdev, +static int hdmi_audio_config(struct omap_dss_device *dssdev, struct omap_dss_audio *audio) { return -EPERM; @@ -1225,21 +1043,21 @@ static const struct omapdss_hdmi_ops hdmi_ops = { .connect = hdmi_connect, .disconnect = hdmi_disconnect, - .enable = omapdss_hdmi_display_enable, - .disable = omapdss_hdmi_display_disable, + .enable = hdmi_display_enable, + .disable = hdmi_display_disable, - .check_timings = omapdss_hdmi_display_check_timing, - .set_timings = omapdss_hdmi_display_set_timing, - .get_timings = omapdss_hdmi_display_get_timings, + .check_timings = hdmi_display_check_timing, + .set_timings = hdmi_display_set_timing, + .get_timings = hdmi_display_get_timings, .read_edid = hdmi_read_edid, - .audio_enable = omapdss_hdmi_audio_enable, - .audio_disable = omapdss_hdmi_audio_disable, - .audio_start = omapdss_hdmi_audio_start, - .audio_stop = omapdss_hdmi_audio_stop, - .audio_supported = omapdss_hdmi_audio_supported, - .audio_config = omapdss_hdmi_audio_config, + .audio_enable = hdmi_audio_enable, + .audio_disable = hdmi_audio_disable, + .audio_start = hdmi_audio_start, + .audio_stop = hdmi_audio_stop, + .audio_supported = hdmi_audio_supported, + .audio_config = hdmi_audio_config, }; static void hdmi_init_output(struct platform_device *pdev) @@ -1301,50 +1119,15 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev) hdmi.ip_data.pll_offset = HDMI_PLLCTRL; hdmi.ip_data.phy_offset = HDMI_PHY; - hdmi.ct_cp_hpd_gpio = -1; - hdmi.ls_oe_gpio = -1; - hdmi.hpd_gpio = -1; - hdmi_init_output(pdev); - r = hdmi_panel_init(); - if (r) { - DSSERR("can't init panel\n"); - return r; - } - dss_debugfs_create_file("hdmi", hdmi_dump_regs); - if (pdev->dev.platform_data) { - r = hdmi_probe_pdata(pdev); - if (r) - goto err_probe; - } - - return 0; - -err_probe: - hdmi_panel_exit(); - hdmi_uninit_output(pdev); - pm_runtime_disable(&pdev->dev); - return r; -} - -static int __exit hdmi_remove_child(struct device *dev, void *data) -{ - struct omap_dss_device *dssdev = to_dss_device(dev); - hdmi_uninit_display(dssdev); return 0; } static int __exit omapdss_hdmihw_remove(struct platform_device *pdev) { - device_for_each_child(&pdev->dev, NULL, hdmi_remove_child); - - dss_unregister_child_devices(&pdev->dev); - - hdmi_panel_exit(); - hdmi_uninit_output(pdev); pm_runtime_disable(&pdev->dev); diff --git a/drivers/video/omap2/dss/hdmi_panel.c b/drivers/video/omap2/dss/hdmi_panel.c deleted file mode 100644 index dfb8eda..0000000 --- a/drivers/video/omap2/dss/hdmi_panel.c +++ /dev/null @@ -1,414 +0,0 @@ -/* - * hdmi_panel.c - * - * HDMI library support functions for TI OMAP4 processors. - * - * Copyright (C) 2010-2011 Texas Instruments Incorporated - http://www.ti.com/ - * Authors: Mythri P k - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published by - * the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see . - */ - -#include -#include -#include -#include -#include -#include