From patchwork Thu Mar 13 07:42:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inki Dae X-Patchwork-Id: 3822291 Return-Path: X-Original-To: patchwork-dri-devel@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 03B08BF540 for ; Thu, 13 Mar 2014 07:42:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1CB662027D for ; Thu, 13 Mar 2014 07:42:57 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id BAEF3201FB for ; Thu, 13 Mar 2014 07:42:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2A723FAD45; Thu, 13 Mar 2014 00:42:53 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by gabe.freedesktop.org (Postfix) with ESMTP id AE453FAD45 for ; Thu, 13 Mar 2014 00:42:50 -0700 (PDT) Received: from epcpsbgr1.samsung.com (u141.gpu120.samsung.co.kr [203.254.230.141]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N2D006UO6RDMZ90@mailout2.samsung.com> for dri-devel@lists.freedesktop.org; Thu, 13 Mar 2014 16:42:49 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.114]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id F8.67.12635.87161235; Thu, 13 Mar 2014 16:42:49 +0900 (KST) X-AuditID: cbfee68d-b7fcd6d00000315b-50-532161781f8c Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 0F.C1.29263.87161235; Thu, 13 Mar 2014 16:42:48 +0900 (KST) Received: from daeinki-desktop.10.32.193.11 ([10.252.75.62]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N2D00AJ56RCH100@mmp1.samsung.com>; Thu, 13 Mar 2014 16:42:48 +0900 (KST) From: Inki Dae To: airlied@linux.ie, dri-devel@lists.freedesktop.org Subject: [PATCH 1/2] drm/exynos: hdmi: consider APB PHY Date: Thu, 13 Mar 2014 16:42:47 +0900 Message-id: <1394696568-32281-1-git-send-email-inki.dae@samsung.com> X-Mailer: git-send-email 1.7.9.5 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrLLMWRmVeSWpSXmKPExsWyRsSkSLcyUTHYoGcrs0XvuZNMFle+vmez mHR/AovF2aY37BZ3N5xldGD1mN1wkcVj+7cHrB73u48zefRtWcUYwBLFZZOSmpNZllqkb5fA ldF46zZLwSbhit7zbSwNjDf4uxg5OCQETCQevhPvYuQEMsUkLtxbz9bFyMUhJLCUUWL67qNM EAkTia1XrzJCJBYxSuya3cwGkhAS6GaSONgSCWKzCahKTFxxHywuImAq0TFpKQuIzSwQLvFp 6gFWEFtYwFyi5ek2ZpDFLED1rxf7gIR5BVwkVj3ezQxxj4LEnEk2IKskBN6zSayZeQeslUVA QOLb5EMsEDWyEpsOMEOcJilxcMUNlgmMggsYGVYxiqYWJBcUJ6UXGeoVJ+YWl+al6yXn525i BAbl6X/Pencw3j5gfYgxGWjcRGYp0eR8YFDnlcQbGpsZWZiamBobmVuakSasJM6b9DApSEgg PbEkNTs1tSC1KL6oNCe1+BAjEwenVAOjI/cTIe2JdosTGyx9dG5aC9UskI0vqxQ6tn3CxbOf Fnz87xca6PLiFZM4z0epbW8cPIz/V4h7vtY/IFl24XNUohBT9cSitP2e5vJuh04oTT2w4Ujh Cvmgm1YN4r8bu3qLwvTWSNrMYrRLzVWL2O2b+DI7JsdUWWU3r0n6xqYYAa/5MzhWHVRiKc5I NNRiLipOBACs1L9nYAIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrNIsWRmVeSWpSXmKPExsVy+t9jAd2KRMVgg+nvLSx6z51ksrjy9T2b xaT7E1gszja9Ybe4u+EsowOrx+yGiywe2789YPW4332cyaNvyyrGAJaoBkabjNTElNQihdS8 5PyUzLx0WyXv4HjneFMzA0NdQ0sLcyWFvMTcVFslF58AXbfMHKDNSgpliTmlQKGAxOJiJX07 TBNCQ9x0LWAaI3R9Q4LgeowM0EDCGsaMxlu3WQo2CVf0nm9jaWC8wd/FyMkhIWAisfXqVUYI W0ziwr31bF2MXBxCAosYJXbNbmYDSQgJdDNJHGyJBLHZBFQlJq64DxYXETCV6Ji0lAXEZhYI l/g09QAriC0sYC7R8nQbcxcjBwcLUP3rxT4gYV4BF4lVj3eDhSUEFCTmTLKZwMi9gJFhFaNo akFyQXFSeq6hXnFibnFpXrpecn7uJkZw0D+T2sG4ssHiEKMAB6MSD++K5QrBQqyJZcWVuYcY JTiYlUR4PX0Ug4V4UxIrq1KL8uOLSnNSiw8xJgPtnsgsJZqcD4zIvJJ4Q2MTMyNLI3NDCyNj c9KElcR5D7RaBwoJpCeWpGanphakFsFsYeLglGpg9OwVKndhTDB/dEjdx2Cr8HoXu/Vs/91M pDmnZs14ct1Cv5BV91VwbUBw88uOT3a7Hym8s+BZMdnmpmnN159doctfNrDkJNvfvGY794T9 HnfOOK2VJva2s3jrbuauuv7sx5lDjNbHHxqUbprsVncqRmCp9EXupe9MooPnuTmlnWjucXR/ Xr9EiaU4I9FQi7moOBEA/iOwL74CAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Cc: kyungmin.park@samsung.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 This patch returns error in case of using APB PHY. Exynos5420 SoC and maybe later would use APB PHY instead of I2C PHY so such case should be considered. Signed-off-by: Inki Dae Signed-off-by: Kyungmin Park --- drivers/gpu/drm/exynos/exynos_hdmi.c | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index e6ce363..b695398 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c @@ -63,6 +63,11 @@ enum hdmi_type { HDMI_TYPE14, }; +struct hdmi_driver_data { + unsigned int type; + unsigned int is_apb_phy:1; +}; + struct hdmi_resources { struct clk *hdmi; struct clk *sclk_hdmi; @@ -197,6 +202,14 @@ struct hdmiphy_config { u8 conf[32]; }; +struct hdmi_driver_data exynos4212_hdmi_driver_data = { + .type = HDMI_TYPE14, +}; + +struct hdmi_driver_data exynos5_hdmi_driver_data = { + .type = HDMI_TYPE14, +}; + /* list of phy config settings */ static const struct hdmiphy_config hdmiphy_v13_configs[] = { { @@ -1959,10 +1972,10 @@ err_data: static struct of_device_id hdmi_match_types[] = { { .compatible = "samsung,exynos5-hdmi", - .data = (void *)HDMI_TYPE14, + .data = &exynos5_hdmi_driver_data, }, { .compatible = "samsung,exynos4212-hdmi", - .data = (void *)HDMI_TYPE14, + .data = &exynos4212_hdmi_driver_data, }, { /* end node */ } @@ -1976,6 +1989,7 @@ static int hdmi_probe(struct platform_device *pdev) struct resource *res; const struct of_device_id *match; struct device_node *ddc_node, *phy_node; + struct hdmi_driver_data *drv_data; int ret; if (!dev->of_node) @@ -1996,7 +2010,9 @@ static int hdmi_probe(struct platform_device *pdev) match = of_match_node(hdmi_match_types, dev->of_node); if (!match) return -ENODEV; - hdata->type = (enum hdmi_type)match->data; + + drv_data = (struct hdmi_driver_data *)match->data; + hdata->type = drv_data->type; hdata->hpd_gpio = pdata->hpd_gpio; hdata->dev = dev; @@ -2030,6 +2046,10 @@ static int hdmi_probe(struct platform_device *pdev) return -ENODEV; } + /* Not support APB PHY yet. */ + if (drv_data->is_apb_phy) + return -EPERM; + /* hdmiphy i2c driver */ phy_node = of_parse_phandle(dev->of_node, "phy", 0); if (!phy_node) {