From patchwork Fri Jun 26 00:55:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ond=C5=99ej_Jirman?= X-Patchwork-Id: 11627273 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 C58BD92A for ; Fri, 26 Jun 2020 11:46:47 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 8E2A120781 for ; Fri, 26 Jun 2020 11:46:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="xR7f1D2d"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="qitU7Lm9"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=megous.com header.i=@megous.com header.b="Xw0eueqv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8E2A120781 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=megous.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=i+SJDUV+EgXtuJzlII5DyBurqxB/FdhCAdbzyEfNq3Y=; b=xR7f1D2daJs/jUz3O2Ssb7uTkj LmWlG919Ul2x07VyX8jH64VtD0/4l8PWObUZUO52k+FBnAJ1FmIzwvEcejVdgcqtPohC8H/e+WcVP VvzM6iIQXIZR3yaw/rOMzxMYnsOZcswTAXeZC24Gdm9qlPHvW7eJkOrLFGGNZ0y7SL+9QHRMR/kfZ I8Eew1fjQy5ET7Lq8uDuEixbJYVlINsn455Cs5UcyPxMNo7OupAfAgriNbmvUf0UjaORmhIW/Ovl8 qMh9cpRoynDwljKYB5WNW3BkI8fxSjxWLmYebOANT/qEW4TbAh0o2e8rAPPm+R92FYIo9R2+imLSJ KfVX5I6g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jommu-0002iz-6N; Fri, 26 Jun 2020 11:44:56 +0000 Received: from casper.infradead.org ([90.155.50.34]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jolME-0000bm-Vp for linux-arm-kernel@merlin.infradead.org; Fri, 26 Jun 2020 10:13:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:In-Reply-To:References; bh=0jX1eOeBRBh8LbmOjNlN+h19JaqfPZ57TOp/jivBF1M=; b=qitU7Lm9MlaC1US0xd9993HaTO 6ALWNxpPMDy8f+ia7TQWhDpOXCRrvVCuAe4SIKbsdiBPTtT7pVQJVQd5PeL1PBjMWA8MEWx+cR4Pi UCvCyElCzmyCJ5O6rvlkknWFl6LI8nG+uYsbic6E5NgsAOfpw5jol11JlIJbz2NNpxCUxkbhI8L14 8BiN/Oy+yErTggCmZmimyHW/kk6/8fa0o0lRZF1AyQTBOPsRak8io3L5dDfWKBCqugz1L1gXz2w1u +CMAYykbvUYAiYku156yn1gNFEOJlGfx8DaJ6/6A3w/+cg/42Nh3GHpoxmhAYzi472B0K/MoUTMIW pfOx5hDA==; Received: from vps.xff.cz ([195.181.215.36]) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jocf7-0003WU-TG for linux-arm-kernel@lists.infradead.org; Fri, 26 Jun 2020 00:56:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megous.com; s=mail; t=1593132963; bh=d1pLcaDef4Me95L2X7dipb6sm+nm/smqudPJGr/v5sM=; h=From:To:Cc:Subject:Date:From; b=Xw0eueqvF8EvLsITl/CmUIa+ctT2ZIEAMF4BTKRdoHTWQIWYHVZM/dDOkkuyUGdY7 qmCQZrTtdL6BhyxPgCx2sGJ/iAFgANis8R6nI/dhOrxvFJM2wtzo0i9Y83KOT0essr ND09SC57+3O+bsaFZdTJjfbr8DqVLOSnRS2//TMQ= From: Ondrej Jirman To: linux-sunxi@googlegroups.com, Thierry Reding , Sam Ravnborg , David Airlie , Daniel Vetter , =?utf-8?q?Guido_G=C3=BCnther?= , Purism Kernel Team , Rob Herring , Maxime Ripard , Chen-Yu Tsai , Linus Walleij , Icenowy Zheng Subject: [PATCH v5 00/13] Add support for PinePhone LCD panel Date: Fri, 26 Jun 2020 02:55:48 +0200 Message-Id: <20200626005601.241022-1-megous@megous.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200626_015614_494715_77F5AB84 X-CRM114-Status: GOOD ( 21.50 ) X-Spam-Score: -2.1 (--) X-Spam-Report: SpamAssassin version 3.4.4 on casper.infradead.org summary: Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ondrej Jirman , devicetree@vger.kernel.org, Samuel Holland , Bhushan Shah , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Luca Weiss , Martijn Braam , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org This patchset adds support for the LCD panel of PinePhone. I've tested this on PinePhone 1.0 and 1.2. Please take a look. thank you and regards, Ondrej Jirman Changes in v5: - rewritten on top of rocktech-jh057n00900 driver - rocktech-jh057n00900 renamed to st7703 (controller name) - converted rocktech-jh057n00900 bindings to yaml and extended for xbd599 Changes in v4: - use ->type from the mode instead of hardcoding (Samuel) - move init_sequence to ->prepare (Samuel) - move anti-flicker delay to ->enable, explain it (Samuel) - add enter_sleep after display_off (Samuel) - drop ->disable (move code to ->unprepare) - add ID bytes dumping (Linus) (I can't test it since allwinner DSI driver has a broken dcs_read function, and I didn't manage to fix it.) - document magic bytes (Linus) - assert reset during powerup - cleanup powerup timings according to the datasheet Changes in v3: - Panel driver renamed to the name of the LCD controller - Re-organize the driver slightly to more easily support more panels based on the same controller. - Add patch to enable the touchscreen to complete the LCD support on PinePhone. - Dropped the "DSI fix" patch (the driver seems to work for me without it) - Improved brightness levels handling: - PinePhone 1.0 uses default levels generated by the driver - On PinePhone 1.1 duty cycles < 20% lead to black screen, so default levels can't be used. Martijn Braam came up with a list of duty cycle values that lead to perception of linear brigtness level <-> light intensity on PinePhone 1.1 - There was some feedback on v2 about this being similar to st7701. It's only similar in name. Most of the "user commands" are different, so I opted to keep this in a new driver instead of creating st770x. Anyone who likes to check the differences, here are datasheets: - https://megous.com/dl/tmp/ST7703_DS_v01_20160128.pdf - https://megous.com/dl/tmp/ST7701.pdf Changes in v2: - DT Example fix. - DT Format fix. - Raised copyright info to 2020. - Sort panel operation functions. - Sort inclusion. -- For phone owners: -- There's an open question on how to set the backlight brightness values on post 1.0 revision phone, since lower duty cycles (< 10-20%) lead to backlight being black. It would be nice if more people can test the various backlight levels on 1.1 and 1.2 revision with this change in dts: brightness-levels = <0 1000>; num-interpolated-steps = <1000>; and report at what brightness level the backlight turns on. So far it seems this has a wide range. Lowest useable duty cycle for me is ~7% on 1.2 and for Martijn ~20% on 1.1. Icenowy Zheng (2): dt-bindings: vendor-prefixes: Add Xingbangda arm64: dts: sun50i-a64-pinephone: Enable LCD support on PinePhone Ondrej Jirman (11): dt-bindings: panel: Convert rocktech,jh057n00900 to yaml dt-bindings: panel: Add compatible for Xingbangda XBD599 panel drm/panel: rocktech-jh057n00900: Rename the driver to st7703 drm/panel: st7703: Rename functions from jh057n prefix to st7703 drm/panel: st7703: Prepare for supporting multiple panels drm/panel: st7703: Move code specific to jh057n closer together drm/panel: st7703: Move generic part of init sequence to enable callback drm/panel: st7703: Add support for Xingbangda XBD599 drm/panel: st7703: Enter sleep after display off drm/panel: st7703: Assert reset prior to powering down the regulators arm64: dts: sun50i-a64-pinephone: Add touchscreen support .../display/panel/rocktech,jh057n00900.txt | 23 - .../display/panel/rocktech,jh057n00900.yaml | 70 ++ .../devicetree/bindings/vendor-prefixes.yaml | 2 + .../allwinner/sun50i-a64-pinephone-1.1.dts | 19 + .../dts/allwinner/sun50i-a64-pinephone.dtsi | 54 ++ drivers/gpu/drm/panel/Kconfig | 26 +- drivers/gpu/drm/panel/Makefile | 2 +- .../drm/panel/panel-rocktech-jh057n00900.c | 424 ------------ drivers/gpu/drm/panel/panel-sitronix-st7703.c | 655 ++++++++++++++++++ 9 files changed, 814 insertions(+), 461 deletions(-) delete mode 100644 Documentation/devicetree/bindings/display/panel/rocktech,jh057n00900.txt create mode 100644 Documentation/devicetree/bindings/display/panel/rocktech,jh057n00900.yaml delete mode 100644 drivers/gpu/drm/panel/panel-rocktech-jh057n00900.c create mode 100644 drivers/gpu/drm/panel/panel-sitronix-st7703.c