summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/include/mach/spi.h
diff options
context:
space:
mode:
authorminwuklee <mlee@nvidia.com>2010-12-21 11:29:25 +0900
committerBharat Nihalani <bnihalani@nvidia.com>2010-12-20 21:56:02 -0800
commit80d292db5cfac9f87889751fa15146de3e553e0d (patch)
tree7a812cd8f6fd0576f6eb2c63f27fe4a387b59151 /arch/arm/mach-tegra/include/mach/spi.h
parente8c13883cd1a79caf386426c3b793baa8c089e79 (diff)
tegra: spi: add slave driver
- no endian conversion is needed, so use memcpy to copy from client buf to dma buf or vice versa when bits_per_word is 32. - do spi complete operation in the last dma complete callback - add spi_tegra_abort_transfer whcih is called by upper s/w stack for timeout functionality bug 749431 bug 749983 bug 752531 bug 760790 Change-Id: I5cd14397e1a066fe807d72405b6ced98d62b50da Reviewed-on: http://git-master/r/13801 Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/include/mach/spi.h')
-rwxr-xr-xarch/arm/mach-tegra/include/mach/spi.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/include/mach/spi.h b/arch/arm/mach-tegra/include/mach/spi.h
new file mode 100755
index 000000000000..171e4007b4bc
--- /dev/null
+++ b/arch/arm/mach-tegra/include/mach/spi.h
@@ -0,0 +1,42 @@
+/*
+ * arch/arm/mach-tegra/include/mach/spi.h
+ *
+ * Copyright (c) 2010, NVIDIA Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __MACH_TEGRA_SPI_H
+#define __MACH_TEGRA_SPI_H
+
+#include <linux/types.h>
+#include <linux/spi/spi.h>
+
+typedef int (*callback)(void *client_data);
+
+/**
+ * register_spi_slave_callback - registers notification callback provided by
+ * the client.
+ * This callback indicate that the controller is all set to receive/transfer
+ * data.
+ * @spi: struct spi_device - refer to linux/spi/spi.h
+ * @func: Callback function
+ * @client_data: Data to be passed in callback
+ * Context: can not sleep
+ */
+int spi_tegra_register_callback(struct spi_device *spi, callback func,
+ void *client_data);
+
+#endif