From patchwork Sun Aug 12 18:41:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 10565119 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id ADBCA1815 for ; Tue, 14 Aug 2018 06:55:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9CFC3293FA for ; Tue, 14 Aug 2018 06:55:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9107C29503; Tue, 14 Aug 2018 06:55:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2D000293FA for ; Tue, 14 Aug 2018 06:55:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3503F6E23A; Tue, 14 Aug 2018 06:55:04 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from asavdk3.altibox.net (asavdk3.altibox.net [109.247.116.14]) by gabe.freedesktop.org (Postfix) with ESMTPS id 77F846E017 for ; Sun, 12 Aug 2018 18:41:58 +0000 (UTC) Received: from ravnborg.org (unknown [158.248.196.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by asavdk3.altibox.net (Postfix) with ESMTPS id 7A8CB20023; Sun, 12 Aug 2018 20:41:53 +0200 (CEST) Date: Sun, 12 Aug 2018 20:41:52 +0200 From: Sam Ravnborg To: Boris Brezillon , Rob Herring , Mark Rutland , Lee Jones , Nicolas Ferre , Alexandre Belloni Subject: [RFC PATCH 0/7] add at91sam9 LCDC DRM driver Message-ID: <20180812184152.GA22343@ravnborg.org> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-CMAE-Score: 0 X-CMAE-Analysis: v=2.3 cv=dqr19Wo4 c=1 sm=1 tr=0 a=ddpE2eP9Sid01c7MzoqXPA==:117 a=ddpE2eP9Sid01c7MzoqXPA==:17 a=kj9zAlcOel0A:10 a=2615zWNuQ_jwnKR2bIgA:9 a=CjuIK1q_8ugA:10 X-Mailman-Approved-At: Tue, 14 Aug 2018 06:55:00 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Sam Ravnborg , linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-pwm@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP New DRM based driver for at91sam9 SOC's that uses the Atmel LCDC IP core. This is first version of a patch set that adds drivers for the Atmel LCDC IP core. Posted for review as the basics works now. The LCDC IP core contains two devices: - a PWM often used for backlight - a LCD display controller Both devices are supported today by the atmel_lcdfb driver. For this new set of drivers the compatible strings was selected to avoid clash with the existing compatible strings used for the atmel_lcdfb driver to allow them to co-exist. This patchset implements three drivers. - A MFD driver that include the generic parts. - A PWM driver. - A DRM display controller driver. This is the same split as used for the Atmel hlcdc IP. The hlcdc and lcdc has only a few things in common and trying to share the code for them was not a viable solution. The DRM implementation has a few shortcomings compared to the existing fbdev based driver: - STN displays are not supported Binding support is missing but most of the STN specific functionality is otherwise ported from the fbdev driver. I assume the info should come from the panel but as I lack HW I have not looked too much into what is required. - gamma support is missing The driver utilises drm_simple_kms_helper and this helper lacks support for setting up gamma. If this is useful please let me know and I will extend drm_simple_kms_helper to support this and update the driver. - modesetting is not checked (see TODO in file) Is this required for such a simple setup? - support for extra modes as applicable (and lcd-wiring-mode) - support for AVR32 (is it relevant?) The first patch renames .../drm/atmel-hlcdc to .../drm/atmel to have a nice home for both drivers. The drivers _works_ on a proprietary at91sam9263 based board and I will eventually migrate the at91sam9263ek over to use it as well. Works is maybe a stretch - the following was tested: modetest shows reasonable output modetest -s shows some nice colored squares vbltest shows 45.70 Hz (after terminating modetest -s with SIGINT) drmdevice shows reasonable output brightness can be controlled Anything else that can be recommended for some basic tests? How to test suspend/resume? REVIEW Please give feedback on general structure/architecture Please check if the drm framework is used in the optimal way And then the usual review from spelling errors, names, style etc. All feedback (from spelling errors to general structure) appreciated! Sam Sam Ravnborg (7): atmel-hlcdc: renamed directory to drm/atmel/ dt-binding: add bindings for Atmel LCDC mfd mfd: add atmel-lcdc driver dt-bindings: add bindings for Atmel LCDC pwm pwm: add pwm-atmel-lcdc driver dt-bindings: add bindings for Atmel lcdc-display-controller drm: add Atmel LCDC display controller support .../display/atmel/lcdc-display-controller.txt | 40 + .../devicetree/bindings/mfd/atmel-lcdc.txt | 75 ++ .../devicetree/bindings/pwm/atmel-lcdc-pwm.txt | 30 + MAINTAINERS | 9 +- drivers/gpu/drm/Kconfig | 2 +- drivers/gpu/drm/Makefile | 2 +- drivers/gpu/drm/atmel-hlcdc/Kconfig | 10 - drivers/gpu/drm/atmel/Kconfig | 28 + drivers/gpu/drm/{atmel-hlcdc => atmel}/Makefile | 2 + .../drm/{atmel-hlcdc => atmel}/atmel_hlcdc_crtc.c | 0 .../drm/{atmel-hlcdc => atmel}/atmel_hlcdc_dc.c | 0 .../drm/{atmel-hlcdc => atmel}/atmel_hlcdc_dc.h | 0 .../{atmel-hlcdc => atmel}/atmel_hlcdc_output.c | 0 .../drm/{atmel-hlcdc => atmel}/atmel_hlcdc_plane.c | 0 drivers/gpu/drm/atmel/atmel_lcdc-dc.c | 1094 ++++++++++++++++++++ drivers/mfd/Kconfig | 10 + drivers/mfd/Makefile | 1 + drivers/mfd/atmel-lcdc.c | 158 +++ drivers/pwm/Kconfig | 13 + drivers/pwm/Makefile | 1 + drivers/pwm/pwm-atmel-lcdc.c | 178 ++++ include/linux/mfd/atmel-lcdc.h | 184 ++++ 22 files changed, 1824 insertions(+), 13 deletions(-)