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=-5.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,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 E66F0C433E1 for ; Thu, 14 May 2020 14:08:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C4A7C20671 for ; Thu, 14 May 2020 14:08:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Dj7/g773" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727839AbgENOIN (ORCPT ); Thu, 14 May 2020 10:08:13 -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-Google-Smtp-Source: ABdhPJx5t1yZM5yB0Se02KNKlQ3Kf5olZkwfnoQ7/EcJOQjcx6eZpQDoXhQSKSv4wdy91TSKQPnH1L4MsQ9yfH5F0tc= 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 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=-5.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,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 0FD57C433E0 for ; Thu, 14 May 2020 14:08:19 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 CE46120671 for ; Thu, 14 May 2020 14:08:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Rro4hJK8"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Dj7/g773" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CE46120671 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=7zLesntDIs7weLds9+Qr7uU7n129Hjs0sMozViLugWA=; b=Rro4hJK8qtMBnB nuPZfFD2DJPS6ls46b0xJpq63DNQcyATKyDiv3tXuC1V7m8GsqFHM+j07jY7XkHI8RWaZwllSYgUm v8VePMT8gfCvFtdaLO2pEcZrfITRvHY8OUvGwUw1TesDgVb6eBBJoalKGrdmnbgSRNvGU1UNlWQk1 wU8HVoTfh+bZSJpI3c7wGEW8oqyZQu3XaavIlZEL5cQfhP4cgIXED1CTvCmmwsaPqspdjG5hibKtD 9MbIN9I4I3OaQWa88njXC0q9d9q47OTcPsuc3lMHB4pJOFGzm4m9Sus3Fxsxj1xduqYT4G9xg53QI GKlymsz4xVs/844fG36Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jZEX3-0004zK-FO; Thu, 14 May 2020 14:08:17 +0000 Received: from mail-lj1-x244.google.com ([2a00:1450:4864:20::244]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jZEWz-0004yw-N8 for linux-arm-kernel@lists.infradead.org; Thu, 14 May 2020 14:08:15 +0000 Received: by mail-lj1-x244.google.com with SMTP id f18so3624512lja.13 for ; Thu, 14 May 2020 07:08:12 -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=rl+YneRyJO5doVYLyeID4pURXhzgFf76H5FCUQAwVNuoQ2NO6hq3p8dPfhTLGg4l0X fDRyFxs3y2jbSi+oWfUTgm6HoC09vulL60KQxgfrDTzwNe5hqu3BwF2UENmeXyDi1e9s Qrhi54GLXfYvx81akaBPvJnwZAFWjIcFqbDi1r1MlHhhUtzfIWVnu2IzK6MPNmfPtZyi FfOKUfZDYkjci8ULSURbkekwDvAwEnZAKgkfNeQyqivBHDHhlsTd8dR8isJnZd/XOeRV G96iyOXMA27mllnIJ+wCzxzJs0qbUTaLGp2fC9Qy8RsStpiWtvwfkL0v9+2ymz8pmkMe IvQg== X-Gm-Message-State: AOAM532SsY5YCoeKzDZFvgjsO4LsJGNoFnYQA35CEQ0NAwIMEn+AMSqU WRUtJmn9dCf5otWaixoqy/dQShjRZ96fxjstq+I0nA== X-Google-Smtp-Source: ABdhPJx5t1yZM5yB0Se02KNKlQ3Kf5olZkwfnoQ7/EcJOQjcx6eZpQDoXhQSKSv4wdy91TSKQPnH1L4MsQ9yfH5F0tc= 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200514_070813_760478_951FD2A2 X-CRM114-Status: GOOD ( 15.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Alexandre TORGUE , Dave Airlie , Michael Turquette , "linux-kernel@vger.kernel.org" , "open list:DRM PANEL DRIVERS" , linux-clk , Stephen Boyd , Rob Herring , "thierry.reding@gmail.com" , Maxime Coquelin , Daniel Vetter , Sam Ravnborg , linux-stm32@st-md-mailman.stormreply.com, Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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=-5.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 839B4C433E0 for ; Thu, 14 May 2020 14:08:13 +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 58AF720727 for ; Thu, 14 May 2020 14:08:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Dj7/g773" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 58AF720727 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 B006589F89; Thu, 14 May 2020 14:08:12 +0000 (UTC) Received: from mail-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 30B2F89F89 for ; Thu, 14 May 2020 14:08:12 +0000 (UTC) Received: by mail-lj1-x242.google.com with SMTP id l19so3638877lje.10 for ; Thu, 14 May 2020 07:08:12 -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=RP05vAMueVFyD2/hG7ZEQjn0RQwOuP4ID0ghvLHK3xy/oWCwlOTt7+lpIeVLsxMY2u B3bMxzdNHVHBufqBCVcd0NdY8noAp3l3yrvwLjscx4EBmXX6cmT4S4gZ/XB/5QacY/TY hukEVxq+arMtWu1hwvsZgQn4XL4kN0PdkTQa85jgYRncgOUogZsbVKUIrByHgJKA4dFC MD7EBybKN1zD4U2R+hdwQY5rY0oprTflKXwhwk7d70mtTHBgTtvqYYwVQYwrIEtx3MTG 9Uv81cCrCe5IZCm+0doKP6nAepWGluqM9IGN5ir8uW4mpWoFMtZWaSdS5iTKwFgl4veA 5PXg== X-Gm-Message-State: AOAM532kYTShfsWXbM1q8qoY/aqwZrcSXWzfy/LzBs3VG7jfxMzAK2Pd DTlI51twHTqjh6F/rmWzdeT/eghNrt+ZbsHGQZWMSw== X-Google-Smtp-Source: ABdhPJx5t1yZM5yB0Se02KNKlQ3Kf5olZkwfnoQ7/EcJOQjcx6eZpQDoXhQSKSv4wdy91TSKQPnH1L4MsQ9yfH5F0tc= 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 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" , Alexandre TORGUE , Dave Airlie , Michael Turquette , "linux-kernel@vger.kernel.org" , "open list:DRM PANEL DRIVERS" , linux-clk , Stephen Boyd , Rob Herring , "thierry.reding@gmail.com" , Maxime Coquelin , Sam Ravnborg , linux-stm32@st-md-mailman.stormreply.com, Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel