Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp10966687rwl; Mon, 2 Jan 2023 11:12:29 -0800 (PST) X-Google-Smtp-Source: AMrXdXswJaK20Srq9ASO3ILw4dElLADPqkacgPdLDeAkRfZhhqJkZGv8mcvOmifYmPsOOMLNsjJV X-Received: by 2002:a05:6a21:2d09:b0:a4:aa40:2253 with SMTP id tw9-20020a056a212d0900b000a4aa402253mr50498908pzb.21.1672686749707; Mon, 02 Jan 2023 11:12:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672686749; cv=none; d=google.com; s=arc-20160816; b=ynuycf6n3LSR9x1yi7+y8RIR/rQTnVVpLni1Z0pPzvTaBqqCHIKKOy+8opzO/pmHWS vvHT0drK4U/NrcHppnZ0G65JyodXOulQFyCZGFwWJVOoEnsp3IahklWP9RRtT6Dxb3pS Rp249finDBMtTKSFGEhxDmLFfqmtRypLME30IVgtrcaYiru46Zhg3dSHp4OUiRBfx+mk oDwkgph1yXBc1d/STL7R4MKopbPm0XV4z5cwFNFI3mSx/jmO0geFtYN39a67MORfvt4U VFnPoxcu1QXqVcB99WU+i0ybETRfdcwy4uPiX38tg3ICG8P5sHhXzY8D5rnqIbGh9yt8 5RQw== 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=/ZAzHomv0gTa6nnBgQv0Q7o28VeLdXtgMz7vUsXOKAY=; b=SlkGZz0WlNQA34i1zlS8r+i5qctkbM74kAs0XHPu7067fK7/ofrwx+WYDJgSFtQmyy EWRNEbO4KuQOJBNYVWgELLLmrg5vkBZ0xPcSQTUlnThro9MtU4B+L3IUgtT6pcL2kqfk xZI9PN0P7CBvgr+9wMjeZPrffJV0tEOZ0irvRE+kiCpmWKKSY2C1NO32hN33JWsGcpBt 42exzNzl6+Fp6DC+6Us70Wz8JGTs66G/+ORx4WyDrVc5mdIcki4Dx4GiQIXbcWQZCZA6 3U6IW4t1F+O8pixLemAPsywE3sdQvHWcDkknDcG92IpAo1l83XYyNzvF6DJSG55801gB jIKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ravnborg.org header.s=rsa2 header.b=UP9H4NwX; dkim=neutral (no key) header.i=@ravnborg.org header.b=COgo4StE; 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 m65-20020a632644000000b004701a950fe7si23606045pgm.551.2023.01.02.11.12.22; Mon, 02 Jan 2023 11:12:29 -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=UP9H4NwX; dkim=neutral (no key) header.i=@ravnborg.org header.b=COgo4StE; 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 S232862AbjABSrs (ORCPT + 61 others); Mon, 2 Jan 2023 13:47:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232535AbjABSrq (ORCPT ); Mon, 2 Jan 2023 13:47:46 -0500 Received: from mailrelay5-1.pub.mailoutpod2-cph3.one.com (mailrelay5-1.pub.mailoutpod2-cph3.one.com [46.30.211.180]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A20710A for ; Mon, 2 Jan 2023 10:47:44 -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=/ZAzHomv0gTa6nnBgQv0Q7o28VeLdXtgMz7vUsXOKAY=; b=UP9H4NwXQK9tjTN36Ubd8EArt/qYoAupbgOJRG+uGpSjaJuksc1Fvm9r04omiDGzOZgrjMn11Q/Rq YhWqV9QBxxWKWoDym4jqRHmaAei3D5DjsJElCYpujFcK6UWM5tfbEBEpg+Y4YiSVcmOBTSNoor+Xy5 SUgqVm8PS7DvEo6F7HsVzkxGoPIkPou3LjpY5eKL5UQBsaw38TU5cUN23rVnNMgHcfDp2V2tZC5+Zq W2lG7FAXm1xdQXzgAjIyt2151odcrz8qDly+HD9AR/y8mT7fVKefdA5xz2Mks2I3CRwLU0Rk0rf7z0 fW8pSsDzniTChVjFTQP3x4Nk5lrEOaQ== 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=/ZAzHomv0gTa6nnBgQv0Q7o28VeLdXtgMz7vUsXOKAY=; b=COgo4StEfCRo042l0Jf/Br+nC3gWIWpkdDHwSsArHLm23Y0lVCyIdgQYmCETu9IIM/r7q/iT6gzrF j4uZPPNDg== X-HalOne-ID: c964db1b-8acd-11ed-81f1-7703b0afff57 Received: from ravnborg.org (2-105-2-98-cable.dk.customer.tdc.net [2.105.2.98]) by mailrelay5 (Halon) with ESMTPSA id c964db1b-8acd-11ed-81f1-7703b0afff57; Mon, 02 Jan 2023 18:46:40 +0000 (UTC) Date: Mon, 2 Jan 2023 19:46:38 +0100 From: Sam Ravnborg To: Javier Martinez Canillas Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Thierry Reding Subject: Re: [PATCH 08/14] drm/panel-jdi-fhd-r63452: Drop custom DSI write macros Message-ID: References: <20221228014757.3170486-1-javierm@redhat.com> <20221228014757.3170486-9-javierm@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221228014757.3170486-9-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 Hi Javier, On Wed, Dec 28, 2022 at 02:47:51AM +0100, Javier Martinez Canillas wrote: > There are macros for these already in the header, use > that instead and delete the custom DSI write macros defined in the driver. > > Signed-off-by: Javier Martinez Canillas > --- > > drivers/gpu/drm/panel/panel-jdi-fhd-r63452.c | 50 +++++++------------- > 1 file changed, 17 insertions(+), 33 deletions(-) > > diff --git a/drivers/gpu/drm/panel/panel-jdi-fhd-r63452.c b/drivers/gpu/drm/panel/panel-jdi-fhd-r63452.c > index d8765b2294fb..e3f0e59b5e36 100644 > --- a/drivers/gpu/drm/panel/panel-jdi-fhd-r63452.c > +++ b/drivers/gpu/drm/panel/panel-jdi-fhd-r63452.c > @@ -29,22 +29,6 @@ static inline struct jdi_fhd_r63452 *to_jdi_fhd_r63452(struct drm_panel *panel) > return container_of(panel, struct jdi_fhd_r63452, panel); > } > > -#define dsi_generic_write_seq(dsi, seq...) do { \ > - static const u8 d[] = { seq }; \ > - int ret; \ > - ret = mipi_dsi_generic_write(dsi, d, ARRAY_SIZE(d)); \ > - if (ret < 0) \ > - return ret; \ > - } while (0) > - > -#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 jdi_fhd_r63452_reset(struct jdi_fhd_r63452 *ctx) > { > gpiod_set_value_cansleep(ctx->reset_gpio, 0); > @@ -63,12 +47,12 @@ static int jdi_fhd_r63452_on(struct jdi_fhd_r63452 *ctx) > > dsi->mode_flags |= MIPI_DSI_MODE_LPM; > > - dsi_generic_write_seq(dsi, 0xb0, 0x00); > - dsi_generic_write_seq(dsi, 0xd6, 0x01); > - dsi_generic_write_seq(dsi, 0xec, > + mipi_dsi_generic_write_seq(dsi, 0xb0, 0x00); > + mipi_dsi_generic_write_seq(dsi, 0xd6, 0x01); > + mipi_dsi_generic_write_seq(dsi, 0xec, > 0x64, 0xdc, 0xec, 0x3b, 0x52, 0x00, 0x0b, 0x0b, > 0x13, 0x15, 0x68, 0x0b, 0xb5); Fix indent - with this fixed everywhere: Reviewed-by: Sam Ravnborg > - dsi_generic_write_seq(dsi, 0xb0, 0x03); > + mipi_dsi_generic_write_seq(dsi, 0xb0, 0x03); > > ret = mipi_dsi_dcs_set_tear_on(dsi, MIPI_DSI_DCS_TEAR_MODE_VBLANK); > if (ret < 0) { > @@ -76,7 +60,7 @@ static int jdi_fhd_r63452_on(struct jdi_fhd_r63452 *ctx) > return ret; > } > > - dsi_dcs_write_seq(dsi, MIPI_DCS_SET_ADDRESS_MODE, 0x00); > + mipi_dsi_dcs_write_seq(dsi, MIPI_DCS_SET_ADDRESS_MODE, 0x00); > > ret = mipi_dsi_dcs_set_pixel_format(dsi, 0x77); > if (ret < 0) { > @@ -108,10 +92,10 @@ static int jdi_fhd_r63452_on(struct jdi_fhd_r63452 *ctx) > return ret; > } > > - dsi_dcs_write_seq(dsi, MIPI_DCS_WRITE_CONTROL_DISPLAY, 0x24); > - dsi_dcs_write_seq(dsi, MIPI_DCS_WRITE_POWER_SAVE, 0x00); > - dsi_dcs_write_seq(dsi, MIPI_DCS_SET_CABC_MIN_BRIGHTNESS, 0x00); > - dsi_dcs_write_seq(dsi, 0x84, 0x00); > + mipi_dsi_dcs_write_seq(dsi, MIPI_DCS_WRITE_CONTROL_DISPLAY, 0x24); > + mipi_dsi_dcs_write_seq(dsi, MIPI_DCS_WRITE_POWER_SAVE, 0x00); > + mipi_dsi_dcs_write_seq(dsi, MIPI_DCS_SET_CABC_MIN_BRIGHTNESS, 0x00); > + mipi_dsi_dcs_write_seq(dsi, 0x84, 0x00); > > ret = mipi_dsi_dcs_set_display_on(dsi); > if (ret < 0) { > @@ -127,10 +111,10 @@ static int jdi_fhd_r63452_on(struct jdi_fhd_r63452 *ctx) > } > msleep(80); > > - dsi_generic_write_seq(dsi, 0xb0, 0x04); > - dsi_dcs_write_seq(dsi, 0x84, 0x00); > - dsi_generic_write_seq(dsi, 0xc8, 0x11); > - dsi_generic_write_seq(dsi, 0xb0, 0x03); > + mipi_dsi_generic_write_seq(dsi, 0xb0, 0x04); > + mipi_dsi_dcs_write_seq(dsi, 0x84, 0x00); > + mipi_dsi_generic_write_seq(dsi, 0xc8, 0x11); > + mipi_dsi_generic_write_seq(dsi, 0xb0, 0x03); > > return 0; > } > @@ -143,12 +127,12 @@ static int jdi_fhd_r63452_off(struct jdi_fhd_r63452 *ctx) > > dsi->mode_flags &= ~MIPI_DSI_MODE_LPM; > > - dsi_generic_write_seq(dsi, 0xb0, 0x00); > - dsi_generic_write_seq(dsi, 0xd6, 0x01); > - dsi_generic_write_seq(dsi, 0xec, > + mipi_dsi_generic_write_seq(dsi, 0xb0, 0x00); > + mipi_dsi_generic_write_seq(dsi, 0xd6, 0x01); > + mipi_dsi_generic_write_seq(dsi, 0xec, > 0x64, 0xdc, 0xec, 0x3b, 0x52, 0x00, 0x0b, 0x0b, > 0x13, 0x15, 0x68, 0x0b, 0x95); > - dsi_generic_write_seq(dsi, 0xb0, 0x03); > + mipi_dsi_generic_write_seq(dsi, 0xb0, 0x03); > > ret = mipi_dsi_dcs_set_display_off(dsi); > if (ret < 0) { > -- > 2.38.1