From patchwork Tue Nov 10 23:46:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 11895843 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 58710C388F7 for ; Tue, 10 Nov 2020 23:47:03 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id EBFF420825 for ; Tue, 10 Nov 2020 23:47:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="u/ORs0QN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EBFF420825 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1F08D89D58; Tue, 10 Nov 2020 23:47:01 +0000 (UTC) Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 217F589D58 for ; Tue, 10 Nov 2020 23:47:00 +0000 (UTC) Received: by mail-lj1-x244.google.com with SMTP id h23so12355185ljg.13 for ; Tue, 10 Nov 2020 15:47:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=khCnrGcki9o8mKzcd5bCbIg16yUPV4xc/WhNkEV8Tok=; b=u/ORs0QN5/8GNcc5WPRtlACFGXVsKVFbYuGsrzCv1yjHxcPy/iM5a/i+6vMUP6AKjN zSHk/ZYl8qUWVCssuNs9diEHlqZ4Py5b5EqAo7jLgpwAddN/m2FV9P7oyjsd2QxhzXRz l+6ua64z7QgON4W1QW+UOSGw3txS1ESYHK9IfLUs6k8RLIImNiWIUt/sSPfpSP55FQi0 cyqgQId3rGQ1p8BbtMwSDfUHV57QQE5+iSRp7zPcMOKdx6Q1Is+CQYGV3VtbmHWgrsMQ 5QFsV8pJxfrZi04clbXYEzKmGfR1dY/++THEnKwL/mwp785/k2SEfBwdo7Y4SelB+pF5 7HSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=khCnrGcki9o8mKzcd5bCbIg16yUPV4xc/WhNkEV8Tok=; b=JVfUwI4F9sLuEq1fpHXBnhxiMXRvQQBJWfJK22BiKnxZm69B4tbUDS1Suz/Zz8kI8q 0ns+miPGG9k1KAICC9+oZlZ7yYKZGa5ec00kOPxoXTsHIF7MnXANdiM8pKnWxDsvsWUe sL8OKtZfbE34Y9Oi4GZLB5BwRz4BTMdid75ja/+/QAm446s17qwAEs7e6yhtOsKWu8Yu VgPftK3rm1w2ZItN38EsmL7xgUrde5zKgcx0frqjbfD7mBYiFzraSBhIknFWBXcp97c+ 1EGbQZNjFILJW3HbHoR9oUJkffRgL+clhD3RYgblPuIFbZz3Eo/RBPDoHnO8WwVwk1NU RVbw== X-Gm-Message-State: AOAM533WbC5QfwazGPnwuv6HN/4M9+ULs59CYAxmw/7kSfAki75fi3Qz 4ZANJ8yLcoq5LUBdt/KhRBhNwQ== X-Google-Smtp-Source: ABdhPJzu4zhI7ATvz2cS3ifaqpbPNdcj+FCldCfQgZdOFlyA1OLSbRWf/zHRc4w+ZEKaQQ/wAABacg== X-Received: by 2002:a2e:9083:: with SMTP id l3mr3274847ljg.118.1605052018573; Tue, 10 Nov 2020 15:46:58 -0800 (PST) Received: from localhost.bredbandsbolaget (c-92d7225c.014-348-6c756e10.bbcust.telenor.se. [92.34.215.146]) by smtp.gmail.com with ESMTPSA id y65sm39883lff.73.2020.11.10.15.46.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Nov 2020 15:46:57 -0800 (PST) From: Linus Walleij To: Thierry Reding , Sam Ravnborg , Stephan Gerhold , =?utf-8?q?Pawe=C5=82_Chmiel?= Subject: [PATCH 1/5] drm/panel: s6e63m0: Simplify SPI writing Date: Wed, 11 Nov 2020 00:46:49 +0100 Message-Id: <20201110234653.2248594-2-linus.walleij@linaro.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201110234653.2248594-1-linus.walleij@linaro.org> References: <20201110234653.2248594-1-linus.walleij@linaro.org> 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: dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This writing code is equivalent to the spi_write() helper in the SPI framework. Insert a comment that this will always work fine since SPI buffers are in native endianness. Cc: Stephan Gerhold Cc: Paweł Chmiel Signed-off-by: Linus Walleij --- drivers/gpu/drm/panel/panel-samsung-s6e63m0-spi.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e63m0-spi.c b/drivers/gpu/drm/panel/panel-samsung-s6e63m0-spi.c index d298d780220d..75f00ed4810b 100644 --- a/drivers/gpu/drm/panel/panel-samsung-s6e63m0-spi.c +++ b/drivers/gpu/drm/panel/panel-samsung-s6e63m0-spi.c @@ -25,16 +25,9 @@ static int s6e63m0_spi_dcs_read(struct device *dev, const u8 cmd, u8 *data) static int s6e63m0_spi_write_word(struct device *dev, u16 data) { struct spi_device *spi = to_spi_device(dev); - struct spi_transfer xfer = { - .len = 2, - .tx_buf = &data, - }; - struct spi_message msg; - spi_message_init(&msg); - spi_message_add_tail(&xfer, &msg); - - return spi_sync(spi, &msg); + /* SPI buffers are always in CPU order */ + return spi_write(spi, &data, 2); } static int s6e63m0_spi_dcs_write(struct device *dev, const u8 *data, size_t len)