From patchwork Tue Jul 1 08:10:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 32849 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yk0-f197.google.com (mail-yk0-f197.google.com [209.85.160.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 85120203C0 for ; Tue, 1 Jul 2014 08:10:38 +0000 (UTC) Received: by mail-yk0-f197.google.com with SMTP id 19sf15371551ykq.8 for ; Tue, 01 Jul 2014 01:10:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=ihcR5rlyp2mFfjeRWK76vzAwAIBwnzIaggpVGSaHpQU=; b=NjufGw8qBHuqPVgfWaptWeGG0uIzVoSF6/jK+vhIePQKV3+XZQa/v/HiFQukom4Mis pa8aasNR6fp966vQDQbQ8R7e/SktecOKpGv9PJ8tqx6btV3j9SSjAPJ2eNuxwOnsKmfO YHq6beHAi/6goXo9TqzLB1oBcIAKS3M8rBn45c/M2KJVfaGSkQqRm+deHCZ/2HlGNTTz gRudyHyA9ljm+Utf9BSD4paB/OVjvYUuyUJv/TF3E8b48nKWPTQqRz5qg71FezE43jzG un28gUI36fu9A2raQJL346D9rlXx7HqLAw4rmoC/rxw9Bu5WbnYIa8Pg+sClp+c1CTLY w2AQ== X-Gm-Message-State: ALoCoQmm2mdowLx2c1DBhPV693KDf5Ws5aquSe653oN21zTtOvL2GhXn6KQ0sXhlsT+6sn4ONVax X-Received: by 10.58.172.5 with SMTP id ay5mr25407574vec.37.1404202238361; Tue, 01 Jul 2014 01:10:38 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.30.36 with SMTP id c33ls1859224qgc.72.gmail; Tue, 01 Jul 2014 01:10:38 -0700 (PDT) X-Received: by 10.220.17.199 with SMTP id t7mr38053016vca.1.1404202238227; Tue, 01 Jul 2014 01:10:38 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id s5si11135404vcu.2.2014.07.01.01.10.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 01 Jul 2014 01:10:38 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.174 as permitted sender) client-ip=209.85.220.174; Received: by mail-vc0-f174.google.com with SMTP id hy4so8515606vcb.5 for ; Tue, 01 Jul 2014 01:10:38 -0700 (PDT) X-Received: by 10.58.119.75 with SMTP id ks11mr44230173veb.20.1404202238125; Tue, 01 Jul 2014 01:10:38 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp197867vcb; Tue, 1 Jul 2014 01:10:37 -0700 (PDT) X-Received: by 10.43.172.74 with SMTP id nx10mr41982073icc.37.1404202237508; Tue, 01 Jul 2014 01:10:37 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id so9si25090523pac.191.2014.07.01.01.10.36; Tue, 01 Jul 2014 01:10:36 -0700 (PDT) Received-SPF: none (google.com: linux-samsung-soc-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755048AbaGAIKg (ORCPT + 8 others); Tue, 1 Jul 2014 04:10:36 -0400 Received: from mailout3.w1.samsung.com ([210.118.77.13]:45220 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755500AbaGAIKd (ORCPT ); Tue, 1 Jul 2014 04:10:33 -0400 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N80001EUXDGGR80@mailout3.w1.samsung.com> for linux-samsung-soc@vger.kernel.org; Tue, 01 Jul 2014 09:10:28 +0100 (BST) X-AuditID: cbfec7f5-b7f626d000004b39-b1-53b26cf585d9 Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 67.28.19257.5FC62B35; Tue, 01 Jul 2014 09:10:29 +0100 (BST) Received: from amdc1339.digital.local ([106.116.147.30]) by eusync2.samsung.com (Oracle Communications Messaging Server 7u4-23.01 (7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0N8000A5SXDBMY80@eusync2.samsung.com>; Tue, 01 Jul 2014 09:10:29 +0100 (BST) From: Marek Szyprowski To: linux-samsung-soc@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: Marek Szyprowski , Kukjin Kim , Tobias Jakobi , Daniel Drake , Andrzej Hajda , Inki Dae , Tomasz Stanislawski , Tomasz Figa Subject: [PATCH 3/7] drm: hdmi/mixer: enable exynos 4210 and 4x12 soc support Date: Tue, 01 Jul 2014 10:10:07 +0200 Message-id: <1404202211-15788-4-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.2 In-reply-to: <1404202211-15788-1-git-send-email-m.szyprowski@samsung.com> References: <1404202211-15788-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpmluLIzCtJLcpLzFFi42I5/e/4Fd2vOZuCDXafZbe4te4cq8Wj+Y+Z La58fc9mMen+BBaL3gVX2SxmnN/HZNH18yebxdojd9kt1s94zWIxr/0lqwOXx6LvWR6LN+1n 87jffZzJo2/LKkaPz5vkAlijuGxSUnMyy1KL9O0SuDI2Lz/JVvDXsGLa9Q7mBsYjml2MHBwS AiYS6y5kdjFyApliEhfurWfrYuTiEBJYyiix/f0Udginj0lic8NNNpAqNgFDia63XWwgzSIC bhKz/rOC1DAL7GWSuPpqIliNsICvxNor75hBbBYBVYnnZ04xgti8Ah4S81e0s0Nsk5P4/3IF E4jNKeApsefqQbC4EFDN/u9bmCYw8i5gZFjFKJpamlxQnJSea6RXnJhbXJqXrpecn7uJERJw X3cwLj1mdYhRgINRiYf3hf6mYCHWxLLiytxDjBIczEoivOxpQCHelMTKqtSi/Pii0pzU4kOM TBycUg2Mhb9vGE21fj5xKz9L3lblpn61lQ61cpGPXdN36scmMDZPddX7YHL4ioBHm86Bv6nu mYs/sWs/ijt2Pmu6Duu8mmAB1bz/3PU/vK9rT6/+ePLFeeY9h9fekjH/debfxeXnbK5a1Mks sykPYZOLuFjjXnPB+s+eee7fl67QLE29O+V9/iwNv7PblFiKMxINtZiLihMBy2tcRhYCAAA= Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: m.szyprowski@samsung.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.174 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Configuration sets for Exynos 4210 and 4x12 SoC were already defined in Exynos HDMI and Mixed drivers, but they lacked proper linking to device tree 'compatible' values. This patch fixes this issue adding support for following compatible values: samsung,exynos4210-mixer, samsung,exynos4212-mixer and samsung,exynos4210-hdmi. It also corrects access to sclk_mixer clock, which is available only on Exynos 4210. Signed-off-by: Marek Szyprowski --- .../devicetree/bindings/video/exynos_mixer.txt | 5 ++- drivers/gpu/drm/exynos/exynos_hdmi.c | 10 +++++ drivers/gpu/drm/exynos/exynos_mixer.c | 51 +++++++++++++++------- 3 files changed, 49 insertions(+), 17 deletions(-) diff --git a/Documentation/devicetree/bindings/video/exynos_mixer.txt b/Documentation/devicetree/bindings/video/exynos_mixer.txt index 7bfde9c9d658..08b394b1edbf 100644 --- a/Documentation/devicetree/bindings/video/exynos_mixer.txt +++ b/Documentation/devicetree/bindings/video/exynos_mixer.txt @@ -4,8 +4,9 @@ Required properties: - compatible: value should be one of the following: 1) "samsung,exynos5-mixer" 2) "samsung,exynos4210-mixer" - 3) "samsung,exynos5250-mixer" - 4) "samsung,exynos5420-mixer" + 3) "samsung,exynos4212-mixer" + 4) "samsung,exynos5250-mixer" + 5) "samsung,exynos5420-mixer" - reg: physical base address of the mixer and length of memory mapped region. diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index a9a87d024c56..7bd99939b984 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c @@ -593,6 +593,13 @@ static struct hdmi_driver_data exynos4212_hdmi_driver_data = { .is_apb_phy = 0, }; +static struct hdmi_driver_data exynos4210_hdmi_driver_data = { + .type = HDMI_TYPE13, + .phy_confs = hdmiphy_v13_configs, + .phy_conf_count = ARRAY_SIZE(hdmiphy_v13_configs), + .is_apb_phy = 0, +}; + static struct hdmi_driver_data exynos5_hdmi_driver_data = { .type = HDMI_TYPE14, .phy_confs = hdmiphy_v13_configs, @@ -2277,6 +2284,9 @@ static struct of_device_id hdmi_match_types[] = { .compatible = "samsung,exynos5-hdmi", .data = &exynos5_hdmi_driver_data, }, { + .compatible = "samsung,exynos4210-hdmi", + .data = &exynos4210_hdmi_driver_data, + }, { .compatible = "samsung,exynos4212-hdmi", .data = &exynos4212_hdmi_driver_data, }, { diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c index 7529946d0a74..9d0c21a50a86 100644 --- a/drivers/gpu/drm/exynos/exynos_mixer.c +++ b/drivers/gpu/drm/exynos/exynos_mixer.c @@ -76,7 +76,7 @@ struct mixer_resources { struct clk *vp; struct clk *sclk_mixer; struct clk *sclk_hdmi; - struct clk *sclk_dac; + struct clk *mout_mixer; }; enum mixer_version_id { @@ -93,6 +93,7 @@ struct mixer_context { bool interlace; bool powered; bool vp_enabled; + bool has_sclk; u32 int_en; struct mutex mixer_mutex; @@ -106,6 +107,7 @@ struct mixer_context { struct mixer_drv_data { enum mixer_version_id version; bool is_vp_enabled; + bool has_sclk; }; static const u8 filter_y_horiz_tap8[] = { @@ -809,19 +811,23 @@ static int vp_resources_init(struct mixer_context *mixer_ctx) dev_err(dev, "failed to get clock 'vp'\n"); return -ENODEV; } - mixer_res->sclk_mixer = devm_clk_get(dev, "sclk_mixer"); - if (IS_ERR(mixer_res->sclk_mixer)) { - dev_err(dev, "failed to get clock 'sclk_mixer'\n"); - return -ENODEV; - } - mixer_res->sclk_dac = devm_clk_get(dev, "sclk_dac"); - if (IS_ERR(mixer_res->sclk_dac)) { - dev_err(dev, "failed to get clock 'sclk_dac'\n"); - return -ENODEV; - } - if (mixer_res->sclk_hdmi) - clk_set_parent(mixer_res->sclk_mixer, mixer_res->sclk_hdmi); + if (mixer_ctx->has_sclk) { + mixer_res->sclk_mixer = devm_clk_get(dev, "sclk_mixer"); + if (IS_ERR(mixer_res->sclk_mixer)) { + dev_err(dev, "failed to get clock 'sclk_mixer'\n"); + return -ENODEV; + } + mixer_res->mout_mixer = devm_clk_get(dev, "mout_mixer"); + if (IS_ERR(mixer_res->mout_mixer)) { + dev_err(dev, "failed to get clock 'mout_mixer'\n"); + return -ENODEV; + } + + if (mixer_res->sclk_hdmi && mixer_res->mout_mixer) + clk_set_parent(mixer_res->mout_mixer, + mixer_res->sclk_hdmi); + } res = platform_get_resource(mixer_ctx->pdev, IORESOURCE_MEM, 1); if (res == NULL) { @@ -1082,7 +1088,8 @@ static void mixer_poweron(struct exynos_drm_manager *mgr) clk_prepare_enable(res->mixer); if (ctx->vp_enabled) { clk_prepare_enable(res->vp); - clk_prepare_enable(res->sclk_mixer); + if (ctx->has_sclk) + clk_prepare_enable(res->sclk_mixer); } mutex_lock(&ctx->mixer_mutex); @@ -1121,7 +1128,8 @@ static void mixer_poweroff(struct exynos_drm_manager *mgr) clk_disable_unprepare(res->mixer); if (ctx->vp_enabled) { clk_disable_unprepare(res->vp); - clk_disable_unprepare(res->sclk_mixer); + if (ctx->has_sclk) + clk_disable_unprepare(res->sclk_mixer); } pm_runtime_put_sync(ctx->dev); @@ -1189,9 +1197,15 @@ static struct mixer_drv_data exynos5250_mxr_drv_data = { .is_vp_enabled = 0, }; +static struct mixer_drv_data exynos4212_mxr_drv_data = { + .version = MXR_VER_0_0_0_16, + .is_vp_enabled = 1, +}; + static struct mixer_drv_data exynos4210_mxr_drv_data = { .version = MXR_VER_0_0_0_16, .is_vp_enabled = 1, + .has_sclk = 1, }; static struct platform_device_id mixer_driver_types[] = { @@ -1208,6 +1222,12 @@ static struct platform_device_id mixer_driver_types[] = { static struct of_device_id mixer_match_types[] = { { + .compatible = "samsung,exynos4210-mixer", + .data = &exynos4210_mxr_drv_data, + }, { + .compatible = "samsung,exynos4212-mixer", + .data = &exynos4212_mxr_drv_data, + }, { .compatible = "samsung,exynos5-mixer", .data = &exynos5250_mxr_drv_data, }, { @@ -1251,6 +1271,7 @@ static int mixer_bind(struct device *dev, struct device *manager, void *data) ctx->pdev = pdev; ctx->dev = dev; ctx->vp_enabled = drv->is_vp_enabled; + ctx->has_sclk = drv->has_sclk; ctx->mxr_ver = drv->version; init_waitqueue_head(&ctx->wait_vsync_queue); atomic_set(&ctx->wait_vsync_event, 0);