Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755205AbcCUMfB (ORCPT ); Mon, 21 Mar 2016 08:35:01 -0400 Received: from mail-bl2nam02on0068.outbound.protection.outlook.com ([104.47.38.68]:20736 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754479AbcCUMe6 (ORCPT ); Mon, 21 Mar 2016 08:34:58 -0400 X-Greylist: delayed 848 seconds by postgrey-1.27 at vger.kernel.org; Mon, 21 Mar 2016 08:34:58 EDT Authentication-Results: spf=pass (sender IP is 149.199.60.100) 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; 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 1/2] mtd: Added dummy entry in the spi_transfer structure. Date: Mon, 21 Mar 2016 17:50:08 +0530 Message-ID: <1458562809-36114-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-22206.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:149.199.60.100;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(2980300002)(438002)(199003)(189002)(107886002)(46386002)(189998001)(45336002)(50986999)(2906002)(50226001)(5001770100001)(36756003)(81166005)(5008740100001)(50466002)(90966002)(586003)(4001430100002)(1096002)(36386004)(1220700001)(92566002)(87936001)(86362001)(5003940100001)(47776003)(229853001)(217423001)(33646002)(11100500001)(52956003)(19580395003)(106466001)(63266004)(48376002)(42186005)(103686003)(19580405001)(6806005)(107986001)(921003)(1121003)(217873001);DIR:OUT;SFP:1101;SCL:1;SRVR:BL2NAM02HT105;H:xsj-pvapsmtpgw02;FPR:;SPF:Pass;MLV:sfv;A:1;MX:1;LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: a622cb0e-adb6-4e93-d5ab-08d351833c6f X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(8251501002);SRVR:BL2NAM02HT105; X-Microsoft-Antispam-PRVS: <72ad967bac084abf91018b8d6292e165@BL2NAM02HT105.eop-nam02.prod.protection.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(13015025)(13024025)(13017025)(8121501046)(13018025)(13023025)(3002001)(10201501046);SRVR:BL2NAM02HT105;BCL:0;PCL:0;RULEID:;SRVR:BL2NAM02HT105; X-Forefront-PRVS: 0888B1D284 X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Mar 2016 12:20:48.4024 (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.100];Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2NAM02HT105 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1585 Lines: 45 This patch does following things. 1. Added dummy entry in the spi_transfer structure. 2. Assigned dummy cycles to dummy member in the transfer structure during read operation. Signed-off-by: P L Sai Krishna --- drivers/mtd/devices/m25p80.c | 1 + include/linux/spi/spi.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c index c9c3b7f..7c9fac9 100644 --- a/drivers/mtd/devices/m25p80.c +++ b/drivers/mtd/devices/m25p80.c @@ -139,6 +139,7 @@ static int m25p80_read(struct spi_nor *nor, loff_t from, size_t len, t[0].tx_buf = flash->command; t[0].len = m25p_cmdsz(nor) + dummy; + t[0].dummy = nor->read_dummy; spi_message_add_tail(&t[0], &m); t[1].rx_buf = buf; diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index 857a9a1..3f93526 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h @@ -664,6 +664,7 @@ 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: number of dummy cycles. * @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 +753,7 @@ struct spi_transfer { u8 bits_per_word; u16 delay_usecs; u32 speed_hz; + u32 dummy; struct list_head transfer_list; }; -- 2.1.2