From patchwork Sat Oct 16 10:22:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Nazzareno Trimarchi X-Patchwork-Id: 12563535 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 62A3EC433FE for ; Sat, 16 Oct 2021 10:22:45 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3699860F9D for ; Sat, 16 Oct 2021 10:22:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3699860F9D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 98BC86E42E; Sat, 16 Oct 2021 10:22:38 +0000 (UTC) Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by gabe.freedesktop.org (Postfix) with ESMTPS id 952C56E429 for ; Sat, 16 Oct 2021 10:22:37 +0000 (UTC) Received: by mail-ed1-x535.google.com with SMTP id g10so48457569edj.1 for ; Sat, 16 Oct 2021 03:22:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=k6lg1YXQcsQSaHtESENC7NuGsQBvloHafjyXCeclFK4=; b=cZe7t7ecRSVFyGK6rU8otT3u8PVOITqJIX4Q8vpIBzXn17/WMj8MGdaNGNZcpAhqF/ TmlJAXSSUSkfPl5wCZNYTcXQmfh0i1Y6YPJXdz5qScCmSi9oP/KDnKSnD8S479xJ6C2x LosDWN4CvbEUZaYo0kufzUiQxs3Blt8WQAqAc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=k6lg1YXQcsQSaHtESENC7NuGsQBvloHafjyXCeclFK4=; b=dgVsXqSOd+biPF27HDCZ4kawEeFga4c6VYO3dq0cKvUrXyPYz+JPsC5nve571vEwfa Sn0Lb+DShxtMZ88l1ieHYTVMQSN9W3y5AzmlQoMHeOsDOCTHE5qhXU6L+2pMXO9tLWL3 z6gFyz/dXHHhLO2CJGZNO2m3KNyWVejcTpklxO6mKAK+Y9T3mpZ3kgYFeFM9WCy02H0v PI0fS1BMidM5UdRlrkumF/v+oG5TsYyErc1Q9JL6anE6RdpdGCh657lrio1+Lhvq8DKj RpzcmvzGNwj9NA5khz1F/8KJMJ+HDLw3igOTqOhyaULVzre5xx4qv69Cra1a53NgVwCa vCbQ== X-Gm-Message-State: AOAM5305RDRtVGLNrjiyNpaflitIyTA0mvzRWc6ViaF83NaTsVTWA4Ak YvR5UXCP3YCsQx8T9HkxekExkA== X-Google-Smtp-Source: ABdhPJwYr2Usdx2fRzfvE8x6T5AzkhCgdaiWSMcYlqVDwgsemSvZ7/5rzDYKZhxXYIbK96KEblxmUg== X-Received: by 2002:a17:906:5212:: with SMTP id g18mr13775067ejm.564.1634379755998; Sat, 16 Oct 2021 03:22:35 -0700 (PDT) Received: from panicking.lan (93-46-124-24.ip107.fastwebnet.it. [93.46.124.24]) by smtp.gmail.com with ESMTPSA id la1sm6117361ejc.48.2021.10.16.03.22.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Oct 2021 03:22:35 -0700 (PDT) From: Michael Trimarchi To: Thierry Reding , Sam Ravnborg , David Airlie , Laurent Pinchart , Rob Herring , =?utf-8?q?Heiko_St=C3=BCbner?= Cc: devicetree@vger.kernel.org, Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/5] dt-bindings: vendor-prefix: add Wanchanglong Electronics Technology Date: Sat, 16 Oct 2021 10:22:28 +0000 Message-Id: <20211016102232.202119-2-michael@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211016102232.202119-1-michael@amarulasolutions.com> References: <20211016102232.202119-1-michael@amarulasolutions.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 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" Wanchanglong Electronics Technology is a company to provide LCD modules. Signed-off-by: Michael Trimarchi --- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml index a867f7102c35..5c43391d8c3d 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml @@ -1304,6 +1304,8 @@ patternProperties: description: Wondermedia Technologies, Inc. "^wobo,.*": description: Wobo + "^wanchanglong,.*": + description: Wanchanglong Electronics Technology(SHENZHEN)Co.,Ltd. "^x-powers,.*": description: X-Powers "^xes,.*": From patchwork Sat Oct 16 10:22:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Nazzareno Trimarchi X-Patchwork-Id: 12563537 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0BA1C433F5 for ; Sat, 16 Oct 2021 10:22:48 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B23D260F9D for ; Sat, 16 Oct 2021 10:22:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B23D260F9D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CC8766E431; Sat, 16 Oct 2021 10:22:39 +0000 (UTC) Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by gabe.freedesktop.org (Postfix) with ESMTPS id 145E86E431 for ; Sat, 16 Oct 2021 10:22:39 +0000 (UTC) Received: by mail-ed1-x533.google.com with SMTP id d9so48079675edh.5 for ; Sat, 16 Oct 2021 03:22:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TOmpy4NRsL7YBTrF+WylGCQIQbJLF+1nonIibjI7sao=; b=L0R72lACDyIrElOSQEx1yNWncnTHX4W+bRg2YsBaX0Bl9laj21aG3SLwz/aqbT9sdZ PBHGCmUPWY42/cf6zTnCYyE8ge+fPC/d9bqILGfCtqV8xCDRpYIq+i6XJe+bLSILOtST vg/RvAVy+JnL+yksIIYjtL1oAmxXfMrPvxW8k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TOmpy4NRsL7YBTrF+WylGCQIQbJLF+1nonIibjI7sao=; b=LDny/cHI02VdKDhd/j2MJ3HHGrBk89Zc1zFrGfoXjtU0/xLKQAwSKjDwqjIbOQsP/y /AOKodDxGDVTM4YpazrB8xqVij+IwTDPdrtjK3eq/Cq4dbDkdkZdNjQyVYnD5A3gopOl iO3cSydmsLkfZBX4aWRuvGUIWwdfe7GGH/f54G6Fuhb/jBS9SSfIBGE4ZZPwg1kLaRXD JOVNMZfM3GqSz8OyyLoOVWhxGdxvrXbtWbitlemYVL3PNJm9frC5t3+7kQho8wzN+Bst 6Om9P+RV/scpEPMDjPkNjNsfBcxRPmipWFkpGeEAp+qoT5K7ifGCjWa96Z8fphdVDmtD UWfg== X-Gm-Message-State: AOAM533rFZbl82TOCOAblME8TuKuHsv1Z0o9rMMt5yLWR3i+rBYGZyn7 JPVRvuxo2pip5eBtp80YTTbpoQ== X-Google-Smtp-Source: ABdhPJxscYgap4r49H136i1b/1lIJKmVp7yW8CV076NAEL8vz2YkdB3hn/8i+XZNo9adXbrDQcmRJw== X-Received: by 2002:a05:6402:50d4:: with SMTP id h20mr24829965edb.112.1634379757427; Sat, 16 Oct 2021 03:22:37 -0700 (PDT) Received: from panicking.lan (93-46-124-24.ip107.fastwebnet.it. [93.46.124.24]) by smtp.gmail.com with ESMTPSA id la1sm6117361ejc.48.2021.10.16.03.22.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Oct 2021 03:22:36 -0700 (PDT) From: Michael Trimarchi To: Thierry Reding , Sam Ravnborg , David Airlie , Laurent Pinchart , Rob Herring , =?utf-8?q?Heiko_St=C3=BCbner?= Cc: devicetree@vger.kernel.org, Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/5] drm/panel: ilitek-ili9881d: add support for Wanchanglong W552946ABA panel Date: Sat, 16 Oct 2021 10:22:29 +0000 Message-Id: <20211016102232.202119-3-michael@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211016102232.202119-1-michael@amarulasolutions.com> References: <20211016102232.202119-1-michael@amarulasolutions.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 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" W552946ABA is a panel by Wanchanglong. This panel utilizes the Ilitek ILI9881D controller. Add this panel's initialzation sequence and timing to ILI9881D driver. Tested on px30-evb v11 Signed-off-by: Michael Trimarchi --- drivers/gpu/drm/panel/panel-ilitek-ili9881c.c | 238 +++++++++++++++++- 1 file changed, 237 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c index 0145129d7c66..d1f20758ed08 100644 --- a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c @@ -42,6 +42,7 @@ struct ili9881c_desc { const struct ili9881c_instr *init; const size_t init_length; const struct drm_display_mode *mode; + const unsigned long mode_flags; }; struct ili9881c { @@ -453,6 +454,213 @@ static const struct ili9881c_instr k101_im2byl02_init[] = { ILI9881C_COMMAND_INSTR(0xD3, 0x3F), /* VN0 */ }; +static const struct ili9881c_instr w552946ab_init[] = { + ILI9881C_SWITCH_PAGE_INSTR(3), + ILI9881C_COMMAND_INSTR(0x01, 0x00), + ILI9881C_COMMAND_INSTR(0x02, 0x00), + ILI9881C_COMMAND_INSTR(0x03, 0x53), + ILI9881C_COMMAND_INSTR(0x04, 0x53), + ILI9881C_COMMAND_INSTR(0x05, 0x13), + ILI9881C_COMMAND_INSTR(0x06, 0x04), + ILI9881C_COMMAND_INSTR(0x07, 0x02), + ILI9881C_COMMAND_INSTR(0x08, 0x02), + ILI9881C_COMMAND_INSTR(0x09, 0x00), + ILI9881C_COMMAND_INSTR(0x0A, 0x00), + ILI9881C_COMMAND_INSTR(0x0B, 0x00), + ILI9881C_COMMAND_INSTR(0x0C, 0x00), + ILI9881C_COMMAND_INSTR(0x0D, 0x00), + ILI9881C_COMMAND_INSTR(0x0E, 0x00), + ILI9881C_COMMAND_INSTR(0x0F, 0x00), + + ILI9881C_COMMAND_INSTR(0x10, 0x00), + ILI9881C_COMMAND_INSTR(0x11, 0x00), + ILI9881C_COMMAND_INSTR(0x12, 0x00), + ILI9881C_COMMAND_INSTR(0x13, 0x00), + ILI9881C_COMMAND_INSTR(0x14, 0x00), + ILI9881C_COMMAND_INSTR(0x15, 0x08), + ILI9881C_COMMAND_INSTR(0x16, 0x10), + ILI9881C_COMMAND_INSTR(0x17, 0x00), + ILI9881C_COMMAND_INSTR(0x18, 0x08), + ILI9881C_COMMAND_INSTR(0x19, 0x00), + ILI9881C_COMMAND_INSTR(0x1A, 0x00), + ILI9881C_COMMAND_INSTR(0x1B, 0x00), + ILI9881C_COMMAND_INSTR(0x1C, 0x00), + ILI9881C_COMMAND_INSTR(0x1D, 0x00), + ILI9881C_COMMAND_INSTR(0x1E, 0xC0), + ILI9881C_COMMAND_INSTR(0x1F, 0x80), + + ILI9881C_COMMAND_INSTR(0x20, 0x02), + ILI9881C_COMMAND_INSTR(0x21, 0x09), + ILI9881C_COMMAND_INSTR(0x22, 0x00), + ILI9881C_COMMAND_INSTR(0x23, 0x00), + ILI9881C_COMMAND_INSTR(0x24, 0x00), + ILI9881C_COMMAND_INSTR(0x25, 0x00), + ILI9881C_COMMAND_INSTR(0x26, 0x00), + ILI9881C_COMMAND_INSTR(0x27, 0x00), + ILI9881C_COMMAND_INSTR(0x28, 0x55), + ILI9881C_COMMAND_INSTR(0x29, 0x03), + ILI9881C_COMMAND_INSTR(0x2A, 0x00), + ILI9881C_COMMAND_INSTR(0x2B, 0x00), + ILI9881C_COMMAND_INSTR(0x2C, 0x00), + ILI9881C_COMMAND_INSTR(0x2D, 0x00), + ILI9881C_COMMAND_INSTR(0x2E, 0x00), + ILI9881C_COMMAND_INSTR(0x2F, 0x00), + + ILI9881C_COMMAND_INSTR(0x30, 0x00), + ILI9881C_COMMAND_INSTR(0x31, 0x00), + ILI9881C_COMMAND_INSTR(0x32, 0x00), + ILI9881C_COMMAND_INSTR(0x33, 0x00), + ILI9881C_COMMAND_INSTR(0x34, 0x04), + ILI9881C_COMMAND_INSTR(0x35, 0x05), + ILI9881C_COMMAND_INSTR(0x36, 0x05), + ILI9881C_COMMAND_INSTR(0x37, 0x00), + ILI9881C_COMMAND_INSTR(0x38, 0x3C), + ILI9881C_COMMAND_INSTR(0x39, 0x35), + ILI9881C_COMMAND_INSTR(0x3A, 0x00), + ILI9881C_COMMAND_INSTR(0x3B, 0x40), + ILI9881C_COMMAND_INSTR(0x3C, 0x00), + ILI9881C_COMMAND_INSTR(0x3D, 0x00), + ILI9881C_COMMAND_INSTR(0x3E, 0x00), + ILI9881C_COMMAND_INSTR(0x3F, 0x00), + + ILI9881C_COMMAND_INSTR(0x40, 0x00), + ILI9881C_COMMAND_INSTR(0x41, 0x88), + ILI9881C_COMMAND_INSTR(0x42, 0x00), + ILI9881C_COMMAND_INSTR(0x43, 0x00), + ILI9881C_COMMAND_INSTR(0x44, 0x1F), + + ILI9881C_COMMAND_INSTR(0x50, 0x01), + ILI9881C_COMMAND_INSTR(0x51, 0x23), + ILI9881C_COMMAND_INSTR(0x52, 0x45), + ILI9881C_COMMAND_INSTR(0x53, 0x67), + ILI9881C_COMMAND_INSTR(0x54, 0x89), + ILI9881C_COMMAND_INSTR(0x55, 0xaB), + ILI9881C_COMMAND_INSTR(0x56, 0x01), + ILI9881C_COMMAND_INSTR(0x57, 0x23), + ILI9881C_COMMAND_INSTR(0x58, 0x45), + ILI9881C_COMMAND_INSTR(0x59, 0x67), + ILI9881C_COMMAND_INSTR(0x5A, 0x89), + ILI9881C_COMMAND_INSTR(0x5B, 0xAB), + ILI9881C_COMMAND_INSTR(0x5C, 0xCD), + ILI9881C_COMMAND_INSTR(0x5D, 0xEF), + ILI9881C_COMMAND_INSTR(0x5E, 0x03), + ILI9881C_COMMAND_INSTR(0x5F, 0x14), + + ILI9881C_COMMAND_INSTR(0x60, 0x15), + ILI9881C_COMMAND_INSTR(0x61, 0x0C), + ILI9881C_COMMAND_INSTR(0x62, 0x0D), + ILI9881C_COMMAND_INSTR(0x63, 0x0E), + ILI9881C_COMMAND_INSTR(0x64, 0x0F), + ILI9881C_COMMAND_INSTR(0x65, 0x10), + ILI9881C_COMMAND_INSTR(0x66, 0x11), + ILI9881C_COMMAND_INSTR(0x67, 0x08), + ILI9881C_COMMAND_INSTR(0x68, 0x02), + ILI9881C_COMMAND_INSTR(0x69, 0x0A), + ILI9881C_COMMAND_INSTR(0x6A, 0x02), + ILI9881C_COMMAND_INSTR(0x6B, 0x02), + ILI9881C_COMMAND_INSTR(0x6C, 0x02), + ILI9881C_COMMAND_INSTR(0x6D, 0x02), + ILI9881C_COMMAND_INSTR(0x6E, 0x02), + ILI9881C_COMMAND_INSTR(0x6F, 0x02), + + ILI9881C_COMMAND_INSTR(0x70, 0x02), + ILI9881C_COMMAND_INSTR(0x71, 0x02), + ILI9881C_COMMAND_INSTR(0x72, 0x06), + ILI9881C_COMMAND_INSTR(0x73, 0x02), + ILI9881C_COMMAND_INSTR(0x74, 0x02), + ILI9881C_COMMAND_INSTR(0x75, 0x14), + ILI9881C_COMMAND_INSTR(0x76, 0x15), + ILI9881C_COMMAND_INSTR(0x77, 0x0F), + ILI9881C_COMMAND_INSTR(0x78, 0x0E), + ILI9881C_COMMAND_INSTR(0x79, 0x0D), + ILI9881C_COMMAND_INSTR(0x7A, 0x0C), + ILI9881C_COMMAND_INSTR(0x7B, 0x11), + ILI9881C_COMMAND_INSTR(0x7C, 0x10), + ILI9881C_COMMAND_INSTR(0x7D, 0x06), + ILI9881C_COMMAND_INSTR(0x7E, 0x02), + ILI9881C_COMMAND_INSTR(0x7F, 0x0A), + + ILI9881C_COMMAND_INSTR(0x80, 0x02), + ILI9881C_COMMAND_INSTR(0x81, 0x02), + ILI9881C_COMMAND_INSTR(0x82, 0x02), + ILI9881C_COMMAND_INSTR(0x83, 0x02), + ILI9881C_COMMAND_INSTR(0x84, 0x02), + ILI9881C_COMMAND_INSTR(0x85, 0x02), + ILI9881C_COMMAND_INSTR(0x86, 0x02), + ILI9881C_COMMAND_INSTR(0x87, 0x02), + ILI9881C_COMMAND_INSTR(0x88, 0x08), + ILI9881C_COMMAND_INSTR(0x89, 0x02), + ILI9881C_COMMAND_INSTR(0x8A, 0x02), + + ILI9881C_SWITCH_PAGE_INSTR(4), + ILI9881C_COMMAND_INSTR(0x00, 0x80), + ILI9881C_COMMAND_INSTR(0x70, 0x00), + ILI9881C_COMMAND_INSTR(0x71, 0x00), + ILI9881C_COMMAND_INSTR(0x66, 0xFE), + ILI9881C_COMMAND_INSTR(0x82, 0x15), + ILI9881C_COMMAND_INSTR(0x84, 0x15), + ILI9881C_COMMAND_INSTR(0x85, 0x15), + ILI9881C_COMMAND_INSTR(0x3a, 0x24), + ILI9881C_COMMAND_INSTR(0x32, 0xAC), + ILI9881C_COMMAND_INSTR(0x8C, 0x80), + ILI9881C_COMMAND_INSTR(0x3C, 0xF5), + ILI9881C_COMMAND_INSTR(0x88, 0x33), + + ILI9881C_SWITCH_PAGE_INSTR(1), + ILI9881C_COMMAND_INSTR(0x22, 0x0A), + ILI9881C_COMMAND_INSTR(0x31, 0x00), + ILI9881C_COMMAND_INSTR(0x53, 0x78), + ILI9881C_COMMAND_INSTR(0x50, 0x5B), + ILI9881C_COMMAND_INSTR(0x51, 0x5B), + ILI9881C_COMMAND_INSTR(0x60, 0x20), + ILI9881C_COMMAND_INSTR(0x61, 0x00), + ILI9881C_COMMAND_INSTR(0x62, 0x0D), + ILI9881C_COMMAND_INSTR(0x63, 0x00), + + ILI9881C_COMMAND_INSTR(0xA0, 0x00), + ILI9881C_COMMAND_INSTR(0xA1, 0x10), + ILI9881C_COMMAND_INSTR(0xA2, 0x1C), + ILI9881C_COMMAND_INSTR(0xA3, 0x13), + ILI9881C_COMMAND_INSTR(0xA4, 0x15), + ILI9881C_COMMAND_INSTR(0xA5, 0x26), + ILI9881C_COMMAND_INSTR(0xA6, 0x1A), + ILI9881C_COMMAND_INSTR(0xA7, 0x1D), + ILI9881C_COMMAND_INSTR(0xA8, 0x67), + ILI9881C_COMMAND_INSTR(0xA9, 0x1C), + ILI9881C_COMMAND_INSTR(0xAA, 0x29), + ILI9881C_COMMAND_INSTR(0xAB, 0x5B), + ILI9881C_COMMAND_INSTR(0xAC, 0x26), + ILI9881C_COMMAND_INSTR(0xAD, 0x28), + ILI9881C_COMMAND_INSTR(0xAE, 0x5C), + ILI9881C_COMMAND_INSTR(0xAF, 0x30), + ILI9881C_COMMAND_INSTR(0xB0, 0x31), + ILI9881C_COMMAND_INSTR(0xB1, 0x2E), + ILI9881C_COMMAND_INSTR(0xB2, 0x32), + ILI9881C_COMMAND_INSTR(0xB3, 0x00), + + ILI9881C_COMMAND_INSTR(0xC0, 0x00), + ILI9881C_COMMAND_INSTR(0xC1, 0x10), + ILI9881C_COMMAND_INSTR(0xC2, 0x1C), + ILI9881C_COMMAND_INSTR(0xC3, 0x13), + ILI9881C_COMMAND_INSTR(0xC4, 0x15), + ILI9881C_COMMAND_INSTR(0xC5, 0x26), + ILI9881C_COMMAND_INSTR(0xC6, 0x1A), + ILI9881C_COMMAND_INSTR(0xC7, 0x1D), + ILI9881C_COMMAND_INSTR(0xC8, 0x67), + ILI9881C_COMMAND_INSTR(0xC9, 0x1C), + ILI9881C_COMMAND_INSTR(0xCA, 0x29), + ILI9881C_COMMAND_INSTR(0xCB, 0x5B), + ILI9881C_COMMAND_INSTR(0xCC, 0x26), + ILI9881C_COMMAND_INSTR(0xCD, 0x28), + ILI9881C_COMMAND_INSTR(0xCE, 0x5C), + ILI9881C_COMMAND_INSTR(0xCF, 0x30), + ILI9881C_COMMAND_INSTR(0xD0, 0x31), + ILI9881C_COMMAND_INSTR(0xD1, 0x2E), + ILI9881C_COMMAND_INSTR(0xD2, 0x32), + ILI9881C_COMMAND_INSTR(0xD3, 0x00), + ILI9881C_SWITCH_PAGE_INSTR(0), +}; + static inline struct ili9881c *panel_to_ili9881c(struct drm_panel *panel) { return container_of(panel, struct ili9881c, panel); @@ -603,6 +811,23 @@ static const struct drm_display_mode k101_im2byl02_default_mode = { .height_mm = 217, }; +static const struct drm_display_mode w552946aba_default_mode = { + .clock = 64000, + + .hdisplay = 720, + .hsync_start = 720 + 40, + .hsync_end = 720 + 40 + 10, + .htotal = 720 + 40 + 10 + 40, + + .vdisplay = 1280, + .vsync_start = 1280 + 22, + .vsync_end = 1280 + 22 + 4, + .vtotal = 1280 + 22 + 4 + 11, + + .width_mm = 68, + .height_mm = 121, +}; + static int ili9881c_get_modes(struct drm_panel *panel, struct drm_connector *connector) { @@ -670,7 +895,7 @@ static int ili9881c_dsi_probe(struct mipi_dsi_device *dsi) drm_panel_add(&ctx->panel); - dsi->mode_flags = MIPI_DSI_MODE_VIDEO_SYNC_PULSE; + dsi->mode_flags = ctx->desc->mode_flags; dsi->format = MIPI_DSI_FMT_RGB888; dsi->lanes = 4; @@ -691,17 +916,28 @@ static const struct ili9881c_desc lhr050h41_desc = { .init = lhr050h41_init, .init_length = ARRAY_SIZE(lhr050h41_init), .mode = &lhr050h41_default_mode, + .mode_flags = MIPI_DSI_MODE_VIDEO_SYNC_PULSE, }; static const struct ili9881c_desc k101_im2byl02_desc = { .init = k101_im2byl02_init, .init_length = ARRAY_SIZE(k101_im2byl02_init), .mode = &k101_im2byl02_default_mode, + .mode_flags = MIPI_DSI_MODE_VIDEO_SYNC_PULSE, +}; + +static const struct ili9881c_desc w552946aba_desc = { + .init = w552946ab_init, + .init_length = ARRAY_SIZE(w552946ab_init), + .mode = &w552946aba_default_mode, + .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | + MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_NO_EOT_PACKET, }; static const struct of_device_id ili9881c_of_match[] = { { .compatible = "bananapi,lhr050h41", .data = &lhr050h41_desc }, { .compatible = "feixin,k101-im2byl02", .data = &k101_im2byl02_desc }, + { .compatible = "wanchanglong,w552946aba", .data = &w552946aba_desc }, { } }; MODULE_DEVICE_TABLE(of, ili9881c_of_match); From patchwork Sat Oct 16 10:22:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Nazzareno Trimarchi X-Patchwork-Id: 12563541 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A4BEAC433F5 for ; Sat, 16 Oct 2021 10:22:54 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 76DD560F11 for ; Sat, 16 Oct 2021 10:22:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 76DD560F11 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E1ECD6E435; Sat, 16 Oct 2021 10:22:49 +0000 (UTC) Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by gabe.freedesktop.org (Postfix) with ESMTPS id 744C56E430 for ; Sat, 16 Oct 2021 10:22:40 +0000 (UTC) Received: by mail-ed1-x52a.google.com with SMTP id t16so48260399eds.9 for ; Sat, 16 Oct 2021 03:22:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=L0Q4wbPx25npnHXSTuPpnP12kJs52O+N8TRBg77edyU=; b=Rk45p+n5dJliPHK1SQZkAydrXdOtBwuXZofnk138jmSEEe2XKqn8pKIv5S8IVdeWdn kTElIRRrsUKWHNcT0zapV9io+hzuuzzwgTHN2anhkxFVELox6trjx7SV/Dg9mt44Uvyr XMlDuPsOpUsCGm334yV//+kktPVMg8G5xa0to= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=L0Q4wbPx25npnHXSTuPpnP12kJs52O+N8TRBg77edyU=; b=IF38irDh7QiB6aChVPGSnvTQM283cRe3LAwTRMUgK1l7yZOY+IHbu8MzSdL2NgqZnH XQ3ZIAB7UeT8n2cnkCZbo8+zdpu6ugeiVxyicHXpkVjL9A8fvxJX3678TG6E4cpJvkKK VDVOHST+5OSo+OyBfLVjGyAy0GT5fyOW6PDZmBwsYUqV0H9smkkw4epnFnYyzR17Wacw 70iYkYxGMjjfyzSweAnVA4tcPFBCtAe3bAjQGnmE3+j0jRxX0NGIji1uc2ZLCeXm095f lbp2Onpe8GKgUA5TVYDE3RwVAJ30LYl6pmFRdP6Yddnr9A5HjXNUZ/3RflhcFl+0WN5u I/og== X-Gm-Message-State: AOAM531JKkUtQVJGfNYqlIqaA2aqymSom8vPFEO0dREak//l2BLF1on4 tkLLF4sljleU8q5/UzJkfGP9KA== X-Google-Smtp-Source: ABdhPJxrwkhAK72JOqkJ82YTTRvBONSKXSXXnA0GYp0UgFy52AlsWhvK4GP9sxru4Y3LWCL9L0gbdw== X-Received: by 2002:a17:906:d979:: with SMTP id rp25mr13065511ejb.355.1634379758951; Sat, 16 Oct 2021 03:22:38 -0700 (PDT) Received: from panicking.lan (93-46-124-24.ip107.fastwebnet.it. [93.46.124.24]) by smtp.gmail.com with ESMTPSA id la1sm6117361ejc.48.2021.10.16.03.22.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Oct 2021 03:22:38 -0700 (PDT) From: Michael Trimarchi To: Thierry Reding , Sam Ravnborg , David Airlie , Laurent Pinchart , Rob Herring , =?utf-8?q?Heiko_St=C3=BCbner?= Cc: devicetree@vger.kernel.org, Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/5] dt-bindings: ili9881c: add compatible string for Wanchanglong w552946aba Date: Sat, 16 Oct 2021 10:22:30 +0000 Message-Id: <20211016102232.202119-4-michael@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211016102232.202119-1-michael@amarulasolutions.com> References: <20211016102232.202119-1-michael@amarulasolutions.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 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" It utilizes an Ilitek ILI9881D controller chip, but its compatible with ili9881c so should be added to ilitek,ili9881c file. Add the compatible string for it. Signed-off-by: Michael Trimarchi --- .../devicetree/bindings/display/panel/ilitek,ili9881c.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/display/panel/ilitek,ili9881c.yaml b/Documentation/devicetree/bindings/display/panel/ilitek,ili9881c.yaml index b2fcec4f22fd..2d4a5643a785 100644 --- a/Documentation/devicetree/bindings/display/panel/ilitek,ili9881c.yaml +++ b/Documentation/devicetree/bindings/display/panel/ilitek,ili9881c.yaml @@ -15,6 +15,7 @@ properties: - enum: - bananapi,lhr050h41 - feixin,k101-im2byl02 + - wanchanglong,w552946aba - const: ilitek,ili9881c backlight: true From patchwork Sat Oct 16 10:22:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Nazzareno Trimarchi X-Patchwork-Id: 12563539 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 20B71C433EF for ; Sat, 16 Oct 2021 10:22:52 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E7C7160F11 for ; Sat, 16 Oct 2021 10:22:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E7C7160F11 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CEBE26E433; Sat, 16 Oct 2021 10:22:46 +0000 (UTC) Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by gabe.freedesktop.org (Postfix) with ESMTPS id EE3F06E430 for ; Sat, 16 Oct 2021 10:22:41 +0000 (UTC) Received: by mail-ed1-x536.google.com with SMTP id g10so48458035edj.1 for ; Sat, 16 Oct 2021 03:22:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UpaN0+D4v6gZi4C1AIXdRvIf3e9k8TCo9M0Z0xiwZZA=; b=bVpdXZI2t1pu8Dq2bx9BYsDi8Jaxe8gZVC1bkUVLKjO3ibe87Ybbg1ab+UgLVeXDKb m7x45p0HDGuJDf0Dot9aQUuvAnr9q6DMYNrpiiE28WBMTzz7Cmre21wxkaJ8clgPhGeW nbd6brzazC4OFiSA9wHzwi0YsAqXfUKfE8qz4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UpaN0+D4v6gZi4C1AIXdRvIf3e9k8TCo9M0Z0xiwZZA=; b=gKClZrG4VImWojea9+s9swjJrgZ0jHgRTScmJaVh4b5eeK4bTOMZh5vB+3BQXymNJH OrVnoN6vOLng70A1pVFbqqhBGA8yVu0KVxdqcKy1s3JxO5hqhx/CkgqFrFuHbIs5m19u QMFV7JFA1jjEg+nne5q8DEMfOKyie7V4GIy9Yqhd7f93ahfOnNNHQjU7T8PiP9Uh5ctJ k8rB2xIGB/AjXm2iLv9tLeYfi37qG3UwbdeQ22jK5JDv0+EsYeLzRnqjMibE2BsgMSnH 4pesg6zZpwHdU+YA/YN6IxEAF+MVIZmB72izEMkxb5eThdCVx5lqzljYUpORaPNk1/+S BdZw== X-Gm-Message-State: AOAM530OD+pDRmQoUGdVEB69OX/SXaW9CMzTcRpervWbw/nPhc3ltoZZ eL1jKuZbfoMGOT8a5TzH42lnCP5EMiSPpS1Z X-Google-Smtp-Source: ABdhPJwwaHJDJm9L+CJNdyZDd6ge+ozPrl5Qg+7itKwaQX0evzlEbxXfMHGOf3U9R8mm0BMJs1HoAw== X-Received: by 2002:a17:906:838c:: with SMTP id p12mr13237355ejx.181.1634379760431; Sat, 16 Oct 2021 03:22:40 -0700 (PDT) Received: from panicking.lan (93-46-124-24.ip107.fastwebnet.it. [93.46.124.24]) by smtp.gmail.com with ESMTPSA id la1sm6117361ejc.48.2021.10.16.03.22.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Oct 2021 03:22:39 -0700 (PDT) From: Michael Trimarchi To: Thierry Reding , Sam Ravnborg , David Airlie , Laurent Pinchart , Rob Herring , =?utf-8?q?Heiko_St=C3=BCbner?= Cc: devicetree@vger.kernel.org, Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/5] drm/panel: ilitek-ili9881c: Make gpio-reset optional Date: Sat, 16 Oct 2021 10:22:31 +0000 Message-Id: <20211016102232.202119-5-michael@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211016102232.202119-1-michael@amarulasolutions.com> References: <20211016102232.202119-1-michael@amarulasolutions.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 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" Depends in how logic is connected to the board the gpio is not stricly required. Signed-off-by: Michael Trimarchi --- .../devicetree/bindings/display/panel/ilitek,ili9881c.yaml | 1 - drivers/gpu/drm/panel/panel-ilitek-ili9881c.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/display/panel/ilitek,ili9881c.yaml b/Documentation/devicetree/bindings/display/panel/ilitek,ili9881c.yaml index 2d4a5643a785..07789d554889 100644 --- a/Documentation/devicetree/bindings/display/panel/ilitek,ili9881c.yaml +++ b/Documentation/devicetree/bindings/display/panel/ilitek,ili9881c.yaml @@ -27,7 +27,6 @@ required: - compatible - power-supply - reg - - reset-gpios additionalProperties: false diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c index d1f20758ed08..103a16018975 100644 --- a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c @@ -883,7 +883,7 @@ static int ili9881c_dsi_probe(struct mipi_dsi_device *dsi) return PTR_ERR(ctx->power); } - ctx->reset = devm_gpiod_get(&dsi->dev, "reset", GPIOD_OUT_LOW); + ctx->reset = devm_gpiod_get_optional(&dsi->dev, "reset", GPIOD_OUT_LOW); if (IS_ERR(ctx->reset)) { dev_err(&dsi->dev, "Couldn't get our reset GPIO\n"); return PTR_ERR(ctx->reset); From patchwork Sat Oct 16 10:22:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Nazzareno Trimarchi X-Patchwork-Id: 12563543 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1401BC433F5 for ; Sat, 16 Oct 2021 10:22:57 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D985460F11 for ; Sat, 16 Oct 2021 10:22:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D985460F11 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4F7F36E437; Sat, 16 Oct 2021 10:22:50 +0000 (UTC) Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by gabe.freedesktop.org (Postfix) with ESMTPS id 58BB06E430 for ; Sat, 16 Oct 2021 10:22:43 +0000 (UTC) Received: by mail-ed1-x52e.google.com with SMTP id g10so48458238edj.1 for ; Sat, 16 Oct 2021 03:22:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jQxWHRxLlS8GB+mEPe7uBuP6Wvk6JtWdqezPMx1FAp8=; b=ZbrmSQysVOsDCgQE0R6U3t3cdzYpfABmpvw7lgZv+AatxUb2dgxqNNEbUwa4mFm2jC gKg/7phFpRe61dVUCU+eX8qf9CQ6OPy+jbszZFR/hc7uwNgJ9n1YeRljudbcmN0YR2uf 9y81QaVInw28J2Rppwrr+MTcRq5lI6+W6y1uw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jQxWHRxLlS8GB+mEPe7uBuP6Wvk6JtWdqezPMx1FAp8=; b=KIxVaWXmw0tU+p0XsN8OfyZqsh+b+4AGwdMFJ1sUBudlqW/2tFfdXhzRtWC+r3GAmH +nu2LG2bgxlJDAlrGSQqd156bhvILdHKkKplZ74kZH6mBgxQ1zwk0oOMn35qBxxCV+5d ZwXEX5CXcoToHwoNXkF3G7Xk5eQw42uPeR3Pu+yxTfIUt/L+1Vcp/0+8L+rwnfz6DKjM kha53EIWnJzATJQuziOOzK9FK+v7OpDsLPHssnGTcLHngPHmljL7IDOcHSfu4Yea+CBl QINLfh0Z24WeB8HVTH4egwwg4I6QjD6IbNMiKl+v+QbaD5euMlfyjnvcGNBeTcwImif4 bXuQ== X-Gm-Message-State: AOAM530J/lAUqSX1LiBTci+/Tei2BvhXgdqnzGy+bFX1fi+7AMIqGcGo DFf/UCUtH7Y5A/zYhFN65N6R9Q== X-Google-Smtp-Source: ABdhPJyo2efIjAHZdjigTFM3MOKnWgRMrDKspLEdjzUqBqA8mceLmTZXTMTW7XJRpja34WkdXfZSIA== X-Received: by 2002:a17:907:6297:: with SMTP id nd23mr14071082ejc.62.1634379761781; Sat, 16 Oct 2021 03:22:41 -0700 (PDT) Received: from panicking.lan (93-46-124-24.ip107.fastwebnet.it. [93.46.124.24]) by smtp.gmail.com with ESMTPSA id la1sm6117361ejc.48.2021.10.16.03.22.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Oct 2021 03:22:41 -0700 (PDT) From: Michael Trimarchi To: Thierry Reding , Sam Ravnborg , David Airlie , Laurent Pinchart , Rob Herring , =?utf-8?q?Heiko_St=C3=BCbner?= Cc: devicetree@vger.kernel.org, Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/5] drm/bridge: dw-mipi-dsi: Fix dsi registration during drm probing Date: Sat, 16 Oct 2021 10:22:32 +0000 Message-Id: <20211016102232.202119-6-michael@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211016102232.202119-1-michael@amarulasolutions.com> References: <20211016102232.202119-1-michael@amarulasolutions.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 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" The dsi registration is implemented in rockchip platform driver. The attach can be called before the probe is terminated and therefore we need to be sure that corresponding entry during attach is valid Signed-off-by: Michael Trimarchi --- drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 8 +++++++- drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 12 ++++++++---- include/drm/bridge/dw_mipi_dsi.h | 2 +- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c index e44e18a0112a..44b211be15fc 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c @@ -362,8 +362,14 @@ static int dw_mipi_dsi_host_attach(struct mipi_dsi_host *host, dsi->device_found = true; } + /* + * NOTE: the dsi registration is implemented in + * platform driver, that to say dsi would be exist after + * probe is terminated. The call is done before the end of probe + * so we need to pass the dsi to the platform driver. + */ if (pdata->host_ops && pdata->host_ops->attach) { - ret = pdata->host_ops->attach(pdata->priv_data, device); + ret = pdata->host_ops->attach(pdata->priv_data, device, dsi); if (ret < 0) return ret; } diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c index a2262bee5aa4..32ddc8642ec1 100644 --- a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c @@ -997,7 +997,8 @@ static const struct component_ops dw_mipi_dsi_rockchip_ops = { }; static int dw_mipi_dsi_rockchip_host_attach(void *priv_data, - struct mipi_dsi_device *device) + struct mipi_dsi_device *device, + struct dw_mipi_dsi *dmd) { struct dw_mipi_dsi_rockchip *dsi = priv_data; struct device *second; @@ -1005,6 +1006,8 @@ static int dw_mipi_dsi_rockchip_host_attach(void *priv_data, mutex_lock(&dsi->usage_mutex); + dsi->dmd = dmd; + if (dsi->usage_mode != DW_DSI_USAGE_IDLE) { DRM_DEV_ERROR(dsi->dev, "dsi controller already in use\n"); mutex_unlock(&dsi->usage_mutex); @@ -1280,6 +1283,7 @@ static int dw_mipi_dsi_rockchip_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct device_node *np = dev->of_node; + struct dw_mipi_dsi *dmd; struct dw_mipi_dsi_rockchip *dsi; struct phy_provider *phy_provider; struct resource *res; @@ -1391,9 +1395,9 @@ static int dw_mipi_dsi_rockchip_probe(struct platform_device *pdev) if (IS_ERR(phy_provider)) return PTR_ERR(phy_provider); - dsi->dmd = dw_mipi_dsi_probe(pdev, &dsi->pdata); - if (IS_ERR(dsi->dmd)) { - ret = PTR_ERR(dsi->dmd); + dmd = dw_mipi_dsi_probe(pdev, &dsi->pdata); + if (IS_ERR(dmd)) { + ret = PTR_ERR(dmd); if (ret != -EPROBE_DEFER) DRM_DEV_ERROR(dev, "Failed to probe dw_mipi_dsi: %d\n", ret); diff --git a/include/drm/bridge/dw_mipi_dsi.h b/include/drm/bridge/dw_mipi_dsi.h index bda8aa7c2280..cf81f19806ad 100644 --- a/include/drm/bridge/dw_mipi_dsi.h +++ b/include/drm/bridge/dw_mipi_dsi.h @@ -41,7 +41,7 @@ struct dw_mipi_dsi_phy_ops { struct dw_mipi_dsi_host_ops { int (*attach)(void *priv_data, - struct mipi_dsi_device *dsi); + struct mipi_dsi_device *dsi, struct dw_mipi_dsi *dmd); int (*detach)(void *priv_data, struct mipi_dsi_device *dsi); };