Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp10963990rwl; Mon, 2 Jan 2023 11:09:26 -0800 (PST) X-Google-Smtp-Source: AMrXdXuE/eplqoUu6p7xjK5kJcs9c0igomhS8jB4yiD8vHaDcu+f+5ukWrWx97VjWFprkZOlfNJJ X-Received: by 2002:a17:906:cb99:b0:7c0:f5d7:cac7 with SMTP id mf25-20020a170906cb9900b007c0f5d7cac7mr42598807ejb.67.1672686566793; Mon, 02 Jan 2023 11:09:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672686566; cv=none; d=google.com; s=arc-20160816; b=Nwo+bN6VxGzsWwSzagGP+BKmoo4z6nWt+CJ49aQ7/YXvQs28EHfANvz9A84Vx8fjPr V7ZB2Df2lN11J0lHmLxY4InWJ18rNfm//hP/KKkK5JEq8FTenKXKlvm5ZFHycNP8iagA NxXLU5iDlVWdlqxNbxTJjbk2lX+SQV1buXFiAbIsEUKymANbhM96jSn3iUDhxx02l3zB Oyfuwefr21JhP4QiRCfEuDPAy4nh8IkHdX5DIfsOrvp8c14uA8Fj1x43x935cFX89UQk hOn95cZbfmgsN8amXSbYvgYPceOUy9ujYFcxNqSaf+as2ptbyS/QynOZvale9xV0J6yi Fasw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=/XFSebgx2HIciu5wwjMJ8G7XT2qN1rYL+0/uj3yYc6A=; b=OLtyP+ur++h1S0N2zUaQj64u5iNrGl6LABKkcztJFg4wtVm38KqpiwU23Dds2b17ZE 3JwZ3o6S7A4OI2+vOhjLhIoBZbsvK/HS9Fi87eokc6c0RwsQ7S0F6/mwDZ7CVc+UJaEq h2t3YwNAgplo8H26nKJefef62Obn0wgd0VLb5umeCdHnmz+lJMkFN7sb3uYTb6y+wvEt AeOW+4ZWD39VNIW2zLhUsOg+hYsEh3IxyZbWDuw5tn2728VWJF5MaG5+uUR/uDq852KX qoy64nJWnyi0vz+Pp+ddj/FmcRGV4vDxbgbGFGQ0okVZKVgpMaHBT0T4TvJg2DTM5hvh s4uQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ravnborg.org header.s=rsa2 header.b=lJCyDoNo; dkim=neutral (no key) header.i=@ravnborg.org header.s=ed2; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ji5-20020a170907980500b007addbdb9fbbsi26819977ejc.558.2023.01.02.11.09.06; Mon, 02 Jan 2023 11:09:26 -0800 (PST) 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=@ravnborg.org header.s=rsa2 header.b=lJCyDoNo; dkim=neutral (no key) header.i=@ravnborg.org header.s=ed2; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232796AbjABSo3 (ORCPT + 61 others); Mon, 2 Jan 2023 13:44:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234249AbjABSo1 (ORCPT ); Mon, 2 Jan 2023 13:44:27 -0500 X-Greylist: delayed 249 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Mon, 02 Jan 2023 10:44:25 PST Received: from mailrelay2-1.pub.mailoutpod2-cph3.one.com (mailrelay2-1.pub.mailoutpod2-cph3.one.com [46.30.211.177]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 988FDBE08 for ; Mon, 2 Jan 2023 10:44:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ravnborg.org; s=rsa2; h=in-reply-to:content-type:mime-version:references:message-id:subject:cc:to: from:date:from; bh=/XFSebgx2HIciu5wwjMJ8G7XT2qN1rYL+0/uj3yYc6A=; b=lJCyDoNoMBcGfOR4NL7/DdlGmh5DjPP5qHDM2NeKiTttxh8NQX14zahQ7ID+Gd2+3xUyKnOcem1F9 1NTDQSCxvWageTQIZzFybwCPBQTg2gIhav7NzluLHkpBhcYEFt4ryO03bHugLOtyuMaxhHLXd4lkaY ffDTEbmfEK5XaXsSgDhkaIlgaFhDMmkZCOTJ7AH79Ev2YCnlzPr7aKfw9GeFbfkmYy4FYxTplFNJzW nM8/X5bDsJcxU3xLVJdD/dCiQ5GE192KmC0VG3RV7n3F7nPXVdZdMMbVHT+dp2pagdklEFBBJj1h0/ w7rl9yqB4tPg6TxvarpwwYVw4W2YklA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ravnborg.org; s=ed2; h=in-reply-to:content-type:mime-version:references:message-id:subject:cc:to: from:date:from; bh=/XFSebgx2HIciu5wwjMJ8G7XT2qN1rYL+0/uj3yYc6A=; b=a5CtB94QuPHGQVxS6TGpO9UkcljmxBFgCopWhUosfBafSWe8klvix+HzBbUMz3OM1gHvewFYTX+3L JNAYQWjBg== X-HalOne-ID: 533e9773-8acd-11ed-a28f-93f0a866dfbb Received: from ravnborg.org (2-105-2-98-cable.dk.customer.tdc.net [2.105.2.98]) by mailrelay2 (Halon) with ESMTPSA id 533e9773-8acd-11ed-a28f-93f0a866dfbb; Mon, 02 Jan 2023 18:43:21 +0000 (UTC) Date: Mon, 2 Jan 2023 19:43:19 +0100 From: Sam Ravnborg To: Javier Martinez Canillas Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Thierry Reding Subject: Re: [PATCH 04/14] drm/panel-leadtek-ltk050h3146w: Drop custom DSI write macro Message-ID: References: <20221228014757.3170486-1-javierm@redhat.com> <20221228014757.3170486-5-javierm@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221228014757.3170486-5-javierm@redhat.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_NONE 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 Javier, On Wed, Dec 28, 2022 at 02:47:47AM +0100, Javier Martinez Canillas wrote: > There is a macro for this already in the header, use > that instead and delete the custom DSI write macro defined in the driver. > > Signed-off-by: Javier Martinez Canillas > --- > > .../drm/panel/panel-leadtek-ltk050h3146w.c | 64 ++++++++----------- > 1 file changed, 28 insertions(+), 36 deletions(-) > > diff --git a/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c b/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c > index 5619f186d28c..525dddef4d9c 100644 > --- a/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c > +++ b/drivers/gpu/drm/panel/panel-leadtek-ltk050h3146w.c > @@ -244,14 +244,6 @@ struct ltk050h3146w *panel_to_ltk050h3146w(struct drm_panel *panel) > return container_of(panel, struct ltk050h3146w, panel); > } > > -#define dsi_dcs_write_seq(dsi, cmd, seq...) do { \ > - static const u8 b[] = { cmd, seq }; \ > - int ret; \ > - ret = mipi_dsi_dcs_write_buffer(dsi, b, ARRAY_SIZE(b)); \ > - if (ret < 0) \ > - return ret; \ > - } while (0) > - > static int ltk050h3146w_init_sequence(struct ltk050h3146w *ctx) > { > struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); > @@ -261,55 +253,55 @@ static int ltk050h3146w_init_sequence(struct ltk050h3146w *ctx) > * Init sequence was supplied by the panel vendor without much > * documentation. > */ > - dsi_dcs_write_seq(dsi, 0xdf, 0x93, 0x65, 0xf8); > - dsi_dcs_write_seq(dsi, 0xb0, 0x01, 0x03, 0x02, 0x00, 0x64, 0x06, > + mipi_dsi_dcs_write_seq(dsi, 0xdf, 0x93, 0x65, 0xf8); > + mipi_dsi_dcs_write_seq(dsi, 0xb0, 0x01, 0x03, 0x02, 0x00, 0x64, 0x06, > 0x01); Fix indent here and later. With this fixed: Reviewed-by: Sam Ravnborg > - dsi_dcs_write_seq(dsi, 0xb2, 0x00, 0xb5); > - dsi_dcs_write_seq(dsi, 0xb3, 0x00, 0xb5); > - dsi_dcs_write_seq(dsi, 0xb7, 0x00, 0xbf, 0x00, 0x00, 0xbf, 0x00); > + mipi_dsi_dcs_write_seq(dsi, 0xb2, 0x00, 0xb5); > + mipi_dsi_dcs_write_seq(dsi, 0xb3, 0x00, 0xb5); > + mipi_dsi_dcs_write_seq(dsi, 0xb7, 0x00, 0xbf, 0x00, 0x00, 0xbf, 0x00); > > - dsi_dcs_write_seq(dsi, 0xb9, 0x00, 0xc4, 0x23, 0x07); > - dsi_dcs_write_seq(dsi, 0xbb, 0x02, 0x01, 0x24, 0x00, 0x28, 0x0f, > + mipi_dsi_dcs_write_seq(dsi, 0xb9, 0x00, 0xc4, 0x23, 0x07); > + mipi_dsi_dcs_write_seq(dsi, 0xbb, 0x02, 0x01, 0x24, 0x00, 0x28, 0x0f, > 0x28, 0x04, 0xcc, 0xcc, 0xcc); > - dsi_dcs_write_seq(dsi, 0xbc, 0x0f, 0x04); > - dsi_dcs_write_seq(dsi, 0xbe, 0x1e, 0xf2); > - dsi_dcs_write_seq(dsi, 0xc0, 0x26, 0x03); > - dsi_dcs_write_seq(dsi, 0xc1, 0x00, 0x12); > - dsi_dcs_write_seq(dsi, 0xc3, 0x04, 0x02, 0x02, 0x76, 0x01, 0x80, > + mipi_dsi_dcs_write_seq(dsi, 0xbc, 0x0f, 0x04); > + mipi_dsi_dcs_write_seq(dsi, 0xbe, 0x1e, 0xf2); > + mipi_dsi_dcs_write_seq(dsi, 0xc0, 0x26, 0x03); > + mipi_dsi_dcs_write_seq(dsi, 0xc1, 0x00, 0x12); > + mipi_dsi_dcs_write_seq(dsi, 0xc3, 0x04, 0x02, 0x02, 0x76, 0x01, 0x80, > 0x80); > - dsi_dcs_write_seq(dsi, 0xc4, 0x24, 0x80, 0xb4, 0x81, 0x12, 0x0f, > + mipi_dsi_dcs_write_seq(dsi, 0xc4, 0x24, 0x80, 0xb4, 0x81, 0x12, 0x0f, > 0x16, 0x00, 0x00); > - dsi_dcs_write_seq(dsi, 0xc8, 0x7f, 0x72, 0x67, 0x5d, 0x5d, 0x50, > + mipi_dsi_dcs_write_seq(dsi, 0xc8, 0x7f, 0x72, 0x67, 0x5d, 0x5d, 0x50, > 0x56, 0x41, 0x59, 0x57, 0x55, 0x70, 0x5b, 0x5f, > 0x4f, 0x47, 0x38, 0x23, 0x08, 0x7f, 0x72, 0x67, > 0x5d, 0x5d, 0x50, 0x56, 0x41, 0x59, 0x57, 0x55, > 0x70, 0x5b, 0x5f, 0x4f, 0x47, 0x38, 0x23, 0x08); > - dsi_dcs_write_seq(dsi, 0xd0, 0x1e, 0x1f, 0x57, 0x58, 0x48, 0x4a, > + mipi_dsi_dcs_write_seq(dsi, 0xd0, 0x1e, 0x1f, 0x57, 0x58, 0x48, 0x4a, > 0x44, 0x46, 0x40, 0x1f, 0x42, 0x1f, 0x1f, 0x1f, > 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f); > - dsi_dcs_write_seq(dsi, 0xd1, 0x1e, 0x1f, 0x57, 0x58, 0x49, 0x4b, > + mipi_dsi_dcs_write_seq(dsi, 0xd1, 0x1e, 0x1f, 0x57, 0x58, 0x49, 0x4b, > 0x45, 0x47, 0x41, 0x1f, 0x43, 0x1f, 0x1f, 0x1f, > 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f); > - dsi_dcs_write_seq(dsi, 0xd2, 0x1f, 0x1e, 0x17, 0x18, 0x07, 0x05, > + mipi_dsi_dcs_write_seq(dsi, 0xd2, 0x1f, 0x1e, 0x17, 0x18, 0x07, 0x05, > 0x0b, 0x09, 0x03, 0x1f, 0x01, 0x1f, 0x1f, 0x1f, > 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f); > - dsi_dcs_write_seq(dsi, 0xd3, 0x1f, 0x1e, 0x17, 0x18, 0x06, 0x04, > + mipi_dsi_dcs_write_seq(dsi, 0xd3, 0x1f, 0x1e, 0x17, 0x18, 0x06, 0x04, > 0x0a, 0x08, 0x02, 0x1f, 0x00, 0x1f, 0x1f, 0x1f, > 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f); > - dsi_dcs_write_seq(dsi, 0xd4, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x20, > + mipi_dsi_dcs_write_seq(dsi, 0xd4, 0x00, 0x00, 0x00, 0x0c, 0x06, 0x20, > 0x01, 0x02, 0x00, 0x60, 0x15, 0xb0, 0x30, 0x03, > 0x04, 0x00, 0x60, 0x72, 0x0a, 0x00, 0x60, 0x08); > - dsi_dcs_write_seq(dsi, 0xd5, 0x00, 0x06, 0x06, 0x00, 0x30, 0x00, > + mipi_dsi_dcs_write_seq(dsi, 0xd5, 0x00, 0x06, 0x06, 0x00, 0x30, 0x00, > 0x00, 0x00, 0x00, 0x00, 0xbc, 0x50, 0x00, 0x05, > 0x21, 0x00, 0x60); > - dsi_dcs_write_seq(dsi, 0xdd, 0x2c, 0xa3, 0x00); > - dsi_dcs_write_seq(dsi, 0xde, 0x02); > - dsi_dcs_write_seq(dsi, 0xb2, 0x32, 0x1c); > - dsi_dcs_write_seq(dsi, 0xb7, 0x3b, 0x70, 0x00, 0x04); > - dsi_dcs_write_seq(dsi, 0xc1, 0x11); > - dsi_dcs_write_seq(dsi, 0xbb, 0x21, 0x22, 0x23, 0x24, 0x36, 0x37); > - dsi_dcs_write_seq(dsi, 0xc2, 0x20, 0x38, 0x1e, 0x84); > - dsi_dcs_write_seq(dsi, 0xde, 0x00); > + mipi_dsi_dcs_write_seq(dsi, 0xdd, 0x2c, 0xa3, 0x00); > + mipi_dsi_dcs_write_seq(dsi, 0xde, 0x02); > + mipi_dsi_dcs_write_seq(dsi, 0xb2, 0x32, 0x1c); > + mipi_dsi_dcs_write_seq(dsi, 0xb7, 0x3b, 0x70, 0x00, 0x04); > + mipi_dsi_dcs_write_seq(dsi, 0xc1, 0x11); > + mipi_dsi_dcs_write_seq(dsi, 0xbb, 0x21, 0x22, 0x23, 0x24, 0x36, 0x37); > + mipi_dsi_dcs_write_seq(dsi, 0xc2, 0x20, 0x38, 0x1e, 0x84); > + mipi_dsi_dcs_write_seq(dsi, 0xde, 0x00); > > ret = mipi_dsi_dcs_set_tear_on(dsi, 1); > if (ret < 0) { > -- > 2.38.1