Skip to contentSkip to conversation

drivers/char: bfin_sport: new userspace driver for Blackfin SPORTs

PATCH New Mike Frysinger 1 participant 1 message Mar 25, 2011 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/char: bfin_sport: new userspace driver for Blackfin SPORTs

From: Roy Huang <[email protected]>

This let's people read/write the SPORT peripheral directly. Useful for people who only need to do basic streaming.

---
 arch/blackfin/include/asm/bfin_sport.h |    3 +
 drivers/char/Kconfig                   |   12 +
 drivers/char/Makefile                  |    1 +
 drivers/char/bfin_sport.c              |  957 ++++++++++++++++++++++++++++++++
 4 files changed, 973 insertions(+), 0 deletions(-)
 create mode 100644 drivers/char/bfin_sport.c
arch/blackfin/include/asm/bfin_sport.h +3 -0
index d27600c2..51aaebc 100644
@@ -13,6 +13,7 @@
 #define NORM_MODE	0x0
 #define TDM_MODE	0x1
 #define I2S_MODE	0x2
+#define NDSO_MODE	0x3
 
 /* Data format, normal, a-law or u-law */
 #define NORM_FORMAT	0x0
@@ -56,6 +57,8 @@ struct sport_config {
 /* Userspace interface */
 #define SPORT_IOC_MAGIC		'P'
 #define SPORT_IOC_CONFIG	_IOWR('P', 0x01, struct sport_config)
+#define SPORT_IOC_GET_SYSTEMCLOCK         _IOR('P', 0x02, unsigned long)
+#define SPORT_IOC_SET_BAUDRATE            _IOW('P', 0x03, unsigned long)
 
 #ifdef __KERNEL__
 
drivers/char/Kconfig +12 -0
index 17f9b96..0b2d3f1 100644
@@ -4,6 +4,18 @@
 
 menu "Character devices"
 
+config BFIN_SPORT
+	tristate "Blackfin SPORT driver for direct raw access"
+	depends on BLACKFIN
+	default n
+	help
+	  This is a generic character interface to the SPORT peripheral that
+	  exists on many Blackfin parts.  It is a standalone driver that is
+	  only used for direct userspace access to the device and is not used
+	  in conjunction with any other driver.
+
+	  If unsure, then say N.
+
 config VT
 	bool "Virtual terminal" if EXPERT
 	depends on !S390
drivers/char/Makefile +1 -0
index 8238f89..fc31c81 100644
@@ -41,6 +41,7 @@ obj-$(CONFIG_IBM_BSR)		+= bsr.o
 obj-$(CONFIG_SGI_MBCS)		+= mbcs.o
 obj-$(CONFIG_BRIQ_PANEL)	+= briq_panel.o
 obj-$(CONFIG_BFIN_OTP)		+= bfin-otp.o
+obj-$(CONFIG_BFIN_SPORT)	+= bfin_sport.o
 
 obj-$(CONFIG_PRINTER)		+= lp.o
 
drivers/char/bfin_sport.c new file +957 -0

957 lines not on this page · raw message

Signature · 1 line
1.7.4.1