From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.5 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C94DC7618B for ; Mon, 29 Jul 2019 14:26:26 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 63936206DD for ; Mon, 29 Jul 2019 14:26:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Pl+E72bC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 63936206DD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=uuGg4urnz7lsSf4/OVG+X0QHg4rETrqz+M6UrIGstCU=; b=Pl+E72bCRrs3C5aO0lGPtO12Ie eNuKpl6nFigQlQ7IYRKA9kBCgTgEI01qjbSFax2jR+glUiWe/4lV0aiNWrcxiDITyguxNkxLdNb8Z QTaPIOqWHKAQ7eq2FEtUc5WjFqxsN1QuKBRHz227BMKnUAgX36Xw6zNFFvoSEM9/xi/q4NiJF4VTL JAaGl4b8hEZiaosBdqiPEodEkcf395y4QeP2+0kPfHi6Xa1F8ywOX2R3+Oi97IuWXZMUfKQS5X6or 7rOORvjYKwLMfPufHECBk69WKVHHD2my5h43pnqiKBpStOCzb/h9r6cyPWYQNsqTKZhD49oGVz/Cc UZvPF2mw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hs6bJ-0004g1-Ox; Mon, 29 Jul 2019 14:26:10 +0000 Received: from 212.199.177.27.static.012.net.il ([212.199.177.27] helo=herzl.nuvoton.co.il) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hs6bF-0004er-Uw for linux-mtd@lists.infradead.org; Mon, 29 Jul 2019 14:26:07 +0000 Received: from taln60.nuvoton.co.il (ntil-fw [212.199.177.25]) by herzl.nuvoton.co.il (8.13.8/8.13.8) with ESMTP id x6TEP6lN025573; Mon, 29 Jul 2019 17:25:06 +0300 Received: by taln60.nuvoton.co.il (Postfix, from userid 10070) id C3EFF622ED; Mon, 29 Jul 2019 17:25:06 +0300 (IDT) From: Tomer Maimon To: broonie@kernel.org, dwmw2@infradead.org, computersforpeace@gmail.com, marek.vasut@gmail.com, miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com, bbrezillon@kernel.org, yogeshnarayan.gaur@nxp.com, tudor.ambarus@microchip.com, gregkh@linuxfoundation.org, frieder.schrempf@exceet.de, tglx@linutronix.de Subject: [RFC v1 2/3] spi: spi-mem: add callback function to spi-mem device Date: Mon, 29 Jul 2019 17:25:03 +0300 Message-Id: <20190729142504.188336-3-tmaimon77@gmail.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20190729142504.188336-1-tmaimon77@gmail.com> References: <20190729142504.188336-1-tmaimon77@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190729_072606_379900_DE8985E3 X-CRM114-Status: UNSURE ( 7.33 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Tomer Maimon , linux-spi@vger.kernel.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-mtd" Errors-To: linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org Add callback function support to the spi-mem device for passing an argument from the spi-mem layer to the spi layer. Signed-off-by: Tomer Maimon --- include/linux/spi/spi-mem.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/linux/spi/spi-mem.h b/include/linux/spi/spi-mem.h index 5f7d20bd2b09..b9841a9030be 100644 --- a/include/linux/spi/spi-mem.h +++ b/include/linux/spi/spi-mem.h @@ -13,6 +13,8 @@ #include +typedef size_t (*spi_mem_callback)(void *spi_mem_param); + #define SPI_MEM_OP_CMD(__opcode, __buswidth) \ { \ .buswidth = __buswidth, \ @@ -172,6 +174,9 @@ struct spi_mem_dirmap_desc { * @spi: the underlying SPI device * @drvpriv: spi_mem_driver private data * @name: name of the SPI memory device + * @callback: routine for passing an argument from the + * spi-mem layer to the spi layer. + * @callback_param: general parameter to pass to the callback routine * * Extra information that describe the SPI memory device and may be needed by * the controller to properly handle this device should be placed here. @@ -183,6 +188,8 @@ struct spi_mem { struct spi_device *spi; void *drvpriv; const char *name; + spi_mem_callback callback; + void *callback_param; }; /** -- 2.18.0 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/