From patchwork Wed Mar 9 08:31:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Meng Yi X-Patchwork-Id: 8544321 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id AF9AE9F46A for ; Wed, 9 Mar 2016 09:44:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3F58C2026F for ; Wed, 9 Mar 2016 09:44:42 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id C7C1D2025A for ; Wed, 9 Mar 2016 09:44:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ED5C26E88D; Wed, 9 Mar 2016 09:44:37 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 911 seconds by postgrey-1.35 at gabe; Wed, 09 Mar 2016 08:55:28 UTC Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1bon0077.outbound.protection.outlook.com [157.56.111.77]) by gabe.freedesktop.org (Postfix) with ESMTPS id 409FC6E866 for ; Wed, 9 Mar 2016 08:55:28 +0000 (UTC) Received: from CH1PR03CA012.namprd03.prod.outlook.com (10.255.156.157) by BY2PR0301MB2118.namprd03.prod.outlook.com (10.163.197.147) with Microsoft SMTP Server (TLS) id 15.1.434.16; Wed, 9 Mar 2016 08:40:19 +0000 Received: from BN1AFFO11FD010.protection.gbl (10.255.156.132) by CH1PR03CA012.outlook.office365.com (10.255.156.157) with Microsoft SMTP Server (TLS) id 15.1.427.16 via Frontend Transport; Wed, 9 Mar 2016 08:40:19 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; cmss.chinamobile.com; dkim=none (message not signed) header.d=none;cmss.chinamobile.com; dmarc=none action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1AFFO11FD010.mail.protection.outlook.com (10.58.52.70) with Microsoft SMTP Server (TLS) id 15.1.434.11 via Frontend Transport; Wed, 9 Mar 2016 08:40:18 +0000 Received: from titan.ap.freescale.net ([10.192.208.233]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id u298e8PA005427; Wed, 9 Mar 2016 01:40:16 -0700 From: Meng Yi To: , , Subject: [PATCH v3 3/3] drm/layerscape: Add HDMI driver for freescale DCU Date: Wed, 9 Mar 2016 16:31:02 +0800 Message-ID: <1457512262-45984-3-git-send-email-meng.yi@nxp.com> X-Mailer: git-send-email 2.1.0.27.g96db324 In-Reply-To: <1457512262-45984-1-git-send-email-meng.yi@nxp.com> References: <1457512262-45984-1-git-send-email-meng.yi@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131019864190599419; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(4326007)(47776003)(86362001)(6806005)(5008740100001)(2906002)(36756003)(50466002)(33646002)(575784001)(50226001)(104016004)(19580405001)(19580395003)(586003)(92566002)(77096005)(76176999)(5003940100001)(229853001)(106466001)(48376002)(87936001)(81166005)(105606002)(85426001)(2201001)(189998001)(1096002)(1220700001)(2950100001)(5001770100001)(11100500001)(5890100001)(50986999)(7059030)(2004002); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0301MB2118; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD010; 1:8RQlJqvjWF98dnC372LbbaHqoMYjHyTdbGd7a3oJSTUNj44B002h7CQG+SkB1HkbpvLekqOxr/KcNlmPY38On7xmXTLIRXnlcHCGv/gl85L9fa9XmcnruA6oMnJ1QGD4NOhWEd22G6EqBvEhy14mpgMHEieGyOyDrTBcdDN8s9tf5SpvMq7v7XCfyY05XTXATEdxYXU8LoqnEOxmQAZ59iJq8QBsiUDEJLOdhbhHbtXi9c1Ta2gouR4yCE5H/GjyMGptlrk3ouvOhFPlvOmEQKBnXr5hgx7pmjIWTk7xW5KCqraMtsEyheL2sOG5kN1tIkJt+6rmaLTKPJ5cQCN5OHBNakj072x9SUGH9hjqAltb/FWhKHIaDK8OilFj3SIdGuvoipKoCv/J5gtGIqzcOonQ3smO86JQpTK80Yt3m+B3sA5LXtXa6ftGmx2I3NzVNTZiJ2ou26a6D0KRDpc8T25EK5IL+APjpd4JcFYwBPM4gNeguoLf7thyqOVgaBJC MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: f273d22e-f91f-4670-5492-08d347f671fb X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB2118; 2:OalnVQLup+CS49z5XSt4CMD3AWNz9iJ/FC/vvJW4QlG5xb7ypr9ZLmlspWqO/SnwoHRscUNYlxO6qfxNNNrzf5hFWZ0zqC8xGN8KP3QILLUJBY5cnNKm/u4qzxLSUJgXYPqS64mBIkjmcIm1bFntmOqTFXo7voboKecGWeeDver/q50kkkPvjD/3jrwO6ash; 3:KvXlFpyw+uBgC1mzj3HrnvTwyXZcILhrqqP0lb12hFdWL8jkjpbAK8A7OSu2rvJfhUcWn9q9vDkLzs1HKC1Nhvp69rWYQ4hs5oeS6/9HzeCfjLYXAnZ9PEX3ImTXtlQHyxMhbTn6vDB0imCc6X+WJTU6haLOpcVcgEAoLFO4MCmH7UNtP+uA1Qx7wmTPpHkHYooMGO7Y2XHZp5jq/d9FY92gx7P5L29fZWOAMMPuAqc=; 25:8nf+4anIn1fa71QMe6cKkyNAASbA74YdsyVyuDJ7h+fzLTsOoCmSsRtH+dNZWpPIvAn/4TYlpKmSwuRtXtpGFhTP3tBSqIgJVY3V2W4QhFgFnERSOLHjkiS3hrsk+U4yyhd3Dgg7YTemVRUJEmeO1dGIGQy7f88E+6goYtybrOOadNBEp9K/Z3ozS9mH0XrELbu0zsap5xi5h9fhZpMvDfCSqK9OdStHSA641qj14IxuFtAC9CCwSpyIP6NvtImUP0rm3Ib1Kl7HzaqXo0LcLSfQjeQt+qhHpX6WNGMmf1B5QAYXKZeQfd1gGYmblO34Bim+wJZrjrezGV2qeqFeeg== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR0301MB2118; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13015025)(8121501046)(13018025)(13024025)(13023025)(13017025)(5005006)(10201501046)(3002001); SRVR:BY2PR0301MB2118; BCL:0; PCL:0; RULEID:(400006); SRVR:BY2PR0301MB2118; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB2118; 4:HkBNBqnRPQKDmCGLpeL5hc6SWY04hcBi3ecLv87QQeSCTrRv2+mfyJUfbyBry5eFW/08QphjevwQxUEj6K76NY5yRYHBDp6BScmxSViqIFEzTJJweGSaGaBQRv4ZamQgaiHmfLrplsyBBiqSF+p714Cbpb/E7JiXmYyHz2L+b2L+m6qXtJHEil8y+4vRUTEtPJn7wt2vJg3iWfCqh8T+Nz5iu8TZkqytkSOG52WQjx7KbBa4MUUufrnGRVoMc3Wifz43GHbSvzvZS2iNMRfhtpWLfb/EUUj+k4DwLfdv5Z3/zfy+SGD/ZDl7HLxhyhrEmkwoN/9mMwfdsoikpbICL/zUqpbYyN5LwReJnUk0ZaZDEH2TFqoo2FHP1JIiKHE7EMMJ/d9xbjZ+Vzi+HTM73c7ldaamRMxgVVZ4blBEyafjNToC6l980PI0dg5D5HTvBJmGpNzBxSLZS1n2fPhWSA== X-Forefront-PRVS: 0876988AF0 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0301MB2118; 23:seYvrVzpGq50iJVoohJcncKXPakqLyYCyfdJi99?= =?us-ascii?Q?r5gpPPJ9hcZVLi1H8rD8Ul1mkGCKltRfBYGVS9FpWTlJt21gNwRU1qtD0/w/?= =?us-ascii?Q?TSHUsnpYGuwWFQLRt+mv7BBrnp49u7FvvPYJr8OhGt3bALRiiMr7ar0td/zV?= =?us-ascii?Q?Jfw2pXZsgWBbESOR3K4rYUliCL0b9PJxUIF3SfyUMkxEDcTSAhSJD/exvxCc?= =?us-ascii?Q?Cj2tKWyaQLga1614yQO6P6+xOd5MtvrBlLqHn9IRZ2BihpJg/lHQMO4vYo5e?= =?us-ascii?Q?PSmRhdlAA2Wncngks4LWifAUIOFrF7ieQ03+dIVoNZo0iwYqH79vDOKIdt9n?= =?us-ascii?Q?KrjOi2dm1ED3gpTYxfMrfopT8558sWbJjZADG9uJN2+KUo/FCfNFPd4dsZ6s?= =?us-ascii?Q?4uL+uMjTvUQrCEXC1ujftHCJqqsz8XycHFGbOoRbQJtf/m8iHgQJY3cbMx6W?= =?us-ascii?Q?bFlRn1NYOxWU9y547yDqHChdIe6iWRUXJkF4rKWFi68ogXTAqHQNIiAI6XR8?= =?us-ascii?Q?Pl8KD3jUpupVoPyFPcrI/out6KB0z5PQpkuaPmrbR73594ikZOlRJKTTUyQO?= =?us-ascii?Q?5DzRXt4x5dR9ssUaOB2M2dicaaIv9YrT0ydkRiA/1uR6/lfzs1V4Ij/p9fHT?= =?us-ascii?Q?TSpTNXm0L1j7/SnI3xPr/tfBEDRWiufuO0QadY3kA8FDspfgF6Q1qtktGG6T?= =?us-ascii?Q?bVQXoSu1tQ6FYWdhH6YPHJ4e/VQtW4kHppbKUSKDJBED46YRIqvL4Du8jLnn?= =?us-ascii?Q?Mj8quXbbIb5bkGj/5T6k8wk0SmRwpVW7RiWy1ORUpsItMzH6EuiEmOoYo3JU?= =?us-ascii?Q?OFd+K3FSibN0451bX+J2PJMcLaI/YLpgGg6XrbKbHakUrBYyLdT9fovoPuq7?= =?us-ascii?Q?y431DGCpORVdQdd7GPkMEFLH7r1uCFz4EsQKapgwHU2CadnYJkxR7fXjrR6Y?= =?us-ascii?Q?pt5uaX9Ww7EpcT7SXv/6o7Oz8qmdUSpPrZdSIxpEkhFrlUqjklhyufeDlJzB?= =?us-ascii?Q?Hujci+F7zNkkMVU0l+t4c8dczDeZf75wOf7d+SOGadC7AAgUnre4Li8rJxxg?= =?us-ascii?Q?YGm9Aj5mF5Qfb06DvcnCW0Y140TjQnBrsqOZbPWLGaI9wm/KoCQ6YQpiVoVk?= =?us-ascii?Q?Ox6c/4m3Dtm2wqp3yAuZQJt9HuzkKr3ux?= X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB2118; 5:8dQEwulPCjsyJ6gTnCfAg6q9Up62aQcdCi9XApVtglLwoCj0yYixJ2OEIwdh+d8ChWbevXUlNYqieVtSlZsVPLpZvyGsHropyUm0GN7MUVWn6DZqY48MBGZHri5gVJoQcsljn3fnzr2c2L0TSzv09ogVbWcsMWm9HWC9Y8jl7oU=; 24:Lwwdqja6aLxC7hN1duKYP6GwmrEejcglguuR+XA2SNkjYN7JgNow0qaESTK6QND1+FSYGQKVX2khLT4xlXKhD1W8bCpFEosCF7cXITDHFaQ= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2016 08:40:18.7323 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0301MB2118 X-Mailman-Approved-At: Wed, 09 Mar 2016 09:44:31 +0000 Cc: Meng Yi , Xiubo Li , Alison Wang X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_MED, 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 DCU is the shortcut of 'display controller unit', some HDMI transmitter attached to DCU, such as sii9022a, and this driver add the relavent functions to DRM framewrok. Signed-off-by: Meng Yi Signed-off-by: Alison Wang Signed-off-by: Xiubo Li Signed-off-by: Jianwei Wang --- Change in V3: Use "of_graph" to describe the connection to DCU. --- .../bindings/display/bridge/sil,sii9022a.txt | 55 ++++ drivers/gpu/drm/fsl-dcu/Makefile | 1 + drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h | 1 + drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_hdmi.c | 292 +++++++++++++++++++++ drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c | 12 + drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_output.h | 11 + 6 files changed, 372 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/bridge/sil,sii9022a.txt create mode 100644 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_hdmi.c diff --git a/Documentation/devicetree/bindings/display/bridge/sil,sii9022a.txt b/Documentation/devicetree/bindings/display/bridge/sil,sii9022a.txt new file mode 100644 index 0000000..20655f7 --- /dev/null +++ b/Documentation/devicetree/bindings/display/bridge/sil,sii9022a.txt @@ -0,0 +1,55 @@ +Device-Tree bindings for the SiI902x hdmi transmitter. +----------------------------------------- + +The SiI9022A is an ultra low-power HDMI transmitter. It supports resolutions from +standard definition 480i/p and 576i/p all the way to high-definition 720p, 1080i, +and 1080p, the highest resolution supported by HDTVs today. It also supports all +PC resolutions up to UXGA for netbooks + +Required properties: +- compatible: Should be "sil,sii9022a". +- reg: The I2C address of the device. +- interrupts: Interrupt number to the cpu. + +Required nodes: + +The sii9022 has one video ports. Its connection is modelled using the OF +graph bindings specified in Documentation/devicetree/bindings/graph.txt. + +- Video port 0 for the HDMI output + +Example: +------- + +/ { + hdmi-out { + compatible = "hdmi-connector"; + type = "a"; + + port { + hdmi_con: endpoint { + remote-endpoint = <&sii9022a_out>; + }; + }; + }; +}; + +&i2c1 { + sii9022: hdmi@39 { + compatible = "sil,sii9022a"; + reg = <0x39>; + interrupts = ; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + sii9022_out: endpoint { + remote-endpoint = <&hdmi_con>; + }; + }; + }; + }; +}; diff --git a/drivers/gpu/drm/fsl-dcu/Makefile b/drivers/gpu/drm/fsl-dcu/Makefile index 6ea1523..98cacc2 100644 --- a/drivers/gpu/drm/fsl-dcu/Makefile +++ b/drivers/gpu/drm/fsl-dcu/Makefile @@ -1,6 +1,7 @@ fsl-dcu-drm-y := fsl_dcu_drm_drv.o \ fsl_dcu_drm_kms.o \ fsl_dcu_drm_rgb.o \ + fsl_dcu_drm_hdmi.o \ fsl_dcu_drm_plane.o \ fsl_dcu_drm_crtc.o \ fsl_dcu_drm_fbdev.o diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h index 6413ac9..7d1b0fd 100644 --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.h @@ -189,6 +189,7 @@ struct fsl_dcu_drm_device { struct drm_fbdev_cma *fbdev; struct drm_crtc crtc; struct drm_encoder encoder; + struct drm_encoder_slave *slave; struct fsl_dcu_drm_connector connector; const struct fsl_dcu_soc_data *soc; }; diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_hdmi.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_hdmi.c new file mode 100644 index 0000000..97d8621 --- /dev/null +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_hdmi.c @@ -0,0 +1,292 @@ +/* + * Copyright 2015 Freescale Semiconductor, Inc. + * + * Freescale DCU drm device driver + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include