From patchwork Tue Nov 26 07:34:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Poddar, Sourav" X-Patchwork-Id: 3237091 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E7B68C045B for ; Tue, 26 Nov 2013 07:36:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C9D9A20384 for ; Tue, 26 Nov 2013 07:35:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CF9082037B for ; Tue, 26 Nov 2013 07:35:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754300Ab3KZHf5 (ORCPT ); Tue, 26 Nov 2013 02:35:57 -0500 Received: from comal.ext.ti.com ([198.47.26.152]:46137 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753860Ab3KZHfz (ORCPT ); Tue, 26 Nov 2013 02:35:55 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id rAQ7ZTMU000939; Tue, 26 Nov 2013 01:35:29 -0600 Received: from DLEE70.ent.ti.com (dlemailx.itg.ti.com [157.170.170.113]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id rAQ7ZTRw016259; Tue, 26 Nov 2013 01:35:29 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.2.342.3; Tue, 26 Nov 2013 01:35:29 -0600 Received: from a0131647.apr.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id rAQ7ZLXo030173; Tue, 26 Nov 2013 01:35:26 -0600 From: Sourav Poddar To: , , , CC: , , , , Sourav Poddar Subject: [PATCH 01/17] spi/spi.h: Add get_buf/put_buf support in spi master.. Date: Tue, 26 Nov 2013 13:04:57 +0530 Message-ID: <1385451313-1875-2-git-send-email-sourav.poddar@ti.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1385451313-1875-1-git-send-email-sourav.poddar@ti.com> References: <1385451313-1875-1-git-send-email-sourav.poddar@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Add get_buf, put_buf api support in spi master. This can be used in a scenario where spi controller supports memory mapped operations(typically with flash devices). So, the memcpy needs top be done in slave devices which need the required memory mapped address. These api can be used to get that master address. These can also be used to turm the master controller clock, as usually the clocks get turned in spi core. But, in memory mapped case, we will bypass the spi core and hence needa way out to turn on the controller clock. Signed-off-by: Sourav Poddar --- include/linux/spi/spi.h | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index 8c62ba7..3b3743d 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h @@ -291,6 +291,10 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv) * number. Any individual value may be -ENOENT for CS lines that * are not GPIOs (driven by the SPI controller itself). * + * @get_buf: used for memory mapped cases, when the slave device wants to + * know the address to be used for memcopy. + * @put_buf: Used for memory mapped cases after get_buf, after the memcpy + * has finished. * Each SPI master controller can communicate with one or more @spi_device * children. These make a small bus, sharing MOSI, MISO and SCK signals * but not chip select signals. Each device may be configured to use a @@ -421,6 +425,9 @@ struct spi_master { int (*transfer_one)(struct spi_master *master, struct spi_device *spi, struct spi_transfer *transfer); + void (*get_buf)(struct spi_master *master); + void (*put_buf)(struct spi_master *master); + /* gpio chip select */ int *cs_gpios; };