From patchwork Thu Jun 30 03:54:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Pronin X-Patchwork-Id: 9206603 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 019836089D for ; Thu, 30 Jun 2016 03:56:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E9C9628564 for ; Thu, 30 Jun 2016 03:56:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DE6FD285E6; Thu, 30 Jun 2016 03:56:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D0C332859C for ; Thu, 30 Jun 2016 03:56:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751703AbcF3DzT (ORCPT ); Wed, 29 Jun 2016 23:55:19 -0400 Received: from mail-pa0-f53.google.com ([209.85.220.53]:33230 "EHLO mail-pa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751601AbcF3Dyr (ORCPT ); Wed, 29 Jun 2016 23:54:47 -0400 Received: by mail-pa0-f53.google.com with SMTP id b13so23934585pat.0 for ; Wed, 29 Jun 2016 20:54:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=zOwjHZlSMyBV3xk5LGHYUrBANlDPms5FE+CsbxeSWxQ=; b=dh9RQ1MEmfbV3MnMuO1BZcA7CE/ejHvrjR4UZ3rwJycOmK2j2ezgJf0ikhAwUJoH5f ynXM/DCQG6+HFHc3CyNBVsSdr9blJVrJWCVER1atw9/AjGoEt6kQG0uazuwQyQRY/mc+ HjLnE6g5Oy010ZFuHmQzUgsj82ZM7PbMQ3lV8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=zOwjHZlSMyBV3xk5LGHYUrBANlDPms5FE+CsbxeSWxQ=; b=KHeI557NcQscT0ESXN03WAz7GiizA+FUd3j90xnpU2fSm3/mQ9nbAKFamjJajbtz8Z PI5dZxe/RJB23Z1kNCpGGB5Vc7gVKb0+B8ydlfnJOGXdcsIOcgY7UYgoGJnsqxBafWO0 mkQ7r8wpoXYTjqjrsah1Y2XblzCPoeFjIQS84IAeblM2xsal1bgjXuBQErdoxC8LaS3M gu28q6yOrNqrtz10s00j4g9XAwy8Psfdiq2xwcjLExTY18y8BAXBnhq1jr9JRFsBoQ+G pKT7EKrJxcmkOootqz2PjiE5mwsXvoeKSL5SQZKUstv2MCglYDHuE9YwYiXSKiUeGvqt dcnQ== X-Gm-Message-State: ALyK8tIQjGGMPh/M/ev9LsOCeFiImUNYwMxlh3OaKdazfzQbqAAjdPeS4GGAnDkl/hCsIb5U X-Received: by 10.66.25.38 with SMTP id z6mr17694116paf.11.1467258869697; Wed, 29 Jun 2016 20:54:29 -0700 (PDT) Received: from apronin0.mtv.corp.google.com ([172.22.64.136]) by smtp.gmail.com with ESMTPSA id 64sm1184045pfj.96.2016.06.29.20.54.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Jun 2016 20:54:29 -0700 (PDT) From: apronin@chromium.org To: Mark Brown Cc: linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, Andrey Pronin Subject: [PATCH 2/4] spi: Document option to wake a device by toggling CS Date: Wed, 29 Jun 2016 20:54:25 -0700 Message-Id: <1467258867-117727-2-git-send-email-apronin@chromium.org> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 In-Reply-To: <1467258867-117727-1-git-send-email-apronin@chromium.org> References: <1467258867-117727-1-git-send-email-apronin@chromium.org> Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Andrey Pronin Some SPI devices may go to sleep after a period of inactivity on SPI. For such devices, if enough time has passed since the last SPI transaction, toggle CS and wait for the device to start before communicating with it. Signed-off-by: Andrey Pronin --- Documentation/devicetree/bindings/spi/spi-bus.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Documentation/devicetree/bindings/spi/spi-bus.txt b/Documentation/devicetree/bindings/spi/spi-bus.txt index 42d5954..1b7ffd4 100644 --- a/Documentation/devicetree/bindings/spi/spi-bus.txt +++ b/Documentation/devicetree/bindings/spi/spi-bus.txt @@ -63,6 +63,13 @@ contain the following properties. used for MISO. Defaults to 1 if not present. - spi-rx-delay-us - (optional) Microsecond delay after a read transfer. - spi-tx-delay-us - (optional) Microsecond delay after a write transfer. +- cs-wake-after-sleep - (optional) Device may go to sleep after a period + of SPI inactivity. If this flag is set, toggle CS and + wait for it to wake before communicating to it. +- cs-sleep-delay - (optional) Delay after which the device may go to + sleep if there was no SPI activity (msec). +- cs-wake-duration - (optional) Time it takes the device to wake up after + toggling CS if it went to sleep (msec). Some SPI controllers and devices support Dual and Quad SPI transfer mode. It allows data in the SPI system to be transferred in 2 wires(DUAL) or 4 wires(QUAD).