From patchwork Wed Nov 8 03:52:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lechner X-Patchwork-Id: 835586 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=lechnology.com header.i=@lechnology.com header.b="sAhFupwV"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yWtw46ZrHz9s3T for ; Wed, 8 Nov 2017 15:43:16 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751159AbdKHEnP (ORCPT ); Tue, 7 Nov 2017 23:43:15 -0500 Received: from vern.gendns.com ([206.190.152.46]:49916 "EHLO vern.gendns.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750832AbdKHEnO (ORCPT ); Tue, 7 Nov 2017 23:43:14 -0500 X-Greylist: delayed 3040 seconds by postgrey-1.27 at vger.kernel.org; Tue, 07 Nov 2017 23:43:14 EST DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lechnology.com; s=default; h=Message-Id:Date:Subject:Cc:To:From:Sender: Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=j9Mk5JyF1no8BGHRs8yxYDyE8cpMH7HWUBvBUdtpKZU=; b=sAhFupwVqkSQuTqJWv/KBMXKl6 /sagMRyo0J4QwgfGFjDLT5uroQiidiUiOodraWDekNCGSXKsFElIB2jqki8aQJYU8qANDUJ5sS7Sv 13nSXqINswficnkN2E5X65NO94Xcf+k+FyrcX8oiugzK0enbXKlkviqvtqbK7bxU8T6UoyxhFUxup RZYv1s1MvNvuQFJXGxNMsbcWylZqTDUlhnX3QH+02aG2fNaLpegE9Oc5MRd8irp+2hMyADe9ZQR2P jzOHByEbw5f7baLhxl/cqQedPqFgwetOt54O8VhEohPc2Hf7D/lk+PDoj2QZ9Yz5qhjluBbCuVhLS uoLwGAEw==; Received: from 108-198-5-147.lightspeed.okcbok.sbcglobal.net ([108.198.5.147]:47358 helo=freyr.lechnology.com) by vern.gendns.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-SHA256:128) (Exim 4.89) (envelope-from ) id 1eCHOv-003JjM-Ie; Tue, 07 Nov 2017 22:51:41 -0500 From: David Lechner To: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org Cc: David Lechner , =?utf-8?q?Noralf_Tr=C3=B8nnes?= , Rob Herring , Mark Rutland , linux-kernel@vger.kernel.org Subject: [PATCH v1 0/2] DRM driver for ILI9225 display panels Date: Tue, 7 Nov 2017 21:52:14 -0600 Message-Id: <1510113136-6788-1-git-send-email-david@lechnology.com> X-Mailer: git-send-email 2.7.4 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vern.gendns.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lechnology.com X-Get-Message-Sender-Via: vern.gendns.com: authenticated_id: davidmain+lechnology.com/only user confirmed/virtual account not confirmed X-Authenticated-Sender: vern.gendns.com: davidmain@lechnology.com X-Source: X-Source-Args: X-Source-Dir: Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This is a new driver for ILI9225 based display panels. There are a couple of things that stand out: 1. Despite my best efforts, I could not find a name for this display[1], so I have made up a generic name for it. If someone recognizes this and has a name for it, please speak up. The best documentation I could find was here[2]. 2. There is quite a bit of one-off code copied from mipi-dbi.c. Based on the feedback from a previous patch series, I'm guessing that we don't want to modify mipi-dbi.c to accommodate the ILI9225 controller because the ILI9225 controller does not use standard MIPI commands. ILI9225 has it's own non-standard command set, but other than that, it pretty much matches the generic mipi-dbi driver in all regards. Code that could be easily shared: a. ili9225_buf_copy() is exactly the same as mipi_dbi_buf_copy() - ili9225_buf_copy() is used in ili9225_fb_dirty() - mipi_dbi_buf_copy() is static in mipi-dbi.c b. ili9225_spi_cmd_max_speed() is exactly the same as mipi_dbi_spi_cmd_max_speed() - ili9225_spi_cmd_max_speed() is used in ili9225_command() below, so would not need to be copied if mipi_dbi_typec3_command() could be shared - mipi_dbi_spi_cmd_max_speed() is static in mipi-dbi.c c. ili9225_command() is nearly the same as mipi_dbi_typec3_command() - a few unused lines were removed so I didn't have to copy even more code, but these would not be an issue if code was shared - cmd == ILI9225_WRITE_DATA_TO_GRAM instead of cmd == MIPI_DCS_WRITE_MEMORY_START d. ili9225_spi_init() is nearly the same as mipi_dbi_spi_init() - a few unused lines were removed so I didn't have to copy even more code, but these would not be an issue if code was shared - mipi->command = ili9225_command instead of mipi->command = mipi_dbi_typec3_command - this function would not need to be copied if mipi_dbi_typec3_command() was modified to work with the ILI9225 command set too e. ili9225_init() is nearly the same as mipi_dbi_init() - only difference is ili9225_fb_funcs instead of mipi_dbi_fb_funcs 3. I haven't tried it, but I believe that it is possible to implement DRM_FORMAT_RGB888 directly instead of simulating DRM_FORMAT_XRGB8888. I don't know if there would be any real benefit to doing this. I am not familiar enough with userspace programs/libraries to know if this mode is universally used. And, it will only physically be 18-bit color instead of 24-bit but will increase the amount of data transferred by 50% (3 bytes per pixel instead of 2). Implementing this would have a side effect of making the one-off shared code (described above) more than one-off though. [1]: https://github.com/Nkawu/TFT_22_ILI9225 [2]: http://www.hotmcu.com/22-176x220-tft-lcd-with-spi-interface-p-316.html David Lechner (2): dt-bindings: Add binding for Ilitek ILI9225 display panels drm/tinydrm: add driver for ILI9225 panels .../devicetree/bindings/display/ilitek,ili9225.txt | 25 + MAINTAINERS | 6 + drivers/gpu/drm/tinydrm/Kconfig | 10 + drivers/gpu/drm/tinydrm/Makefile | 1 + drivers/gpu/drm/tinydrm/ili9225.c | 547 +++++++++++++++++++++ 5 files changed, 589 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/ilitek,ili9225.txt create mode 100644 drivers/gpu/drm/tinydrm/ili9225.c --- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html