Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp208535ybd; Tue, 25 Jun 2019 19:56:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqx+XwPQhzxmf9KQWot+cSm+Eb5fLPhfW84Hpy3CXiJzcmfhbU20vQpl3q7OciJUGrj0pC0L X-Received: by 2002:a17:90a:2446:: with SMTP id h64mr1590301pje.0.1561517776336; Tue, 25 Jun 2019 19:56:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561517776; cv=none; d=google.com; s=arc-20160816; b=CqL5rZSmKlZbkVklYX3k/I0lHM3psd2O6LJINO7T7hS0urF6XpsG4ScrhBRM7u9bte eSVIJdwO3Da4Xlg1CX5DjxS7A9DsvM9GisSgPe+CxBvXyiuIvvmQ8VoSEs0DCfB1O0T6 zf1PilTCu+J8+cR0/+rCKDmpAxtS+bxP3ghVLlWlcU5Q/ck7UJLOlBXAbTVqViCNQc90 +2yFTfszTKs0maIAgotqiXr+4jx54Mo0unegDsR3meylefkylaB5TjRTNtMEQOKb9aE2 Ql+QXieixyQVZ7bM0MQltAJvaHdWE96dg4+H5vxffvgmnk/ssTYUjSJt96wysJvKNzxY 8sRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=/m2j9SCLSW6e6vJDOyV7+p2/RZZh2km8JV/gZYIaWUM=; b=eBT0PP2I/4QfmsUj1Fm1rpculp3EjemR+jBTtfhF6wzBoqr7Or+ByhpV7iBh3kF6+U Rw8sKkFJ19L5PB9ltytAeT54EPidYJ+P0K/Vieg5J/xQKih09QAiCcRmxvHSp7LX+Oss jDOdavZqgFCtvVAq9vHSkzc1BEVnGeMZMXGZebrxxFJSFLWU+eB1TJJyvlyKEUhcskYz xoq/r77bnl3F6nXBsPkpwhlMz72xFp41HxtAVCwBh53sTWdQs5qGxgFbC3IhOt48a+tC 6wsntyhiKUbSTrO1o4oEhanVOlzkKIthh+ezsDFeZkOkdrhavgB7rDyC7UFQVf6TK9Af UHhg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x10si13815333pfm.71.2019.06.25.19.56.00; Tue, 25 Jun 2019 19:56:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726725AbfFZCye (ORCPT + 99 others); Tue, 25 Jun 2019 22:54:34 -0400 Received: from mailgw02.mediatek.com ([1.203.163.81]:58011 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726369AbfFZCyd (ORCPT ); Tue, 25 Jun 2019 22:54:33 -0400 X-UUID: 64bf0259d5f24b26ae3ab6955a9b80fb-20190626 X-UUID: 64bf0259d5f24b26ae3ab6955a9b80fb-20190626 Received: from mtkcas32.mediatek.inc [(172.27.4.253)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 2013699147; Wed, 26 Jun 2019 10:54:19 +0800 Received: from MTKCAS32.mediatek.inc (172.27.4.184) by MTKMBS33N2.mediatek.inc (172.27.4.76) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 26 Jun 2019 10:54:18 +0800 Received: from mszsdclx1018.gcn.mediatek.inc (172.27.4.253) by MTKCAS32.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Wed, 26 Jun 2019 10:54:15 +0800 From: Jitao Shi To: Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , , David Airlie , Matthias Brugger CC: Jitao Shi , Thierry Reding , Ajay Kumar , Inki Dae , Rahul Sharma , Sean Paul , Vincent Palatin , Andy Yan , Philipp Zabel , Russell King , , , , , , , Sascha Hauer , , , , , , Subject: [v3 4/4] drm/panel: support for auo,kd101n80-45na wuxga dsi video mode panel Date: Wed, 26 Jun 2019 10:54:00 +0800 Message-ID: <20190626025400.109567-5-jitao.shi@mediatek.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190626025400.109567-1-jitao.shi@mediatek.com> References: <20190626025400.109567-1-jitao.shi@mediatek.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Auo,kd101n80-45na's connector is same as boe,tv101wum-nl6. The most codes can be reuse. So auo,kd101n80-45na and boe,tv101wum-nl6 use one driver file. Add the different parts in driver data. Signed-off-by: Jitao Shi --- .../gpu/drm/panel/panel-boe-tv101wum-nl6.c | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c index 30d1f53dcbaf..6ff49f900cd2 100644 --- a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c +++ b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c @@ -372,6 +372,15 @@ static const struct panel_init_cmd boe_init_cmd[] = { {}, }; +static const struct panel_init_cmd auo_init_cmd[] = { + _INIT_DELAY_CMD(24), + _INIT_DCS_CMD(0x11), + _INIT_DELAY_CMD(120), + _INIT_DCS_CMD(0x29), + _INIT_DELAY_CMD(120), + {}, +}; + static inline struct boe_panel *to_boe_panel(struct drm_panel *panel) { return container_of(panel, struct boe_panel, base); @@ -571,6 +580,33 @@ static const struct panel_desc boe_tv101wum_nl6_desc = { .init_cmds = boe_init_cmd, }; +static const struct drm_display_mode auo_default_mode = { + .clock = 157000, + .hdisplay = 1200, + .hsync_start = 1200 + 80, + .hsync_end = 1200 + 80 + 24, + .htotal = 1200 + 80 + 24 + 36, + .vdisplay = 1920, + .vsync_start = 1920 + 16, + .vsync_end = 1920 + 16 + 4, + .vtotal = 1920 + 16 + 4 + 16, + .vrefresh = 60, +}; + +static const struct panel_desc auo_kd101n80_45na_desc = { + .modes = &auo_default_mode, + .bpc = 8, + .size = { + .width = 135, + .height = 216, + }, + .lanes = 4, + .format = MIPI_DSI_FMT_RGB888, + .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE | + MIPI_DSI_MODE_LPM, + .init_cmds = auo_init_cmd, +}; + static int boe_panel_get_modes(struct drm_panel *panel) { struct boe_panel *boe = to_boe_panel(panel); @@ -694,6 +730,9 @@ static const struct of_device_id boe_of_match[] = { { .compatible = "boe,tv101wum-nl6", .data = &boe_tv101wum_nl6_desc }, + { .compatible = "auo,kd101n80-45na", + .data = &auo_kd101n80_45na_desc + }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, boe_of_match); -- 2.21.0