Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754423AbdFNHUF (ORCPT ); Wed, 14 Jun 2017 03:20:05 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:43853 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751324AbdFNHUC (ORCPT ); Wed, 14 Jun 2017 03:20:02 -0400 X-AuditID: b6c32a39-f790c6d000000e85-d1-5940e3a0ee26 MIME-version: 1.0 Content-type: text/plain; charset="utf-8"; format="flowed" Subject: Re: [PATCH 2/3] drm/panel: Add support for s6e63j0x03 panel driver To: Andrzej Hajda , thierry.reding@gmail.com, airlied@linux.ie, robh+dt@kernel.org, mark.rutland@arm.com, catalin.marinas@arm.com, will.deacon@arm.com, kgene@kernel.org, krzk@kernel.org Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, javier@osg.samsung.com, inki.dae@samsung.com, Hyungwon Hwang , Hoegeun Kwon From: Hoegeun Kwon Message-id: Date: Wed, 14 Jun 2017 16:19:59 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 In-reply-to: <04f1d0f1-0010-d21a-1d02-e4e5f9440e56@samsung.com> Content-transfer-encoding: 8bit Content-language: en-US X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrOJsWRmVeSWpSXmKPExsWy7bCmru6Cxw6RBncOyVjcWneO1aL33Ekm i/fLehgt5h8Bcq98fc9m8X55F5vF0hl9rBaT7k9gsXjzdg2TRf/j18wW589vYLfY9Pgaq8Xl XXPYLGac38dksfT6RSaL1r1H2C1+7prHYvHy4wkWByGPNfPWMHrsnHWX3WPTqk42j+3fHrB6 3O8+zuSxeUm9x5Z+oHjfllWMHp83yQVwRqXaZKQmpqQWKaTmJeenZOal2yp5B8c7x5uaGRjq GlpamCsp5CXmptoquf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694j7BY/d81jsXj58QSLg5DHmnlrGD12zrrL7rFpVSebx/ZvD1g9 7ncfZ/LYvKTeY0s/ULxvyypGj8+b5AI4o9xsMlITU1KLFFLzkvNTMvPSbZVCQ9x0LZQU8hJz U22VInR9Q4KUFMoSc0qBPCMDNODgHOAerKRvl+CWce+le8F88YrZu8oaGOcKdTFyckgImEgs 3XSIBcIWk7hwbz1bFyMXh5DAakaJ08tfMoMkeAUEJX5MvgdWxCxgJvHl5WFWiKL7jBKN264C ORwcwgLeEjdmcoHERQQuMUr82fIfqmE9k8TJr2IQDX1MElOebWUCSbAJ6Ep87bnOBLHBTuLD vEdg21gEVCW23nvMDmKLCkRI7Lp+gBXE5hSwl7hzejsbxFB5iYNXnkMtEJdobr3JMoFRcBaS Y2chOXYWkpZZSFoWMLKsYuRKLSjOTc8tNiow3MQITAXbDmv572D8cTb6EKMAB6MSD++D9/aR QqyJZcWVuYcYJTiYlUR4Jc47RArxpiRWVqUW5ccXleakFh9iNAU6fSKzlGhyPjBN5ZXEG5pY GpkYmJkZGhkYmymJ804I/BIhJJCeWJKanZpakFoE08fEwSnVwLg+tU1OmTXDN/XCz4bna++E 3bQ77Tg5ovpy+EqdD3vM9qb9dFu5tOdfhuixd9kf3r6tW1bAXGUvZqTaOWsmi8Ph3a0GLsw8 PA61hw66Wevc3Hn0s72Yn2n49U6DPpuzjsIRvdvlxQW0lLdence0756pzJ0FeXYLun2LrjQ/ Xj2xZMr+807TSpVYijMSDbWYi4oTAegk6WIbAwAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170614072000epcas1p1ace20c1fed480321b267eeeb08e76206 X-Msg-Generator: CA X-Sender-IP: 182.195.42.79 X-Local-Sender: =?UTF-8?B?6raM7ZqM6re8G1RpemVuIFBsYXRmb3JtIExhYihTL1fshLw=?= =?UTF-8?B?7YSwKRvsgrzshLHsoITsnpAbRW5naW5lZXI=?= X-Global-Sender: =?UTF-8?B?SG9lZ2V1biBLd29uG1RpemVuIFBsYXRmb3JtIExhYi4bU2Ft?= =?UTF-8?B?c3VuZyBFbGVjdHJvbmljcxtFbmdpbmVlcg==?= X-Sender-Code: =?UTF-8?B?QzEwG1RFTEUbQzEwVjgxMTE=?= CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20170609045938epcas5p216c0ff705d60a32ee57ecb55de9233b5 X-RootMTR: 20170609045938epcas5p216c0ff705d60a32ee57ecb55de9233b5 References: <1496984354-5271-1-git-send-email-hoegeun.kwon@samsung.com> <1496984354-5271-3-git-send-email-hoegeun.kwon@samsung.com> <04f1d0f1-0010-d21a-1d02-e4e5f9440e56@samsung.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2876 Lines: 97 Hi Andrzej, Thanks for your review. On 06/12/2017 10:16 PM, Andrzej Hajda wrote: > Hi Hoegeun, > > Nice to see patches completing support for mainlined platforms. > > On 09.06.2017 06:59, Hoegeun Kwon wrote: >> This patch adds MIPI-DSI based S6E63J0X03 AMOLED LCD panel driver >> which uses mipi_dsi bus to communicate with panel. The panel has >> 320×320 resolution in 1.63" physical panel. This panel is used in >> Samsung Galaxy Gear 2. >> >> Signed-off-by: Inki Dae >> Signed-off-by: Hyungwon Hwang >> Signed-off-by: Hoegeun Kwon >> --- >> drivers/gpu/drm/panel/Kconfig | 7 + >> drivers/gpu/drm/panel/Makefile | 1 + >> drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c | 491 +++++++++++++++++++++++ >> 3 files changed, 499 insertions(+) >> create mode 100644 drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c >> >> ... >> + >> +static int s6e63j0x03_enable(struct drm_panel *panel) >> +{ >> + struct s6e63j0x03 *ctx = panel_to_s6e63j0x03(panel); >> + struct backlight_device *bl_dev = ctx->bl_dev; >> + u8 seq[] = { MIPI_DCS_SET_DISPLAY_ON }; >> + int ret; >> + >> + ret = s6e63j0x03_dcs_write_seq(ctx, seq, ARRAY_SIZE(seq)); >> + if (ret > 0) >> + bl_dev->props.power = FB_BLANK_UNBLANK; >> + >> + return 0; >> +} > For many (maybe most) panels power on sequence is as follows: > 0. Enable power supplies and gpios. > 1. Initialization, including MIPI_DCS_EXIT_SLEEP_MODE > 2. Wait for 120ms, to avoid display glitches. > 3. Unblanking and adjusting display, including MIPI_DCS_SET_DISPLAY_ON. > > And power-off: > 4. MIPI_DCS_SET_DISPLAY_OFF > 5. MIPI_DCS_ENTER_SLEEP_MODE > 6. Wait for 120ms > 7. Disable power supplies and gpios. > > I suppose waiting for 120ms is a good indicator what should be put into > prepare/enable/disable/unprepare phase. > In my opinion it should be as follows: > Prepare: 0, 1 > Enable: 2, 3 > Disable: 4,5,6 > Unprepare: 7 > > What do you think about it? > Could you arrange the code this way and test if it works correctly? > Maybe you/other developers have some opinions about it? I agree with you. I will send ver2 patch with the above style. And modify it to use as mipi_dsi_dcs_*. >> + >> +static const struct drm_display_mode default_mode = { >> + .clock = 4644, >> + .hdisplay = 320, >> + .hsync_start = 320 + 1, >> + .hsync_end = 320 + 1 + 1, >> + .htotal = 320 + 1 + 1 + 1, >> + .vdisplay = 320, >> + .vsync_start = 320 + 150, >> + .vsync_end = 320 + 150 + 1, >> + .vtotal = 320 + 150 + 1 + 2, >> + .vrefresh = 30, >> + .flags = 0, >> +}; > clock should be equal vtotal*htotal*vrefresh, it is little higher? what > is the reason? > What is actual refresh rate? The actual refresh rate is 30.43Hz So I will modfiy the clock Hz to 4649. ((323 * 473 )* 30.43) / 1000 = 4649 Best regards, Hoegeun