Skip to content

Commit

Permalink
USB: Put phidgets driver in a sysfs class
Browse files Browse the repository at this point in the history
This patch creates a device class phidget and add the phidget drivers to 
them.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Sean Young authored and Greg Kroah-Hartman committed Sep 27, 2006
1 parent d5176b4 commit 912b24c
Show file tree
Hide file tree
Showing 7 changed files with 334 additions and 190 deletions.
13 changes: 10 additions & 3 deletions drivers/usb/misc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,16 @@ config USB_CYTHERM
To compile this driver as a module, choose M here: the
module will be called cytherm.

config USB_PHIDGET
tristate "USB Phidgets drivers"
depends on USB
help
Say Y here to enable the various drivers for devices from
Phidgets inc.

config USB_PHIDGETKIT
tristate "USB PhidgetInterfaceKit support"
depends on USB
depends on USB_PHIDGET
help
Say Y here if you want to connect a PhidgetInterfaceKit USB device
from Phidgets Inc.
Expand All @@ -127,7 +134,7 @@ config USB_PHIDGETKIT

config USB_PHIDGETMOTORCONTROL
tristate "USB PhidgetMotorControl support"
depends on USB
depends on USB_PHIDGET
help
Say Y here if you want to connect a PhidgetMotorControl USB device
from Phidgets Inc.
Expand All @@ -137,7 +144,7 @@ config USB_PHIDGETMOTORCONTROL

config USB_PHIDGETSERVO
tristate "USB PhidgetServo support"
depends on USB
depends on USB_PHIDGET
help
Say Y here if you want to connect an 1 or 4 Motor PhidgetServo
servo controller version 2.0 or 3.0.
Expand Down
1 change: 1 addition & 0 deletions drivers/usb/misc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ obj-$(CONFIG_USB_LCD) += usblcd.o
obj-$(CONFIG_USB_LD) += ldusb.o
obj-$(CONFIG_USB_LED) += usbled.o
obj-$(CONFIG_USB_LEGOTOWER) += legousbtower.o
obj-$(CONFIG_USB_PHIDGET) += phidget.o
obj-$(CONFIG_USB_PHIDGETKIT) += phidgetkit.o
obj-$(CONFIG_USB_PHIDGETMOTORCONTROL) += phidgetmotorcontrol.o
obj-$(CONFIG_USB_PHIDGETSERVO) += phidgetservo.o
Expand Down
43 changes: 43 additions & 0 deletions drivers/usb/misc/phidget.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* USB Phidgets class
*
* Copyright (C) 2006 Sean Young <sean@mess.org>
*
* 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.
*/

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/err.h>
#include <linux/device.h>

struct class *phidget_class;

static int __init init_phidget(void)
{
phidget_class = class_create(THIS_MODULE, "phidget");

if (IS_ERR(phidget_class))
return PTR_ERR(phidget_class);

return 0;
}

static void __exit cleanup_phidget(void)
{
class_destroy(phidget_class);
}

EXPORT_SYMBOL_GPL(phidget_class);

module_init(init_phidget);
module_exit(cleanup_phidget);

MODULE_LICENSE("GPL");
MODULE_AUTHOR("Sean Young <sean@mess.org>");
MODULE_DESCRIPTION("Container module for phidget class");

12 changes: 12 additions & 0 deletions drivers/usb/misc/phidget.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* USB Phidgets class
*
* Copyright (C) 2006 Sean Young <sean@mess.org>
*
* 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.
*/

extern struct class *phidget_class;
Loading

0 comments on commit 912b24c

Please sign in to comment.