Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp4560898rwo; Tue, 25 Jul 2023 07:51:08 -0700 (PDT) X-Google-Smtp-Source: APBJJlGPtPHG3J6QUC84auiww7dIgp5Wuwrgy4cWFiqBs1hsDhyMjNCWG5T69K8zammluCXsoWO1 X-Received: by 2002:a17:906:64da:b0:993:f6c8:300f with SMTP id p26-20020a17090664da00b00993f6c8300fmr12339535ejn.15.1690296667721; Tue, 25 Jul 2023 07:51:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690296667; cv=none; d=google.com; s=arc-20160816; b=eS02X6ZKRzffewxx4b/Y6XP1AIDzRnvIecEQIca6T6Fnoa8EzmxEmY6DRVtWLCUW7W ULglDFwg/u0USlni9fYDRbYpdmJCUsOp2RWJbzhFMPIV1OYJv5C26pDDVtYTXGzTr6uP av5/mYw9UtpYYQtBKIPrJSvurcbWsiaFkBb+r+3eP0JKn/IYBeyUSslp4Zo0aq0N6at4 gZaFC/9uysCRyGjkHuHWdjMF0wb7eIdMNVQ5VvENTa/Kg6hrj8xJaoXdKr/Hd6n73QAM hUGWklbrNlsGjR8xE2GNibWLuGUozTpW3KY3e+si2B8MXx0VcrNqmWFn3yEjHOKhTqBO Mf+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :content-language:references:cc:to:subject:from:user-agent :mime-version:date:message-id:dkim-signature; bh=f9EB8X33aRUmZMKRYPVjUaySzT93jlxRxPUesuKBKeg=; fh=UjIHRN1QWuUkb2U+EJOUkYAqNHNXoBu4CSJY/jMXn5E=; b=XsmsyE9Pae9lNbf1lQmdFik85cZZNYpb1dWBQcPP9z0YmkcUy0xiX+fTNPUVga10TX iT+yF5T+Yfl1SgCBnbliK2EL/4MfGmdYTJ/kFjJbOKKlmuezidBodeDkN/N3kEi7sO4s vc3Ln2CZTn7++A/v77F5fNQygL3lMLZhNozIDsejyxwh+k5aHZRtq++HtA0uBlh+RLV8 aVVXSgloGTICHKn2tvMRgm2isqxWW1VoLUx/ejEGpyYJ6CEqAoRG9nxu62LgTW/YfLz1 B4jWNLrMCRzIMOxnQh0gqfZju/RnPnpyvrKOGZ7+gMHcjUAXjRDWRP3ydCwGXbk0NQVD UvwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=DKA9d51v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a14-20020a170906670e00b0098d2f715b89si7902263ejp.102.2023.07.25.07.50.43; Tue, 25 Jul 2023 07:51:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=DKA9d51v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231663AbjGYOUr (ORCPT + 99 others); Tue, 25 Jul 2023 10:20:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232479AbjGYOUg (ORCPT ); Tue, 25 Jul 2023 10:20:36 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F1B12136 for ; Tue, 25 Jul 2023 07:16:29 -0700 (PDT) Received: from [IPV6:2a01:e0a:212:79f0:c61e:ae3f:a2:fe43] (unknown [IPv6:2a01:e0a:212:79f0:c61e:ae3f:a2:fe43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: aferraris) by madras.collabora.co.uk (Postfix) with ESMTPSA id B90126600357; Tue, 25 Jul 2023 15:16:01 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1690294562; bh=8Yx9/u1pnkdZXQC7WxaG0vujP7+zkjx6QBkYxWSjdK4=; h=Date:From:Subject:To:Cc:References:In-Reply-To:From; b=DKA9d51vwnwDR0IWHIyIlJrlyFdB1FrOiuAOkcot4BeSxaJtqlPgUl/j49CZMX3/A 5RGxUFElafn48CtKEsQ7EQNDfmICbl4PzEEap7kmC+ABnqLuiLd1GCt63dSgKsdkv2 ICvvh5DNWxCx5TVa3yf0BX93OYISR3MEr5cvqtsCmAc/Rqf/h4FUj7XjmimzpYrQGL QXSdGI/HLcR9NCg5OO8iJ5hkZHnLSwOMImVOh1zg5deR/R4CnILOXhK6AdKShH266h fM8YSW3WblWH+9+5JSg036PP9cdrW7J21dxZzOm0/rZBtndGGlAMrwZzx3BAhNKUwd 9WO2k1in5pOGg== Message-ID: <0623ebc5-eef8-2c93-040f-eeeabc79ce17@collabora.com> Date: Tue, 25 Jul 2023 16:15:58 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 From: Arnaud Ferraris Subject: Re: [PATCH v5 2/2 RESEND] drm: panel: Add novatek nt35596s panel driver To: Linus Walleij Cc: Neil Armstrong , Sam Ravnborg , David Airlie , Daniel Vetter , Sumit Semwal , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Molly Sophia References: <20230719152007.197710-1-arnaud.ferraris@collabora.com> <20230719152007.197710-3-arnaud.ferraris@collabora.com> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Linus, Le 23/07/2023 à 18:45, Linus Walleij a écrit : > Hi Arnaud & Molly, > > overall the driver looks very good! > > On Wed, Jul 19, 2023 at 5:20 PM Arnaud Ferraris > wrote: > >> From: Molly Sophia >> >> Novatek NT35596s is a generic DSI IC that drives command and video mode >> panels. Add the driver for it. Currently add support for the LCD panel >> from JDI connected with this IC, as found on Xiaomi Mi Mix2s phones. >> >> Signed-off-by: Molly Sophia >> Signed-off-by: Arnaud Ferraris > (...) > >> .../gpu/drm/panel/panel-novatek-nt36672a.c | 251 ++++++++++++++++-- > So are you sure the nt35596s panel driver is so similar to nt36672a that > they should share the same driver? > With all the magic number sequences I'm not so sure, do they really share > any of the magic numbers? Their magic number sequences are quite different, however all the other bits (power/reset sequences and timings) fit in, which isn't the case of the other novatek panel drivers. Moreover, they have similar (although not identical) resolutions. > If not, consider creating a new driver, and then base it on the > nt35510 instead. I would gladly make this a new driver, but I'd rather base it on the nt36672a for the reasons mentioned above. I do fear, however, that this would lead to unnecessary code duplication, as 90% of the driver (magic number sequences excluded) would be identical to the nt36672a (and to be fully honest, I don't think I have the needed knowledge to make it "better"). >> +static const struct nt36672a_panel_cmd jdi_nt35596s_video_on_cmds[] = { >> + { .data = { 0xff, 0x24 } }, >> + { .data = { 0x9d, 0x34 } }, > (...) > > These are never nice. Do you have a datasheet so you can provide > defines for the magic hex values? I found an old (2012) datasheet for the NT35596 (without the final "S") which is marked "Draft", so I'm really unsure this will be enough to make sense of those numbers. > The construction with these .data seqence array > should be replaces with some open coded sequences > I feel, bit this pattern is already in the driver so I guess it's OK. > Yours, > Linus Walleij Cheers, Arnaud