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: 11895847 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 2C6B8C55ABD for ; Tue, 10 Nov 2020 23:47:08 +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 C10B520809 for ; Tue, 10 Nov 2020 23:47:07 +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="U9ihdXyD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C10B520809 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 BBD5689D61; Tue, 10 Nov 2020 23:47:06 +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 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-Google-Smtp-Source: ABdhPJxIJrO5fByuVcFYiXbVUCNS8ERYFbme3PDojsduwGAs4jamuSEibsdODjf4WOe7N6BG8x8Yug== 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); }