From patchwork Sat Nov 10 11:34:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shaik Ameer Basha X-Patchwork-Id: 1723601 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 1085BDFE7E for ; Sat, 10 Nov 2012 11:13:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751311Ab2KJLN2 (ORCPT ); Sat, 10 Nov 2012 06:13:28 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:36621 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751267Ab2KJLN0 (ORCPT ); Sat, 10 Nov 2012 06:13:26 -0500 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MD900CM8R69HT60@mailout1.samsung.com> for linux-fbdev@vger.kernel.org; Sat, 10 Nov 2012 20:13:24 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.125]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 49.07.12699.4D63E905; Sat, 10 Nov 2012 20:13:24 +0900 (KST) X-AuditID: cbfee61b-b7f616d00000319b-e5-509e36d4472f Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 98.07.12699.4D63E905; Sat, 10 Nov 2012 20:13:24 +0900 (KST) Received: from localhost.localdomain ([107.108.73.106]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MD90003RR60HY40@mmp2.samsung.com> for linux-fbdev@vger.kernel.org; Sat, 10 Nov 2012 20:13:24 +0900 (KST) From: Shaik Ameer Basha To: linux-fbdev@vger.kernel.org Cc: inki.dae@samsung.com, dh09.lee@samsung.com, FlorianSchandinat@gmx.de, s.nawrocki@samsung.com, kgene.kim@samsung.com Subject: [PATCH 2/2] video: exynos-mipi-dsi: Adding DT support to exynos mipi driver Date: Sat, 10 Nov 2012 17:04:45 +0530 Message-id: <1352547285-12302-3-git-send-email-shaik.ameer@samsung.com> X-Mailer: git-send-email 1.7.0.4 In-reply-to: <1352547285-12302-1-git-send-email-shaik.ameer@samsung.com> References: <1352547285-12302-1-git-send-email-shaik.ameer@samsung.com> DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrLLMWRmVeSWpSXmKPExsWyRsSkVveK2bwAg97tZhYn+j6wOjB6fN4k F8AYxWWTkpqTWZZapG+XwJWxd+FCloIZbxgrpv+fwNLAuP8QYxcjJ4eEgInEt43vmCFsMYkL 99azdTFycQgJLGWUOPX9JBtM0eKpz6ES0xklZl7ewgzhLGeS2LfvAStIFZuAocT2e1fAbBEB eYk9/e1MIDazQKXE/QWfwCYJC4RJbLp5Dmw1i4CqxNIFL8BsXgF3iTfnH7NCbFOQaF12iB3E 5hTwkPgyaxuQzQG0zF3i0wV7iFYBiW+TD7GAhCUEZCU2HQA7R0LgMpvEvAdNUEdLShxccYNl AqPwAkaGVYyiqQXJBcVJ6blGesWJucWleel6yfm5mxiBYXj63zPpHYyrGiwOMQpwMCrx8DL5 zQ0QYk0sK67MPcQowcGsJMIbpj0vQIg3JbGyKrUoP76oNCe1+BCjD9AlE5mlRJPzgTGSVxJv aGxibmpsamlkZGZqikNYSZy32SMlQEggPbEkNTs1tSC1CGYcEwenVAMjS7+zw9sUTqcnjYFq 5Q2/zRfblIfG3k1d1qr6sZnx+Cfdr9Yn/++KW2ibu0RJQ0dWSNQtUI39/+ym6TE3v0pGnW0Q Slv4ZP+LauuvU7xPc4ZZH2Pfb7zzyMvIw0enzS9a7CL/R9Hj8CnpBeq6KSkW0wUMl/34wmp/ 7KddgPttwafLzzrb5MoosRRnJBpqMRcVJwIAzg02DnACAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuphkeLIzCtJLcpLzFFi42I5/e+xoO4Vs3kBBtNmiVmc6PvA6sDo8XmT XABjVAOjTUZqYkpqkUJqXnJ+SmZeuq2Sd3C8c7ypmYGhrqGlhbmSQl5ibqqtkotPgK5bZg7Q VCWFssScUqBQQGJxsZK+HaYJoSFuuhYwjRG6viFBcD1GBmggYQ1jxt6FC1kKZrxhrJj+fwJL A+P+Q4xdjJwcEgImEounPmeDsMUkLtxbD2RzcQgJTGeUmHl5CzOEs5xJYt++B6wgVWwChhLb 710Bs0UE5CX29LczgdjMApUS9xd8ApskLBAmsenmObANLAKqEksXvACzeQXcJd6cf8wKsU1B onXZIXYQm1PAQ+LLrG1ANgfQMneJTxfsJzDyLmBkWMUomlqQXFCclJ5rpFecmFtcmpeul5yf u4kRHOTPpHcwrmqwOMQowMGoxMPL5Dc3QIg1say4MvcQowQHs5IIb5j2vAAh3pTEyqrUovz4 otKc1OJDjD5AR01klhJNzgdGYF5JvKGxibmpsamliYWJmSUOYSVx3maPlAAhgfTEktTs1NSC 1CKYcUwcnFLAOJ52+cDkuiy75vq3U//ssfry5/rJkpDiV0oGxffn+wUnSPxucXs/hdM5I1na Qvn0g9cs5lf2lLIpzn82S9SN01i7aabbb56i35W8YssYPiwXulDLvO1FgsQL9v2+KXPXCfVc +Hu01eeIZdG8nLycg9xyTzyWmE5ev+jBmnkrskU3W07Psok7rMRSnJFoqMVcVJwIANpZSCef AgAA X-CFilter-Loop: Reflected Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org This patch adds the DT support for the exynos mipi-dsi driver. for DT support mipi device node should supply the following information to the mipi-dsi driver. 1] dsim_config information 2] d-phy setting information 3] lcd poweron, reset information 4] fb_videomode information Change-Id: I93005636a7825b0c5ef4832dd17a2809d0aeda1d Signed-off-by: Shaik Ameer Basha --- .../devicetree/bindings/video/exynos/mipi-dsi.txt | 185 +++++++ drivers/video/exynos/exynos_mipi_dsi.c | 573 +++++++++++++++++++- include/video/exynos_mipi_dsim.h | 27 + 3 files changed, 765 insertions(+), 20 deletions(-) create mode 100644 Documentation/devicetree/bindings/video/exynos/mipi-dsi.txt diff --git a/Documentation/devicetree/bindings/video/exynos/mipi-dsi.txt b/Documentation/devicetree/bindings/video/exynos/mipi-dsi.txt new file mode 100644 index 0000000..6445eac --- /dev/null +++ b/Documentation/devicetree/bindings/video/exynos/mipi-dsi.txt @@ -0,0 +1,185 @@ +* Samsung Exynos MIPI-DSI bindings + +Properties for MIPI-DSI node :: +=============================== +- compatible: should be "samsung,exynos5-mipi" + +- reg: should contain mipi-dsi physical address location and length. + +- interrupts: should contain mipi-dsi interrupt number + +- enabled: Describes whether MIPI DSI got enabled in uboot + +- mipi-lcd: phandle to lcd specific information. It can be anything + specific to lcd driver. + +- mipi-phy: phandle to D-PHY node. + +- mipi-config: subnode for mipi config information + - auto_flush: enable or disable Auto flush of MD FIFO using VSYNC pulse + - eot_disable: enable or disable EoT packet in HS mode + - auto_vertical_cnt: specifies auto vertical count mode. + In Video mode, the vertical line transition uses line counter + configured by VSA, VBP, and Vertical resolution. If this bit is + set to '1', the line counter does not use VSA and VBP registers. + In command mode, this property is ignored. + - hse: set horizontal sync event mode. + In VSYNC pulse and Vporch area, MIPI DSI master transfers only + HSYNC start packet to MIPI DSI slave at MIPI DSI spec1.1r02. + This bit transfers HSYNC end packet in VSYNC pulse and Vporch + area. In command mode, this property is ignored. + - hfp: specifies HFP disable mode. + If this property is set, DSI master ignores HFP area in + VIDEO mode. In command mode, this property is ignored. + - hbp: specifies HBP disable mode. + If this property is set, DSI master ignores HBP area in + VIDEO mode. In command mode, this property is ignored. + - hsa: specifies HSA disable mode. + If this property is set, DSI master ignores HSA area in + VIDEO mode. In command mode, this property is ignored. + - cmd_allow: specifies the number of horizontal lines, where command + packet transmission is allowed after Stable VFP period. + - e_interface: specifies interface to be used.(CPU or RGB interface) + - e_virtual_ch: specifies virtual channel number that main or + sub display uses. + - e_pixel_format: specifies pixel stream format for main or sub display. + - e_burst_mode: selects Burst mode in Video mode. + In Non-burst mode, RGB data area is filled with RGB data + and NULL packets, according to input bandwidth of RGB interface. + In Burst mode, RGB data area is filled with RGB data only. + - e_no_data_lane: specifies data lane count to be used by Master. + - e_byte_clk: select byte clock source. (it must be DSIM_PLL_OUT_DIV8) + DSIM_EXT_CLK_DIV8 and DSIM_EXT_CLK_BYPASSS are not supported. + - pll_stable_time: specifies the PLL Timer for stability of the + generated clock(System clock cycle base). If the timer value + goes to 0x00000000, the clock stable bit of status and interrupt + register is set. + - esc_clk: specifies escape clock frequency for getting the escape clock + prescaler value. + - stop_holding_cnt: specifies the interval value between transmitting + read packet(or write "set_tear_on" command) and BTA request. + after transmitting read packet or write "set_tear_on" command, + BTA requests to D-PHY automatically. this counter value + specifies the interval between them. + - bta_timeout: specifies the timer for BTA. + this register specifies time out from BTA request to change + the direction with respect to Tx escape clock. + - rx_timeout: specifies the timer for LP Rx mode timeout. + this register specifies time out on how long RxValid deasserts, + after RxLpdt asserts with respect to Tx escape clock. + - RxValid specifies Rx data valid indicator. + - RxLpdt specifies an indicator that D-PHY is under RxLpdt mode. + - RxValid and RxLpdt specifies signal from D-PHY. + +- display-mode: timing and resolution information of the panel used. As per + current exynos mipi-dsi driver need, only some fields from + struct fb_videomode are defined in this node. + - xres: horizontal resolution (active frame width) + - yres: vertical resolution (active frame height). + - left_margin: Horizontal Back Porch (Number of PIXCLK pulses between + HSYNC signal and the first valid pixel data. + - right_margin: Horizontal Front Porch (Number of PIXCLK between + last valid pixel data in the line and the next HSYNC pulse). + - upper_margin: Vertical Back Porch (Number of lines (HSYNC pulses) + from when a VSYNC signal is asserted and the first valid line). + - lower_margin: Vertical Front Porch (Number of lines (HSYNC pulses) + between last valid line of the frame and the next VSYNC Pulse). + - hsync_len: Hsync pulse width (Number of PIXCLK pulses when a HSYNC + signal is active). + - vsync_len: Vsync pulse width (Number of HSYNC pulses when a VSYNC + signal is active). + +Properties for D-PHY node :: +============================= + Instead of passing D-PHY related callbacks as part of platform data, +we can pass the phy nodes to the mipi driver. Depending on the type of PHY +settings, we can implement multiple PHY node types and corresponding +enable/disable/reset callbacks in the driver itself. Currently we support +only one type of PHY node. + +D-PHY node type1: +------------------ +- compatible: "samsung,exynos-mipi-phy-type1" +- reg_enable_dphy: should contain physical address location of + D-PHY enable register +- mask_enable_dphy: should contain the mask for D-PHY enable register +- reg_reset_dsim: should contain physical address location of + D-PHY DSIM reset register +- mask_reset_dsim: should contain the mask for D-PHY DSIM reset register + +MIPI-LCD node :: +================= + Apart from the following three properties, driver specific +properties can be sent through this node. The following example sends +some more properties for driver's use. + +- lcd-name: name of the device to use with this device +- id: id of device to be registered (default -1 in case not specified) +- bus-id: bus id for identifing connected bus and this bus id should be + same as id of mipi_dsim_device (default -1 incase not specified) + +Example: +-------- + mipi_lcd: mipi-lcd@toshiba { + lcd-name = "tc358764"; + id = <0>; + enabled = <1>; + reset-delay = <120>; + power-on-delay = <25>; + power-off-delay = <200>; + gpio-poweron = <&gpx1 5 0 0 0>; + }; + + mipi_dsim_phy: mipi-phy@exynos5250 { + compatible = "samsung-exynos,mipi-phy-type1"; + reg_enable_dphy = <0x10040714>; + mask_enable_dphy = <0x00000001>; + reg_reset_dsim = <0x10040714>; + mask_reset_dsim = <0x00000004>; + }; + + mipi { + compatible = "samsung,exynos-mipi"; + reg = <0x14500000 0x10000>; + interrupts = <0 82 0>; + + mipi-lcd = <&mipi_lcd>; + mipi-phy = <&mipi_dsim_phy>; + enabled = <0>; + + mipi-config { + e_interface = <1>; + e_pixel_format = <7>; + auto_flush = <0>; + eot_disable = <0>; + auto_vertical_cnt = <0>; + hse = <0>; + hfp = <0>; + hbp = <0>; + hsa = <0>; + e_no_data_lane = <3>; + e_byte_clk = <0>; + e_burst_mode = <3>; + p = <3>; + m = <115>; + s = <1>; + pll_stable_time = <500>; + esc_clk = <400000>; + stop_holding_cnt =<0x0f>; + bta_timeout = <0xff>; + rx_timeout = <0xffff>; + e_virtual_ch = <0>; + cmd_allow = <0xf>; + }; + + panel-info { + left_margin = <0x4>; + right_margin = <0x4>; + upper_margin = <0x4>; + lower_margin = <0x4>; + hsync_len = <0x4>; + vsync_len = <0x4>; + xres = <1280>; + yres = <800>; + }; + }; diff --git a/drivers/video/exynos/exynos_mipi_dsi.c b/drivers/video/exynos/exynos_mipi_dsi.c index ae20bc3..667857b 100755 --- a/drivers/video/exynos/exynos_mipi_dsi.c +++ b/drivers/video/exynos/exynos_mipi_dsi.c @@ -32,6 +32,7 @@ #include #include #include +#include #include