Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3493491ybi; Mon, 29 Jul 2019 07:30:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqx28Vb0EFlvQalmoOU4q3zZrdbrbZix2uk1y2Cu7k61XUlzVVMYX21oDU2pQHCkUSOnZQ2A X-Received: by 2002:a63:eb51:: with SMTP id b17mr101571534pgk.384.1564410633169; Mon, 29 Jul 2019 07:30:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564410633; cv=none; d=google.com; s=arc-20160816; b=QS9t9dbUiLUUg9zSSTg1sHVNH7eUbpGZsma294EXBfL/iQkJtH2Z7pZ/ZW6JJkJC9i b2fPa8e/YMVP77L5Z00kxg/E19p6eJaHXHvxYj7y99wm/u1VspOHVuM5y0LCMoKa+/K4 poqBoXRhoVwqUwVIMzVltJrOxrQOrwOObcvzG9U0s5DikfJGpRqofHFFTgpIORFGw8Ws UuJrwl+cP1F2D/1IhdGAv9tQcFwHKDS9vsFcJB/Ka6omAcfL3w1CDZDb45Ltvm3XiN66 1mISrVXD/DPrh3pcMjyJC3ZFfZEz8XWnIGUrC89nr70aF29iUrQVxcRvFZoTRZ+RjHnl 9njQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=5GPMTHO2oTFsiB90+W2P5IdnZnt9Xquwn78rQ3NXaJw=; b=Kt1EjlRK7QERRl8NtQL9ZXJDax8+N/NUQr0ixGPVjS9BNAXwnd3hDKGwy8YmO1TafE gsQZnc3JFY/5X31T2L1kSBDHusvGllD8P8sjUUHnCwvsT2U+2EJ6pkzaGnHqBwrrVX8R 0xRjXplZ56F8r5e2vMYGohzxpgfJcLguJXA6vdEKKxC3IcwFMwRGLNROI/7H+KgjY4YW 9v0njMCYFyQCmZ4hOjNQJnoGlKXKjXutWrz4x+K7VDyqVdd0AJcsoXZ53gaslxTJZCiM gzUCY+p/74nyTVv5hy12mqI0JGQpKgjx8yLbxmmFLR0+CS7xqrWQbBktvtW5man7tRwY OrXQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g6si26700784pll.82.2019.07.29.07.30.17; Mon, 29 Jul 2019 07:30:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727868AbfG2O0b (ORCPT + 99 others); Mon, 29 Jul 2019 10:26:31 -0400 Received: from 212.199.177.27.static.012.net.il ([212.199.177.27]:40074 "EHLO herzl.nuvoton.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727409AbfG2O0a (ORCPT ); Mon, 29 Jul 2019 10:26:30 -0400 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 Cc: linux-spi@vger.kernel.org, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Tomer Maimon 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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