From patchwork Tue Nov 26 07:34:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Poddar, Sourav" X-Patchwork-Id: 3237101 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 F2410C0C5E for ; Tue, 26 Nov 2013 07:36:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EAD832037B for ; Tue, 26 Nov 2013 07:36:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C9C9520383 for ; Tue, 26 Nov 2013 07:35:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754371Ab3KZHf7 (ORCPT ); Tue, 26 Nov 2013 02:35:59 -0500 Received: from arroyo.ext.ti.com ([192.94.94.40]:59112 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752690Ab3KZHf4 (ORCPT ); Tue, 26 Nov 2013 02:35:56 -0500 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id rAQ7ZYXs021853; Tue, 26 Nov 2013 01:35:34 -0600 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id rAQ7ZYT7002000; Tue, 26 Nov 2013 01:35:34 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.2.342.3; Tue, 26 Nov 2013 01:35:34 -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 rAQ7ZLXp030173; Tue, 26 Nov 2013 01:35:31 -0600 From: Sourav Poddar To: , , , CC: , , , , Sourav Poddar Subject: [PATCH 02/17] spi/spi.h: Add configure from slave support. Date: Tue, 26 Nov 2013 13:04:58 +0530 Message-ID: <1385451313-1875-3-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 There are few use cases encountered where the master controller depends on the slave parameters for some of its register configure. Add an api in spi master which can be used to enable the above feature. Typical usecase encountered till now is - ti qspi controller required flash opcodes to configure its set up register for memory mapped operations. There was another discussion on some LUT registers for some other qspi controller in mailing list, these feature can also be used for that case also. Signed-off-by: Sourav Poddar --- include/linux/spi/spi.h | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index 3b3743d..4be969a 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h @@ -295,6 +295,9 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv) * know the address to be used for memcopy. * @put_buf: Used for memory mapped cases after get_buf, after the memcpy * has finished. + * @configure_from_slave: Used when SPI controller has registers which need + * to be configured from slave specifics information(typical use case for + * SPI flash device). * 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 @@ -427,6 +430,7 @@ struct spi_master { void (*get_buf)(struct spi_master *master); void (*put_buf)(struct spi_master *master); + void (*configure_from_slave)(struct spi_device *spi, u8 *val); /* gpio chip select */ int *cs_gpios;