Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/dtor/input

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (29 commits)
  Input: i8042 - add Dell Vostro 1510 to nomux list
  Input: gtco - use USB endpoint API
  Input: add support for Maple controller as a joystick
  Input: atkbd - broaden the Dell DMI signatures
  Input: HIL drivers - add MODULE_ALIAS()
  Input: map_to_7segment.h - convert to __inline__ for userspace
  Input: add support for enhanced rotary controller on pxa930 and pxa935
  Input: add support for trackball on pxa930 and pxa935
  Input: add da9034 touchscreen support
  Input: ads7846 - strict_strtoul takes unsigned long
  Input: make some variables and functions static
  Input: add tsc2007 based touchscreen driver
  Input: psmouse - add module parameters to control OLPC touchpad delays
  Input: i8042 - add Gigabyte M912 netbook to noloop exception table
  Input: atkbd - Samsung NC10 key repeat fix
  Input: atkbd - add keyboard quirk for HP Pavilion ZV6100 laptop
  Input: libps2 - handle 0xfc responses from devices
  Input: add support for Wacom W8001 penabled serial touchscreen
  Input: synaptics - report multi-taps only if supported by the device
  Input: add joystick driver for Walkera WK-0701 RC transmitter
  ...
  • Loading branch information
Linus Torvalds committed Jan 7, 2009
2 parents c861ea2 + 9334e90 commit db30c70
Show file tree
Hide file tree
Showing 54 changed files with 3,105 additions and 522 deletions.
109 changes: 109 additions & 0 deletions Documentation/input/walkera0701.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@

Walkera WK-0701 transmitter is supplied with a ready to fly Walkera
helicopters such as HM36, HM37, HM60. The walkera0701 module enables to use
this transmitter as joystick

Devel homepage and download:
http://zub.fei.tuke.sk/walkera-wk0701/

or use cogito:
cg-clone http://zub.fei.tuke.sk/GIT/walkera0701-joystick


Connecting to PC:

At back side of transmitter S-video connector can be found. Modulation
pulses from processor to HF part can be found at pin 2 of this connector,
pin 3 is GND. Between pin 3 and CPU 5k6 resistor can be found. To get
modulation pulses to PC, signal pulses must be amplified.

Cable: (walkera TX to parport)

Walkera WK-0701 TX S-VIDEO connector:
(back side of TX)
__ __ S-video: canon25
/ |_| \ pin 2 (signal) NPN parport
/ O 4 3 O \ pin 3 (GND) LED ________________ 10 ACK
( O 2 1 O ) | C
\ ___ / 2 ________________________|\|_____|/
| [___] | |/| B |\
------- 3 __________________________________|________________ 25 GND
E


I use green LED and BC109 NPN transistor.

Software:

Build kernel with walkera0701 module. Module walkera0701 need exclusive
access to parport, modules like lp must be unloaded before loading
walkera0701 module, check dmesg for error messages. Connect TX to PC by
cable and run jstest /dev/input/js0 to see values from TX. If no value can
be changed by TX "joystick", check output from /proc/interrupts. Value for
(usually irq7) parport must increase if TX is on.



Technical details:

Driver use interrupt from parport ACK input bit to measure pulse length
using hrtimers.

Frame format:
Based on walkera WK-0701 PCM Format description by Shaul Eizikovich.
(downloaded from http://www.smartpropoplus.com/Docs/Walkera_Wk-0701_PCM.pdf)

Signal pulses:
(ANALOG)
SYNC BIN OCT
+---------+ +------+
| | | |
--+ +------+ +---

Frame:
SYNC , BIN1, OCT1, BIN2, OCT2 ... BIN24, OCT24, BIN25, next frame SYNC ..

pulse length:
Binary values: Analog octal values:

288 uS Binary 0 318 uS 000
438 uS Binary 1 398 uS 001
478 uS 010
558 uS 011
638 uS 100
1306 uS SYNC 718 uS 101
798 uS 110
878 uS 111

24 bin+oct values + 1 bin value = 24*4+1 bits = 97 bits

(Warning, pulses on ACK ar inverted by transistor, irq is rised up on sync
to bin change or octal value to bin change).

Binary data representations:

One binary and octal value can be grouped to nibble. 24 nibbles + one binary
values can be sampled between sync pulses.

Values for first four channels (analog joystick values) can be found in
first 10 nibbles. Analog value is represented by one sign bit and 9 bit
absolute binary value. (10 bits per channel). Next nibble is checksum for
first ten nibbles.

Next nibbles 12 .. 21 represents four channels (not all channels can be
directly controlled from TX). Binary representations ar the same as in first
four channels. In nibbles 22 and 23 is a special magic number. Nibble 24 is
checksum for nibbles 12..23.

After last octal value for nibble 24 and next sync pulse one additional
binary value can be sampled. This bit and magic number is not used in
software driver. Some details about this magic numbers can be found in
Walkera_Wk-0701_PCM.pdf.

Checksum calculation:

Summary of octal values in nibbles must be same as octal value in checksum
nibble (only first 3 bits are used). Binary value for checksum nibble is
calculated by sum of binary values in checked nibbles + sum of octal values
in checked nibbles divided by 8. Only bit 0 of this sum is used.

20 changes: 20 additions & 0 deletions arch/arm/mach-pxa/include/mach/pxa930_rotary.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#ifndef __ASM_ARCH_PXA930_ROTARY_H
#define __ASM_ARCH_PXA930_ROTARY_H

/* NOTE:
*
* rotary can be either interpreted as a ralative input event (e.g.
* REL_WHEEL or REL_HWHEEL) or a specific key event (e.g. UP/DOWN
* or LEFT/RIGHT), depending on if up_key & down_key are assigned
* or rel_code is assigned a non-zero value. When all are non-zero,
* up_key and down_key will be preferred.
*/
struct pxa930_rotary_platform_data {
int up_key;
int down_key;
int rel_code;
};

void __init pxa930_set_rotarykey_info(struct pxa930_rotary_platform_data *info);

#endif /* __ASM_ARCH_PXA930_ROTARY_H */
10 changes: 10 additions & 0 deletions arch/arm/mach-pxa/include/mach/pxa930_trkball.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#ifndef __ASM_ARCH_PXA930_TRKBALL_H
#define __ASM_ARCH_PXA930_TRKBALL_H

struct pxa930_trkball_platform_data {
int x_filter;
int y_filter;
};

#endif /* __ASM_ARCH_PXA930_TRKBALL_H */

2 changes: 1 addition & 1 deletion drivers/input/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Each configuration option enables a list of files.

obj-$(CONFIG_INPUT) += input-core.o
input-core-objs := input.o ff-core.o
input-core-objs := input.o input-compat.o ff-core.o

obj-$(CONFIG_INPUT_FF_MEMLESS) += ff-memless.o
obj-$(CONFIG_INPUT_POLLDEV) += input-polldev.o
Expand Down
6 changes: 3 additions & 3 deletions drivers/input/evbug.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ MODULE_LICENSE("GPL");
static void evbug_event(struct input_handle *handle, unsigned int type, unsigned int code, int value)
{
printk(KERN_DEBUG "evbug.c: Event. Dev: %s, Type: %d, Code: %d, Value: %d\n",
handle->dev->dev.bus_id, type, code, value);
dev_name(&handle->dev->dev), type, code, value);
}

static int evbug_connect(struct input_handler *handler, struct input_dev *dev,
Expand All @@ -65,7 +65,7 @@ static int evbug_connect(struct input_handler *handler, struct input_dev *dev,
goto err_unregister_handle;

printk(KERN_DEBUG "evbug.c: Connected device: %s (%s at %s)\n",
dev->dev.bus_id,
dev_name(&dev->dev),
dev->name ?: "unknown",
dev->phys ?: "unknown");

Expand All @@ -81,7 +81,7 @@ static int evbug_connect(struct input_handler *handler, struct input_dev *dev,
static void evbug_disconnect(struct input_handle *handle)
{
printk(KERN_DEBUG "evbug.c: Disconnected device: %s\n",
handle->dev->dev.bus_id);
dev_name(&handle->dev->dev));

input_close_device(handle);
input_unregister_handle(handle);
Expand Down
Loading

0 comments on commit db30c70

Please sign in to comment.