From: Feng Tang <feng.tang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org,
alan-VuQAYsv1563Yd54FQh9/CA@public.gmane.org
Subject: [PATCH 1/2] spi_dw: move spi_dw_chip definition to a header file in include/linux/spi/
Date: Thu, 8 Sep 2011 15:23:35 +0800 [thread overview]
Message-ID: <1315466615-6043-1-git-send-email-feng.tang@intel.com> (raw)
So that it could be used to setup slave device's platform data, when platform
boot code enumerates and registers those spi slave devices.
Signed-off-by: Feng Tang <feng.tang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
drivers/spi/spi-dw.h | 20 +-------------------
include/linux/spi/spi-dw-platform.h | 23 +++++++++++++++++++++++
2 files changed, 24 insertions(+), 19 deletions(-)
create mode 100644 include/linux/spi/spi-dw-platform.h
diff --git a/drivers/spi/spi-dw.h b/drivers/spi/spi-dw.h
index 8b7b07b..290688f 100644
--- a/drivers/spi/spi-dw.h
+++ b/drivers/spi/spi-dw.h
@@ -3,6 +3,7 @@
#include <linux/io.h>
#include <linux/scatterlist.h>
+#include <linux/spi/spi-dw-platform.h>
/* Bit fields in CTRLR0 */
#define SPI_DFS_OFFSET 0
@@ -49,12 +50,6 @@
/* TX RX interrupt level threshold, max can be 256 */
#define SPI_INT_THRESHOLD 32
-enum dw_ssi_type {
- SSI_MOTO_SPI = 0,
- SSI_TI_SSP,
- SSI_NS_MICROWIRE,
-};
-
struct dw_spi_reg {
u32 ctrl0;
u32 ctrl1;
@@ -209,19 +204,6 @@ static inline void spi_umask_intr(struct dw_spi *dws, u32 mask)
dw_writel(dws, imr, new_mask);
}
-/*
- * Each SPI slave device to work with dw_api controller should
- * has such a structure claiming its working mode (PIO/DMA etc),
- * which can be save in the "controller_data" member of the
- * struct spi_device
- */
-struct dw_spi_chip {
- u8 poll_mode; /* 0 for contoller polling mode */
- u8 type; /* SPI/SSP/Micrwire */
- u8 enable_dma;
- void (*cs_control)(u32 command);
-};
-
extern int dw_spi_add_host(struct dw_spi *dws);
extern void dw_spi_remove_host(struct dw_spi *dws);
extern int dw_spi_suspend_host(struct dw_spi *dws);
diff --git a/include/linux/spi/spi-dw-platform.h b/include/linux/spi/spi-dw-platform.h
new file mode 100644
index 0000000..7c283c6
--- /dev/null
+++ b/include/linux/spi/spi-dw-platform.h
@@ -0,0 +1,23 @@
+#ifndef SPI_DW_PLATFORM_HEADER_H
+#define SPI_DW_PLATFORM_HEADER_H
+
+enum dw_ssi_type {
+ SSI_MOTO_SPI = 0,
+ SSI_TI_SSP,
+ SSI_NS_MICROWIRE,
+};
+
+/*
+ * Each SPI slave device to work with dw_api controller should
+ * has such a structure claiming its working mode (PIO/DMA etc),
+ * which can be save in the "controller_data" member of the
+ * struct spi_device
+ */
+struct dw_spi_chip {
+ u8 poll_mode; /* 0 for contoller polling mode */
+ u8 type; /* SPI/SSP/Micrwire */
+ u8 enable_dma;
+ void (*cs_control)(u32 command);
+};
+
+#endif /* SPI_DW_PLATFORM_HEADER_H */
--
1.7.1
------------------------------------------------------------------------------
Doing More with Less: The Next Generation Virtual Desktop
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops? How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
reply other threads:[~2011-09-08 7:23 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1315466615-6043-1-git-send-email-feng.tang@intel.com \
--to=feng.tang-ral2jqcrhueavxtiumwx3w@public.gmane.org \
--cc=alan-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
--cc=grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org \
--cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).