Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2153220ybd; Mon, 24 Jun 2019 01:32:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqxiSfZucCSwgGeaoX0qWInp6LCK9HfEdyu+Yf/ZrsFJqFT65ks741sYu3XXnBnafMB137Vg X-Received: by 2002:a65:6686:: with SMTP id b6mr31829123pgw.125.1561365135708; Mon, 24 Jun 2019 01:32:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561365135; cv=none; d=google.com; s=arc-20160816; b=xWKHL5vwYu4SJRMUS2xkBd9jz17FxIEldP8GQNRBjdhp6GHhviWM+GZKKgKJw5CypP Xjv9FnV8DeU2RAebeIs0yxYeEugS8BoSds4jy/rdU+cIe8Kyi9Fc8OSMq0dVZgaX9ieJ RpPvWCk/PP5K6u+f1XXVxfZFU5XxInFDE5FmZI8mKTTz1oYfzJOb35b6W2pJM737DoDX LmWo2C4QpDAg8uaBpVXGBuEQaU5K5H+B+XGCzq25HuZ3XgXTH5cxRPnSUSuyDPACdFSb sEUJDyDmzjhnG1D4K3pglu/0Xkws4Rtn4NvV/LvYw78K1twM4ANbWZ/IycSD1vO9YN+P i+hw== 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=7E/0ZpZZcsuQ29KA7bgdiUtP3MxRnPIQj3PqVXr4ghk=; b=0h05uePiCljl/ntJz9ZnXwMkVSWla7n4ziByxBaUuWOGZSzgVMI4rs1kO2GCYJjKHo eSTgd3mnrAFKxbBj6H2CH16K5qfRwSFzczG9rLQGjpFQR04s254PGP3NtcJNlDRA7TpK a6M4TTzkx08Z4fL1hY7B1z5DfulQ+rzkm3L51OBER2I5Q/U6h3tfLOiaIf97dVjsHpIm 4FUaxOQUxcirPPe/uXJW0xK4znDvB4+DmkPWmAWC3rTLpBP+qxhMoR2XgJkwbziVIbLS BzozbOTMX01EJV+eRqyJYTx0WPpAWEBQPkZkP33lWZjGjGZO/Y16Z3p4pDRNCK8507c6 exdw== 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 s5si10085359plq.140.2019.06.24.01.31.59; Mon, 24 Jun 2019 01:32:15 -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 S1728119AbfFXIAn (ORCPT + 99 others); Mon, 24 Jun 2019 04:00:43 -0400 Received: from Mailgw01.mediatek.com ([1.203.163.78]:33938 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727243AbfFXIAm (ORCPT ); Mon, 24 Jun 2019 04:00:42 -0400 X-UUID: 38754436abf2429f8da264e9d1e305fd-20190624 X-UUID: 38754436abf2429f8da264e9d1e305fd-20190624 Received: from mtkcas34.mediatek.inc [(172.27.4.253)] by mailgw01.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 664715075; Mon, 24 Jun 2019 16:00:32 +0800 Received: from MTKCAS36.mediatek.inc (172.27.4.186) by MTKMBS33N2.mediatek.inc (172.27.4.76) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 24 Jun 2019 16:00:31 +0800 Received: from mszsdclx1018.gcn.mediatek.inc (172.27.4.253) by MTKCAS36.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Mon, 24 Jun 2019 16:00:28 +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: [v2 2/2] drm/panel: support for auo,kd101n80-45na wuxga dsi video mode panel Date: Mon, 24 Jun 2019 16:00:01 +0800 Message-ID: <20190624080001.67222-3-jitao.shi@mediatek.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190624080001.67222-1-jitao.shi@mediatek.com> References: <20190624080001.67222-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 | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c index 6e06c8506623..d1ee43cfcbe2 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); @@ -572,6 +581,34 @@ 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, + .type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED, +}; + +static const struct panel_desc auo_kd101n80_45na_desc = { + .modes = &auo_default_mode, + .bpc = 8, + .size = { + .width = 216, + .height = 135, + }, + .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); @@ -695,6 +732,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