Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4f99de6d authored by Dmitry Torokhov's avatar Dmitry Torokhov
Browse files

Input: iforce - split into core and transport modules



Now that we have moved enough transport details into separate source files
we can change them into transport modules so that they are only loaded when
needed.

Tested-by: default avatarTim Schumacher <timschumi@gmx.de>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 81fd4313
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -13,15 +13,15 @@ config JOYSTICK_IFORCE
	  module will be called iforce.

config JOYSTICK_IFORCE_USB
	bool "I-Force USB joysticks and wheels"
	depends on JOYSTICK_IFORCE && (JOYSTICK_IFORCE=m || USB=y) && USB
	tristate "I-Force USB joysticks and wheels"
	depends on JOYSTICK_IFORCE && USB
	help
	  Say Y here if you have an I-Force joystick or steering wheel
	  connected to your USB port.

config JOYSTICK_IFORCE_232
	bool "I-Force Serial joysticks and wheels"
	depends on JOYSTICK_IFORCE && (JOYSTICK_IFORCE=m || SERIO=y) && SERIO
	tristate "I-Force Serial joysticks and wheels"
	depends on JOYSTICK_IFORCE && SERIO
	help
	  Say Y here if you have an I-Force joystick or steering wheel
	  connected to your serial (COM) port.
+3 −4
Original line number Diff line number Diff line
@@ -5,7 +5,6 @@
#

obj-$(CONFIG_JOYSTICK_IFORCE)		+= iforce.o

iforce-y := iforce-ff.o iforce-main.o iforce-packets.o
iforce-$(CONFIG_JOYSTICK_IFORCE_232)	+= iforce-serio.o
iforce-$(CONFIG_JOYSTICK_IFORCE_USB)	+= iforce-usb.o
obj-$(CONFIG_JOYSTICK_IFORCE_232)	+= iforce-serio.o
obj-$(CONFIG_JOYSTICK_IFORCE_USB)	+= iforce-usb.o
+2 −33
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@
#include "iforce.h"

MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>, Johann Deneux <johann.deneux@gmail.com>");
MODULE_DESCRIPTION("USB/RS232 I-Force joysticks and wheels driver");
MODULE_DESCRIPTION("Core I-Force joysticks and wheels driver");
MODULE_LICENSE("GPL");

static signed short btn_joystick[] =
@@ -411,35 +411,4 @@ int iforce_init_device(struct device *parent, u16 bustype,
 fail:	input_free_device(input_dev);
	return error;
}

static int __init iforce_init(void)
{
	int err = 0;

#ifdef CONFIG_JOYSTICK_IFORCE_USB
	err = usb_register(&iforce_usb_driver);
	if (err)
		return err;
#endif
#ifdef CONFIG_JOYSTICK_IFORCE_232
	err = serio_register_driver(&iforce_serio_drv);
#ifdef CONFIG_JOYSTICK_IFORCE_USB
	if (err)
		usb_deregister(&iforce_usb_driver);
#endif
#endif
	return err;
}

static void __exit iforce_exit(void)
{
#ifdef CONFIG_JOYSTICK_IFORCE_USB
	usb_deregister(&iforce_usb_driver);
#endif
#ifdef CONFIG_JOYSTICK_IFORCE_232
	serio_unregister_driver(&iforce_serio_drv);
#endif
}

module_init(iforce_init);
module_exit(iforce_exit);
EXPORT_SYMBOL(iforce_init_device);
+2 −0
Original line number Diff line number Diff line
@@ -96,6 +96,7 @@ int iforce_send_packet(struct iforce *iforce, u16 cmd, unsigned char* data)

	return 0;
}
EXPORT_SYMBOL(iforce_send_packet);

/* Start or stop an effect */
int iforce_control_playback(struct iforce* iforce, u16 id, unsigned int value)
@@ -203,3 +204,4 @@ void iforce_process_packet(struct iforce *iforce, u16 cmd, unsigned char *data)
			break;
	}
}
EXPORT_SYMBOL(iforce_process_packet);
+7 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 */

#include <linux/serio.h>
#include "iforce.h"

struct iforce_serio {
@@ -250,3 +251,9 @@ struct serio_driver iforce_serio_drv = {
	.connect	= iforce_serio_connect,
	.disconnect	= iforce_serio_disconnect,
};

module_serio_driver(iforce_serio_drv);

MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>, Johann Deneux <johann.deneux@gmail.com>");
MODULE_DESCRIPTION("RS232 I-Force joysticks and wheels driver");
MODULE_LICENSE("GPL");
Loading