From patchwork Thu Aug 16 12:54:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "(Exiting) Baolin Wang" X-Patchwork-Id: 10567387 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1C682913 for ; Thu, 16 Aug 2018 12:55:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 09E732AA53 for ; Thu, 16 Aug 2018 12:55:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F08F32ADE1; Thu, 16 Aug 2018 12:55:30 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 8AAB52AA53 for ; Thu, 16 Aug 2018 12:55:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391464AbeHPPxy (ORCPT ); Thu, 16 Aug 2018 11:53:54 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:35865 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389341AbeHPPxy (ORCPT ); Thu, 16 Aug 2018 11:53:54 -0400 Received: by mail-pl0-f67.google.com with SMTP id e11-v6so2074218plb.3 for ; Thu, 16 Aug 2018 05:55:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=cvX4bf2n4cCtLSLi1usDuICrAMQwoBzNjS22rozmeSs=; b=PTIDQoH5Cmu8XzHr5m0+VtUI3H+FKVgyPdUSKOwErZgUrGqO7l+5I1wslMzqkJKnvK IQeNBSpaLINAbL6Cs6s3uSVDRYXhYUfL820sSCb1wB6CnqtDMZG0f4xOSSWqXHarZVPu +WAShEEDabkKa1TPKTlpcivLTrlF3LotCh2zM= 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; bh=cvX4bf2n4cCtLSLi1usDuICrAMQwoBzNjS22rozmeSs=; b=NUR0GFnO8JKKQkcpMF5gd9YYWlOaPDN1gO/xl340fEncQtp6ocUndNPpnRa+EJQ/ee jaS1JWRY45+1bsgrv84oW0e5TACWBq2uACK/QRhrwzu4tw2rnPbpbSbWySQZIXijb/Hr ogiIXNEyZc1oI3Fn5MWtpCMOUWsb2rrAjlDBvkG1ZrorDi+tkVtbp8ceu0erVQFWxl21 wbTygnaHqotldDtPWsfUeYqGf6Q5YcieE9q9huNAvRGhVo7NACM6WdpK2O60darbtPEC k2szQn5x8OFKI+wrTqATaUITOVDvBTxsOczLsqviPm4VQ7moPc7VDPN3A0LKjyUDUnaC ao4g== X-Gm-Message-State: AOUpUlFcBZh7b8nKblHA2gIaLQObWzlkHDLm+RE1lwsdsrSHhKf/5D8q 3TnnR+bPaI/JX3zg7hNe2LO0Zg== X-Google-Smtp-Source: AA+uWPwlSK8Ef+qKB0NYkgHCy3eo3xJbERRm9zojg8HuYvRmpdeggY5CeG/lkPu8IAfH+2bSz4hUwg== X-Received: by 2002:a17:902:7d8f:: with SMTP id a15-v6mr29231316plm.332.1534424129053; Thu, 16 Aug 2018 05:55:29 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id 203-v6sm34944589pgb.14.2018.08.16.05.55.25 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 16 Aug 2018 05:55:28 -0700 (PDT) From: Baolin Wang To: broonie@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com Cc: orsonzhai@gmail.com, zhang.lyra@gmail.com, lanqing.liu@spreadtrum.com, baolin.wang@linaro.org, linux-spi@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/3] spi: Introduce one new field to set word delay Date: Thu, 16 Aug 2018 20:54:49 +0800 Message-Id: X-Mailer: git-send-email 1.7.9.5 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 For some SPI controllers, after each word size (specified by bits_per_word) transimission, the hardware need some delay to make sure the slave has enough time to receive the whole data. So introducing one new 'word_delay' field of struct spi_tansfer for slave devices to set this inter word delay time. Signed-off-by: Baolin Wang --- Changes from v1: - New patch in v2. --- include/linux/spi/spi.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index a64235e..d698f9d 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h @@ -711,6 +711,8 @@ extern void spi_res_release(struct spi_controller *ctlr, * @delay_usecs: microseconds to delay after this transfer before * (optionally) changing the chipselect status, then starting * the next transfer or completing this @spi_message. + * @word_delay: clock cycles to inter word delay after each word size + * (set by bits_per_word) transmission. * @transfer_list: transfers are sequenced through @spi_message.transfers * @tx_sg: Scatterlist for transmit, currently not for client use * @rx_sg: Scatterlist for receive, currently not for client use @@ -793,6 +795,7 @@ struct spi_transfer { u8 bits_per_word; u16 delay_usecs; u32 speed_hz; + u16 word_delay; struct list_head transfer_list; };