From patchwork Thu Apr 7 14:39:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Krishna Potthuri X-Patchwork-Id: 8773551 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C8CAEC0553 for ; Thu, 7 Apr 2016 14:40:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E6DAE2025A for ; Thu, 7 Apr 2016 14:40:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 065FD20251 for ; Thu, 7 Apr 2016 14:40:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756541AbcDGOjt (ORCPT ); Thu, 7 Apr 2016 10:39:49 -0400 Received: from mail-bl2nam02on0089.outbound.protection.outlook.com ([104.47.38.89]:4516 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756523AbcDGOjr (ORCPT ); Thu, 7 Apr 2016 10:39:47 -0400 Received: from BL2NAM02FT011.eop-nam02.prod.protection.outlook.com (10.152.76.60) by BL2NAM02HT161.eop-nam02.prod.protection.outlook.com (10.152.77.21) with Microsoft SMTP Server (TLS) id 15.1.453.6; Thu, 7 Apr 2016 14:39:45 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by BL2NAM02FT011.mail.protection.outlook.com (10.152.77.5) with Microsoft SMTP Server (TLS) id 15.1.453.6 via Frontend Transport; Thu, 7 Apr 2016 14:39:45 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1aoB5w-00037C-CB; Thu, 07 Apr 2016 07:39:40 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1aoB5w-0005f2-8O; Thu, 07 Apr 2016 07:39:40 -0700 Received: from xsj-pvapsmtp01 (mailhub.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id u37EdXDf023281; Thu, 7 Apr 2016 07:39:33 -0700 Received: from [172.23.146.172] (helo=xhdl3764.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1aoB5o-0005eB-KH; Thu, 07 Apr 2016 07:39:32 -0700 Received: by xhdl3764.xilinx.com (Postfix, from userid 14964) id BCCF01A203D6; Thu, 7 Apr 2016 20:09:31 +0530 (IST) From: P L Sai Krishna To: Michal Simek , Soren Brinkmann , David Woodhouse , "Brian Norris" , Mark Brown , "Javier Martinez Canillas" , Boris Brezillon , Stephen Warren , Geert Uytterhoeven , "Andrew F. Davis" , Marek Vasut , Jagan Teki , =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= CC: , , , , "Harini Katakam" , Punnaiah Choudary Kalluri , Anirudha Sarangi , P L Sai Krishna Subject: [LINUX PATCH v2 1/3] spi: Added dummy_cycle entry in the spi_transfer structure. Date: Thu, 7 Apr 2016 20:09:27 +0530 Message-ID: <1460039969-9835-1-git-send-email-lakshmis@xilinx.com> X-Mailer: git-send-email 2.1.2 X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.0.0.1202-22244.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(438002)(199003)(189002)(103686003)(11100500001)(86362001)(189998001)(50986999)(5003940100001)(36756003)(42186005)(106466001)(45336002)(5001770100001)(5008740100001)(63266004)(87936001)(217423001)(92566002)(1220700001)(90966002)(47776003)(2906002)(229853001)(4326007)(4001430100002)(6806005)(50226001)(36386004)(46386002)(33646002)(50466002)(19580395003)(19580405001)(48376002)(81166005)(586003)(1096002)(107886002)(52956003)(921003)(107986001)(217873001)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:BL2NAM02HT161; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; MLV:sfv; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 1a3ac2e2-4e32-46da-cbab-08d35ef27684 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501002); SRVR:BL2NAM02HT161; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13015025)(13024025)(13018025)(5005006)(8121501046)(13017025)(13023025)(3002001)(10201501046); SRVR:BL2NAM02HT161; BCL:0; PCL:0; RULEID:; SRVR:BL2NAM02HT161; X-Forefront-PRVS: 0905A6B2C7 X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Apr 2016 14:39:45.0382 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2NAM02HT161 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds dummy_cycles entry in the spi_transfer structure. len field in the transfer structure contains dummy bytes along with actual data bytes, controllers which requires dummy bytes use len field and simply Ignore the dummy_cycles field. Controllers which expects dummy cycles won't work directly by using len field because host driver doesn't know that len field of a particular transfer includes dummy bytes or not (and also number of dummy bytes included in len field). In such cases host driver use this dummy_cycles field to identify the number of dummy cycles and based on that it will send the required number of dummy cycles. Signed-off-by: P L Sai Krishna --- v2: - Changed the structure member name from dummy to dummy_cycles. - Updated the documentation of dummy_cycles. - m25p80 changes split into another patch. include/linux/spi/spi.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index 857a9a1..63135b3 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h @@ -664,6 +664,9 @@ extern void spi_res_release(struct spi_master *master, * @len: size of rx and tx buffers (in bytes) * @speed_hz: Select a speed other than the device default for this * transfer. If 0 the default (from @spi_device) is used. + * @dummy_cycles: number of dummy cycles. If host controller requires + * dummy cycles rather than dummy bytes which send along with Cmd + * and address then this dummy_cycles is used. * @bits_per_word: select a bits_per_word other than the device default * for this transfer. If 0 the default (from @spi_device) is used. * @cs_change: affects chipselect after this transfer completes @@ -752,6 +755,7 @@ struct spi_transfer { u8 bits_per_word; u16 delay_usecs; u32 speed_hz; + u32 dummy_cycles; struct list_head transfer_list; };