From patchwork Wed Jun 17 00:32:04 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: 1310827 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=megous.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=megous.com header.i=@megous.com header.a=rsa-sha256 header.s=mail header.b=TIuel8Qm; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 49mmHb6fZ7z9sSd for ; Wed, 17 Jun 2020 10:32:43 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726572AbgFQAcR (ORCPT ); Tue, 16 Jun 2020 20:32:17 -0400 Received: from vps.xff.cz ([195.181.215.36]:44112 "EHLO vps.xff.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725894AbgFQAcQ (ORCPT ); Tue, 16 Jun 2020 20:32:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megous.com; s=mail; t=1592353933; bh=3DltW7Xjb/ItNKdpuNJ0j4SFSJbomVCA6l+130ne/oQ=; h=From:To:Cc:Subject:Date:From; b=TIuel8QmQBPWbMa5I/MdP4HRXX+hyBQg6/kjHEip4KK4sUL/lhZwT5ZgXEmPSFvJz OqkBVhXwxewBCdd2r/qzfnEnyGw3SAalvQsDNvjIkBXxMe3jC7BEHcjnIHMEFHvCh7 NQcQPIbY8391ZxkBNH5B81PkUcuKGCex1xaO7fJs= From: Ondrej Jirman To: linux-sunxi@googlegroups.com, Thierry Reding , Sam Ravnborg , David Airlie , Daniel Vetter , 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 v4 0/5] Add support for PinePhone LCD panel Date: Wed, 17 Jun 2020 02:32:04 +0200 Message-Id: <20200617003209.670819-1-megous@megous.com> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This patchset adds support for the LCD panel of PinePhone. The first 3 patches are for the panel itself, and the last 2 patches are for enabling it on PinePhone. I've tested this on PinePhone 1.0 and 1.2. Please take a look. thank you and regards, Ondrej Jirman 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 (4): dt-bindings: vendor-prefixes: Add Xingbangda dt-bindings: panel: Add binding for Xingbangda XBD599 panel drm: panel: Add Xingbangda XBD599 panel (ST7703 controller) arm64: dts: sun50i-a64-pinephone: Enable LCD support on PinePhone Ondrej Jirman (1): arm64: dts: sun50i-a64-pinephone: Add touchscreen support .../display/panel/sitronix,st7703.yaml | 63 +++ .../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 | 10 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-sitronix-st7703.c | 535 ++++++++++++++++++ 7 files changed, 684 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/panel/sitronix,st7703.yaml create mode 100644 drivers/gpu/drm/panel/panel-sitronix-st7703.c