From patchwork Sat Dec 7 20:35:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 11277765 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2625D14BD for ; Sat, 7 Dec 2019 20:36:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 04A9A2467A for ; Sat, 7 Dec 2019 20:36:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="AI3kKMlU" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726824AbfLGUgO (ORCPT ); Sat, 7 Dec 2019 15:36:14 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:45741 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726555AbfLGUgN (ORCPT ); Sat, 7 Dec 2019 15:36:13 -0500 Received: by mail-pl1-f194.google.com with SMTP id w7so4134929plz.12; Sat, 07 Dec 2019 12:36:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Z3/AYVovlJiJ1Alu6bE6pYRPal+N6Ynq1x5wnV6ZnAY=; b=AI3kKMlUpDOEK8jI30xnwDi6FbaN9R3AEX+zDWP825P8L4WIE6lqRibsGBNH990x6S 2W1aLv0wOqFpSB31f8F7l1zxV56Did5ya2GMvZJ/7kw5cHAiEfhR2Tp53PQ3sBAT6oDh JqVOaJt1II8tJNn5yAwswhTIVOU091UFAbTFFtsaWx9yef9ywpJEWEh8wHlNvkGl5Dz6 AyO6kHoUAsNIa12cbiDJO2VwLMlvuw05GwqlR+nBzBPNHq75Pfni4Kia7/5Ei0HVRpRP xZ2t/i0AwZn6D+xVSpxrbG6oah5ngpYwQTzPZiNkuXxk2AlDapRg4dVo5mUFeoHH5c8p FtEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Z3/AYVovlJiJ1Alu6bE6pYRPal+N6Ynq1x5wnV6ZnAY=; b=dh/hzZ3uSwUOsmp99yIDkbcNyZGJvW/x0x28nLWetKiIEB83kXUd0oFzjcLfuQiN5S lxqFB7JXM6x+xX6eWkOcObIWa5YZyxy35L9GhbJY+phOi9PltsClCQH5q9qVxHd9/Kk0 lcJikDwwmWj7ha2sMaQtFMDy7T1eFiSdZYSngqoW25JM/KVwZA1J8LvPl5TTuVXNSV1B hu+NYs1vp8LIsXMcOhS003i0Y6u/WaTcTCkXmbPnUPzI9/UgzhP1Rb3c6x3llFyW6dHt DUxtNEDsYaEs+QWlJ/H+NZfWJvtDzM9V25/kuQP8JumjdOUeNgWiR2rVMg3wrQFtCgIN ukQw== X-Gm-Message-State: APjAAAX/NKo2r0la6wSwoLraosZbMMysscUxiec+i2udyeklrsBPAF7/ J0/5JjNMI8fubnbTEn0TIK0= X-Google-Smtp-Source: APXvYqy0w+EuWHFKr8S5+G6Ihehi1cLJ75cYyMki2L3dxv/6qi53ML5wX8lcDeRM081R2NGlCpOONA== X-Received: by 2002:a17:90a:fb87:: with SMTP id cp7mr23509768pjb.56.1575750972199; Sat, 07 Dec 2019 12:36:12 -0800 (PST) Received: from localhost (c-73-25-156-94.hsd1.or.comcast.net. [73.25.156.94]) by smtp.gmail.com with ESMTPSA id l1sm1884223pgs.47.2019.12.07.12.36.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Dec 2019 12:36:11 -0800 (PST) From: Rob Clark To: dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, aarch64-laptops@lists.linaro.org Cc: Laurent Pinchart , Vasily Khoruzhick , Bjorn Andersson , Jeffrey Hugo , Rob Clark , Thierry Reding , Sam Ravnborg , David Airlie , Daniel Vetter , Rob Herring , Mark Rutland , devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS), linux-kernel@vger.kernel.org (open list) Subject: [PATCH 1/4] dt-bindings: display: panel: document panel-id Date: Sat, 7 Dec 2019 12:35:50 -0800 Message-Id: <20191207203553.286017-2-robdclark@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191207203553.286017-1-robdclark@gmail.com> References: <20191207203553.286017-1-robdclark@gmail.com> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Rob Clark For devices that have one of several possible panels installed, the panel-id property gives firmware a generic way to locate and enable the panel node corresponding to the installed panel. Example of how to use this property: ivo_panel { compatible = "ivo,m133nwf4-r0"; panel-id = <0xc5>; status = "disabled"; ports { port { ivo_panel_in_edp: endpoint { remote-endpoint = <&sn65dsi86_out_ivo>; }; }; }; }; boe_panel { compatible = "boe,nv133fhm-n61"; panel-id = <0xc4>; status = "disabled"; ports { port { boe_panel_in_edp: endpoint { remote-endpoint = <&sn65dsi86_out_boe>; }; }; }; }; sn65dsi86: bridge@2c { compatible = "ti,sn65dsi86"; ports { #address-cells = <1>; #size-cells = <0>; port@0 { reg = <0>; sn65dsi86_in_a: endpoint { remote-endpoint = <&dsi0_out>; }; }; port@1 { reg = <1>; sn65dsi86_out_boe: endpoint@c4 { remote-endpoint = <&boe_panel_in_edp>; }; sn65dsi86_out_ivo: endpoint@c5 { remote-endpoint = <&ivo_panel_in_edp>; }; }; }; }; Signed-off-by: Rob Clark Reviewed-by: Sam Ravnborg --- .../bindings/display/panel/panel-common.yaml | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/Documentation/devicetree/bindings/display/panel/panel-common.yaml b/Documentation/devicetree/bindings/display/panel/panel-common.yaml index ef8d8cdfcede..6113319b91dd 100644 --- a/Documentation/devicetree/bindings/display/panel/panel-common.yaml +++ b/Documentation/devicetree/bindings/display/panel/panel-common.yaml @@ -75,6 +75,32 @@ properties: in the device graph bindings defined in Documentation/devicetree/bindings/graph.txt. + panel-id: + description: + To support the case where one of several different panels can be installed + on a device, the panel-id property can be used by the firmware to identify + which panel should have it's status changed to "ok". This property is not + used by the HLOS itself. + + For a device with multiple potential panels, a node for each potential + should be defined with status = "disabled", and an appropriate panel-id + property. The video data producer should be setup with endpoints going to + each possible panel. The firmware will find the dt node with a panel-id + matching the actual panel installed, and change it's status to "ok". + + The exact method the firmware uses to determine the panel-id of the installed + panel is outside the scope of this binding, but a few examples are + + 1) u-boot module reading a value from a u-boot env var + 2) EFI driver module reading a value from an EFI variable + 3) device specific firmware reading some device specific GPIOs or + e-fuse + + The panel-id values are an opaque integer. They can be sparse. The only + important thing is that each possible panel in the system has a unique + panel-id, and that the values configured in the device's DTB match the + values that the firmware is looking for. + ddc-i2c-bus: $ref: /schemas/types.yaml#/definitions/phandle description: From patchwork Sat Dec 7 20:35:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 11277763 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BB499139A for ; Sat, 7 Dec 2019 20:36:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 98FF92467A for ; Sat, 7 Dec 2019 20:36:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fejbPTGE" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726845AbfLGUgP (ORCPT ); Sat, 7 Dec 2019 15:36:15 -0500 Received: from mail-pj1-f66.google.com ([209.85.216.66]:32931 "EHLO mail-pj1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726555AbfLGUgP (ORCPT ); Sat, 7 Dec 2019 15:36:15 -0500 Received: by mail-pj1-f66.google.com with SMTP id r67so4185769pjb.0; Sat, 07 Dec 2019 12:36:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kPGabNCq4wvn/E6P0guB04MXnY7RQzJiTE6DO4F+/5c=; b=fejbPTGExleKnqhKzbTJe2QRYYJ83L/AsFX3Orxh9feE9NIPyYEMNxKFqkGDyMQ6rF FQyuovSyMWmvs5v8uI/3n6B8gT2FfXog5EEwnuGRcXfFF3VgFC/y3+TJGx6OliZQNop7 7RAXHmpNEiHg/m+Ma7H5ShJYS5Ylv/fe1oP6AgocW9BFyh3cMzHolHB7tJw9wAIaKUQ6 noB5rFM8gDPsi9qrnkgW9kWd/+5WjBumhgyIVxw5HqzWHuvW5wvWnnIvZWM5TX+RId5m Kc2kn5vZLQW5z9rpfRdzfle2qQaUw9U/KQ8ORcog3GiP0gd3937HnI0FgaXikkWiBjGW PxqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kPGabNCq4wvn/E6P0guB04MXnY7RQzJiTE6DO4F+/5c=; b=QyJiYQFZUin/6nj1I5wGWnoKJAD/lyX0c70nl3lvIvt+apxUeRwupcKwLQatmpddkc lh2zwQyCA4rh9XDgjY6+7Ghkm3ztX8Ho+GL6YWWIw9aPlR+bqYxb/uKNhW6XPOZEqQQE 7Cfc7SVD5TxOjc7ngw0JuMUV3bPBGU24T7MhdCWig2GvBgsiZLda4micozZ5tBgQXRUE WkqtXEnfitLPL65T8xHBruLsTOcQtAMYdJN5k/3Z+B3mJ+PX6goBb6T/TeTYrmoA3JBB kLE1LHXPmaVV5kds6EBtqJ44/NkOhsTTjXO8WRsIxyDIRkI2CxPIlGyChuZ6HgJDzjaV OhFg== X-Gm-Message-State: APjAAAUtQFTR/vSJ+zv1e/SEzx6tkO1u/Z7msSUYX48zzmLhR4Jjsg+R g+a82jIMXzBBSwXFKCeLkGc= X-Google-Smtp-Source: APXvYqzDfayEIq2IU2ZF76xRpq1YVP/uNxKHNPyI6TREpRcqY3KTtpmPIdU+GsItMQeh+jnuG7UijA== X-Received: by 2002:a17:90b:3cc:: with SMTP id go12mr23177882pjb.89.1575750974098; Sat, 07 Dec 2019 12:36:14 -0800 (PST) Received: from localhost (c-73-25-156-94.hsd1.or.comcast.net. [73.25.156.94]) by smtp.gmail.com with ESMTPSA id 133sm20887100pfy.14.2019.12.07.12.36.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Dec 2019 12:36:13 -0800 (PST) From: Rob Clark To: dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, aarch64-laptops@lists.linaro.org Cc: Laurent Pinchart , Vasily Khoruzhick , Bjorn Andersson , Jeffrey Hugo , Rob Clark , Maarten Lankhorst , Maxime Ripard , Sean Paul , David Airlie , Daniel Vetter , linux-kernel@vger.kernel.org (open list) Subject: [PATCH 2/4] drm/of: add support to find any enabled endpoint Date: Sat, 7 Dec 2019 12:35:51 -0800 Message-Id: <20191207203553.286017-3-robdclark@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191207203553.286017-1-robdclark@gmail.com> References: <20191207203553.286017-1-robdclark@gmail.com> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Rob Clark To handle the case where there are multiple panel endpoints, only one of which is enabled/installed, add support for a wildcard endpoint value to request finding whichever endpoint is enabled. Signed-off-by: Rob Clark --- drivers/gpu/drm/drm_of.c | 41 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_of.c b/drivers/gpu/drm/drm_of.c index 0ca58803ba46..2baf44e401b8 100644 --- a/drivers/gpu/drm/drm_of.c +++ b/drivers/gpu/drm/drm_of.c @@ -219,11 +219,44 @@ int drm_of_encoder_active_endpoint(struct device_node *node, } EXPORT_SYMBOL_GPL(drm_of_encoder_active_endpoint); +static int find_enabled_endpoint(const struct device_node *node, u32 port) +{ + struct device_node *endpoint_node, *remote; + u32 endpoint = 0; + + for (endpoint = 0; ; endpoint++) { + endpoint_node = of_graph_get_endpoint_by_regs(node, port, endpoint); + if (!endpoint_node) { + pr_debug("No more endpoints!\n"); + return -ENODEV; + } + + remote = of_graph_get_remote_port_parent(endpoint_node); + of_node_put(endpoint_node); + if (!remote) { + pr_debug("no valid remote node\n"); + continue; + } + + if (!of_device_is_available(remote)) { + pr_debug("not available for remote node\n"); + of_node_put(remote); + continue; + } + + pr_debug("found enabled endpoint %d for %s\n", endpoint, remote->name); + of_node_put(remote); + return endpoint; + } + + return -ENODEV; +} + /** * drm_of_find_panel_or_bridge - return connected panel or bridge device * @np: device tree node containing encoder output ports * @port: port in the device tree node - * @endpoint: endpoint in the device tree node + * @endpoint: endpoint in the device tree node, or -1 to find an enabled endpoint * @panel: pointer to hold returned drm_panel * @bridge: pointer to hold returned drm_bridge * @@ -246,6 +279,12 @@ int drm_of_find_panel_or_bridge(const struct device_node *np, if (panel) *panel = NULL; + if (endpoint == -1) { + endpoint = find_enabled_endpoint(np, port); + if (endpoint < 0) + return endpoint; + } + remote = of_graph_get_remote_node(np, port, endpoint); if (!remote) return -ENODEV; From patchwork Sat Dec 7 20:35:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 11277757 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B41A617EF for ; Sat, 7 Dec 2019 20:36:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 92FC72467F for ; Sat, 7 Dec 2019 20:36:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OEECddpv" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726881AbfLGUgS (ORCPT ); Sat, 7 Dec 2019 15:36:18 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:43942 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726555AbfLGUgR (ORCPT ); Sat, 7 Dec 2019 15:36:17 -0500 Received: by mail-pf1-f196.google.com with SMTP id h14so5138317pfe.10; Sat, 07 Dec 2019 12:36:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cVm3fTMGs3Ke7LE9pcHFJZXCh+yS4/KCWiEc/FuKj34=; b=OEECddpvOrRkOHKphVcLzjAo5l1LyjDSbYArI7pl794LpAjUmWUCJD5PxVBb/q7Rlw Iky1w3tt3+AQH2X/oeWERBrmkT0PiAk1+PuEwMswhVguy0+wReG2xEJ9hqJKMQwMb52r tzIfsIeV68azc1QXvzZWhGLG2pv8aD4jX6D5Y84xIfKPNiSkmMgF/VfD53hai+qNQpaj 9fCpljuMnNZl+sQFx2myqDUk1/fe0GwoM1JlzQBgxLuap2GENkT2BHBDb7KKmGLFmv20 8xXjGq86IFO8cp2RVkUWlPX/bFS/F7QQJPpP8OBXgOuWGUrEiGe7Rq1lUmNHZqjXr++U a+DA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cVm3fTMGs3Ke7LE9pcHFJZXCh+yS4/KCWiEc/FuKj34=; b=BivL127VdxBy9yBw1bW924Aa2WYPcq9C8YB5HERdTVzu5Be12WWF57I0Vy7ugh6BCK CNh8hXZR25Mn5z96Rh6i2t5DWM1n5K3v7fhtmu4Qazbg0SR1raWCIDsSI2fJLqh4Rxmb QRIJIPHhwe4tx+8iSAGR5fKTuJBB3hAHmbPVVoZdp93GRXqM/2KxpPCL29rVNXKFapgX kWA22VePg1kSj7+1yP1Er/0YOiRmB4Wn6/x4Ge9ZMic8dBREcRN7GqYkFA2yd4zMyQTX e7UKTTL5zEWvnJD6toNMnj8K1PXZ8CSA1iSlJu6MjJmAcugf3ywRscdQ9d/5vJtFVl2z 6k/A== X-Gm-Message-State: APjAAAXnmWaNCri7i9SCIRF7uKYrmf3Luqd0J2WYg7i09JkGX2pQ3/9P 4nVPLwIjhYXfim9cYGt+HDM= X-Google-Smtp-Source: APXvYqyXkQWGRk0eUOkq9bFetsRJZzyqR9S1EFwc18YoOwHz+LAS2LVd0p0QBem+UVSKxeVb7hixvw== X-Received: by 2002:a62:5202:: with SMTP id g2mr21373195pfb.43.1575750976236; Sat, 07 Dec 2019 12:36:16 -0800 (PST) Received: from localhost (c-73-25-156-94.hsd1.or.comcast.net. [73.25.156.94]) by smtp.gmail.com with ESMTPSA id j3sm20479085pfi.8.2019.12.07.12.36.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Dec 2019 12:36:15 -0800 (PST) From: Rob Clark To: dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, aarch64-laptops@lists.linaro.org Cc: Laurent Pinchart , Vasily Khoruzhick , Bjorn Andersson , Jeffrey Hugo , Rob Clark , Andrzej Hajda , Neil Armstrong , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter , linux-kernel@vger.kernel.org (open list) Subject: [PATCH 3/4] drm/bridge: ti-sn65dsi86: find any enabled endpoint Date: Sat, 7 Dec 2019 12:35:52 -0800 Message-Id: <20191207203553.286017-4-robdclark@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191207203553.286017-1-robdclark@gmail.com> References: <20191207203553.286017-1-robdclark@gmail.com> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Rob Clark This bridge is used on a number of devices that can have one of multiple different panels installed. The firmware will enable the panel driver node for the panel that is actually installed. So the bridge should ask drm_of_find_panel_or_bridge() to find the endpoint for the enabled panel. Signed-off-by: Rob Clark --- drivers/gpu/drm/bridge/ti-sn65dsi86.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c index 43abf01ebd4c..62bc98d9d152 100644 --- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c @@ -720,7 +720,7 @@ static int ti_sn_bridge_probe(struct i2c_client *client, pdata->dev = &client->dev; - ret = drm_of_find_panel_or_bridge(pdata->dev->of_node, 1, 0, + ret = drm_of_find_panel_or_bridge(pdata->dev->of_node, 1, -1, &pdata->panel, NULL); if (ret) { DRM_ERROR("could not find any panel node\n"); From patchwork Sat Dec 7 20:35:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 11277759 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 324A21805 for ; Sat, 7 Dec 2019 20:36:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 06A7824673 for ; Sat, 7 Dec 2019 20:36:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FZC7kka9" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726911AbfLGUgU (ORCPT ); Sat, 7 Dec 2019 15:36:20 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:44737 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726884AbfLGUgT (ORCPT ); Sat, 7 Dec 2019 15:36:19 -0500 Received: by mail-pg1-f196.google.com with SMTP id x7so5061594pgl.11; Sat, 07 Dec 2019 12:36:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=888GZt/LFDsB0HcMe2D0lH6dvAdiWaFC5K/VFb+FLyg=; b=FZC7kka9khJuBvH092mVH2D1D0nl7lvHYcJGUQIvoX1J+2bknn3Sj6cBOSAtJatdi1 c8mdMu6TPsgsmZGzhwT9bVyjmnzGXCU2R33bnyesSJo5EhQokOJu4aijGFitDWsCf92P Th/I+DAuu6Z2pMvlJAu9LH9rGg1LGzlkogTpwzVFt50k+Sv2kt4V8l6spxR4QHyodsPf 9GC8y38I2CoD+BgcJsERwb1hbCAtYCt+8GcxVQL5z4nK0hJgiHXI6NTF2IjlyYIlucr7 +aaEE9VqBH2d/QrtBl1ubFi2p940XmWIJLZJZ+OYObhaxpYtGSayWR2K58YwobUBc8ZP JhxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=888GZt/LFDsB0HcMe2D0lH6dvAdiWaFC5K/VFb+FLyg=; b=QKeROGTVlQO1FI3JNiEO5InrETHSlIIK7DRlWIWLFkh+sUZmEa8HWlM+GbM0kAYUwu JyI0vqOwxt0NGN51J6Jmr8zr0oEG1Wt/hRZOiHY3+ZBKxJura9LwygkxUfmk8bW7csoP ENjpFOGA7mmR75uNPBIbTsPr+hJ7NMgrEZ1yRxOAOTxKj55t7+XXzmUB4hAm+B8mwwPu ItccUQJY6aSvc3Vjc1Udt99Q2Zj2of/oH8X9NG5BYWs58UTg7V+glceQ6V38H/7062uG g6MKBtnHGujY3UppBms4W7cYocbDjU6CogKZFnEg6xmJE7FS+A9G3q87xMSB9XFk/zKI QDgQ== X-Gm-Message-State: APjAAAU0FJ0r2CQ5cuD7jbG5hqrO3SxYq69w2wGOVxDOKtvI9KdaLp7r lGeRQiNieB7C3sd60qFef6U= X-Google-Smtp-Source: APXvYqy4kMRRjVnTQQ6xB4h4lJyLmxDcQ3cnEwCLJqf5PzLedWWzGDfEA6KsXGK0ZDhVOvvDPL5L1w== X-Received: by 2002:a63:d351:: with SMTP id u17mr10551445pgi.84.1575750978424; Sat, 07 Dec 2019 12:36:18 -0800 (PST) Received: from localhost (c-73-25-156-94.hsd1.or.comcast.net. [73.25.156.94]) by smtp.gmail.com with ESMTPSA id k5sm7061084pju.14.2019.12.07.12.36.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Dec 2019 12:36:17 -0800 (PST) From: Rob Clark To: dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, aarch64-laptops@lists.linaro.org Cc: Laurent Pinchart , Vasily Khoruzhick , Bjorn Andersson , Jeffrey Hugo , Rob Clark , Andy Gross , Rob Herring , Mark Rutland , devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS), linux-kernel@vger.kernel.org (open list) Subject: [PATCH 4/4] arm64: dts: qcom: c630: Enable display Date: Sat, 7 Dec 2019 12:35:53 -0800 Message-Id: <20191207203553.286017-5-robdclark@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191207203553.286017-1-robdclark@gmail.com> References: <20191207203553.286017-1-robdclark@gmail.com> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Bjorn Andersson Signed-off-by: Bjorn Andersson [Initial patch from Bjorn, I've added some regulator-boot-on's to account for display related regulators enabled by the firmware, and updated to handle the two possible panels that can be installed.] Signed-off-by: Rob Clark --- .../boot/dts/qcom/sdm850-lenovo-yoga-c630.dts | 165 ++++++++++++++++++ 1 file changed, 165 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts b/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts index 13dc619687f3..459f65e3eb53 100644 --- a/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts +++ b/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts @@ -7,6 +7,7 @@ /dts-v1/; +#include #include #include "sdm845.dtsi" #include "pm8998.dtsi" @@ -18,6 +19,70 @@ aliases { hsuart0 = &uart6; }; + + ivo_panel { + compatible = "ivo,m133nwf4-r0"; + panel-id = <0xc5>; + status = "disabled"; + power-supply = <&vlcm_3v3>; + no-hpd; + + ports { + port { + ivo_panel_in_edp: endpoint { + remote-endpoint = <&sn65dsi86_out_ivo>; + }; + }; + }; + }; + + boe_panel { + compatible = "boe,nv133fhm-n61"; + panel-id = <0xc4>; + status = "disabled"; + power-supply = <&vlcm_3v3>; + no-hpd; + + ports { + port { + boe_panel_in_edp: endpoint { + remote-endpoint = <&sn65dsi86_out_boe>; + }; + }; + }; + }; + + vlcm_3v3: vlcm-3v3-power { + compatible = "regulator-fixed"; + regulator-name = "VLCM_3V3"; + + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + + gpio = <&tlmm 88 GPIO_ACTIVE_HIGH>; + enable-active-high; + regulator-boot-on; + }; + + sw_edp_1p2: sw-edp-1p2-regulator { + compatible = "regulator-fixed"; + regulator-name = "SW_EDP_1P2"; + + vin-supply = <&vreg_l2a_1p2>; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + + gpio = <&pm8998_gpio 9 GPIO_ACTIVE_HIGH>; + enable-active-high; + regulator-boot-on; + }; + + sn65dsi86_refclk: sn65dsi86-refclk { + compatible = "fixed-clock"; + #clock-cells = <0>; + + clock-frequency = <19200000>; + }; }; &adsp_pas { @@ -79,6 +144,7 @@ regulator-min-microvolt = <880000>; regulator-max-microvolt = <880000>; regulator-initial-mode = ; + regulator-boot-on; }; vddpx_10: @@ -216,6 +282,7 @@ regulator-min-microvolt = <1200000>; regulator-max-microvolt = <1208000>; regulator-initial-mode = ; + regulator-boot-on; }; vreg_l28a_3p0: ldo28 { @@ -239,6 +306,25 @@ status = "okay"; }; +&dsi0 { + status = "okay"; + vdda-supply = <&vreg_l26a_1p2>; + + ports { + port@1 { + endpoint { + remote-endpoint = <&sn65dsi86_in_a>; + data-lanes = <0 1 2 3>; + }; + }; + }; +}; + +&dsi0_phy { + status = "okay"; + vdds-supply = <&vreg_l1a_0p875>; +}; + &gcc { protected-clocks = , , @@ -290,6 +376,58 @@ }; }; +&i2c10 { + status = "okay"; + clock-frequency = <400000>; + + sn65dsi86: bridge@2c { + compatible = "ti,sn65dsi86"; + reg = <0x2c>; + pinctrl-names = "default"; + pinctrl-0 = <&edp_bridge_en>, <&edp_bridge_irq>; + + interrupts-extended = <&tlmm 10 IRQ_TYPE_LEVEL_HIGH>; + + enable-gpios = <&tlmm 96 GPIO_ACTIVE_HIGH>; + + vpll-supply = <&vreg_l14a_1p88>; + vccio-supply = <&vreg_l14a_1p88>; + vcca-supply = <&sw_edp_1p2>; + vcc-supply = <&sw_edp_1p2>; + + clocks = <&sn65dsi86_refclk>; + clock-names = "refclk"; + + max-brightness = <255>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + sn65dsi86_in_a: endpoint { + remote-endpoint = <&dsi0_out>; + }; + }; + + port@1 { + reg = <1>; + + sn65dsi86_out_ivo: endpoint@c5 { + reg = <0>; + remote-endpoint = <&ivo_panel_in_edp>; + }; + + sn65dsi86_out_boe: endpoint@c4 { + reg = <1>; + remote-endpoint = <&boe_panel_in_edp>; + }; + }; + }; + }; +}; + &i2c11 { status = "okay"; clock-frequency = <400000>; @@ -306,6 +444,14 @@ }; }; +&mdss { + status = "okay"; +}; + +&mdss_mdp { + status = "okay"; +}; + &mss_pil { firmware-name = "qcom/LENOVO/81JL/qcdsp1v2850.mbn", "qcom/LENOVO/81JL/qcdsp2850.mbn"; }; @@ -338,6 +484,14 @@ }; }; +&qup_i2c10_default { + pinconf { + pins = "gpio55", "gpio56"; + drive-strength = <2>; + bias-disable; + }; +}; + &qupv3_id_0 { status = "okay"; }; @@ -349,6 +503,17 @@ &tlmm { gpio-reserved-ranges = <0 4>, <81 4>; + edp_bridge_en: edp-bridge-enable { + pins = "gpio96"; + drive-strength = <2>; + bias-disable; + }; + + edp_bridge_irq: edp-bridge-irq { + pins = "gpio10"; + bias-pull-down; + }; + i2c2_hid_active: i2c2-hid-active { pins = <37>; function = "gpio";