Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
usbsevseg.c File Reference
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/string.h>
#include <linux/usb.h>

Go to the source code of this file.

Data Structures

struct  usb_sevsegdev
 

Macros

#define DRIVER_AUTHOR   "Harrison Metzger <[email protected]>"
 
#define DRIVER_DESC   "USB 7 Segment Driver"
 
#define VENDOR_ID   0x0fc5
 
#define PRODUCT_ID   0x1227
 
#define MAXLEN   8
 
#define MYDEV_ATTR_SIMPLE_UNSIGNED(name, update_fcn)
 

Functions

 MODULE_DEVICE_TABLE (usb, id_table)
 
size_t my_memlen (const char *buf, size_t count)
 
 MYDEV_ATTR_SIMPLE_UNSIGNED (powered, update_display_powered)
 
 MYDEV_ATTR_SIMPLE_UNSIGNED (mode_msb, update_display_mode)
 
 MYDEV_ATTR_SIMPLE_UNSIGNED (mode_lsb, update_display_mode)
 
 module_usb_driver (sevseg_driver)
 
 MODULE_AUTHOR (DRIVER_AUTHOR)
 
 MODULE_DESCRIPTION (DRIVER_DESC)
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define DRIVER_AUTHOR   "Harrison Metzger <[email protected]>"

Definition at line 22 of file usbsevseg.c.

#define DRIVER_DESC   "USB 7 Segment Driver"

Definition at line 23 of file usbsevseg.c.

#define MAXLEN   8

Definition at line 27 of file usbsevseg.c.

#define MYDEV_ATTR_SIMPLE_UNSIGNED (   name,
  update_fcn 
)
Value:
static ssize_t show_attr_##name(struct device *dev, \
struct device_attribute *attr, char *buf) \
{ \
struct usb_interface *intf = to_usb_interface(dev); \
struct usb_sevsegdev *mydev = usb_get_intfdata(intf); \
\
return sprintf(buf, "%u\n", mydev->name); \
} \
\
static ssize_t set_attr_##name(struct device *dev, \
struct device_attribute *attr, const char *buf, size_t count) \
{ \
struct usb_interface *intf = to_usb_interface(dev); \
struct usb_sevsegdev *mydev = usb_get_intfdata(intf); \
\
mydev->name = simple_strtoul(buf, NULL, 10); \
update_fcn(mydev); \
\
return count; \
} \
static DEVICE_ATTR(name, S_IRUGO | S_IWUSR, show_attr_##name, set_attr_##name);

Definition at line 174 of file usbsevseg.c.

#define PRODUCT_ID   0x1227

Definition at line 26 of file usbsevseg.c.

#define VENDOR_ID   0x0fc5

Definition at line 25 of file usbsevseg.c.

Function Documentation

MODULE_AUTHOR ( DRIVER_AUTHOR  )
MODULE_DESCRIPTION ( DRIVER_DESC  )
MODULE_DEVICE_TABLE ( usb  ,
id_table   
)
MODULE_LICENSE ( "GPL"  )
module_usb_driver ( sevseg_driver  )
size_t my_memlen ( const char buf,
size_t  count 
)
inline

Definition at line 60 of file usbsevseg.c.

MYDEV_ATTR_SIMPLE_UNSIGNED ( powered  ,
update_display_powered   
)
MYDEV_ATTR_SIMPLE_UNSIGNED ( mode_msb  ,
update_display_mode   
)
MYDEV_ATTR_SIMPLE_UNSIGNED ( mode_lsb  ,
update_display_mode   
)