From patchwork Tue Nov 10 23:46:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 322906 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:5ce:0:0:0:0 with SMTP id l14csp657520ils; Tue, 10 Nov 2020 15:47:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJwpsJewkTW+G9XU5imAh3TZJ8IWNyTOQI26f976nQBTrPr1sfVgkgwcNWkfy8L/QMy5etIP X-Received: by 2002:a17:90a:eb02:: with SMTP id j2mr688289pjz.136.1605052028876; Tue, 10 Nov 2020 15:47:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605052028; cv=none; d=google.com; s=arc-20160816; b=bqYk0e50p1LPAriWf9btOJ+SQY0vk07h4DPYtLfizkR7n0Y+8edRgiwYicizGwpH+O vnY0wfAOjVTrqcdVBxO2mN5L2Lgnuh460s7sPOlcMloKQyqzXYAk5DAYGJ4F7SxfsDCf v2G1nVgCbOLa87kFgjQO+FV2OSX9uAS/iSoYxSJxzB1djDATK7srEnnyac2E14hi/iwn 1CK+hGcq4c0awulMO1l1g1BJMXy/ncJacNhWsRFG+2OT2StwDt6m5UeXpqbPByqKF9X2 y67DpNOgaod5k9UHod4L18VIHnyCTn3PHeAsWznPkjippiQCwbjE3Oy6kJHwbKXXusoF HIQQ== 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=ZfDWM7PBd6BpAhFupG2ozO9SSfqepOyghdAriVUjG2M=; b=h8Mb3HxMZhbv5pUfyiTFxPK6ZEiasZsuJ+XbC45wIhxpnvDjhiK7AwVD92CX5KRIfw i2k5cNSMmWhq6K0eQIM+a98Rppni4ny+Bt1pt+PYn6SA8itrvz8gIi4zWlasB0uIj4/j CiezMSUI0n1BxaP2kHB55A4X3c6nCjJ0mRgZ43MizAx+vKrY8Pcf/CSQiF7XuXRJWFcA HHAPbqTUi/dCuKy7O9jqksb/ZEHsXeZvWhq6eJ3vBPPfa82TVLg64K0Ep9KpcuASzb+W Ca+YW12GZv28kzFsVrxd1BTfCtR8fc2HwPYvzryloLJf2+lrHwUaJLbyXvPvvFG1btqA Cj9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=U9ihdXyD; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 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. [131.252.210.177]) by mx.google.com with ESMTPS id x11si139323plb.439.2020.11.10.15.47.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Nov 2020 15:47:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=U9ihdXyD; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 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 BBD5689D61; Tue, 10 Nov 2020 23:47:06 +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 EFB3D89D60 for ; Tue, 10 Nov 2020 23:47:04 +0000 (UTC) Received: by mail-lj1-x244.google.com with SMTP id o24so10135782ljj.6 for ; Tue, 10 Nov 2020 15:47:04 -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=E1gRUn+R+klQwSA/hEFGmAtJ4OnicYEWs/eLK/JMuQY=; b=U9ihdXyD1urh+RHMp9iS7+yRg5oU1dA1y2MstjcSTXJ/aqTwr7ziS1Bfr9pmwaGQ4r 88uJuihEMFiDn0RNYkbZp585ls0glQXr3FPPC4Cqo4uKvehn4d4/kxIX4+goPiPV860a SLu7/fEeVaJ7q1Gp/wzZhzjoesA7nKt0QYPBPV9Yz6bzQ7kk/xit3DFfDz0/nN4aNAxR 8mXYseGVARTmwrSkzZgmu/7iqcN7jodaH3bVR8/Y01uL1EbpwNJBnHRp5clYuBkHaxf5 9qSeHCPvYCFpIBmh3EZD0rrZuEpCVQcPqTo2bxRjV4M1o+JUK3XZ43dmA43n5WlUd8Q+ bNIQ== 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=E1gRUn+R+klQwSA/hEFGmAtJ4OnicYEWs/eLK/JMuQY=; b=im9CRrSeABrtW+rTTEM5vnjF+HlsflvWWzG7h+akNjp2I4R8eYtpcaBsNVeXFXt0IX K47EQ5CqsyXTcPruNCZfc6ZxEAt/W8hKyVVue11UC0qLfJ1mHmjQ6jYsvIGZo0dPwpfc DePahqS7k8/EvslJkVuyEn5DS/4kbf+mQ688EhcVVPpjzRrhOTjnFlKjGSqmztI6FOYW W/zd3eNC/m9QCGV9+QehZnxpVscj8fxQTv9y7dLQNdwG8xVTE8xP7ICn+tM5n+todKOP SPFi5v8y7HthWOCu04g5iff4jvwd6MiacY6w766t8JiRa8uwcRBGw/cuwwt3gxyAKcXE HKxw== X-Gm-Message-State: AOAM530OYxy5NkRYBWSoXmkovcOJv0auv7g1BtEcOhgAUrnXCQcDEY/i uAK4LG9bWz8N0S1escyNBQ1l2w== X-Received: by 2002:a2e:b536:: with SMTP id z22mr9602614ljm.177.1605052023412; Tue, 10 Nov 2020 15:47:03 -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.47.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Nov 2020 15:47:02 -0800 (PST) From: Linus Walleij To: Thierry Reding , Sam Ravnborg , Stephan Gerhold , =?utf-8?q?Pawe=C5=82_Chmiel?= Subject: [PATCH 3/5] drm/panel: s6e63m0: Add some explanations Date: Wed, 11 Nov 2020 00:46:51 +0100 Message-Id: <20201110234653.2248594-4-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" The SPI DCS code was a bit hard to understand as the device accepts 9-bit transfers packed into 16-bit words with the most significant bit in bit 9 of the 16-bit word. Add some clarifying comments. Cc: Stephan Gerhold Cc: Paweł Chmiel Signed-off-by: Linus Walleij --- drivers/gpu/drm/panel/panel-samsung-s6e63m0-spi.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e63m0-spi.c b/drivers/gpu/drm/panel/panel-samsung-s6e63m0-spi.c index 9e1552a7ccc7..e47647f418ff 100644 --- a/drivers/gpu/drm/panel/panel-samsung-s6e63m0-spi.c +++ b/drivers/gpu/drm/panel/panel-samsung-s6e63m0-spi.c @@ -42,10 +42,17 @@ static int s6e63m0_spi_dcs_write(struct device *dev, const u8 *data, size_t len) int ret = 0; dev_dbg(dev, "SPI writing dcs seq: %*ph\n", (int)len, data); + + /* + * This sends 9 bits with the first bit (bit 8) set to 0 + * This indicates that this is a command. Anything after the + * command is data. + */ ret = s6e63m0_spi_write_word(dev, *data); while (!ret && --len) { ++data; + /* This sends 9 bits with the first bit (bit 8) set to 1 */ ret = s6e63m0_spi_write_word(dev, *data | DATA_MASK); }