From patchwork Tue Feb 16 01:52:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Meng Yi X-Patchwork-Id: 8322851 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4F610C02AE for ; Tue, 16 Feb 2016 08:44:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D60812034B for ; Tue, 16 Feb 2016 08:44:57 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 5D88F202A1 for ; Tue, 16 Feb 2016 08:44:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D15796E765; Tue, 16 Feb 2016 08:44:53 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0082.outbound.protection.outlook.com [207.46.100.82]) by gabe.freedesktop.org (Postfix) with ESMTPS id C15FC6E212 for ; Tue, 16 Feb 2016 02:01:48 +0000 (UTC) Received: from BN3PR0301CA0076.namprd03.prod.outlook.com (10.160.152.172) by BY2PR03MB316.namprd03.prod.outlook.com (10.141.139.26) with Microsoft SMTP Server (TLS) id 15.1.403.16; Tue, 16 Feb 2016 02:01:47 +0000 Received: from BN1BFFO11FD004.protection.gbl (2a01:111:f400:7c10::1:100) by BN3PR0301CA0076.outlook.office365.com (2a01:111:e400:401e::44) with Microsoft SMTP Server (TLS) id 15.1.409.15 via Frontend Transport; Tue, 16 Feb 2016 02:01:46 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=nxp.com; gmail.com; dkim=none (message not signed) header.d=none; gmail.com; dmarc=none action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BN1BFFO11FD004.mail.protection.outlook.com (10.58.144.67) with Microsoft SMTP Server (TLS) id 15.1.415.6 via Frontend Transport; Tue, 16 Feb 2016 02:01:46 +0000 Received: from titan.ap.freescale.net ([10.192.208.233]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id u1G21aE7016008; Mon, 15 Feb 2016 19:01:43 -0700 From: Meng Yi To: Subject: [PATCH v2 3/3] drm/layerscape: Add HDMI driver for freescale DCU Date: Tue, 16 Feb 2016 09:52:47 +0800 Message-ID: <1455587567-14606-3-git-send-email-meng.yi@nxp.com> X-Mailer: git-send-email 2.1.0.27.g96db324 In-Reply-To: <1455587567-14606-1-git-send-email-meng.yi@nxp.com> References: <1455587567-14606-1-git-send-email-meng.yi@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131000617064834892; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD004; 1:ImJsmMgv9PWYTHNGayFG9OpQJvtlBSmwio0lsGKWKZQhdpGsNLpB22nTLypKuwuQiUOx7oAp+nLxd8MPkiI8mjGXOFzeQUIJw3W0Y+xGg2IbFNaOMViF+4+5+23mJ8/wNpeMyzm/yYNd30yU7AuB2uctejSnZlPLobHscNuDg0h+SrJ/XVjZYMHz1XJo9L2OZv21QmLT/Va6g68HRP+owVSW6d0TGbK3egBhoqeNpJ237kh1MVbcabWuSN2jIJ0QxkDIBqZNmUQQs8pEbXF0OLtFAOAWJWC0tmQc/VRZLic8MsCh7a/4vt4Ly2B9AbbVI2pw3P2doh9JY3oaLO2kzupDXvp1MBxW8+VTGDn0QoIPhBDClB6tVgkxBJFFwSSb16OJRY8NuXQInSujQ7sYl+2tCDkOuuHAMMYHmGyuos2J2FDzhbrHEK1jCAwr1RGO3mx8Jais9Vi5v3VjWkF8gId3PdA5g0arsO4BeX5RNzo= X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(11100500001)(106466001)(19580405001)(19580395003)(229853001)(5890100001)(85426001)(2351001)(50226001)(48376002)(15975445007)(2950100001)(5001960100002)(77096005)(5003940100001)(76176999)(189998001)(50986999)(110136002)(92566002)(87936001)(2906002)(1220700001)(5008740100001)(6806005)(575784001)(4326007)(1096002)(104016004)(33646002)(86362001)(36756003)(50466002)(586003)(105606002)(47776003)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR03MB316; H:az84smr01.freescale.net; FPR:; SPF:Fail; MLV:sfv; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 998137ce-e664-42ac-9c44-08d336751fe5 X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB316; 2:GSrM0apdleOseVk7g3sH0mOw7gQqWDExygRfJtQCTkuiqkPTVGZg49r2z5DKNEybvqkF7wwdSpw0drLL0CT0wTq/stSJ5bCkTklkxBRavX6gYKhe/Obp6DvZTb/+OHeaY+E66bNW2mRid+a6/EUdv0G5L7BPlKs1fyQ+s6T2Fju0418BaxyPTW4dqczlvRzm; 3:Dn3RRQYwLyNFdlbON1VxHxXexjW/C7Si9zYZs98CXaoOI1SZTqspWG6pnHcKZUQJBunQYI922w8nD0xccIY2ZjfZkPCY8crHRSDDEz8afXqrY6yqlRn7v8wR/NQT8Dy+hSZL/bRvfeP6RFQPNRRqr2dkxzrQbSS9g3WHmjJffACSAliiGsrlrF0jlNFQh9rZ51ecwSyVTqvG68w1JnhoEFIgJVJCeAkRd4cQI7f9Fv8=; 25:+pCSnymNnxCpvYcetlPRBeh+H2PqyIz3CQWBpTupvK/qp8OexrIsxs4irZhEBKbOlcEKx8VriUTDZ8M1TstRbThhOmWYJs6JYRtmHcUFwqvaewpuB/6aylhmIkE3HqW2nEFxEo0bLh2Xpj25OsHfEmRXno2kCqvxNiuISTW/Cz2V26hZKnFTk/WuObA0JWDwS3/KTgWl//BRzbTGAZSL3MC+dW2z8QhMxEiZavkAc+f2OFOcNqThGVNuD7py6DSod4WqAWsqrY37xrx8gXjZOdPnuBCig45OPH6iUX1FrzYJRB5f/bJv5pm8ZKLVHPcu X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR03MB316; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(13018025)(13017025)(13015025)(13023025)(13024025)(8121501046)(3002001)(10201501046); SRVR:BY2PR03MB316; BCL:0; PCL:0; RULEID:(400006); SRVR:BY2PR03MB316; X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB316; 4:Jz0Xr3qY2Z8vdufKuQlE5vbCny9rbgnuEFYy5XaPJ+fNiNdnwi2EMHIYBvxx4ANgOMkIw9k+rEGHwGJZSnihmD8823ta7JTeDBuKEw/ssULR1ClcYY2evSXabHP9iHLuCiFNWJSecUZkEQelGEtZY7lkmSr5zQr1uufgpA/bjDpALeIhYzjrPBuQQo0+90azQts8GDIRPTtVBKcozU9nSsJBuyDafBTDA3HPgvLaSLZ/fDhY5RcYm3Wmr40i6k0KEfX0Q3xJ2Prjo4SgiUuxqQ9kHHqRFSQGH/2PC0SFTSvmD7iWYchOlHm9R07tS2nUWayls/V380MioOHxNDUj2wh87J+BVbXbqEDoCBSAZAJGMrPbLv5PKa56hOfT3OKPf3FB48pjlkxGKcqBMAHE6NKUPck1gRjfHTtH7vs4omZ9BmMZwQf4PJKguTNEpi8DX7Ii3HIpOyhemnjIUforws1wUl5DRNLCCGSxeOI6OsgkTMEZitu9Jh/l4q24puLE X-Forefront-PRVS: 0854128AF0 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR03MB316; 23:xvxGlrIH2GOT6XvHrTHiXyTLhIKDelBZfbosqYBDlM?= =?us-ascii?Q?R074oiITgCbLAmK9ufan8MfsPVpge3linMBNKeC8DHW0KDqoP64oDPS+gdbI?= =?us-ascii?Q?JCTYCikygKwFY9tm+XKEdibKsvRZKvTku6ZgKn8YXnSDUfx5JiVXkLUmFeJS?= =?us-ascii?Q?SMlzj6dcaqtK1hWlKBs1SNzv8/w0HcRWBcxjFrCGb+O5O7aaWVfl7Z898KF/?= =?us-ascii?Q?WGhBAbJUGWuhP6wL8ny5cJOGuFDNE2Ub+D+bogvYtqwzmxOOjCIO0f8dZY8e?= =?us-ascii?Q?w71IxNfFZbdghi4PqTphTfgMunk4LdOyfJqL8QHGbeg9cpZTzrUdFHzlstJA?= =?us-ascii?Q?ScVXwjdaoMnXvSVeWYLIvNIQtjbNyepeYIGjehyVhQOyzPFZfuXFfBQH6FMp?= =?us-ascii?Q?SLFzjE12SJxVwO790H/ZbRfckseNpeuuyVkS+hpp394KmPg3phGw2vE9xyKK?= =?us-ascii?Q?A5ceS/BXen0xoWrDktS9obWj0F4o27oWusbUuKm6yWqVli1GDmbSBg0hzEHf?= =?us-ascii?Q?pHFHUrqFZyNxP6RGmc45uj8YBM2HcsuC9seZyC6KVvcIkq0PyN0jhBg2Ry/4?= =?us-ascii?Q?bsz9oics5kzBpoZq6CjPSUV33JTkl2Pwg+nXKSXx7gSlh6YanuE2r863Ac4D?= =?us-ascii?Q?G+fy0TS/ccarGJOk4ZjsYFkFAUcpYeuLcBlio+b0h2UVYV0ZCjxCwRq47JvB?= =?us-ascii?Q?tW+w9+2XaPSobmw+qsH4m48eEx7iAU87YuMcgBqyELSZLY9jySpa2QtAeEZi?= =?us-ascii?Q?f9sM75esBsfBBiM0FQmWRPB/JlAflv1veWnJRuern4wO5ThLNOwPJXQKu/JQ?= =?us-ascii?Q?GE8HTFjxEQOE+8KlS9PngNiPHAN7E7vR32ATugFSHU59ynllbu7o9Ol6OBci?= =?us-ascii?Q?ydKVv2TDgUsE9ArrxeE9Erd4GkWb4ftwITwLalkaAAFjvEKeRDhLaZhWUPBR?= =?us-ascii?Q?qXAFqCphu9nrKRrkKh1XPpxp28BbjCppFuG3CrLf0dL5QEup47RtLtc+NXv1?= =?us-ascii?Q?s8YWUtG+7I6Kvq8UNZfXXzm+E+ytn4wFR8/kIwoK5vZVicmHTFwWvKOkuufz?= =?us-ascii?Q?57ad8q/za8c68dfCnRQDP/fP2XY3uK/NZBCn7tCb21FZfN1QnVgase2UZ41i?= =?us-ascii?Q?WnwlcfaWPeSL0L5SPX2oz9Pk3nAqeG6Rc0QZQRYckwdcP2g6O1SQ=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB316; 5:6HCEnP5BL/jTb9OaI+cZw66EDmyUezSN3SJlyiGNIjjfM8HboN8rzv120JtfJwAa+CsSYzyH2tAa6przU9m6rA1D2mWMHxwSXwgjxafnHGbi/yZLM8XF/GYQ009U+TDu3xOhjeyUcbwEIhq+WQqtsXnySChjLmlZeZSeosttPNs=; 24:rp0dt7GpM13EUiF3T/Fs7YPej4Q1L54P7j6dwh2ZBY7u7h5VYtPzC2iq33AAL2qW8qFgj2UfZ2a8TS2RYNqEaeeTXfJg1e2Tv2n4HwZhEp0= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Feb 2016 02:01:46.1246 (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.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR03MB316 X-Mailman-Approved-At: Tue, 16 Feb 2016 08:44:50 +0000 Cc: Meng Yi , Xiubo Li , Alison Wang , dri-devel@lists.freedesktop.org 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 v2 -Fixed conflict with Stefan's branch. http://git.agner.ch/gitweb/?p=linux-drm-fsl-dcu.git;a=summary --- .../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 | 271 +++++++++++++++++++++ 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, 351 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..7debbfb --- /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 = <1>; + 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..0b06060 --- /dev/null +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_hdmi.c @@ -0,0 +1,271 @@ +/* + * 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