Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp10978844rwl; Mon, 2 Jan 2023 11:27:49 -0800 (PST) X-Google-Smtp-Source: AMrXdXsNf9dkbOm46Y2mFhR1P5jhKPuPaYsLmNqOzVMbImVzrdT4VKxW31lobibMNFkwgvY/whge X-Received: by 2002:a17:902:f78e:b0:186:a43b:a5 with SMTP id q14-20020a170902f78e00b00186a43b00a5mr48733080pln.13.1672687669052; Mon, 02 Jan 2023 11:27:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672687669; cv=none; d=google.com; s=arc-20160816; b=R2NsfVdkbk6ro8XA0Kq7LAXkZRKCCLEB22V5yaGve1uaOUQzpdfx/U1PMwxvcnETqB DIuvi2s61RZsxzqDz0TtgqQD0bM31nU4Ui2iFeMt8j05epr/hezgpqB1/JU+VH4VHgWu SEiSVZn3kCWS3DAuzvbS5mdHCr1YXbhI/+9RbH5ZQPYNF69IyM+cGc5XWFQqgsnMYYk6 ERp3/XJ3r9Ap63ZzLqd+BDY8DZVfhgpLqUUMjvQxyxSJ+s+4SSbm5KG8BGLRDm6+lDTp lHEAaPzG5JLEP3xoUr8yj02JxDNaUbBmJbxNOuTpp94pvRe3KMnfC/DQ9/jaWbxeZmiy uQJw== 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=9VjhZi1lZp62p1i/a1yEP66fDtHh2k3BomIwh/pXJGI=; b=bBeHGyjXe9CkA537SHhTexrsUVTpWixaYh3458NzJD3rtfmtwbZqzjibEPuzcWVdis oKRCsUvH7lxMy+D0vbWFgQsWbsLnpWLBOeyV4Y7VcRhfLjEXUjWFKQOdbRcmfdECU9zt MYVZZV1fJmEopQ9g82Seu6JAniQAW4q+8Fv0STxutL8geysNX1BG2FgCG2CZVTovlccv FDqk3hla6uQsk4f4fykzVhbDyFs8cXa92T9yXvSPBV4XPmvGKQRYTu+Ze6ii6mtrZfw1 OAHFopHul6mARebP6SMSmdbqMgH6TuSplsVa0lDVhwiO92THAoLP3M0//0S42H/PvbiM YC+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ravnborg.org header.s=rsa2 header.b=SMv0HwDs; dkim=neutral (no key) header.i=@ravnborg.org header.s=ed2 header.b=hNmcXMw3; 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 w3-20020a170902e88300b00189d63396c2si33820970plg.35.2023.01.02.11.27.41; Mon, 02 Jan 2023 11:27:49 -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=SMv0HwDs; dkim=neutral (no key) header.i=@ravnborg.org header.s=ed2 header.b=hNmcXMw3; 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 S233202AbjABSsJ (ORCPT + 61 others); Mon, 2 Jan 2023 13:48:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232535AbjABSsI (ORCPT ); Mon, 2 Jan 2023 13:48:08 -0500 X-Greylist: delayed 85 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Mon, 02 Jan 2023 10:48:07 PST Received: from mailrelay5-1.pub.mailoutpod2-cph3.one.com (mailrelay5-1.pub.mailoutpod2-cph3.one.com [IPv6:2a02:2350:5:404::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D173BE0F for ; Mon, 2 Jan 2023 10:48:06 -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=9VjhZi1lZp62p1i/a1yEP66fDtHh2k3BomIwh/pXJGI=; b=SMv0HwDsCyj9XHS8MtM3kucGvsb22zFB1Q8QQcqQ0Zp16egyfrY9GVWOvZ8JClg8df6lpq0RatuK5 JXAh0JCrlCljskkca8BpIJ0mA4F1dGtf/LiAVIDcU5mFR646PWRs3L2LWZVpf4YVEcCR3AmZRQi8oF 8ESJ6I+qCygJy1OPvF0WeXK1BqrO3qcnCILevkrRF0eoU1nF1N0HmGIpLu1xVkwGyHWxg8coavORGp /LR92qmty13nvbafLVfqMfKLKgFXElUuij5D/PQn4aBcYRbdo7CmdFouAEGg152keU54rhOhq5ZXai 6q435+JFW4qD+WOdiQnJphrrDZN3cGg== 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=9VjhZi1lZp62p1i/a1yEP66fDtHh2k3BomIwh/pXJGI=; b=hNmcXMw3dimZxN4CESJnuumR299a1U9G/ykayuy4EV3SO5vxa9wqZfQeB23FOXchwHA9qP1/r2HNi GkxYhR+AA== X-HalOne-ID: fd414098-8acd-11ed-81f3-7703b0afff57 Received: from ravnborg.org (2-105-2-98-cable.dk.customer.tdc.net [2.105.2.98]) by mailrelay5 (Halon) with ESMTPSA id fd414098-8acd-11ed-81f3-7703b0afff57; Mon, 02 Jan 2023 18:48:05 +0000 (UTC) Date: Mon, 2 Jan 2023 19:48:03 +0100 From: Sam Ravnborg To: Javier Martinez Canillas Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Thierry Reding Subject: Re: [PATCH 09/14] drm/panel-samsung-s6e88a0-ams452ef01: Drop custom DSI write macro Message-ID: References: <20221228014757.3170486-1-javierm@redhat.com> <20221228014757.3170486-10-javierm@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221228014757.3170486-10-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_NONE,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 On Wed, Dec 28, 2022 at 02:47:52AM +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 > --- > > .../panel/panel-samsung-s6e88a0-ams452ef01.c | 24 +++++++------------ > 1 file changed, 8 insertions(+), 16 deletions(-) > > diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e88a0-ams452ef01.c b/drivers/gpu/drm/panel/panel-samsung-s6e88a0-ams452ef01.c > index 97ff7a18545c..e94d88fed4f3 100644 > --- a/drivers/gpu/drm/panel/panel-samsung-s6e88a0-ams452ef01.c > +++ b/drivers/gpu/drm/panel/panel-samsung-s6e88a0-ams452ef01.c > @@ -28,14 +28,6 @@ s6e88a0_ams452ef01 *to_s6e88a0_ams452ef01(struct drm_panel *panel) > return container_of(panel, struct s6e88a0_ams452ef01, panel); > } > > -#define dsi_dcs_write_seq(dsi, seq...) do { \ > - static const u8 d[] = { seq }; \ > - int ret; \ > - ret = mipi_dsi_dcs_write_buffer(dsi, d, ARRAY_SIZE(d)); \ > - if (ret < 0) \ > - return ret; \ > - } while (0) > - > static void s6e88a0_ams452ef01_reset(struct s6e88a0_ams452ef01 *ctx) > { > gpiod_set_value_cansleep(ctx->reset_gpio, 1); > @@ -54,8 +46,8 @@ static int s6e88a0_ams452ef01_on(struct s6e88a0_ams452ef01 *ctx) > > dsi->mode_flags |= MIPI_DSI_MODE_LPM; > > - dsi_dcs_write_seq(dsi, 0xf0, 0x5a, 0x5a); // enable LEVEL2 commands > - dsi_dcs_write_seq(dsi, 0xcc, 0x4c); // set Pixel Clock Divider polarity > + mipi_dsi_dcs_write_seq(dsi, 0xf0, 0x5a, 0x5a); // enable LEVEL2 commands > + mipi_dsi_dcs_write_seq(dsi, 0xcc, 0x4c); // set Pixel Clock Divider polarity > > ret = mipi_dsi_dcs_exit_sleep_mode(dsi); > if (ret < 0) { > @@ -65,7 +57,7 @@ static int s6e88a0_ams452ef01_on(struct s6e88a0_ams452ef01 *ctx) > msleep(120); > > // set default brightness/gama > - dsi_dcs_write_seq(dsi, 0xca, > + mipi_dsi_dcs_write_seq(dsi, 0xca, > 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, // V255 RR,GG,BB > 0x80, 0x80, 0x80, // V203 R,G,B > 0x80, 0x80, 0x80, // V151 R,G,B > @@ -77,11 +69,11 @@ static int s6e88a0_ams452ef01_on(struct s6e88a0_ams452ef01 *ctx) > 0x6b, 0x68, 0x71, // V3 R,G,B > 0x00, 0x00, 0x00); // V1 R,G,B Fix indent - with this fixed: Reviewed-by: Sam Ravnborg > // set default Amoled Off Ratio > - dsi_dcs_write_seq(dsi, 0xb2, 0x40, 0x0a, 0x17, 0x00, 0x0a); > - dsi_dcs_write_seq(dsi, 0xb6, 0x2c, 0x0b); // set default elvss voltage > - dsi_dcs_write_seq(dsi, MIPI_DCS_WRITE_POWER_SAVE, 0x00); > - dsi_dcs_write_seq(dsi, 0xf7, 0x03); // gamma/aor update > - dsi_dcs_write_seq(dsi, 0xf0, 0xa5, 0xa5); // disable LEVEL2 commands > + mipi_dsi_dcs_write_seq(dsi, 0xb2, 0x40, 0x0a, 0x17, 0x00, 0x0a); > + mipi_dsi_dcs_write_seq(dsi, 0xb6, 0x2c, 0x0b); // set default elvss voltage > + mipi_dsi_dcs_write_seq(dsi, MIPI_DCS_WRITE_POWER_SAVE, 0x00); > + mipi_dsi_dcs_write_seq(dsi, 0xf7, 0x03); // gamma/aor update > + mipi_dsi_dcs_write_seq(dsi, 0xf0, 0xa5, 0xa5); // disable LEVEL2 commands > > ret = mipi_dsi_dcs_set_display_on(dsi); > if (ret < 0) { > -- > 2.38.1