From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EA2BAC636C9 for ; Sun, 18 Jul 2021 00:32:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C895461153 for ; Sun, 18 Jul 2021 00:32:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232013AbhGRAfD (ORCPT ); Sat, 17 Jul 2021 20:35:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230259AbhGRAe7 (ORCPT ); Sat, 17 Jul 2021 20:34:59 -0400 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED7FEC061764 for ; Sat, 17 Jul 2021 17:32:00 -0700 (PDT) Received: by mail-lf1-x133.google.com with SMTP id g8so16716521lfh.8 for ; Sat, 17 Jul 2021 17:32:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=GiOcA9fDhX332QQkbECnDAuU57MnDvjKhHt74brAsd4=; b=QqbnQgsv/ajdlgCbOM0gq0g7FZNs0AbFigA/0ipXJiEXJGly+tlK9erNMERE8PA2rQ fV/gVY5xNUty2kHdSElmFKDGFoS+yMK3mf7CiRP6LrqKaFPtW5EDm9I4uFh2ZtZh4s3m z4bMO4lo51Dd3Qwhrc++2IKRxPSBmqwPAiUYFMlSPYHp9flltp5ibXqvq61dJlPGJTaQ 0okiiInLKbfmBTEFnH1VyZdD2Ug8K3mh4o2jS+fAxh6J1K14jl3StwsfqWVPhzPYeRRp H45cRIUF/dYngweD8xQ0drMSaJrVAdN3Yn8w3t1wXnRcgfvCknH9ovNC64WK2NC7ho+i WMBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=GiOcA9fDhX332QQkbECnDAuU57MnDvjKhHt74brAsd4=; b=rKShc4uAoxzPBkmX1aXgEKNFMBKXVcdc189M+ExUOnWBRJMa1c4Mzlfc1ywfUohxS6 NdQgP8pgS0RoHLQOpDHlRjfMsrL+9n2/IZp3TmwswJbAWjmbuDH6BiU8eePuwONL1IjL 362pA3rUZNr8R7o+vE45G0988kDSK7XSKM2T7W4gvdIyPZ8MXKpdmNT/r6dWjhm8p+Xs SWYnka9IeOOvWt7eanskOlU4yb1ODrhEI/2eL56IrgeVEoikC3dmta6jraVy6tMnLMYZ +EbBl+9xwKLEfdt7t+14Yq2mB9kpoaFxGB2zthjAA3YTkrNY+IIGSIobCwWy2zcC5OrM c5tQ== X-Gm-Message-State: AOAM530AMIj1zPt1syIBHTaBbzWbH6UEWAB6tRkm9mOx/A+olFvGOiTU H/0nXrnEl/gGMV3LcqdFawJRnmJqEuwf0kF/3IVijg== X-Google-Smtp-Source: ABdhPJzUE4mwcMvftXDt9OelhGDF5Xj2/T270B5egWGsaIKWTNtuSaIt9NhYbKXb4xTog5SSevqmX/HoABHDg7tXXbs= X-Received: by 2002:a05:6512:3f1f:: with SMTP id y31mr6296371lfa.29.1626568319143; Sat, 17 Jul 2021 17:31:59 -0700 (PDT) MIME-Version: 1.0 References: <1626430843-23823-1-git-send-email-dillon.minfei@gmail.com> <1626430843-23823-3-git-send-email-dillon.minfei@gmail.com> In-Reply-To: <1626430843-23823-3-git-send-email-dillon.minfei@gmail.com> From: Linus Walleij Date: Sun, 18 Jul 2021 02:31:48 +0200 Message-ID: Subject: Re: [PATCH 2/2] drm/panel: Add ilitek ili9341 panel driver To: dillon min Cc: "thierry.reding@gmail.com" , Sam Ravnborg , Dave Airlie , Daniel Vetter , Rob Herring , =?UTF-8?Q?Noralf_Tr=C3=B8nnes?= , Doug Anderson , Alexandre Torgue , "open list:DRM PANEL DRIVERS" , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , linux-kernel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Dillon, thanks for your patch! On Fri, Jul 16, 2021 at 12:20 PM wrote: > From: Dillon Min > > This driver combine tiny/ili9341.c mipi_dbi_interface driver > with mipi_dpi_interface driver, can support ili9341 with serial > mode or parallel rgb interface mode by register configuration. > > Signed-off-by: Dillon Min Nice! > +config DRM_PANEL_ILITEK_ILI9341 > + tristate "Ilitek ILI9341 240x320 QVGA panels" > + depends on OF && SPI > + depends on DRM_KMS_HELPER > + depends on DRM_KMS_CMA_HELPER (...) > +#include > +#include > +#include > +#include > +#include Hm now there is a (partial) KMS driver in the panel driver, kinda, sorta. Is this the right split? I'm not the best with DRM infrastructure, just asking. > +struct ili9341_config { > + u32 max_spi_speed; > + /** @mode: the drm display mode */ > + const struct drm_display_mode mode; > + /* @ca: TODO: need comments for this register */ > + u8 ca[ILI9341_CA_LEN]; These are all in the datasheet but I guess you plan to add these TODOs later. (It's fine I suppose, the driver is already very nice.) > + struct regulator *vcc; Use the right name of the pin for the regulator. I guess this is actually vci. I would implement all three regulators and get them as bulk. See e.g. drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c for an example on how to get and enable several regulators using bulk. The regulator framework will provide dummy regulators if you didn't define some of them so it is fine to just provide one or two. Yours, Linus Walleij From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 96FC3C636C9 for ; Sun, 18 Jul 2021 00:32:02 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 53A9561108 for ; Sun, 18 Jul 2021 00:32:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 53A9561108 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 52E096EAC7; Sun, 18 Jul 2021 00:32:01 +0000 (UTC) Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by gabe.freedesktop.org (Postfix) with ESMTPS id BEAD76EAC7 for ; Sun, 18 Jul 2021 00:32:00 +0000 (UTC) Received: by mail-lf1-x12d.google.com with SMTP id x25so22508130lfu.13 for ; Sat, 17 Jul 2021 17:32:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=GiOcA9fDhX332QQkbECnDAuU57MnDvjKhHt74brAsd4=; b=QqbnQgsv/ajdlgCbOM0gq0g7FZNs0AbFigA/0ipXJiEXJGly+tlK9erNMERE8PA2rQ fV/gVY5xNUty2kHdSElmFKDGFoS+yMK3mf7CiRP6LrqKaFPtW5EDm9I4uFh2ZtZh4s3m z4bMO4lo51Dd3Qwhrc++2IKRxPSBmqwPAiUYFMlSPYHp9flltp5ibXqvq61dJlPGJTaQ 0okiiInLKbfmBTEFnH1VyZdD2Ug8K3mh4o2jS+fAxh6J1K14jl3StwsfqWVPhzPYeRRp H45cRIUF/dYngweD8xQ0drMSaJrVAdN3Yn8w3t1wXnRcgfvCknH9ovNC64WK2NC7ho+i WMBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=GiOcA9fDhX332QQkbECnDAuU57MnDvjKhHt74brAsd4=; b=ei6RGbkZN6DN44I9i0zVLimJ+MamSKAiwhYayJ1/zat02WJRSnNkMc6vJOB508fr5m zyQeHkQrf3DeojYIqkSo7g4qRHffdMiYsxEQhM4t/o/m0V3Q94m2db50l2EblC9v7QO1 mWfx0RnZPpwhzZwFaVxt/Kn0Yk2ABWdOXmSmZo6crB6YrRurdy+kb23Z7zUTndmXooeB 2EIt5qrc9GTFmOyeEWc3B99chQZ2HgVCom881/pgd/qjLyj7ttxBa124NYw6WCGsNmsb KVX3N5ebZNQc7mCkUL0IzDsYslOHoBTPVWGiSVkmBRyez3i0bv6Gyt82B83FrRG9WFCp 8EwA== X-Gm-Message-State: AOAM532+G/J5P/zBmeKG7dA+fc77Ktxp7dw9GgpMPCuIrMAWhK/THDo9 i0f4kAiUPwQAbJHESK0utp1mNRjADlUC4p0c0oc8Gw== X-Google-Smtp-Source: ABdhPJzUE4mwcMvftXDt9OelhGDF5Xj2/T270B5egWGsaIKWTNtuSaIt9NhYbKXb4xTog5SSevqmX/HoABHDg7tXXbs= X-Received: by 2002:a05:6512:3f1f:: with SMTP id y31mr6296371lfa.29.1626568319143; Sat, 17 Jul 2021 17:31:59 -0700 (PDT) MIME-Version: 1.0 References: <1626430843-23823-1-git-send-email-dillon.minfei@gmail.com> <1626430843-23823-3-git-send-email-dillon.minfei@gmail.com> In-Reply-To: <1626430843-23823-3-git-send-email-dillon.minfei@gmail.com> From: Linus Walleij Date: Sun, 18 Jul 2021 02:31:48 +0200 Message-ID: Subject: Re: [PATCH 2/2] drm/panel: Add ilitek ili9341 panel driver To: dillon min Content-Type: text/plain; charset="UTF-8" X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , =?UTF-8?Q?Noralf_Tr=C3=B8nnes?= , Dave Airlie , linux-kernel , Doug Anderson , "open list:DRM PANEL DRIVERS" , Alexandre Torgue , Rob Herring , "thierry.reding@gmail.com" , Sam Ravnborg Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hi Dillon, thanks for your patch! On Fri, Jul 16, 2021 at 12:20 PM wrote: > From: Dillon Min > > This driver combine tiny/ili9341.c mipi_dbi_interface driver > with mipi_dpi_interface driver, can support ili9341 with serial > mode or parallel rgb interface mode by register configuration. > > Signed-off-by: Dillon Min Nice! > +config DRM_PANEL_ILITEK_ILI9341 > + tristate "Ilitek ILI9341 240x320 QVGA panels" > + depends on OF && SPI > + depends on DRM_KMS_HELPER > + depends on DRM_KMS_CMA_HELPER (...) > +#include > +#include > +#include > +#include > +#include Hm now there is a (partial) KMS driver in the panel driver, kinda, sorta. Is this the right split? I'm not the best with DRM infrastructure, just asking. > +struct ili9341_config { > + u32 max_spi_speed; > + /** @mode: the drm display mode */ > + const struct drm_display_mode mode; > + /* @ca: TODO: need comments for this register */ > + u8 ca[ILI9341_CA_LEN]; These are all in the datasheet but I guess you plan to add these TODOs later. (It's fine I suppose, the driver is already very nice.) > + struct regulator *vcc; Use the right name of the pin for the regulator. I guess this is actually vci. I would implement all three regulators and get them as bulk. See e.g. drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c for an example on how to get and enable several regulators using bulk. The regulator framework will provide dummy regulators if you didn't define some of them so it is fine to just provide one or two. Yours, Linus Walleij