From patchwork Mon Jun 19 15:59:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 13284788 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 322F1EB64D9 for ; Mon, 19 Jun 2023 16:00:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D034710E07D; Mon, 19 Jun 2023 16:00:15 +0000 (UTC) Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2CD2410E07D for ; Mon, 19 Jun 2023 16:00:08 +0000 (UTC) X-GND-Sasl: miquel.raynal@bootlin.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1687190406; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=y+45VfTOsL7yTDmDGWRFL6hE280I11pH3znrmaQkIAM=; b=hEyWXgh6GDVmzr7J5t6RF0MsKA8vAOGdre1a5PelQcOF758mOZEHVBIrVyDabRcQm+KQbX RTntPi57rCCJsANmN6DRQkRtW2Y7chEJi9hYeZ4JrK9dDVIhiBBCjzKBKJWbPgLMgPvfRU 7InHdRloZN7Z2DsJkc7ur8Gm81wgOd7gk35yEzx9NaU6K6CHv9R1vN02b4vX23Sn8AqG/T CeumV7dTh2fmxPGhPLh2xy0+i/n9Lb+uMpZcnFiFqP2KylqdMg7kIzKtrWZVUpFP58c06h bJZwbACeMvhXiRqfPAQs5EEknr7PcMSBsbuoYEyHJKMsD8+wihukd5o2z/JS5Q== X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com X-GND-Sasl: miquel.raynal@bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id BDE5E1BF20B; Mon, 19 Jun 2023 16:00:04 +0000 (UTC) From: Miquel Raynal To: David Airlie , Daniel Vetter , Thierry Reding , Sam Ravnborg , dri-devel@lists.freedesktop.org Subject: [PATCH v3 3/6] drm/panel: sitronix-st7789v: Use 9 bits per spi word by default Date: Mon, 19 Jun 2023 17:59:55 +0200 Message-Id: <20230619155958.3119181-4-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230619155958.3119181-1-miquel.raynal@bootlin.com> References: <20230619155958.3119181-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Krzysztof Kozlowski , Maxime Ripard , Rob Herring , Maxime Ripard , Thomas Petazzoni , Miquel Raynal Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The Sitronix controller expects 9-bit words, provide this as default at probe time rather than specifying this in each and every access. Signed-off-by: Miquel Raynal Reviewed-by: Sam Ravnborg Acked-by: Maxime Ripard --- drivers/gpu/drm/panel/panel-sitronix-st7789v.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c index 172c6c1fc090..605b9f6d0f14 100644 --- a/drivers/gpu/drm/panel/panel-sitronix-st7789v.c +++ b/drivers/gpu/drm/panel/panel-sitronix-st7789v.c @@ -142,7 +142,6 @@ static int st7789v_spi_write(struct st7789v *ctx, enum st7789v_prefix prefix, u16 txbuf = ((prefix & 1) << 8) | data; xfer.tx_buf = &txbuf; - xfer.bits_per_word = 9; xfer.len = sizeof(txbuf); return spi_sync_transfer(ctx->spi, &xfer, 1); @@ -436,6 +435,11 @@ static int st7789v_probe(struct spi_device *spi) spi_set_drvdata(spi, ctx); ctx->spi = spi; + spi->bits_per_word = 9; + ret = spi_setup(spi); + if (ret < 0) + return dev_err_probe(&spi->dev, ret, "Failed to setup spi\n"); + ctx->info = device_get_match_data(&spi->dev); drm_panel_init(&ctx->panel, dev, &st7789v_drm_funcs,