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: 322904 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:5ce:0:0:0:0 with SMTP id l14csp657470ils; Tue, 10 Nov 2020 15:47:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJzOan+U55jMwc4jkWoANnBs1G/2NSblvgx9I2EAywK4i0YrYa68VpRRc21qsnl0FlRDXv2O X-Received: by 2002:a63:65c7:: with SMTP id z190mr19000801pgb.444.1605052024174; Tue, 10 Nov 2020 15:47:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605052024; cv=none; d=google.com; s=arc-20160816; b=tuB3jQMEghNci+7MhKOZRs+5ZnuJ4CTSNJ7M9UXnqCeHejhibMAapb0BFq8uBSSXAK OxZGTtwwH9+9EprBGtBrPkkBvXbGD1JWXEQLpyBZaOzdr8RVtv8J3fYHocAdvXBU7pni 3woog+O52H+l6KBQ00rh5ym+Ep5niaJsLAws0kT1743woe7Ycu54EjV4ozpJhu4F7wAy oB6yM+ToTgQzJpPRwo+o28pAUX+CTj/Ux89AnmWPlhTAMpP9XzV47sj4GnQycVtol1mA 0Q0I3ZR/APkUB5K1Vffz9oM/DrftnJ+FfHvx5ShjeR5bH0JrO8w42/puZWfCCVWPpARj qVXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:delivered-to; bh=vN8HI5GtF2TcJOoy7+6/gdUCefZb8+elbHVMVTAScts=; b=a7Pp+eZ6BENWGGNUmKudGPIss1WdttMTPQRiaIhi7O2aqZTWhZUtBjxEytBFd1stQl WQsPz/zVeiegvqSrHO84gn55HoXKyXEHXVX+AuZBV2SMxUUMhsoEZwtSVqi2v3mlHq7w erNA7pG2h5UA58S1J/G8zxO0PysFzkJhdO2BqUF0vX+BzMefwgQPghpm8vcwhXqt8SM8 MJI6MxKUvpv7ShGWODZimP70XFecXgo+NtqHF6wzdhOCkV6DJ57Pmu9lzXLW9u1pZM8s tXAjmvOV4Sr+xq80bG1v45e74Fo5FIL7FIaw4iGwBWZWGjRRFudOPpPLdYJlsDQziTh1 PR1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="u/ORs0QN"; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id l194si62088pga.358.2020.11.10.15.47.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Nov 2020 15:47:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="u/ORs0QN"; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.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) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org 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-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)