Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp10977515rwl; Mon, 2 Jan 2023 11:26:08 -0800 (PST) X-Google-Smtp-Source: AMrXdXu5eWq9dBRADDuz2k1nwSlcIdJtG42Y+ywZgS9M/uHGsqBkihStcJwP+bD9IOURLfNrMEcY X-Received: by 2002:a05:6a20:65a9:b0:a5:df86:f0e1 with SMTP id p41-20020a056a2065a900b000a5df86f0e1mr60227439pzh.16.1672687568709; Mon, 02 Jan 2023 11:26:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672687568; cv=none; d=google.com; s=arc-20160816; b=ckgQl4lowR5CR2Ou5bhth5v7nia7t5sYX5LJ9VSb+tQnrKXpCbLt+GZ0NL5lUihoFV INOkdwyRmLwbhNqX0wSDZx05SpDDFTuQzrrjCG0/uSw72mqPpYhFECtyJt428ZOyXRuq +tj9f4M29P9iSq3Hg1fE7AoH043OEs9hvtTIYQYr0ewSG51xkO8cKiyc5KUh4BH6fPQG F/6GAl67syimGDPa285Ki7lW/TvumHM7zN9qxrLlfAZTWmzVGLom/WBS0xmyYtxt013w NIi5pDl3VWna0lmF7M8RRU9lqVI7sFyCbJYOnME/hjfH1XfNueaPkTzg7ASHTbFe4rrQ tWjA== 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=Jqdntt21bL7Yjq26W0YUxIQULOrcTsSva3Xle99cHtY=; b=UAy6WOrnOBLIAEDoNli/lJr1hRE4DPAmlYTMQPlTJ4YFsIXuBGX3jm2hVz+EMaCOaE JG9j38cgN/gUrpltirsQWoZcWf9jxo/6OT3bX0xZQ+yguRt8R5AFmEjATQprOJupOUe2 Q1SWKZK56eP9Xz9U18bG1mo8QF/JcSXn0E3EOy2zQwdCBja5DDPbTfEmw/FtYzQATHBP wXR/WZDXGNwMD6+WgORUPtimvdWxQNFAE7ZXWr6ZhFmWG6rjFANrBwkelVyyRmEsAKTe e7oHCuYLTh2y/bmRMs7svmC2yjJ+ShQssyOkNCHwscmxLaFfXRd3MMSJDtYB1XcH6JCu R32Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ravnborg.org header.s=rsa2 header.b=ski8yGOk; dkim=neutral (no key) header.i=@ravnborg.org; 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 j1-20020a63ec01000000b004988e653840si23150551pgh.774.2023.01.02.11.26.00; Mon, 02 Jan 2023 11:26:08 -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=ski8yGOk; dkim=neutral (no key) header.i=@ravnborg.org; 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 S234916AbjABSzV (ORCPT + 61 others); Mon, 2 Jan 2023 13:55:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230120AbjABSzU (ORCPT ); Mon, 2 Jan 2023 13:55:20 -0500 Received: from mailrelay3-1.pub.mailoutpod2-cph3.one.com (mailrelay3-1.pub.mailoutpod2-cph3.one.com [IPv6:2a02:2350:5:402::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61776BE03 for ; Mon, 2 Jan 2023 10:55:17 -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=Jqdntt21bL7Yjq26W0YUxIQULOrcTsSva3Xle99cHtY=; b=ski8yGOkKzHAX6Gs2Xwez3f5FQT7X+yMioJlOE7wG5gL7byH4Q6Gvutj+bjx+H1C/3Y9rdZs0NiBt pnem6E5Ojxlkv/YAg0tXJQv/TlGr7e0gh4lqJ4Akgst7O4HeGqxeY187qRnevpGhXcgfQtazW78yJc GMV860cVTAIeEHMwIPiqUDykvNGrV0bdOnXuNLsbWASfnpk3d6ozJGs2aljoQBR8cnw416DhGLlPsQ JDjLFiKUeTCCrcMnuiuKic/6VkjoGyq+ulHFzy64BV10fngJpDCiBmNEikad9q+8sipdq3Oz0LN4xj cCeMIs9VC7c8jLub8i8dF7Dfekf6aJg== 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=Jqdntt21bL7Yjq26W0YUxIQULOrcTsSva3Xle99cHtY=; b=lASuBO6+/smpGM7ICJFExO21ghrG8C1HUFNKGC4lvC6V7RPlN46WPOmYHHDhOicIwSZbhK0NM7Hg/ eqyForeCA== X-HalOne-ID: bef84d81-8acc-11ed-b424-ede074c87fad Received: from ravnborg.org (2-105-2-98-cable.dk.customer.tdc.net [2.105.2.98]) by mailrelay3 (Halon) with ESMTPSA id bef84d81-8acc-11ed-b424-ede074c87fad; Mon, 02 Jan 2023 18:39:11 +0000 (UTC) Date: Mon, 2 Jan 2023 19:39:10 +0100 From: Sam Ravnborg To: Javier Martinez Canillas Cc: linux-kernel@vger.kernel.org, Thomas Zimmermann , dri-devel@lists.freedesktop.org Subject: Re: [PATCH 01/14] drm/mipi-dsi: Add a mipi_dsi_dcs_write_seq() macro Message-ID: References: <20221228014757.3170486-1-javierm@redhat.com> <20221228014757.3170486-2-javierm@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221228014757.3170486-2-javierm@redhat.com> X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_NONE, URIBL_BLACK autolearn=no 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:44AM +0100, Javier Martinez Canillas wrote: > Many panel drivers define dsi_dcs_write_seq() and dsi_generic_write_seq() > macros to send DCS commands and generic write packets respectively, with > the payload specified as a list of parameters instead of using arrays. > > There's already a macro for the former, introduced by commit 2a9e9daf75231 > ("drm/mipi-dsi: Introduce mipi_dsi_dcs_write_seq macro") so drivers can be > changed to use that. But there isn't one yet for the latter, let's add it. > > Signed-off-by: Javier Martinez Canillas > --- > > include/drm/drm_mipi_dsi.h | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > > diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h > index 20b21b577dea..c7c458131ba1 100644 > --- a/include/drm/drm_mipi_dsi.h > +++ b/include/drm/drm_mipi_dsi.h > @@ -297,6 +297,22 @@ int mipi_dsi_dcs_set_display_brightness(struct mipi_dsi_device *dsi, > int mipi_dsi_dcs_get_display_brightness(struct mipi_dsi_device *dsi, > u16 *brightness); > > +/** > + * mipi_dsi_generic_write - transmit data using a generic write packet s/mipi_dsi_generic_write/mipi_dsi_generic_write_seq (As the bot also reported) with this fixed: Reviewed-by: Sam Ravnborg > + * @dsi: DSI peripheral device > + * @seq: buffer containing the payload > + */ > +#define mipi_dsi_generic_write_seq(dsi, seq...) do { \ > + static const u8 d[] = { seq }; \ > + struct device *dev = &dsi->dev; \ > + int ret; \ > + ret = mipi_dsi_generic_write(dsi, d, ARRAY_SIZE(d)); \ > + if (ret < 0) { \ > + dev_err_ratelimited(dev, "transmit data failed: %d\n", ret); \ > + return ret; \ > + } \ > + } while (0) > + (If you align '\' under each other it would be nicer, but I could see that mipi_dsi_dcs_write_seq() do not do so). > /** > * mipi_dsi_dcs_write_seq - transmit a DCS command with payload > * @dsi: DSI peripheral device > -- > 2.38.1