From patchwork Fri Jul 14 01:37:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 702979 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D32CC00528 for ; Fri, 14 Jul 2023 01:38:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234619AbjGNBia (ORCPT ); Thu, 13 Jul 2023 21:38:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234208AbjGNBiO (ORCPT ); Thu, 13 Jul 2023 21:38:14 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 192FE30CA; Thu, 13 Jul 2023 18:38:08 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 603F561BCB; Fri, 14 Jul 2023 01:38:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 10512C43215; Fri, 14 Jul 2023 01:38:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689298687; bh=8EUQj+RIHgeP2CyOzNZK9/zBLRftEAwim2XCQDawxbI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uqUi8calaC0JhBUS7zv46DVxb/CwAp9PVAgxFZiPUfQcwXiqXZ2VCsMkgZdmNrC8D Mj9FPcfGsYtZ77S531Wet8N89jRL9Hul80BaIBbmxIQh81uoRvo+FtvrtQiqjyNbbS jc1ZOsRxYsQVd8+zn6cJgokTghm6z6cayNzfiJ0ZfIuRSAyc++vzOuBMhY84b4rrGj OloQMFE7XcXJ8fCahwh8ZOef/D/ZfgBaQYHT8eYaQh+XXpj9qtWJKZev/g3G919n/U I56NtqPZ6u33dwul39oqihDa7fAtvoUVZuz86n5l/Bek4TBcDcU99zN/QR6PSpbIbt rIAAMlIX0Vktg== Received: by mercury (Postfix, from userid 1000) id F34AB10676F8; Fri, 14 Jul 2023 03:37:58 +0200 (CEST) From: Sebastian Reichel To: Sebastian Reichel Cc: Gerald Loacker , Michael Riesch , Miquel Raynal , Thierry Reding , Sam Ravnborg , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, Maxime Ripard Subject: [PATCH v3 16/19] drm/panel: sitronix-st7789v: Use 9 bits per spi word by default Date: Fri, 14 Jul 2023 03:37:53 +0200 Message-Id: <20230714013756.1546769-17-sre@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230714013756.1546769-1-sre@kernel.org> References: <20230714013756.1546769-1-sre@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Miquel Raynal 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 Reviewed-by: Sebastian Reichel Tested-by: Sebastian Reichel Signed-off-by: Sebastian Reichel --- 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 55e475471f43..33bdf9ee4085 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,