Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp770684ybt; Wed, 1 Jul 2020 09:33:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHsxL9+OFv8J92kIfMfsvAz+cgu85BdHPNsVd6wtPdHPiBjQTP1UYfevgYmXljmylRQZfL X-Received: by 2002:aa7:da4c:: with SMTP id w12mr18164528eds.122.1593621224202; Wed, 01 Jul 2020 09:33:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593621224; cv=none; d=google.com; s=arc-20160816; b=FfTicVo9dMkHhH7p47lhgtXmclxheNhapLKtWCYQpEXmYgXHGjHRJQv3qZjzlqlnQq hsULcpTvZyjt++RQ6B8s8le6qYyvV2VMugKcjzae1E1SO0vhYecDY48+7O4o6elDHP/n E8HZeptbVs8sokNjN/J3ISxVAKTXgGIZEcvE0AO/aXFlTFDSQLW3r3ndlMVQtX3vGbt5 GFPJQttgl+Ne5auRdU7SJZLeQqBKk3gPdg3d7Nkz0g8rAGOB63/MM8mc2sAoDwemRf5a ZYtySWanlrGcQYBsRDv67eLLYtmhSTcNwC795HD8TozeCHddbhcmqrnDAQx/UOyvnndO 3xjw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=MEnVhhtqIlHxJCHsFvgGrFiZOqpBdBtgINIsvbatYzE=; b=DX3EKjKEw0aTJahJadNy48afQzAyBpINHypiQ6K9gV+irrqBo2qg/ssWM2G8riaEwu nLdJv5Uh/mZr8s0S+swKVk7dyet31/ldHZJaOIPBCvoZGgOk4dMJzX3ClBivzFuMyppe nSILWRSJjlCUSkvheh7Jei/C3YZhAreXUpl5MENZhvI4t8Y6RvfZxsVTtZUEYAeQAWR0 Y9kzgWx2DIVWVd4Z17knUvao4S6Mp1rd9OEMokaOgbVxtIkV1CggL5H8Mi2ksrThnEBn b5rk+jYtjT+W3D/kmnUiM6jTnTnmuRQzbU3VnrkL897P9R8kwSs7x1bO9spm3wptkh8e a2tQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@megous.com header.s=mail header.b=G2zYEl85; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=megous.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lg19si4202614ejb.138.2020.07.01.09.33.20; Wed, 01 Jul 2020 09:33:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@megous.com header.s=mail header.b=G2zYEl85; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=megous.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732382AbgGAQ3f (ORCPT + 99 others); Wed, 1 Jul 2020 12:29:35 -0400 Received: from vps.xff.cz ([195.181.215.36]:51976 "EHLO vps.xff.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731672AbgGAQ3e (ORCPT ); Wed, 1 Jul 2020 12:29:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megous.com; s=mail; t=1593620970; bh=h41kKdP+3vto+kElOo0VDi6vKhbrYTeB/TfpQYG9yUo=; h=From:To:Cc:Subject:Date:From; b=G2zYEl85biLHwyEiOFO/kaMcNraHZvQR4O65XcOkok8hz8sKy8bqo2ex81MDBezkl tvKQoudL7UNeTi76xcQSLQWMQKqBaZTC24Su46akCky37oA1eD9IGVchCFdQkWYl5j oWNpKKnFrX28UVUi9vO+xHVZyoR2Jk6FygSV2P5c= From: Ondrej Jirman To: linux-sunxi@googlegroups.com, Thierry Reding , Sam Ravnborg , David Airlie , Daniel Vetter , =?UTF-8?q?Guido=20G=C3=BCnther?= , Purism Kernel Team , Rob Herring , Maxime Ripard , Chen-Yu Tsai , Linus Walleij , Icenowy Zheng Cc: Ondrej Jirman , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Samuel Holland , Martijn Braam , Luca Weiss , Bhushan Shah Subject: [PATCH v7 00/13] Add support for PinePhone LCD panel Date: Wed, 1 Jul 2020 18:29:15 +0200 Message-Id: <20200701162928.1638874-1-megous@megous.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 v7: - Removed mode.vrefresh, rebased onto next-20200701 - v6->v7 diff: https://megous.com/dl/tmp/v6-v7.patch Changes in v6: - Fixed spacing in yaml - Fixed wrong vccio->iovcc supply name in the bindings doc - I noticed that the original driver uses a delay of 20ms in the init function to achieve a combined total of 120ms required from post-reset to display_on. I've added a similar delay to xbd599_init, so that xbd599 panel also has the right timing. (patch 9) - v5->v6 diff: https://megous.com/dl/tmp/v5-v6.patch - Added review/ack tags - Learned to run dt_binding_check by myself ;) 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 | 423 ----------- drivers/gpu/drm/panel/panel-sitronix-st7703.c | 654 ++++++++++++++++++ 9 files changed, 813 insertions(+), 460 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 -- 2.27.0