Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1362523ybk; Thu, 14 May 2020 07:12:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCm1t6Wp7F/5KsucVX/nOkfmBENGftwWIt7GbJK9yVYOULAFOu6cmHOY242JhHoTfEW91G X-Received: by 2002:a05:6402:1bc1:: with SMTP id ch1mr4260018edb.90.1589465545946; Thu, 14 May 2020 07:12:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589465545; cv=none; d=google.com; s=arc-20160816; b=xrCl8FW+TRts26hXqfA3K42F9IVRPwgJIk9Bj6q3dAwxdjlb4ZAbdChXlnJPRKCAuQ blvShJPQaoKRhhmON+DWLjeQIgcSMNjHX8L8W7Sd1OmJutlvklHHyeVjOUK7b0pa1BlV MsoD+slKkudVPevos00tK/2fUqCDqZkNHxjde1HIGGlivQAzGtgiJ9dbLNl8EO8hCrrS 5mqqpUviMZq9SIFne6eRqdjxZLKfXodmYfIgT75GP/xjnuy3j+Nx7QKQ9PqIFPSPsh0V oOofZ6Erei1kBNzbU6b1zx6TFWeRlE//CyeAIBKzfahH5qgiRefkmVwFtBaxCDoO02Zs 32Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=4tjpLfreP4k0pSGmLfKu7J4qVyl2PfcgR+DBUFuyQfI=; b=XjQyXYmzLbuX0ySiTqLp1E4CK8PujHzA6e11srvbGcQL+9nrFznZPAtq473Ev/+fKP 03mb99nHiUImDS5BB01kGmfMue5gKF8QaccODbeHWd/sGgEZMWH/vH4y+ArN/XKwwR8B TzSdgBcwpgD/DIsMUKY8qGADv0VFfM0OywwqP7R01/TyqqGeFmdUxBxSAqFuZLb4RDjf AcAbPc2putOcG3teZFp+y562eeAlEdqbotFvz2+7MCOjUm/f8HJYNDA+RpYReaJj5l+D n4MOxlQxuiB1xRoMr4vxNmp15TZkCyRnkwMtF5EvujKwHbu5Yy8mejyUl3CLs7JRi6bC 2u0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Dj7/g773"; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d32si1804659edc.454.2020.05.14.07.12.02; Thu, 14 May 2020 07:12:25 -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=@linaro.org header.s=google header.b="Dj7/g773"; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727834AbgENOIM (ORCPT + 99 others); Thu, 14 May 2020 10:08:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726707AbgENOIM (ORCPT ); Thu, 14 May 2020 10:08:12 -0400 Received: from mail-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12AE8C061A0E for ; Thu, 14 May 2020 07:08:12 -0700 (PDT) Received: by mail-lj1-x242.google.com with SMTP id j3so3646980ljg.8 for ; Thu, 14 May 2020 07:08:11 -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=4tjpLfreP4k0pSGmLfKu7J4qVyl2PfcgR+DBUFuyQfI=; b=Dj7/g773oDlRsTiNUR7xo2qlLm/wu1orsMurVYbTiR6KmugblKgadVSe7mPERK4aCL vEPNEYTpo0FsOvkLTFcAR67KlJyF7Lm0tYMvWEFjNfuewnDqxPfak/mLCAwyBwyRj2ir q0by15fYjqzhJnUNE1ONVJGr3vLUxaVTcB05C/nT5aCMA95AP0XrrQXYs66hWza3MVLf R+msddyOYrqaHHXoL1h2Zg7FvdZ9e0msvkVGT4lgti3NVlNIlsRBi9Wq6iHo7+nPlyp+ J4SOOLifvlUKFSIzHAfmGa1qomnjT8z0ZSZ1URkY4VQZLOT1r8zjI6FEv5Gh00Bgxe6d cS2g== 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=4tjpLfreP4k0pSGmLfKu7J4qVyl2PfcgR+DBUFuyQfI=; b=WW64coZG4UEYECie2wwd6BeIGwgBGbVEJPVKmzP/y3OYtOTo6k3jcCOg+qm/ND7W1q b3hhMnreEYj10IOJfy7KISbD4vgLZj5ylzIrbstMaPeTuFI/nrBAvcSH6/+jRjS4lvXt 1OGq9lh3QRp//TKvWyDiYSPxV9s7HOIpyq1T2QTVwRsq+174TNCszdphEXQ8SVKclRtp Z9AzBKzPtXBAds4I71U2iw7UtBDhRzmA/DnMwXps+7QnoG2An0BzZNx7N0e/0C0XcfvO WFv3XvXlO5vH+lka+czy8cff++O7KgCfrHhnvFokJvE7sRJzQslyPmEcbcC//L3jVDlf O7fQ== X-Gm-Message-State: AOAM532jSucC/S1Fg4mFOSbPudkIo+giTtTcVXvlZ2E4LL98iaOjI9wk KqBfAxmGdBaV0Bueji5HbBNkJgBwwQIsz5UWJ56xhg== X-Received: by 2002:a2e:531e:: with SMTP id h30mr2030382ljb.168.1589465290360; Thu, 14 May 2020 07:08:10 -0700 (PDT) MIME-Version: 1.0 References: <1589267017-17294-1-git-send-email-dillon.minfei@gmail.com> <1589267017-17294-6-git-send-email-dillon.minfei@gmail.com> In-Reply-To: From: Linus Walleij Date: Thu, 14 May 2020 16:07:57 +0200 Message-ID: Subject: Re: [PATCH v3 5/5] drm/panel: Add ilitek ili9341 driver To: dillon min Cc: Rob Herring , Maxime Coquelin , Alexandre TORGUE , "thierry.reding@gmail.com" , Sam Ravnborg , Dave Airlie , Daniel Vetter , Michael Turquette , Stephen Boyd , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , linux-stm32@st-md-mailman.stormreply.com, Linux ARM , "linux-kernel@vger.kernel.org" , "open list:DRM PANEL DRIVERS" , linux-clk Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 14, 2020 at 12:22 PM dillon min wrote: > > > + /* Gamma */ > > > + mipi_dbi_command(dbi, ILI9341_3GAMMA_EN, 0x00); > > > + mipi_dbi_command(dbi, MIPI_DCS_SET_GAMMA_CURVE, 0x01); > > > + mipi_dbi_command(dbi, ILI9341_PGAMMA, > > > + 0x0f, 0x31, 0x2b, 0x0c, 0x0e, 0x08, 0x4e, 0xf1, > > > + 0x37, 0x07, 0x10, 0x03, 0x0e, 0x09, 0x00); > > > + mipi_dbi_command(dbi, ILI9341_NGAMMA, > > > + 0x00, 0x0e, 0x14, 0x03, 0x11, 0x07, 0x31, 0xc1, > > > + 0x48, 0x08, 0x0f, 0x0c, 0x31, 0x36, 0x0f); > > > > It seems to be copies of the stuff above, but why is there a different > > gamma if you use DBI? > for dbi interface, currently i just copy the code from tiny/ili9341.c. > as so many boards use this driver now, like raspberry pi, etc > i'm afraid it's will not work after modification. so, just leave the > original code there. OK if you move it to ili9341_config it will be clear which panels need this gamma and which panels need another gamma. I think there should be one ili9341_config for the new st,* variant and one for the old DBI variant. > anther question: > is there any panel driver have dbi & dpi or dpi & dsi supported? which > i mean support > two different panel interface in one driver. > thanks Usually you split the driver in three files becuase a driver can only list one initcall, and also it makes it modularized. There is nothing in-tree but look at my branch here: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik.git/log/?h=ux500-skomer-v5.7-rc1 You see how I split up the s6e63m0 driver in one SPI part and one DSI part: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik.git/commit/?h=ux500-skomer-v5.7-rc1&id=6c0e1fb5df5fa8fa857dee65f6c0f54d06d158a7 https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik.git/commit/?h=ux500-skomer-v5.7-rc1&id=cfbf562cc709b53b62f5fbc7fedf176ffa17b088 The overall idea should work the same with DBI. Yours, Linus Walleij Yours, Linus Walleij