Convert input documentation to ReST
Subsystems (6)
PATCH v2 25/37 docs: input/sentelic: convert it to ReST format
In reply to Mauro Carvalho ChehabThis file has its own particular format that doesn't match any markup one.
Manually change it to get something that would be readable using ReST markup language.
--- Documentation/input/sentelic.txt | 1000 ++++++++++++++++++++------------------ 1 file changed, 514 insertions(+), 486 deletions(-)
Documentation/input/sentelic.txt +514 -486
@@ -1,411 +1,437 @@ -Copyright (C) 2002-2011 Sentelic Corporation. -Last update: Dec-07-2011 +.. include:: <isonum.txt> + +=============== +Sentelic Driver +=============== + + +:Copyright: |copy| 2002-2011 Sentelic Corporation. + +:Last update: Dec-07-2011 + +Finger Sensing Pad Intellimouse Mode(scrolling wheel, 4th and 5th buttons) +========================================================================== -============================================================================== -* Finger Sensing Pad Intellimouse Mode(scrolling wheel, 4th and 5th buttons) -============================================================================== A) MSID 4: Scrolling wheel mode plus Forward page(4th button) and Backward page (5th button) -@1. Set sample rate to 200; -@2. Set sample rate to 200; -@3. Set sample rate to 80; -@4. Issuing the "Get device ID" command (0xF2) and waits for the response; -@5. FSP will respond 0x04. - -Packet 1 - Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 -BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------| - 1 |Y|X|y|x|1|M|R|L| 2 |X|X|X|X|X|X|X|X| 3 |Y|Y|Y|Y|Y|Y|Y|Y| 4 | | |B|F|W|W|W|W| - |---------------| |---------------| |---------------| |---------------| - -Byte 1: Bit7 => Y overflow - Bit6 => X overflow - Bit5 => Y sign bit - Bit4 => X sign bit - Bit3 => 1 - Bit2 => Middle Button, 1 is pressed, 0 is not pressed. - Bit1 => Right Button, 1 is pressed, 0 is not pressed. - Bit0 => Left Button, 1 is pressed, 0 is not pressed. -Byte 2: X Movement(9-bit 2's complement integers) -Byte 3: Y Movement(9-bit 2's complement integers) -Byte 4: Bit3~Bit0 => the scrolling wheel's movement since the last data report. - valid values, -8 ~ +7 - Bit4 => 1 = 4th mouse button is pressed, Forward one page. - 0 = 4th mouse button is not pressed. - Bit5 => 1 = 5th mouse button is pressed, Backward one page. - 0 = 5th mouse button is not pressed. - -B) MSID 6: Horizontal and Vertical scrolling. -@ Set bit 1 in register 0x40 to 1 - -# FSP replaces scrolling wheel's movement as 4 bits to show horizontal and - vertical scrolling. - -Packet 1 - Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 -BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------| - 1 |Y|X|y|x|1|M|R|L| 2 |X|X|X|X|X|X|X|X| 3 |Y|Y|Y|Y|Y|Y|Y|Y| 4 | | |B|F|r|l|u|d| - |---------------| |---------------| |---------------| |---------------| - -Byte 1: Bit7 => Y overflow - Bit6 => X overflow - Bit5 => Y sign bit - Bit4 => X sign bit - Bit3 => 1 - Bit2 => Middle Button, 1 is pressed, 0 is not pressed. - Bit1 => Right Button, 1 is pressed, 0 is not pressed. - Bit0 => Left Button, 1 is pressed, 0 is not pressed. -Byte 2: X Movement(9-bit 2's complement integers) -Byte 3: Y Movement(9-bit 2's complement integers) -Byte 4: Bit0 => the Vertical scrolling movement downward. - Bit1 => the Vertical scrolling movement upward. - Bit2 => the Horizontal scrolling movement leftward. - Bit3 => the Horizontal scrolling movement rightward. - Bit4 => 1 = 4th mouse button is pressed, Forward one page. - 0 = 4th mouse button is not pressed. - Bit5 => 1 = 5th mouse button is pressed, Backward one page. - 0 = 5th mouse button is not pressed. - -C) MSID 7: -# FSP uses 2 packets (8 Bytes) to represent Absolute Position. - so we have PACKET NUMBER to identify packets. + +1. Set sample rate to 200; +2. Set sample rate to 200; +3. Set sample rate to 80; +4. Issuing the "Get device ID" command (0xF2) and waits for the response; +5. FSP will respond 0x04. + +:: + + Packet 1 + Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 + BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------| + 1 |Y|X|y|x|1|M|R|L| 2 |X|X|X|X|X|X|X|X| 3 |Y|Y|Y|Y|Y|Y|Y|Y| 4 | | |B|F|W|W|W|W| + |---------------| |---------------| |---------------| |---------------| + + Byte 1: Bit7 => Y overflow + Bit6 => X overflow + Bit5 => Y sign bit + Bit4 => X sign bit + Bit3 => 1 + Bit2 => Middle Button, 1 is pressed, 0 is not pressed. + Bit1 => Right Button, 1 is pressed, 0 is not pressed. + Bit0 => Left Button, 1 is pressed, 0 is not pressed. + Byte 2: X Movement(9-bit 2's complement integers) + Byte 3: Y Movement(9-bit 2's complement integers) + Byte 4: Bit3~Bit0 => the scrolling wheel's movement since the last data report. + valid values, -8 ~ +7 + Bit4 => 1 = 4th mouse button is pressed, Forward one page. + 0 = 4th mouse button is not pressed. + Bit5 => 1 = 5th mouse button is pressed, Backward one page. + 0 = 5th mouse button is not pressed. + +B) MSID 6: Horizontal and Vertical scrolling + +- Set bit 1 in register 0x40 to 1 + +FSP replaces scrolling wheel's movement as 4 bits to show horizontal and +vertical scrolling. + +:: + + Packet 1 + Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 + BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------| + 1 |Y|X|y|x|1|M|R|L| 2 |X|X|X|X|X|X|X|X| 3 |Y|Y|Y|Y|Y|Y|Y|Y| 4 | | |B|F|r|l|u|d| + |---------------| |---------------| |---------------| |---------------| + + Byte 1: Bit7 => Y overflow + Bit6 => X overflow + Bit5 => Y sign bit + Bit4 => X sign bit + Bit3 => 1 + Bit2 => Middle Button, 1 is pressed, 0 is not pressed. + Bit1 => Right Button, 1 is pressed, 0 is not pressed. + Bit0 => Left Button, 1 is pressed, 0 is not pressed. + Byte 2: X Movement(9-bit 2's complement integers) + Byte 3: Y Movement(9-bit 2's complement integers) + Byte 4: Bit0 => the Vertical scrolling movement downward. + Bit1 => the Vertical scrolling movement upward. + Bit2 => the Horizontal scrolling movement leftward. + Bit3 => the Horizontal scrolling movement rightward. + Bit4 => 1 = 4th mouse button is pressed, Forward one page. + 0 = 4th mouse button is not pressed. + Bit5 => 1 = 5th mouse button is pressed, Backward one page. + 0 = 5th mouse button is not pressed. + +C) MSID 7 + +FSP uses 2 packets (8 Bytes) to represent Absolute Position. +so we have PACKET NUMBER to identify packets. + If PACKET NUMBER is 0, the packet is Packet 1. If PACKET NUMBER is 1, the packet is Packet 2. Please count this number in program. -# MSID6 special packet will be enable at the same time when enable MSID 7. - -============================================================================== -* Absolute position for STL3886-G0. -============================================================================== -@ Set bit 2 or 3 in register 0x40 to 1 -@ Set bit 6 in register 0x40 to 1 - -Packet 1 (ABSOLUTE POSITION) - Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 -BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------| - 1 |0|1|V|1|1|M|R|L| 2 |X|X|X|X|X|X|X|X| 3 |Y|Y|Y|Y|Y|Y|Y|Y| 4 |r|l|d|u|X|X|Y|Y| - |---------------| |---------------| |---------------| |---------------| - -Byte 1: Bit7~Bit6 => 00, Normal data packet - => 01, Absolute coordination packet - => 10, Notify packet - Bit5 => valid bit - Bit4 => 1 - Bit3 => 1 - Bit2 => Middle Button, 1 is pressed, 0 is not pressed. - Bit1 => Right Button, 1 is pressed, 0 is not pressed. - Bit0 => Left Button, 1 is pressed, 0 is not pressed. -Byte 2: X coordinate (xpos[9:2]) -Byte 3: Y coordinate (ypos[9:2]) -Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0]) - Bit3~Bit2 => X coordinate (ypos[1:0]) - Bit4 => scroll up - Bit5 => scroll down - Bit6 => scroll left - Bit7 => scroll right - -Notify Packet for G0 - Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 -BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------| - 1 |1|0|0|1|1|M|R|L| 2 |C|C|C|C|C|C|C|C| 3 |M|M|M|M|M|M|M|M| 4 |0|0|0|0|0|0|0|0| - |---------------| |---------------| |---------------| |---------------| - -Byte 1: Bit7~Bit6 => 00, Normal data packet - => 01, Absolute coordination packet - => 10, Notify packet - Bit5 => 0 - Bit4 => 1 - Bit3 => 1 - Bit2 => Middle Button, 1 is pressed, 0 is not pressed. - Bit1 => Right Button, 1 is pressed, 0 is not pressed. - Bit0 => Left Button, 1 is pressed, 0 is not pressed. -Byte 2: Message Type => 0x5A (Enable/Disable status packet) - Mode Type => 0xA5 (Normal/Icon mode status) -Byte 3: Message Type => 0x00 (Disabled) - => 0x01 (Enabled) - Mode Type => 0x00 (Normal) - => 0x01 (Icon) -Byte 4: Bit7~Bit0 => Don't Care - -============================================================================== -* Absolute position for STL3888-Ax. -============================================================================== -Packet 1 (ABSOLUTE POSITION) - Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 -BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------| - 1 |0|1|V|A|1|L|0|1| 2 |X|X|X|X|X|X|X|X| 3 |Y|Y|Y|Y|Y|Y|Y|Y| 4 |x|x|y|y|X|X|Y|Y| - |---------------| |---------------| |---------------| |---------------| - -Byte 1: Bit7~Bit6 => 00, Normal data packet - => 01, Absolute coordination packet - => 10, Notify packet - => 11, Normal data packet with on-pad click - Bit5 => Valid bit, 0 means that the coordinate is invalid or finger up. - When both fingers are up, the last two reports have zero valid - bit. - Bit4 => arc - Bit3 => 1 - Bit2 => Left Button, 1 is pressed, 0 is released. - Bit1 => 0 - Bit0 => 1 -Byte 2: X coordinate (xpos[9:2]) -Byte 3: Y coordinate (ypos[9:2]) -Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0]) - Bit3~Bit2 => X coordinate (ypos[1:0]) - Bit5~Bit4 => y1_g - Bit7~Bit6 => x1_g - -Packet 2 (ABSOLUTE POSITION) - Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 -BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------| - 1 |0|1|V|A|1|R|1|0| 2 |X|X|X|X|X|X|X|X| 3 |Y|Y|Y|Y|Y|Y|Y|Y| 4 |x|x|y|y|X|X|Y|Y| - |---------------| |---------------| |---------------| |---------------| - -Byte 1: Bit7~Bit6 => 00, Normal data packet - => 01, Absolute coordinates packet - => 10, Notify packet - => 11, Normal data packet with on-pad click - Bit5 => Valid bit, 0 means that the coordinate is invalid or finger up. - When both fingers are up, the last two reports have zero valid - bit. - Bit4 => arc - Bit3 => 1 - Bit2 => Right Button, 1 is pressed, 0 is released. - Bit1 => 1 - Bit0 => 0 -Byte 2: X coordinate (xpos[9:2]) -Byte 3: Y coordinate (ypos[9:2]) -Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0]) - Bit3~Bit2 => X coordinate (ypos[1:0]) - Bit5~Bit4 => y2_g - Bit7~Bit6 => x2_g - -Notify Packet for STL3888-Ax - Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 -BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------| - 1 |1|0|1|P|1|M|R|L| 2 |C|C|C|C|C|C|C|C| 3 |0|0|F|F|0|0|0|i| 4 |r|l|d|u|0|0|0|0| - |---------------| |---------------| |---------------| |---------------| - -Byte 1: Bit7~Bit6 => 00, Normal data packet - => 01, Absolute coordinates packet - => 10, Notify packet - => 11, Normal data packet with on-pad click - Bit5 => 1 - Bit4 => when in absolute coordinates mode (valid when EN_PKT_GO is 1): - 0: left button is generated by the on-pad command - 1: left button is generated by the external button - Bit3 => 1 - Bit2 => Middle Button, 1 is pressed, 0 is not pressed. - Bit1 => Right Button, 1 is pressed, 0 is not pressed. - Bit0 => Left Button, 1 is pressed, 0 is not pressed. -Byte 2: Message Type => 0xB7 (Multi Finger, Multi Coordinate mode) -Byte 3: Bit7~Bit6 => Don't care - Bit5~Bit4 => Number of fingers - Bit3~Bit1 => Reserved - Bit0 => 1: enter gesture mode; 0: leaving gesture mode -Byte 4: Bit7 => scroll right button - Bit6 => scroll left button - Bit5 => scroll down button - Bit4 => scroll up button - * Note that if gesture and additional button (Bit4~Bit7) - happen at the same time, the button information will not - be sent. - Bit3~Bit0 => Reserved +MSID6 special packet will be enable at the same time when enable MSID 7. + +Absolute position for STL3886-G0 +================================ + +1. Set bit 2 or 3 in register 0x40 to 1 +2. Set bit 6 in register 0x40 to 1 + +:: + + Packet 1 (ABSOLUTE POSITION) + Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 + BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------| + 1 |0|1|V|1|1|M|R|L| 2 |X|X|X|X|X|X|X|X| 3 |Y|Y|Y|Y|Y|Y|Y|Y| 4 |r|l|d|u|X|X|Y|Y| + |---------------| |---------------| |---------------| |---------------| + + Byte 1: Bit7~Bit6 => 00, Normal data packet + => 01, Absolute coordination packet + => 10, Notify packet + Bit5 => valid bit + Bit4 => 1 + Bit3 => 1 + Bit2 => Middle Button, 1 is pressed, 0 is not pressed. + Bit1 => Right Button, 1 is pressed, 0 is not pressed. + Bit0 => Left Button, 1 is pressed, 0 is not pressed. + Byte 2: X coordinate (xpos[9:2]) + Byte 3: Y coordinate (ypos[9:2]) + Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0]) + Bit3~Bit2 => X coordinate (ypos[1:0]) + Bit4 => scroll up + Bit5 => scroll down + Bit6 => scroll left + Bit7 => scroll right + + Notify Packet for G0 + Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 + BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------| + 1 |1|0|0|1|1|M|R|L| 2 |C|C|C|C|C|C|C|C| 3 |M|M|M|M|M|M|M|M| 4 |0|0|0|0|0|0|0|0| + |---------------| |---------------| |---------------| |---------------| + + Byte 1: Bit7~Bit6 => 00, Normal data packet + => 01, Absolute coordination packet + => 10, Notify packet + Bit5 => 0 + Bit4 => 1 + Bit3 => 1 + Bit2 => Middle Button, 1 is pressed, 0 is not pressed. + Bit1 => Right Button, 1 is pressed, 0 is not pressed. + Bit0 => Left Button, 1 is pressed, 0 is not pressed. + Byte 2: Message Type => 0x5A (Enable/Disable status packet) + Mode Type => 0xA5 (Normal/Icon mode status) + Byte 3: Message Type => 0x00 (Disabled) + => 0x01 (Enabled) + Mode Type => 0x00 (Normal) + => 0x01 (Icon) + Byte 4: Bit7~Bit0 => Don't Care + +Absolute position for STL3888-Ax +================================ + +:: + + Packet 1 (ABSOLUTE POSITION) + Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 + BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------| + 1 |0|1|V|A|1|L|0|1| 2 |X|X|X|X|X|X|X|X| 3 |Y|Y|Y|Y|Y|Y|Y|Y| 4 |x|x|y|y|X|X|Y|Y| + |---------------| |---------------| |---------------| |---------------| + + Byte 1: Bit7~Bit6 => 00, Normal data packet + => 01, Absolute coordination packet + => 10, Notify packet + => 11, Normal data packet with on-pad click + Bit5 => Valid bit, 0 means that the coordinate is invalid or finger up. + When both fingers are up, the last two reports have zero valid + bit. + Bit4 => arc + Bit3 => 1 + Bit2 => Left Button, 1 is pressed, 0 is released. + Bit1 => 0 + Bit0 => 1 + Byte 2: X coordinate (xpos[9:2]) + Byte 3: Y coordinate (ypos[9:2]) + Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0]) + Bit3~Bit2 => X coordinate (ypos[1:0]) + Bit5~Bit4 => y1_g + Bit7~Bit6 => x1_g + + Packet 2 (ABSOLUTE POSITION) + Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 + BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------| + 1 |0|1|V|A|1|R|1|0| 2 |X|X|X|X|X|X|X|X| 3 |Y|Y|Y|Y|Y|Y|Y|Y| 4 |x|x|y|y|X|X|Y|Y| + |---------------| |---------------| |---------------| |---------------| + + Byte 1: Bit7~Bit6 => 00, Normal data packet + => 01, Absolute coordinates packet + => 10, Notify packet + => 11, Normal data packet with on-pad click + Bit5 => Valid bit, 0 means that the coordinate is invalid or finger up. + When both fingers are up, the last two reports have zero valid + bit. + Bit4 => arc + Bit3 => 1 + Bit2 => Right Button, 1 is pressed, 0 is released. + Bit1 => 1 + Bit0 => 0 + Byte 2: X coordinate (xpos[9:2]) + Byte 3: Y coordinate (ypos[9:2]) + Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0]) + Bit3~Bit2 => X coordinate (ypos[1:0]) + Bit5~Bit4 => y2_g + Bit7~Bit6 => x2_g + + Notify Packet for STL3888-Ax + Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 + BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------| + 1 |1|0|1|P|1|M|R|L| 2 |C|C|C|C|C|C|C|C| 3 |0|0|F|F|0|0|0|i| 4 |r|l|d|u|0|0|0|0| + |---------------| |---------------| |---------------| |---------------| + + Byte 1: Bit7~Bit6 => 00, Normal data packet + => 01, Absolute coordinates packet + => 10, Notify packet + => 11, Normal data packet with on-pad click + Bit5 => 1 + Bit4 => when in absolute coordinates mode (valid when EN_PKT_GO is 1): + 0: left button is generated by the on-pad command + 1: left button is generated by the external button + Bit3 => 1 + Bit2 => Middle Button, 1 is pressed, 0 is not pressed. + Bit1 => Right Button, 1 is pressed, 0 is not pressed. + Bit0 => Left Button, 1 is pressed, 0 is not pressed. + Byte 2: Message Type => 0xB7 (Multi Finger, Multi Coordinate mode) + Byte 3: Bit7~Bit6 => Don't care + Bit5~Bit4 => Number of fingers + Bit3~Bit1 => Reserved + Bit0 => 1: enter gesture mode; 0: leaving gesture mode + Byte 4: Bit7 => scroll right button + Bit6 => scroll left button + Bit5 => scroll down button + Bit4 => scroll up button + * Note that if gesture and additional button (Bit4~Bit7) + happen at the same time, the button information will not + be sent. + Bit3~Bit0 => Reserved Sample sequence of Multi-finger, Multi-coordinate mode: notify packet (valid bit == 1), abs pkt 1, abs pkt 2, abs pkt 1, abs pkt 2, ..., notify packet (valid bit == 0) -============================================================================== -* Absolute position for STL3888-B0. -============================================================================== -Packet 1(ABSOLUTE POSITION) - Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 -BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------| - 1 |0|1|V|F|1|0|R|L| 2 |X|X|X|X|X|X|X|X| 3 |Y|Y|Y|Y|Y|Y|Y|Y| 4 |r|l|u|d|X|X|Y|Y| - |---------------| |---------------| |---------------| |---------------| - -Byte 1: Bit7~Bit6 => 00, Normal data packet - => 01, Absolute coordinates packet - => 10, Notify packet - => 11, Normal data packet with on-pad click - Bit5 => Valid bit, 0 means that the coordinate is invalid or finger up. - When both fingers are up, the last two reports have zero valid - bit. - Bit4 => finger up/down information. 1: finger down, 0: finger up. - Bit3 => 1 - Bit2 => finger index, 0 is the first finger, 1 is the second finger. - Bit1 => Right Button, 1 is pressed, 0 is not pressed. - Bit0 => Left Button, 1 is pressed, 0 is not pressed. -Byte 2: X coordinate (xpos[9:2]) -Byte 3: Y coordinate (ypos[9:2]) -Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0]) - Bit3~Bit2 => X coordinate (ypos[1:0]) - Bit4 => scroll down button - Bit5 => scroll up button - Bit6 => scroll left button - Bit7 => scroll right button - -Packet 2 (ABSOLUTE POSITION) - Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 -BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------| - 1 |0|1|V|F|1|1|R|L| 2 |X|X|X|X|X|X|X|X| 3 |Y|Y|Y|Y|Y|Y|Y|Y| 4 |r|l|u|d|X|X|Y|Y| - |---------------| |---------------| |---------------| |---------------| - -Byte 1: Bit7~Bit6 => 00, Normal data packet - => 01, Absolute coordination packet - => 10, Notify packet - => 11, Normal data packet with on-pad click - Bit5 => Valid bit, 0 means that the coordinate is invalid or finger up. - When both fingers are up, the last two reports have zero valid - bit. - Bit4 => finger up/down information. 1: finger down, 0: finger up. - Bit3 => 1 - Bit2 => finger index, 0 is the first finger, 1 is the second finger. - Bit1 => Right Button, 1 is pressed, 0 is not pressed. - Bit0 => Left Button, 1 is pressed, 0 is not pressed. -Byte 2: X coordinate (xpos[9:2]) -Byte 3: Y coordinate (ypos[9:2]) -Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0]) - Bit3~Bit2 => X coordinate (ypos[1:0]) - Bit4 => scroll down button - Bit5 => scroll up button - Bit6 => scroll left button - Bit7 => scroll right button - -Notify Packet for STL3888-B0 - Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 -BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------| - 1 |1|0|1|P|1|M|R|L| 2 |C|C|C|C|C|C|C|C| 3 |0|0|F|F|0|0|0|i| 4 |r|l|u|d|0|0|0|0| - |---------------| |---------------| |---------------| |---------------| - -Byte 1: Bit7~Bit6 => 00, Normal data packet - => 01, Absolute coordination packet - => 10, Notify packet - => 11, Normal data packet with on-pad click - Bit5 => 1 - Bit4 => when in absolute coordinates mode (valid when EN_PKT_GO is 1): - 0: left button is generated by the on-pad command - 1: left button is generated by the external button - Bit3 => 1 - Bit2 => Middle Button, 1 is pressed, 0 is not pressed. - Bit1 => Right Button, 1 is pressed, 0 is not pressed. - Bit0 => Left Button, 1 is pressed, 0 is not pressed. -Byte 2: Message Type => 0xB7 (Multi Finger, Multi Coordinate mode) -Byte 3: Bit7~Bit6 => Don't care - Bit5~Bit4 => Number of fingers - Bit3~Bit1 => Reserved - Bit0 => 1: enter gesture mode; 0: leaving gesture mode -Byte 4: Bit7 => scroll right button - Bit6 => scroll left button - Bit5 => scroll up button - Bit4 => scroll down button - * Note that if gesture and additional button(Bit4~Bit7) - happen at the same time, the button information will not - be sent. - Bit3~Bit0 => Reserved +Absolute position for STL3888-B0 +================================ + +:: + + Packet 1(ABSOLUTE POSITION) + Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 + BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------| + 1 |0|1|V|F|1|0|R|L| 2 |X|X|X|X|X|X|X|X| 3 |Y|Y|Y|Y|Y|Y|Y|Y| 4 |r|l|u|d|X|X|Y|Y| + |---------------| |---------------| |---------------| |---------------| + + Byte 1: Bit7~Bit6 => 00, Normal data packet + => 01, Absolute coordinates packet + => 10, Notify packet + => 11, Normal data packet with on-pad click + Bit5 => Valid bit, 0 means that the coordinate is invalid or finger up. + When both fingers are up, the last two reports have zero valid + bit. + Bit4 => finger up/down information. 1: finger down, 0: finger up. + Bit3 => 1 + Bit2 => finger index, 0 is the first finger, 1 is the second finger. + Bit1 => Right Button, 1 is pressed, 0 is not pressed. + Bit0 => Left Button, 1 is pressed, 0 is not pressed. + Byte 2: X coordinate (xpos[9:2]) + Byte 3: Y coordinate (ypos[9:2]) + Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0]) + Bit3~Bit2 => X coordinate (ypos[1:0]) + Bit4 => scroll down button + Bit5 => scroll up button + Bit6 => scroll left button + Bit7 => scroll right button + + Packet 2 (ABSOLUTE POSITION) + Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 + BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------| + 1 |0|1|V|F|1|1|R|L| 2 |X|X|X|X|X|X|X|X| 3 |Y|Y|Y|Y|Y|Y|Y|Y| 4 |r|l|u|d|X|X|Y|Y| + |---------------| |---------------| |---------------| |---------------| + + Byte 1: Bit7~Bit6 => 00, Normal data packet + => 01, Absolute coordination packet + => 10, Notify packet + => 11, Normal data packet with on-pad click + Bit5 => Valid bit, 0 means that the coordinate is invalid or finger up. + When both fingers are up, the last two reports have zero valid + bit. + Bit4 => finger up/down information. 1: finger down, 0: finger up. + Bit3 => 1 + Bit2 => finger index, 0 is the first finger, 1 is the second finger. + Bit1 => Right Button, 1 is pressed, 0 is not pressed. + Bit0 => Left Button, 1 is pressed, 0 is not pressed. + Byte 2: X coordinate (xpos[9:2]) + Byte 3: Y coordinate (ypos[9:2]) + Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0]) + Bit3~Bit2 => X coordinate (ypos[1:0]) + Bit4 => scroll down button + Bit5 => scroll up button + Bit6 => scroll left button + Bit7 => scroll right button + +Notify Packet for STL3888-B0:: + + Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 + BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------| + 1 |1|0|1|P|1|M|R|L| 2 |C|C|C|C|C|C|C|C| 3 |0|0|F|F|0|0|0|i| 4 |r|l|u|d|0|0|0|0| + |---------------| |---------------| |---------------| |---------------| + + Byte 1: Bit7~Bit6 => 00, Normal data packet + => 01, Absolute coordination packet + => 10, Notify packet + => 11, Normal data packet with on-pad click + Bit5 => 1 + Bit4 => when in absolute coordinates mode (valid when EN_PKT_GO is 1): + 0: left button is generated by the on-pad command + 1: left button is generated by the external button + Bit3 => 1 + Bit2 => Middle Button, 1 is pressed, 0 is not pressed. + Bit1 => Right Button, 1 is pressed, 0 is not pressed. + Bit0 => Left Button, 1 is pressed, 0 is not pressed. + Byte 2: Message Type => 0xB7 (Multi Finger, Multi Coordinate mode) + Byte 3: Bit7~Bit6 => Don't care + Bit5~Bit4 => Number of fingers + Bit3~Bit1 => Reserved + Bit0 => 1: enter gesture mode; 0: leaving gesture mode + Byte 4: Bit7 => scroll right button + Bit6 => scroll left button + Bit5 => scroll up button + Bit4 => scroll down button + * Note that if gesture and additional button(Bit4~Bit7) + happen at the same time, the button information will not + be sent. + Bit3~Bit0 => Reserved Sample sequence of Multi-finger, Multi-coordinate mode: notify packet (valid bit == 1), abs pkt 1, abs pkt 2, abs pkt 1, abs pkt 2, ..., notify packet (valid bit == 0) -============================================================================== -* Absolute position for STL3888-Cx and STL3888-Dx. -============================================================================== -Single Finger, Absolute Coordinate Mode (SFAC) - Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 -BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------| - 1 |0|1|0|P|1|M|R|L| 2 |X|X|X|X|X|X|X|X| 3 |Y|Y|Y|Y|Y|Y|Y|Y| 4 |r|l|B|F|X|X|Y|Y| - |---------------| |---------------| |---------------| |---------------| - -Byte 1: Bit7~Bit6 => 00, Normal data packet - => 01, Absolute coordinates packet - => 10, Notify packet - Bit5 => Coordinate mode(always 0 in SFAC mode): - 0: single-finger absolute coordinates (SFAC) mode - 1: multi-finger, multiple coordinates (MFMC) mode - Bit4 => 0: The LEFT button is generated by on-pad command (OPC) - 1: The LEFT button is generated by external button - Default is 1 even if the LEFT button is not pressed. - Bit3 => Always 1, as specified by PS/2 protocol. - Bit2 => Middle Button, 1 is pressed, 0 is not pressed. - Bit1 => Right Button, 1 is pressed, 0 is not pressed. - Bit0 => Left Button, 1 is pressed, 0 is not pressed. -Byte 2: X coordinate (xpos[9:2]) -Byte 3: Y coordinate (ypos[9:2]) -Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0]) - Bit3~Bit2 => X coordinate (ypos[1:0]) - Bit4 => 4th mouse button(forward one page) - Bit5 => 5th mouse button(backward one page) - Bit6 => scroll left button - Bit7 => scroll right button - -Multi Finger, Multiple Coordinates Mode (MFMC): - Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 -BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------| - 1 |0|1|1|P|1|F|R|L| 2 |X|X|X|X|X|X|X|X| 3 |Y|Y|Y|Y|Y|Y|Y|Y| 4 |r|l|B|F|X|X|Y|Y| - |---------------| |---------------| |---------------| |---------------| - -Byte 1: Bit7~Bit6 => 00, Normal data packet - => 01, Absolute coordination packet - => 10, Notify packet - Bit5 => Coordinate mode (always 1 in MFMC mode): - 0: single-finger absolute coordinates (SFAC) mode - 1: multi-finger, multiple coordinates (MFMC) mode - Bit4 => 0: The LEFT button is generated by on-pad command (OPC) - 1: The LEFT button is generated by external button - Default is 1 even if the LEFT button is not pressed. - Bit3 => Always 1, as specified by PS/2 protocol. - Bit2 => Finger index, 0 is the first finger, 1 is the second finger. - If bit 1 and 0 are all 1 and bit 4 is 0, the middle external - button is pressed. - Bit1 => Right Button, 1 is pressed, 0 is not pressed. - Bit0 => Left Button, 1 is pressed, 0 is not pressed. -Byte 2: X coordinate (xpos[9:2]) -Byte 3: Y coordinate (ypos[9:2]) -Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0]) - Bit3~Bit2 => X coordinate (ypos[1:0]) - Bit4 => 4th mouse button(forward one page) - Bit5 => 5th mouse button(backward one page) - Bit6 => scroll left button - Bit7 => scroll right button - - When one of the two fingers is up, the device will output four consecutive +Absolute position for STL3888-Cx and STL3888-Dx +=============================================== + +:: + + Single Finger, Absolute Coordinate Mode (SFAC) + Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 + BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------| + 1 |0|1|0|P|1|M|R|L| 2 |X|X|X|X|X|X|X|X| 3 |Y|Y|Y|Y|Y|Y|Y|Y| 4 |r|l|B|F|X|X|Y|Y| + |---------------| |---------------| |---------------| |---------------| + + Byte 1: Bit7~Bit6 => 00, Normal data packet + => 01, Absolute coordinates packet + => 10, Notify packet + Bit5 => Coordinate mode(always 0 in SFAC mode): + 0: single-finger absolute coordinates (SFAC) mode + 1: multi-finger, multiple coordinates (MFMC) mode + Bit4 => 0: The LEFT button is generated by on-pad command (OPC) + 1: The LEFT button is generated by external button + Default is 1 even if the LEFT button is not pressed. + Bit3 => Always 1, as specified by PS/2 protocol. + Bit2 => Middle Button, 1 is pressed, 0 is not pressed. + Bit1 => Right Button, 1 is pressed, 0 is not pressed. + Bit0 => Left Button, 1 is pressed, 0 is not pressed. + Byte 2: X coordinate (xpos[9:2]) + Byte 3: Y coordinate (ypos[9:2]) + Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0]) + Bit3~Bit2 => X coordinate (ypos[1:0]) + Bit4 => 4th mouse button(forward one page) + Bit5 => 5th mouse button(backward one page) + Bit6 => scroll left button + Bit7 => scroll right button + + Multi Finger, Multiple Coordinates Mode (MFMC): + Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 + BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------| + 1 |0|1|1|P|1|F|R|L| 2 |X|X|X|X|X|X|X|X| 3 |Y|Y|Y|Y|Y|Y|Y|Y| 4 |r|l|B|F|X|X|Y|Y| + |---------------| |---------------| |---------------| |---------------| + + Byte 1: Bit7~Bit6 => 00, Normal data packet + => 01, Absolute coordination packet + => 10, Notify packet + Bit5 => Coordinate mode (always 1 in MFMC mode): + 0: single-finger absolute coordinates (SFAC) mode + 1: multi-finger, multiple coordinates (MFMC) mode + Bit4 => 0: The LEFT button is generated by on-pad command (OPC) + 1: The LEFT button is generated by external button + Default is 1 even if the LEFT button is not pressed. + Bit3 => Always 1, as specified by PS/2 protocol. + Bit2 => Finger index, 0 is the first finger, 1 is the second finger. + If bit 1 and 0 are all 1 and bit 4 is 0, the middle external + button is pressed. + Bit1 => Right Button, 1 is pressed, 0 is not pressed. + Bit0 => Left Button, 1 is pressed, 0 is not pressed. + Byte 2: X coordinate (xpos[9:2]) + Byte 3: Y coordinate (ypos[9:2]) + Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0]) + Bit3~Bit2 => X coordinate (ypos[1:0]) + Bit4 => 4th mouse button(forward one page) + Bit5 => 5th mouse button(backward one page) + Bit6 => scroll left button + Bit7 => scroll right button + +When one of the two fingers is up, the device will output four consecutive MFMC#0 report packets with zero X and Y to represent 1st finger is up or four consecutive MFMC#1 report packets with zero X and Y to represent that the 2nd finger is up. On the other hand, if both fingers are up, the device will output four consecutive single-finger, absolute coordinate(SFAC) packets with zero X and Y. -Notify Packet for STL3888-Cx/Dx - Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 -BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------| - 1 |1|0|0|P|1|M|R|L| 2 |C|C|C|C|C|C|C|C| 3 |0|0|F|F|0|0|0|i| 4 |r|l|u|d|0|0|0|0| - |---------------| |---------------| |---------------| |---------------| +Notify Packet for STL3888-Cx/Dx:: -Byte 1: Bit7~Bit6 => 00, Normal data packet - => 01, Absolute coordinates packet - => 10, Notify packet - Bit5 => Always 0 - Bit4 => 0: The LEFT button is generated by on-pad command(OPC) - 1: The LEFT button is generated by external button - Default is 1 even if the LEFT button is not pressed. - Bit3 => 1 - Bit2 => Middle Button, 1 is pressed, 0 is not pressed. - Bit1 => Right Button, 1 is pressed, 0 is not pressed. - Bit0 => Left Button, 1 is pressed, 0 is not pressed. -Byte 2: Message type: - 0xba => gesture information - 0xc0 => one finger hold-rotating gesture -Byte 3: The first parameter for the received message: - 0xba => gesture ID (refer to the 'Gesture ID' section) - 0xc0 => region ID -Byte 4: The second parameter for the received message: - 0xba => N/A - 0xc0 => finger up/down information + Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 + BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------| + 1 |1|0|0|P|1|M|R|L| 2 |C|C|C|C|C|C|C|C| 3 |0|0|F|F|0|0|0|i| 4 |r|l|u|d|0|0|0|0| + |---------------| |---------------| |---------------| |---------------| + + Byte 1: Bit7~Bit6 => 00, Normal data packet + => 01, Absolute coordinates packet + => 10, Notify packet + Bit5 => Always 0 + Bit4 => 0: The LEFT button is generated by on-pad command(OPC) + 1: The LEFT button is generated by external button + Default is 1 even if the LEFT button is not pressed. + Bit3 => 1 + Bit2 => Middle Button, 1 is pressed, 0 is not pressed. + Bit1 => Right Button, 1 is pressed, 0 is not pressed. + Bit0 => Left Button, 1 is pressed, 0 is not pressed. + Byte 2: Message type: + 0xba => gesture information + 0xc0 => one finger hold-rotating gesture + Byte 3: The first parameter for the received message: + 0xba => gesture ID (refer to the 'Gesture ID' section) + 0xc0 => region ID + Byte 4: The second parameter for the received message: + 0xba => N/A + 0xc0 => finger up/down information Sample sequence of Multi-finger, Multi-coordinates mode:
@@ -416,50 +442,51 @@ Sample sequence of Multi-finger, Multi-coordinates mode: That is, when the device is in MFMC mode, the host will receive interleaved absolute coordinate packets for each finger. -============================================================================== -* FSP Enable/Disable packet -============================================================================== - Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 -BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------| - 1 |Y|X|0|0|1|M|R|L| 2 |0|1|0|1|1|0|1|E| 3 | | | | | | | | | 4 | | | | | | | | | - |---------------| |---------------| |---------------| |---------------| +FSP Enable/Disable packet +========================= -FSP will send out enable/disable packet when FSP receive PS/2 enable/disable -command. Host will receive the packet which Middle, Right, Left button will -be set. The packet only use byte 0 and byte 1 as a pattern of original packet. -Ignore the other bytes of the packet. +:: -Byte 1: Bit7 => 0, Y overflow - Bit6 => 0, X overflow - Bit5 => 0, Y sign bit - Bit4 => 0, X sign bit - Bit3 => 1 - Bit2 => 1, Middle Button - Bit1 => 1, Right Button - Bit0 => 1, Left Button -Byte 2: Bit7~1 => (0101101b) - Bit0 => 1 = Enable - 0 = Disable -Byte 3: Don't care -Byte 4: Don't care (MOUSE ID 3, 4) -Byte 5~8: Don't care (Absolute packet) + Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 + BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------| + 1 |Y|X|0|0|1|M|R|L| 2 |0|1|0|1|1|0|1|E| 3 | | | | | | | | | 4 | | | | | | | | | + |---------------| |---------------| |---------------| |---------------| -============================================================================== -* PS/2 Command Set -============================================================================== + FSP will send out enable/disable packet when FSP receive PS/2 enable/disable + command. Host will receive the packet which Middle, Right, Left button will + be set. The packet only use byte 0 and byte 1 as a pattern of original packet. + Ignore the other bytes of the packet. + + Byte 1: Bit7 => 0, Y overflow + Bit6 => 0, X overflow + Bit5 => 0, Y sign bit + Bit4 => 0, X sign bit + Bit3 => 1 + Bit2 => 1, Middle Button + Bit1 => 1, Right Button + Bit0 => 1, Left Button + Byte 2: Bit7~1 => (0101101b) + Bit0 => 1 = Enable + 0 = Disable + Byte 3: Don't care + Byte 4: Don't care (MOUSE ID 3, 4) + Byte 5~8: Don't care (Absolute packet) + +PS/2 Command Set +================ FSP supports basic PS/2 commanding set and modes, refer to following URL for details about PS/2 commands: http://www.computer-engineering.org/ps2mouse/ -============================================================================== -* Programming Sequence for Determining Packet Parsing Flow -============================================================================== +Programming Sequence for Determining Packet Parsing Flow +======================================================== + 1. Identify FSP by reading device ID(0x00) and version(0x01) register -2a. For FSP version < STL3888 Cx, determine number of buttons by reading - the 'test mode status' (0x20) register: +2. For FSP version < STL3888 Cx, determine number of buttons by reading + the 'test mode status' (0x20) register:: buttons = reg[0x20] & 0x30
@@ -476,25 +503,24 @@ http://www.computer-engineering.org/ps2mouse/ Refer to 'Finger Sensing Pad PS/2 Mouse Intellimouse' section A for packet parsing detail -2b. For FSP version >= STL3888 Cx: +3. For FSP version >= STL3888 Cx: Refer to 'Finger Sensing Pad PS/2 Mouse Intellimouse' section A for packet parsing detail (ignore byte 4, bit ~ 7) -============================================================================== -* Programming Sequence for Register Reading/Writing -============================================================================== +Programming Sequence for Register Reading/Writing +================================================= Register inversion requirement: - Following values needed to be inverted(the '~' operator in C) before being -sent to FSP: +Following values needed to be inverted(the '~' operator in C) before being +sent to FSP:: 0xe8, 0xe9, 0xee, 0xf2, 0xf3 and 0xff. Register swapping requirement: - Following values needed to have their higher 4 bits and lower 4 bits being -swapped before being sent to FSP: +Following values needed to have their higher 4 bits and lower 4 bits being +swapped before being sent to FSP:: 10, 20, 40, 60, 80, 100 and 200.
@@ -512,33 +538,33 @@ Register reading sequence: inverted(refer to the 'Register inversion requirement' section), goto step 6 - 5a. send 0x68 PS/2 command to FSP; + a. send 0x68 PS/2 command to FSP; - 5b. send the inverted register address to FSP and goto step 8; + b. send the inverted register address to FSP and goto step 8; 6. if the register address being to read is not required to be swapped(refer to the 'Register swapping requirement' section), goto step 7 - 6a. send 0xcc PS/2 command to FSP; + a. send 0xcc PS/2 command to FSP; - 6b. send the swapped register address to FSP and goto step 8; + b. send the swapped register address to FSP and goto step 8; 7. send 0x66 PS/2 command to FSP; - 7a. send the original register address to FSP and goto step 8; + a. send the original register address to FSP and goto step 8; 8. send 0xe9(status request) PS/2 command to FSP; 9. the 4th byte of the response read from FSP should be the - requested register value(?? indicates don't care byte): + requested register value(?? indicates don't care byte):: host: 0xe9 3888: 0xfa (??) (??) (val) * Note that since the Cx release, the hardware will return 1's - complement of the register value at the 3rd byte of status request - result: + complement of the register value at the 3rd byte of status request + result:: host: 0xe9 3888: 0xfa (??) (~val) (val)
@@ -551,21 +577,21 @@ Register writing sequence: inverted(refer to the 'Register inversion requirement' section), goto step 3 - 2a. send 0x74 PS/2 command to FSP; + a. send 0x74 PS/2 command to FSP; - 2b. send the inverted register address to FSP and goto step 5; + b. send the inverted register address to FSP and goto step 5; 3. if the register address being to write is not required to be swapped(refer to the 'Register swapping requirement' section), goto step 4 - 3a. send 0x77 PS/2 command to FSP; + a. send 0x77 PS/2 command to FSP; - 3b. send the swapped register address to FSP and goto step 5; + b. send the swapped register address to FSP and goto step 5; 4. send 0x55 PS/2 command to FSP; - 4a. send the register address to FSP and goto step 5; + a. send the register address to FSP and goto step 5; 5. send 0xf3 PS/2 command to FSP;
@@ -573,43 +599,42 @@ Register writing sequence: inverted(refer to the 'Register inversion requirement' section), goto step 7 - 6a. send 0x47 PS/2 command to FSP; + a. send 0x47 PS/2 command to FSP; - 6b. send the inverted register value to FSP and goto step 9; + b. send the inverted register value to FSP and goto step 9; 7. if the register value being to write is not required to be swapped(refer to the 'Register swapping requirement' section), goto step 8 - 7a. send 0x44 PS/2 command to FSP; + a. send 0x44 PS/2 command to FSP; - 7b. send the swapped register value to FSP and goto step 9; + b. send the swapped register value to FSP and goto step 9; 8. send 0x33 PS/2 command to FSP; - 8a. send the register value to FSP; + a. send the register value to FSP; 9. the register writing sequence is completed. - * Note that since the Cx release, the hardware will return 1's - complement of the register value at the 3rd byte of status request - result. Host can optionally send another 0xe9 (status request) PS/2 - command to FSP at the end of register writing to verify that the - register writing operation is successful (?? indicates don't care - byte): + * Since the Cx release, the hardware will return 1's + complement of the register value at the 3rd byte of status request + result. Host can optionally send another 0xe9 (status request) PS/2 + command to FSP at the end of register writing to verify that the + register writing operation is successful (?? indicates don't care + byte):: host: 0xe9 3888: 0xfa (??) (~val) (val) -============================================================================== -* Programming Sequence for Page Register Reading/Writing -============================================================================== +Programming Sequence for Page Register Reading/Writing +====================================================== - In order to overcome the limitation of maximum number of registers +In order to overcome the limitation of maximum number of registers supported, the hardware separates register into different groups called 'pages.' Each page is able to include up to 255 registers. - The default page after power up is 0x82; therefore, if one has to get +The default page after power up is 0x82; therefore, if one has to get access to register 0x8301, one has to use following sequence to switch to page 0x83, then start reading/writing from/to offset 0x01 by using the register read/write sequence described in previous section.
@@ -632,6 +657,7 @@ Page register reading sequence: 8. the response read from FSP should be the requested page value. + Page register writing sequence: 1. send 0xf3 PS/2 command to FSP;
@@ -646,17 +672,17 @@ Page register writing sequence: inverted(refer to the 'Register inversion requirement' section), goto step 6 - 5a. send 0x47 PS/2 command to FSP; + a. send 0x47 PS/2 command to FSP; - 5b. send the inverted page address to FSP and goto step 9; + b. send the inverted page address to FSP and goto step 9; 6. if the page address being written is not required to be swapped(refer to the 'Register swapping requirement' section), goto step 7 - 6a. send 0x44 PS/2 command to FSP; + a. send 0x44 PS/2 command to FSP; - 6b. send the swapped page address to FSP and goto step 9; + b. send the swapped page address to FSP and goto step 9; 7. send 0x33 PS/2 command to FSP;
@@ -664,16 +690,17 @@ Page register writing sequence: 9. the page register writing sequence is completed. -============================================================================== -* Gesture ID -============================================================================== +Gesture ID +========== - Unlike other devices which sends multiple fingers' coordinates to host, +Unlike other devices which sends multiple fingers' coordinates to host, FSP processes multiple fingers' coordinates internally and convert them into a 8 bits integer, namely 'Gesture ID.' Following is a list of supported gesture IDs: + ======= ================================== ID Description + ======= ================================== 0x86 2 finger straight up 0x82 2 finger straight down 0x80 2 finger straight right
@@ -687,38 +714,38 @@ supported gesture IDs: 0x28 3 finger straight right 0x2c 3 finger straight left 0x38 palm + ======= ================================== -============================================================================== -* Register Listing -============================================================================== +Register Listing +================ - Registers are represented in 16 bits values. The higher 8 bits represent +Registers are represented in 16 bits values. The higher 8 bits represent the page address and the lower 8 bits represent the relative offset within that particular page. Refer to the 'Programming Sequence for Page Register Reading/Writing' section for instructions on how to change current page -address. +address:: -offset width default r/w name -0x8200 bit7~bit0 0x01 RO device ID + offset width default r/w name + 0x8200 bit7~bit0 0x01 RO device ID -0x8201 bit7~bit0 RW version ID + 0x8201 bit7~bit0 RW version ID 0xc1: STL3888 Ax 0xd0 ~ 0xd2: STL3888 Bx 0xe0 ~ 0xe1: STL3888 Cx 0xe2 ~ 0xe3: STL3888 Dx -0x8202 bit7~bit0 0x01 RO vendor ID + 0x8202 bit7~bit0 0x01 RO vendor ID -0x8203 bit7~bit0 0x01 RO product ID + 0x8203 bit7~bit0 0x01 RO product ID -0x8204 bit3~bit0 0x01 RW revision ID + 0x8204 bit3~bit0 0x01 RW revision ID -0x820b test mode status 1 + 0x820b test mode status 1 bit3 1 RO 0: rotate 180 degree 1: no rotation *only supported by H/W prior to Cx -0x820f register file page control + 0x820f register file page control bit2 0 RW 1: rotate 180 degree 0: no rotation *supported since Cx
@@ -726,7 +753,7 @@ offset width default r/w name bit0 0 RW 1 to enable page 1 register files *only supported by H/W prior to Cx -0x8210 RW system control 1 + 0x8210 RW system control 1 bit0 1 RW Reserved, must be 1 bit1 0 RW Reserved, must be 0 bit4 0 RW Reserved, must be 0
@@ -737,7 +764,7 @@ offset width default r/w name 40 41 42 43. In addition to that, this bit must be 1 when gesture mode is enabled) -0x8220 test mode status + 0x8220 test mode status bit5~bit4 RO number of buttons 11 => 2, lbtn/rbtn 10 => 4, lbtn/rbtn/scru/scrd
@@ -745,13 +772,13 @@ offset width default r/w name 00 => 6, lbtn/rbtn/scru/scrd/fbtn/bbtn *only supported by H/W prior to Cx -0x8231 RW on-pad command detection + 0x8231 RW on-pad command detection bit7 0 RW on-pad command left button down tag enable 0: disable, 1: enable *only supported by H/W prior to Cx -0x8234 RW on-pad command control 5 + 0x8234 RW on-pad command control 5 bit4~bit0 0x05 RW XLO in 0s/4/1, so 03h = 0010.1b = 2.5 (Note that position unit is in 0.5 scanline) *only supported by H/W prior to Cx
@@ -760,22 +787,22 @@ offset width default r/w name 0: disable, 1: enable *only supported by H/W prior to Cx -0x8235 RW on-pad command control 6 + 0x8235 RW on-pad command control 6 bit4~bit0 0x1d RW XHI in 0s/4/1, so 19h = 1100.1b = 12.5 (Note that position unit is in 0.5 scanline) *only supported by H/W prior to Cx -0x8236 RW on-pad command control 7 + 0x8236 RW on-pad command control 7 bit4~bit0 0x04 RW YLO in 0s/4/1, so 03h = 0010.1b = 2.5 (Note that position unit is in 0.5 scanline) *only supported by H/W prior to Cx -0x8237 RW on-pad command control 8 + 0x8237 RW on-pad command control 8 bit4~bit0 0x13 RW YHI in 0s/4/1, so 11h = 1000.1b = 8.5 (Note that position unit is in 0.5 scanline) *only supported by H/W prior to Cx -0x8240 RW system control 5 + 0x8240 RW system control 5 bit1 0 RW FSP Intellimouse mode enable 0: disable, 1: enable *only supported by H/W prior to Cx
@@ -813,7 +840,7 @@ offset width default r/w name 0: disable, 1: enable *only supported by H/W prior to Cx -0x8243 RW on-pad control + 0x8243 RW on-pad control bit0 0 RW on-pad control enable 0: disable, 1: enable (Note that if this bit is cleared, bit 3/5 will be ineffective)
@@ -827,7 +854,7 @@ offset width default r/w name 0: disable, 1: enable *only supported by H/W prior to Cx -0x8290 RW software control register 1 + 0x8290 RW software control register 1 bit0 0 RW absolute coordination mode 0: disable, 1: enable *supported since Cx
@@ -856,16 +883,17 @@ offset width default r/w name *supported since Cx bit7 0 RW Bx packet output compatible mode - 0: disable, 1: enable *supported since Cx + 0: disable, 1: enable + *supported since Cx *supported since Cx -0x833d RW on-pad command control 1 + 0x833d RW on-pad command control 1 bit7 1 RW on-pad command detection enable 0: disable, 1: enable *supported since Cx -0x833e RW on-pad command detection + 0x833e RW on-pad command detection bit7 0 RW on-pad command left button down tag enable. Works only in H/W based PS/2 data packet mode.
Signature · 1 line
2.9.3
PATCH v2 26/37 docs: input/userio: convert it to ReST format
This file require minimum adjustments to be a valid ReST file. Do it, in order to be able to parse it with Sphinx.
--- Documentation/input/userio.txt | 79 +++++++++++++++++++++++++----------------- 1 file changed, 47 insertions(+), 32 deletions(-)
Documentation/input/userio.txt +47 -32
@@ -1,37 +1,47 @@ - The userio Protocol - (c) 2015 Stephen Chandler Paul <[email protected]> - Sponsored by Red Hat --------------------------------------------------------------------------------- - -1. Introduction -~~~~~~~~~~~~~~~ - This module is intended to try to make the lives of input driver developers +.. include:: <isonum.txt> + +=================== +The userio Protocol +=================== + + +:Copyright: |copy| 2015 Stephen Chandler Paul <[email protected]> + +Sponsored by Red Hat + + +Introduction +============= + +This module is intended to try to make the lives of input driver developers easier by allowing them to test various serio devices (mainly the various touchpads found on laptops) without having to have the physical device in front of them. userio accomplishes this by allowing any privileged userspace program to directly interact with the kernel's serio driver and control a virtual serio port from there. -2. Usage overview -~~~~~~~~~~~~~~~~~ - In order to interact with the userio kernel module, one simply opens the +Usage overview +============== + +In order to interact with the userio kernel module, one simply opens the /dev/userio character device in their applications. Commands are sent to the kernel module by writing to the device, and any data received from the serio driver is read as-is from the /dev/userio device. All of the structures and macros you need to interact with the device are defined in <linux/userio.h> and <linux/serio.h>. -3. Command Structure -~~~~~~~~~~~~~~~~~~~~ - The struct used for sending commands to /dev/userio is as follows: +Command Structure +================= + +The struct used for sending commands to /dev/userio is as follows:: struct userio_cmd { __u8 type; __u8 data; }; - "type" describes the type of command that is being sent. This can be any one -of the USERIO_CMD macros defined in <linux/userio.h>. "data" is the argument +``type`` describes the type of command that is being sent. This can be any one +of the USERIO_CMD macros defined in <linux/userio.h>. ``data`` is the argument that goes along with the command. In the event that the command doesn't have an argument, this field can be left untouched and will be ignored by the kernel. Each command should be sent by writing the struct directly to the character
@@ -39,31 +49,36 @@ device. In the event that the command you send is invalid, an error will be returned by the character device and a more descriptive error will be printed to the kernel log. Only one command can be sent at a time, any additional data written to the character device after the initial command will be ignored. - To close the virtual serio port, just close /dev/userio. -4. Commands -~~~~~~~~~~~ +To close the virtual serio port, just close /dev/userio. -4.1 USERIO_CMD_REGISTER -~~~~~~~~~~~~~~~~~~~~~~~ - Registers the port with the serio driver and begins transmitting data back and +Commands +======== + +USERIO_CMD_REGISTER +~~~~~~~~~~~~~~~~~~~ + +Registers the port with the serio driver and begins transmitting data back and forth. Registration can only be performed once a port type is set with USERIO_CMD_SET_PORT_TYPE. Has no argument. -4.2 USERIO_CMD_SET_PORT_TYPE -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Sets the type of port we're emulating, where "data" is the port type being +USERIO_CMD_SET_PORT_TYPE +~~~~~~~~~~~~~~~~~~~~~~~~ + +Sets the type of port we're emulating, where ``data`` is the port type being set. Can be any of the macros from <linux/serio.h>. For example: SERIO_8042 would set the port type to be a normal PS/2 port. -4.3 USERIO_CMD_SEND_INTERRUPT -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Sends an interrupt through the virtual serio port to the serio driver, where -"data" is the interrupt data being sent. +USERIO_CMD_SEND_INTERRUPT +~~~~~~~~~~~~~~~~~~~~~~~~~ -5. Userspace tools -~~~~~~~~~~~~~~~~~~ - The userio userspace tools are able to record PS/2 devices using some of the +Sends an interrupt through the virtual serio port to the serio driver, where +``data`` is the interrupt data being sent. + +Userspace tools +=============== + +The userio userspace tools are able to record PS/2 devices using some of the debugging information from i8042, and play back the devices on /dev/userio. The latest version of these tools can be found at:
Signature · 1 line
2.9.3
PATCH v2 27/37 docs: input/walkera0701: convert it to ReST format
This file require minimum adjustments to be a valid ReST file. Do it, in order to be able to parse it with Sphinx.
--- Documentation/input/walkera0701.txt | 53 +++++++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 17 deletions(-)
Documentation/input/walkera0701.txt +36 -17
@@ -1,3 +1,6 @@ +=========================== +Walkera WK-0701 transmitter +=========================== Walkera WK-0701 transmitter is supplied with a ready to fly Walkera helicopters such as HM36, HM37, HM60. The walkera0701 module enables to use
@@ -10,7 +13,8 @@ or use cogito: cg-clone http://zub.fei.tuke.sk/GIT/walkera0701-joystick -Connecting to PC: +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,
@@ -19,7 +23,8 @@ modulation pulses to PC, signal pulses must be amplified. Cable: (walkera TX to parport) -Walkera WK-0701 TX S-VIDEO connector: +Walkera WK-0701 TX S-VIDEO connector:: + (back side of TX) __ __ S-video: canon25 / |_| \ pin 2 (signal) NPN parport
@@ -30,10 +35,10 @@ Walkera WK-0701 TX S-VIDEO connector: ------- 3 __________________________________|________________ 25 GND E - I use green LED and BC109 NPN transistor. -Software: +Software +======== Build kernel with walkera0701 module. Module walkera0701 need exclusive access to parport, modules like lp must be unloaded before loading
@@ -44,7 +49,8 @@ be changed by TX "joystick", check output from /proc/interrupts. Value for -Technical details: +Technical details +================= Driver use interrupt from parport ACK input bit to measure pulse length using hrtimers.
@@ -53,17 +59,29 @@ 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: +Signal pulses +------------- + +:: + + (ANALOG) + SYNC BIN OCT + +---------+ +------+ + | | | | + --+ +------+ +--- + +Frame +----- + +:: + SYNC , BIN1, OCT1, BIN2, OCT2 ... BIN24, OCT24, BIN25, next frame SYNC .. -pulse length: +pulse length +------------ + +:: + Binary values: Analog octal values: 288 uS Binary 0 318 uS 000
@@ -80,7 +98,8 @@ pulse length: (Warning, pulses on ACK are inverted by transistor, irq is raised up on sync to bin change or octal value to bin change). -Binary data representations: +Binary data representations +--------------------------- One binary and octal value can be grouped to nibble. 24 nibbles + one binary values can be sampled between sync pulses.
@@ -100,10 +119,10 @@ 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: +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. -
Signature · 1 line
2.9.3
PATCH v2 28/37 docs: input/xpad: convert it to ReST format
This file require minimum adjustments to be a valid ReST file. Do it, in order to be able to parse it with Sphinx.
--- Documentation/input/xpad.txt | 120 ++++++++++++++++++++++++------------------- 1 file changed, 68 insertions(+), 52 deletions(-)
Documentation/input/xpad.txt +68 -52
@@ -1,4 +1,6 @@ +======================================================= xpad - Linux USB driver for Xbox compatible controllers +======================================================= This driver exposes all first-party and third-party Xbox compatible controllers. It has a long history and has enjoyed considerable usage
@@ -15,9 +17,11 @@ the Xbox One's rumble protocol has not been reverse engineered but in the future could be supported. -0. Notes --------- +Notes +===== + The number of buttons/axes reported varies based on 3 things: + - if you are using a known controller - if you are using a known dance pad - if using an unknown device (one not listed below), what you set in the
@@ -35,8 +39,9 @@ This is not true. Both dpad_to_buttons and triggers_to_buttons only affect unknown controllers. -0.1 Normal Controllers ----------------------- +Normal Controllers +------------------ + With a normal controller, the directional pad is mapped to its own X/Y axes. The jstest-program from joystick-1.2.15 (jstest-version 2.1.0) will report 8 axes and 10 buttons.
@@ -55,8 +60,9 @@ in game functionality were OK. However, I find it rather difficult to play first person shooters with a pad. Your mileage may vary. -0.2 Xbox Dance Pads -------------------- +Xbox Dance Pads +--------------- + When using a known dance pad, jstest will report 6 axes and 14 buttons. For dance style pads (like the redoctane pad) several changes
@@ -73,8 +79,9 @@ of buttons, see section 0.3 - Unknown Controllers I've tested this with Stepmania, and it works quite well. -0.3 Unknown Controllers ----------------------- +Unknown Controllers +------------------- + If you have an unknown xbox controller, it should work just fine with the default settings.
@@ -88,9 +95,11 @@ to the list of supported devices, ensuring that it will work out of the box in the future. -1. USB adapters --------------- +USB adapters +============ + All generations of Xbox controllers speak USB over the wire. + - Original Xbox controllers use a proprietary connector and require adapters. - Wireless Xbox 360 controllers require a 'Xbox 360 Wireless Gaming Receiver for Windows'
@@ -101,8 +110,9 @@ All generations of Xbox controllers speak USB over the wire. -1.1 Original Xbox USB adapters --------------- +Original Xbox USB adapters +-------------------------- + Using this driver with an Original Xbox controller requires an adapter cable to break out the proprietary connector's pins to USB. You can buy these online fairly cheap, or build your own.
@@ -123,8 +133,8 @@ you can still use the controller with your X-Box, if you have one ;) -2. Driver Installation ----------------------- +Driver Installation +=================== Once you have the adapter cable, if needed, and the controller connected the xpad module should be auto loaded. To confirm you can cat
@@ -132,13 +142,15 @@ the xpad module should be auto loaded. To confirm you can cat -3. Supported Controllers ------------------------- +Supported Controllers +===================== + For a full list of supported controllers and associated vendor and product IDs see the xpad_device[] array[6]. As of the historic version 0.0.6 (2006-10-10) the following devices -were supported: +were supported:: + original Microsoft XBOX controller (US), vendor=0x045e, product=0x0202 smaller Microsoft XBOX controller (US), vendor=0x045e, product=0x0289 original Microsoft XBOX controller (Japan), vendor=0x045e, product=0x0285
@@ -152,14 +164,16 @@ the module option 'dpad_to_buttons'. If you have an unrecognized controller please see 0.3 - Unknown Controllers -4. Manual Testing ------------------ +Manual Testing +============== + To test this driver's functionality you may use 'jstest'. -For example: -> modprobe xpad -> modprobe joydev -> jstest /dev/js0 +For example:: + + > modprobe xpad + > modprobe joydev + > jstest /dev/js0 If you're using a normal controller, there should be a single line showing 18 inputs (8 axes, 10 buttons), and its values should change if you move
@@ -170,57 +184,59 @@ It works? Voila, you're done ;) -5. Thanks ---------- +Thanks +====== I have to thank ITO Takayuki for the detailed info on his site - http://euc.jp/periphs/xbox-controller.ja.html. - + http://euc.jp/periphs/xbox-controller.ja.html. + His useful info and both the usb-skeleton as well as the iforce input driver (Greg Kroah-Hartmann; Vojtech Pavlik) helped a lot in rapid prototyping the basic functionality. -6. References -------------- +References +========== [1]: http://euc.jp/periphs/xbox-controller.ja.html (ITO Takayuki) + [2]: http://xpad.xbox-scene.com/ + [3]: http://www.markosweb.com/www/xboxhackz.com/ -[4]: /proc/bus/usb/devices - dump from InterAct PowerPad Pro (Germany): -T: Bus=01 Lev=03 Prnt=04 Port=00 Cnt=01 Dev#= 5 Spd=12 MxCh= 0 -D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=32 #Cfgs= 1 -P: Vendor=05fd ProdID=107a Rev= 1.00 -C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA -I: If#= 0 Alt= 0 #EPs= 2 Cls=58(unk. ) Sub=42 Prot=00 Driver=(none) -E: Ad=81(I) Atr=03(Int.) MxPS= 32 Ivl= 10ms -E: Ad=02(O) Atr=03(Int.) MxPS= 32 Ivl= 10ms +[4]: /proc/bus/usb/devices - dump from InterAct PowerPad Pro (Germany):: -[5]: /proc/bus/usb/devices - dump from Redoctane Xbox Dance Pad (US): + T: Bus=01 Lev=03 Prnt=04 Port=00 Cnt=01 Dev#= 5 Spd=12 MxCh= 0 + D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=32 #Cfgs= 1 + P: Vendor=05fd ProdID=107a Rev= 1.00 + C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA + I: If#= 0 Alt= 0 #EPs= 2 Cls=58(unk. ) Sub=42 Prot=00 Driver=(none) + E: Ad=81(I) Atr=03(Int.) MxPS= 32 Ivl= 10ms + E: Ad=02(O) Atr=03(Int.) MxPS= 32 Ivl= 10ms -T: Bus=01 Lev=02 Prnt=09 Port=00 Cnt=01 Dev#= 10 Spd=12 MxCh= 0 -D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 -P: Vendor=0c12 ProdID=8809 Rev= 0.01 -S: Product=XBOX DDR -C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA -I: If#= 0 Alt= 0 #EPs= 2 Cls=58(unk. ) Sub=42 Prot=00 Driver=xpad -E: Ad=82(I) Atr=03(Int.) MxPS= 32 Ivl=4ms -E: Ad=02(O) Atr=03(Int.) MxPS= 32 Ivl=4ms +[5]: /proc/bus/usb/devices - dump from Redoctane Xbox Dance Pad (US):: + + T: Bus=01 Lev=02 Prnt=09 Port=00 Cnt=01 Dev#= 10 Spd=12 MxCh= 0 + D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 + P: Vendor=0c12 ProdID=8809 Rev= 0.01 + S: Product=XBOX DDR + C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA + I: If#= 0 Alt= 0 #EPs= 2 Cls=58(unk. ) Sub=42 Prot=00 Driver=xpad + E: Ad=82(I) Atr=03(Int.) MxPS= 32 Ivl=4ms + E: Ad=02(O) Atr=03(Int.) MxPS= 32 Ivl=4ms [6]: http://lxr.free-electrons.com/ident?i=xpad_device -7. Historic Edits ------------------ -Marko Friedemann <[email protected]> -2002-07-16 +Historic Edits +============== + +2002-07-16 - Marko Friedemann <[email protected]> - original doc -Dominic Cerquetti <[email protected]> -2005-03-19 +2005-03-19 - Dominic Cerquetti <[email protected]> - added stuff for dance pads, new d-pad->axes mappings Later changes may be viewed with 'git log Documentation/input/xpad.txt'
Signature · 1 line
2.9.3
PATCH v2 29/37 docs: input/yealink: convert it to ReST format
This file require minimum adjustments to be a valid ReST file. Do it, in order to be able to parse it with Sphinx.
--- Documentation/input/yealink.txt | 164 +++++++++++++++++++++++----------------- 1 file changed, 93 insertions(+), 71 deletions(-)
Documentation/input/yealink.txt +93 -71
@@ -1,8 +1,12 @@ +=============================================== Driver documentation for yealink usb-p1k phones +=============================================== + +Status +====== -0. Status -~~~~~~~~~ The p1k is a relatively cheap usb 1.1 phone with: + - keyboard full support, yealink.ko / input event API - LCD full support, yealink.ko / sysfs API - LED full support, yealink.ko / sysfs API
@@ -14,10 +18,11 @@ The p1k is a relatively cheap usb 1.1 phone with: For vendor documentation see http://www.yealink.com -1. Compilation (stand alone version) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Compilation (stand alone version) +================================= + Currently only kernel 2.6.x.y versions are supported. -In order to build the yealink.ko module do +In order to build the yealink.ko module do:: make
@@ -26,26 +31,28 @@ the Makefile is pointing to the location where your kernel sources are located, default /usr/src/linux. -1.1 Troubleshooting -~~~~~~~~~~~~~~~~~~~ -Q: Module yealink compiled and installed without any problem but phone - is not initialized and does not react to any actions. -A: If you see something like: - hiddev0: USB HID v1.00 Device [Yealink Network Technology Ltd. VOIP USB Phone - in dmesg, it means that the hid driver has grabbed the device first. Try to - load module yealink before any other usb hid driver. Please see the - instructions provided by your distribution on module configuration. +Troubleshooting +~~~~~~~~~~~~~~~ -Q: Phone is working now (displays version and accepts keypad input) but I can't - find the sysfs files. -A: The sysfs files are located on the particular usb endpoint. On most - distributions you can do: "find /sys/ -name get_icons" for a hint. +:Q: Module yealink compiled and installed without any problem but phone + is not initialized and does not react to any actions. +:A: If you see something like: + hiddev0: USB HID v1.00 Device [Yealink Network Technology Ltd. VOIP USB Phone + in dmesg, it means that the hid driver has grabbed the device first. Try to + load module yealink before any other usb hid driver. Please see the + instructions provided by your distribution on module configuration. +:Q: Phone is working now (displays version and accepts keypad input) but I can't + find the sysfs files. +:A: The sysfs files are located on the particular usb endpoint. On most + distributions you can do: "find /sys/ -name get_icons" for a hint. + + +keyboard features +================= -2. keyboard features -~~~~~~~~~~~~~~~~~~~~ The current mapping in the kernel is provided by the map_p1k_to_key -function: +function:: Physical USB-P1K button layout input events
@@ -60,14 +67,15 @@ function: 7 8 9 7, 8, 9, * 0 # *, 0, #, - The "up" and "down" keys, are symbolised by arrows on the button. - The "pickup" and "hangup" keys are symbolised by a green and red phone - on the button. +The "up" and "down" keys, are symbolised by arrows on the button. +The "pickup" and "hangup" keys are symbolised by a green and red phone +on the button. -3. LCD features -~~~~~~~~~~~~~~~ -The LCD is divided and organised as a 3 line display: +LCD features +============ + +The LCD is divided and organised as a 3 line display:: |[] [][] [][] [][] in |[][] |[] M [][] D [][] : [][] out |[][]
@@ -79,18 +87,19 @@ The LCD is divided and organised as a 3 line display: [] [] [] [] [] [] [] [] [] [] [] [] -Line 1 Format (see below) : 18.e8.M8.88...188 - Icon names : M D : IN OUT STORE -Line 2 Format : ......... - Icon name : NEW REP SU MO TU WE TH FR SA -Line 3 Format : 888888888888 + Line 1 Format (see below) : 18.e8.M8.88...188 + Icon names : M D : IN OUT STORE + Line 2 Format : ......... + Icon name : NEW REP SU MO TU WE TH FR SA + Line 3 Format : 888888888888 Format description: From a userspace perspective the world is separated into "digits" and "icons". A digit can have a character set, an icon can only be ON or OFF. - Format specifier + Format specifier:: + '8' : Generic 7 segment digit with individual addressable segments Reduced capability 7 segment digit, when segments are hard wired together.
@@ -105,9 +114,11 @@ Format description: elements. -4. Driver usage -~~~~~~~~~~~~~~~ -For userland the following interfaces are available using the sysfs interface: +Driver usage +============ + +For userland the following interfaces are available using the sysfs interface:: + /sys/.../ line1 Read/Write, lcd line1 line2 Read/Write, lcd line2
@@ -118,38 +129,43 @@ For userland the following interfaces are available using the sysfs interface: show_icon Write, display the element by writing the icon name. map_seg7 Read/Write, the 7 segments char set, common for all - yealink phones. (see map_to_7segment.h) + yealink phones. (see map_to_7segment.h) ringtone Write, upload binary representation of a ringtone, - see yealink.c. status EXPERIMENTAL due to potential + see yealink.c. status EXPERIMENTAL due to potential races between async. and sync usb calls. -4.1 lineX -~~~~~~~~~ -Reading /sys/../lineX will return the format string with its current value: +lineX +~~~~~ - Example: - cat ./line3 - 888888888888 - Linux Rocks! +Reading /sys/../lineX will return the format string with its current value. + + Example:: + + cat ./line3 + 888888888888 + Linux Rocks! Writing to /sys/../lineX will set the corresponding LCD line. + - Excess characters are ignored. - If less characters are written than allowed, the remaining digits are unchanged. - The tab '\t'and '\n' char does not overwrite the original content. - Writing a space to an icon will always hide its content. - Example: - date +"%m.%e.%k:%M" | sed 's/^0/ /' > ./line1 + Example:: + + date +"%m.%e.%k:%M" | sed 's/^0/ /' > ./line1 Will update the LCD with the current date & time. -4.2 get_icons -~~~~~~~~~~~~~ -Reading will return all available icon names and its current settings: +get_icons +~~~~~~~~~ + +Reading will return all available icon names and its current settings:: cat ./get_icons on M
@@ -172,45 +188,51 @@ Reading will return all available icon names and its current settings: RINGTONE -4.3 show/hide icons -~~~~~~~~~~~~~~~~~~~ +show/hide icons +~~~~~~~~~~~~~~~ + Writing to these files will update the state of the icon. Only one icon at a time can be updated. If an icon is also on a ./lineX the corresponding value is updated with the first letter of the icon. - Example - light up the store icon: - echo -n "STORE" > ./show_icon + Example - light up the store icon:: - cat ./line1 - 18.e8.M8.88...188 - S + echo -n "STORE" > ./show_icon - Example - sound the ringtone for 10 seconds: - echo -n RINGTONE > /sys/..../show_icon - sleep 10 - echo -n RINGTONE > /sys/..../hide_icon + cat ./line1 + 18.e8.M8.88...188 + S + Example - sound the ringtone for 10 seconds:: + + echo -n RINGTONE > /sys/..../show_icon + sleep 10 + echo -n RINGTONE > /sys/..../hide_icon + + +Sound features +============== -5. Sound features -~~~~~~~~~~~~~~~~~ Sound is supported by the ALSA driver: snd_usb_audio One 16-bit channel with sample and playback rates of 8000 Hz is the practical limit of the device. - Example - recording test: - arecord -v -d 10 -r 8000 -f S16_LE -t wav foobar.wav + Example - recording test:: - Example - playback test: - aplay foobar.wav + arecord -v -d 10 -r 8000 -f S16_LE -t wav foobar.wav + Example - playback test:: + + aplay foobar.wav + + +Credits & Acknowledgments +========================= -6. Credits & Acknowledgments -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Olivier Vandorpe, for starting the usbb2k-api project doing much of - the reverse engineering. + the reverse engineering. - Martin Diehl, for pointing out how to handle USB memory allocation. - Dmitry Torokhov, for the numerous code reviews and suggestions. -
Signature · 1 line
2.9.3
PATCH v2 30/37 docs-rst: create a book with Linux Input documentation
Now that all files under Documentation/input follows the ReST markup language, rename them to *.rst and create a book for the Linux Input subsystem.
---
Documentation/conf.py | 2 +
Documentation/input/{alps.txt => alps.rst} | 0
Documentation/input/{amijoy.txt => amijoy.rst} | 0
.../input/{appletouch.txt => appletouch.rst} | 0
Documentation/input/{atarikbd.txt => atarikbd.rst} | 0
Documentation/input/{bcm5974.txt => bcm5974.rst} | 0
Documentation/input/{cd32.txt => cd32.rst} | 0
.../input/{cma3000_d0x.txt => cma3000_d0x.rst} | 0
Documentation/input/conf.py | 10 +++
Documentation/input/{cs461x.txt => cs461x.rst} | 0
.../input/{edt-ft5x06.txt => edt-ft5x06.rst} | 0
Documentation/input/{elantech.txt => elantech.rst} | 0
.../input/{event-codes.txt => event-codes.rst} | 0
Documentation/input/{ff.txt => ff.rst} | 0
Documentation/input/{gamepad.txt => gamepad.rst} | 0
...rt-programming.txt => gameport-programming.rst} | 0
.../input/{gpio-tilt.txt => gpio-tilt.rst} | 0
.../{iforce-protocol.txt => iforce-protocol.rst} | 0
Documentation/input/index.rst | 77 ++++++++++++++++++++++
...input-programming.txt => input-programming.rst} | 0
Documentation/input/{input.txt => input.rst} | 20 ------
.../input/{joystick-api.txt => joystick-api.rst} | 0
.../{joystick-parport.txt => joystick-parport.rst} | 0
Documentation/input/{joystick.txt => joystick.rst} | 0
...touch-protocol.txt => multi-touch-protocol.rst} | 0
Documentation/input/{notifier.txt => notifier.rst} | 0
Documentation/input/{ntrig.txt => ntrig.rst} | 0
.../{rotary-encoder.txt => rotary-encoder.rst} | 0
Documentation/input/{sentelic.txt => sentelic.rst} | 0
Documentation/input/{userio.txt => userio.rst} | 0
.../input/{walkera0701.txt => walkera0701.rst} | 0
Documentation/input/{xpad.txt => xpad.rst} | 0
Documentation/input/{yealink.txt => yealink.rst} | 0
33 files changed, 89 insertions(+), 20 deletions(-)
rename Documentation/input/{alps.txt => alps.rst} (100%)
rename Documentation/input/{amijoy.txt => amijoy.rst} (100%)
rename Documentation/input/{appletouch.txt => appletouch.rst} (100%)
rename Documentation/input/{atarikbd.txt => atarikbd.rst} (100%)
rename Documentation/input/{bcm5974.txt => bcm5974.rst} (100%)
rename Documentation/input/{cd32.txt => cd32.rst} (100%)
rename Documentation/input/{cma3000_d0x.txt => cma3000_d0x.rst} (100%)
create mode 100644 Documentation/input/conf.py
rename Documentation/input/{cs461x.txt => cs461x.rst} (100%)
rename Documentation/input/{edt-ft5x06.txt => edt-ft5x06.rst} (100%)
rename Documentation/input/{elantech.txt => elantech.rst} (100%)
rename Documentation/input/{event-codes.txt => event-codes.rst} (100%)
rename Documentation/input/{ff.txt => ff.rst} (100%)
rename Documentation/input/{gamepad.txt => gamepad.rst} (100%)
rename Documentation/input/{gameport-programming.txt => gameport-programming.rst} (100%)
rename Documentation/input/{gpio-tilt.txt => gpio-tilt.rst} (100%)
rename Documentation/input/{iforce-protocol.txt => iforce-protocol.rst} (100%)
create mode 100644 Documentation/input/index.rst
rename Documentation/input/{input-programming.txt => input-programming.rst} (100%)
rename Documentation/input/{input.txt => input.rst} (92%)
rename Documentation/input/{joystick-api.txt => joystick-api.rst} (100%)
rename Documentation/input/{joystick-parport.txt => joystick-parport.rst} (100%)
rename Documentation/input/{joystick.txt => joystick.rst} (100%)
rename Documentation/input/{multi-touch-protocol.txt => multi-touch-protocol.rst} (100%)
rename Documentation/input/{notifier.txt => notifier.rst} (100%)
rename Documentation/input/{ntrig.txt => ntrig.rst} (100%)
rename Documentation/input/{rotary-encoder.txt => rotary-encoder.rst} (100%)
rename Documentation/input/{sentelic.txt => sentelic.rst} (100%)
rename Documentation/input/{userio.txt => userio.rst} (100%)
rename Documentation/input/{walkera0701.txt => walkera0701.rst} (100%)
rename Documentation/input/{xpad.txt => xpad.rst} (100%)
rename Documentation/input/{yealink.txt => yealink.rst} (100%)Documentation/conf.py +2 -0
@@ -348,6 +348,8 @@ latex_documents = [ 'The kernel development community', 'manual'), ('driver-api/index', 'driver-api.tex', 'The kernel driver API manual', 'The kernel development community', 'manual'), + ('input/index', 'linux-input.tex', 'The Linux input driver subsystem', + 'The kernel development community', 'manual'), ('kernel-documentation', 'kernel-documentation.tex', 'The Linux Kernel Documentation', 'The kernel development community', 'manual'), ('process/index', 'development-process.tex', 'Linux Kernel Development Documentation',
Documentation/input/alps.rst renamed from Documentation/input/alps.txt +0 -0
Documentation/input/amijoy.rst renamed from Documentation/input/amijoy.txt +0 -0
Documentation/input/appletouch.rst renamed from Documentation/input/appletouch.txt +0 -0
Documentation/input/atarikbd.rst renamed from Documentation/input/atarikbd.txt +0 -0
Documentation/input/bcm5974.rst renamed from Documentation/input/bcm5974.txt +0 -0
Documentation/input/cd32.rst renamed from Documentation/input/cd32.txt +0 -0
Documentation/input/cma3000_d0x.rst renamed from Documentation/input/cma3000_d0x.txt +0 -0
Documentation/input/conf.py new file +10 -0
@@ -0,0 +1,10 @@ +# -*- coding: utf-8; mode: python -*- + +project = "The Linux input driver subsystem" + +tags.add("subproject") + +latex_documents = [ + ('index', 'linux-input.tex', project, + 'The kernel development community', 'manual'), +]
Documentation/input/cs461x.rst renamed from Documentation/input/cs461x.txt +0 -0
Documentation/input/edt-ft5x06.rst renamed from Documentation/input/edt-ft5x06.txt +0 -0
Documentation/input/elantech.rst renamed from Documentation/input/elantech.txt +0 -0
Documentation/input/event-codes.rst renamed from Documentation/input/event-codes.txt +0 -0
Documentation/input/ff.rst renamed from Documentation/input/ff.txt +0 -0
Documentation/input/gamepad.rst renamed from Documentation/input/gamepad.txt +0 -0
Documentation/input/gameport-programming.rst renamed from Documentation/input/gameport-programming.txt +0 -0
Documentation/input/gpio-tilt.rst renamed from Documentation/input/gpio-tilt.txt +0 -0
Documentation/input/iforce-protocol.rst renamed from Documentation/input/iforce-protocol.txt +0 -0
Documentation/input/index.rst new file +77 -0
77 lines not on this page · raw message
Documentation/input/input-programming.rst renamed from Documentation/input/input-programming.txt +0 -0
Documentation/input/input.rst renamed from Documentation/input/input.txt +0 -20
@@ -6,30 +6,10 @@ Linux Input drivers :Copyright: |copy| 1999-2001 Vojtech Pavlik <[email protected]> - Sponsored by SuSE -Disclaimer -========== - -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. - -This program is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -more details. - -You should have received a copy of the GNU General Public License along -with this program; if not, write to the Free Software Foundation, Inc., 59 -Temple Place, Suite 330, Boston, MA 02111-1307 USA - Should you need to contact me, the author, you can do so either by e-mail - mail your message to <[email protected]>, or by paper mail: Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic -For your convenience, the GNU General Public License version 2 is included -in the package: See the file COPYING. - Introduction ============
Documentation/input/joystick-api.rst renamed from Documentation/input/joystick-api.txt +0 -0
Documentation/input/joystick-parport.rst renamed from Documentation/input/joystick-parport.txt +0 -0
Documentation/input/joystick.rst renamed from Documentation/input/joystick.txt +0 -0
Documentation/input/multi-touch-protocol.rst renamed from Documentation/input/multi-touch-protocol.txt +0 -0
Documentation/input/notifier.rst renamed from Documentation/input/notifier.txt +0 -0
Documentation/input/ntrig.rst renamed from Documentation/input/ntrig.txt +0 -0
Documentation/input/rotary-encoder.rst renamed from Documentation/input/rotary-encoder.txt +0 -0
Documentation/input/sentelic.rst renamed from Documentation/input/sentelic.txt +0 -0
Documentation/input/userio.rst renamed from Documentation/input/userio.txt +0 -0
Documentation/input/walkera0701.rst renamed from Documentation/input/walkera0701.txt +0 -0
Documentation/input/xpad.rst renamed from Documentation/input/xpad.txt +0 -0
Documentation/input/yealink.rst renamed from Documentation/input/yealink.txt +0 -0
Signature · 1 line
2.9.3
PATCH v2 31/37 docs: input/shape: convert it from xfig to svg
We're using svg as the standard format for vectorial images.
Convert it to .svg, in a way that it is easily editable.
--- Documentation/input/shape.fig | 65 ------------------------------------------- Documentation/input/shape.svg | 39 ++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 65 deletions(-) delete mode 100644 Documentation/input/shape.fig create mode 100644 Documentation/input/shape.svg
Documentation/input/shape.fig deleted +0 -65
@@ -1,65 +0,0 @@ -#FIG 3.2 -Landscape -Center -Inches -Letter -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 6 - 4200 3600 4200 3075 4950 2325 7425 2325 8250 3150 8250 3600 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 - 4200 3675 4200 5400 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 - 8250 3675 8250 5400 -2 1 0 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 - 3675 3600 8700 3600 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 - 8775 3600 10200 3600 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 - 8325 3150 9075 3150 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 - 7500 2325 10200 2325 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 - 3600 3600 3000 3600 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 - 4125 3075 3000 3075 -2 1 0 1 0 7 50 0 -1 4.000 0 0 -1 1 1 2 - 0 0 1.00 60.00 120.00 - 0 0 1.00 60.00 120.00 - 4200 5400 8175 5400 -2 1 0 1 0 7 50 0 -1 4.000 0 0 -1 1 1 2 - 0 0 1.00 60.00 120.00 - 0 0 1.00 60.00 120.00 - 10125 2325 10125 3600 -2 1 0 1 0 7 50 0 -1 4.000 0 0 -1 1 1 2 - 0 0 1.00 60.00 120.00 - 0 0 1.00 60.00 120.00 - 3000 3150 3000 3600 -2 1 0 1 0 7 50 0 -1 4.000 0 0 -1 1 1 2 - 0 0 1.00 60.00 120.00 - 0 0 1.00 60.00 120.00 - 9075 3150 9075 3600 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 - 4950 2325 4950 1200 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 - 7425 2325 7425 1200 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 4 - 4200 3075 4200 2400 3600 1800 3600 1200 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 4 - 8250 3150 8250 2475 8775 1950 8775 1200 -2 1 0 1 0 7 50 0 -1 4.000 0 0 -1 1 1 2 - 0 0 1.00 60.00 120.00 - 0 0 1.00 60.00 120.00 - 3600 1275 4950 1275 -2 1 0 1 0 7 50 0 -1 4.000 0 0 -1 1 1 2 - 0 0 1.00 60.00 120.00 - 0 0 1.00 60.00 120.00 - 7425 1275 8700 1275 -4 1 0 50 0 0 12 0.0000 4 135 1140 6075 5325 Effect duration\001 -4 0 0 50 0 0 12 0.0000 4 180 1305 10200 3000 Effect magnitude\001 -4 0 0 50 0 0 12 0.0000 4 135 780 9150 3450 Fade level\001 -4 1 0 50 0 0 12 0.0000 4 180 1035 4275 1200 Attack length\001 -4 1 0 50 0 0 12 0.0000 4 180 885 8175 1200 Fade length\001 -4 2 0 50 0 0 12 0.0000 4 135 930 2925 3375 Attack level\001
Documentation/input/shape.svg new file +39 -0
@@ -0,0 +1,39 @@ +<svg width="7.95in" height="3.70in" version="1.1" viewBox="1956 1041 9354.492 4306.001" xmlns="http://www.w3.org/2000/svg"> + <polyline transform="translate(-121.88 -68.4)" points="4200 3600 4200 3075 4950 2325 7425 2325 8250 3150 8250 3600" fill="none" stroke="#000" stroke-width="15"/> + <polyline transform="translate(-121.88 -68.4)" points="4200 3675 4200 5400" fill="none" stroke="#000" stroke-dasharray="40, 40" stroke-width="7"/> + <polyline transform="translate(-121.88 -68.4)" points="8250 3675 8250 5400" fill="none" stroke="#000" stroke-dasharray="40, 40" stroke-width="7"/> + <polyline transform="translate(-121.88 -68.4)" points="3675 3600 8700 3600" fill="none" stroke="#000" stroke-width="7"/> + <polyline transform="translate(-121.88 -68.4)" points="8775 3600 10200 3600" fill="none" stroke="#000" stroke-dasharray="40, 40" stroke-width="7"/> + <polyline transform="translate(-121.88 -68.4)" points="8325 3150 9075 3150" fill="none" stroke="#000" stroke-dasharray="40, 40" stroke-width="7"/> + <polyline transform="translate(-121.88 -68.4)" points="7500 2325 10200 2325" fill="none" stroke="#000" stroke-dasharray="40, 40" stroke-width="7"/> + <polyline transform="translate(-121.88 -68.4)" points="3600 3600 3e3 3600" fill="none" stroke="#000" stroke-dasharray="40, 40" stroke-width="7"/> + <polyline transform="translate(-121.88 -68.4)" points="4125 3075 3e3 3075" fill="none" stroke="#000" stroke-dasharray="40, 40" stroke-width="7"/> + <polyline transform="translate(-121.88 -68.4)" points="4217 5400 8158 5400" fill="none" stroke="#000" stroke-width="7"/> + <polyline transform="translate(-121.88 -68.4)" points="8053 5430 8173 5400 8053 5370" fill="none" stroke="#000" stroke-miterlimit="8" stroke-width="7"/> + <polyline transform="translate(-121.88 -68.4)" points="4322 5370 4202 5400 4322 5430" fill="none" stroke="#000" stroke-miterlimit="8" stroke-width="7"/> + <polyline transform="translate(-121.88 -68.4)" points="10125 2342 10125 3583" fill="none" stroke="#000" stroke-width="7"/> + <polyline transform="translate(-121.88 -68.4)" points="10095 3478 10125 3598 10155 3478" fill="none" stroke="#000" stroke-miterlimit="8" stroke-width="7"/> + <polyline transform="translate(-121.88 -68.4)" points="10155 2447 10125 2327 10095 2447" fill="none" stroke="#000" stroke-miterlimit="8" stroke-width="7"/> + <polyline transform="translate(-121.88 -68.4)" points="3e3 3167 3e3 3583" fill="none" stroke="#000" stroke-width="7"/> + <polyline transform="translate(-121.88 -68.4)" points="2970 3478 3e3 3598 3030 3478" fill="none" stroke="#000" stroke-miterlimit="8" stroke-width="7"/> + <polyline transform="translate(-121.88 -68.4)" points="3030 3272 3e3 3152 2970 3272" fill="none" stroke="#000" stroke-miterlimit="8" stroke-width="7"/> + <polyline transform="translate(-121.88 -68.4)" points="9075 3167 9075 3583" fill="none" stroke="#000" stroke-width="7"/> + <polyline transform="translate(-121.88 -68.4)" points="9045 3478 9075 3598 9105 3478" fill="none" stroke="#000" stroke-miterlimit="8" stroke-width="7"/> + <polyline transform="translate(-121.88 -68.4)" points="9105 3272 9075 3152 9045 3272" fill="none" stroke="#000" stroke-miterlimit="8" stroke-width="7"/> + <polyline transform="translate(-121.88 -68.4)" points="4950 2325 4950 1200" fill="none" stroke="#000" stroke-dasharray="40, 40" stroke-width="7"/> + <polyline transform="translate(-121.88 -68.4)" points="7425 2325 7425 1200" fill="none" stroke="#000" stroke-dasharray="40, 40" stroke-width="7"/> + <polyline transform="translate(-121.88 -68.4)" points="4200 3075 4200 2400 3600 1800 3600 1200" fill="none" stroke="#000" stroke-dasharray="40, 40" stroke-width="7"/> + <polyline transform="translate(-121.88 -68.4)" points="8250 3150 8250 2475 8775 1950 8775 1200" fill="none" stroke="#000" stroke-dasharray="40, 40" stroke-width="7"/> + <polyline transform="translate(-121.88 -68.4)" points="3617 1275 4933 1275" fill="none" stroke="#000" stroke-width="7"/> + <polyline transform="translate(-121.88 -68.4)" points="4828 1305 4948 1275 4828 1245" fill="none" stroke="#000" stroke-miterlimit="8" stroke-width="7"/> + <polyline transform="translate(-121.88 -68.4)" points="3722 1245 3602 1275 3722 1305" fill="none" stroke="#000" stroke-miterlimit="8" stroke-width="7"/> + <polyline transform="translate(-121.88 -68.4)" points="7442 1275 8683 1275" fill="none" stroke="#000" stroke-width="7"/> + <polyline transform="translate(-121.88 -68.4)" points="8578 1305 8698 1275 8578 1245" fill="none" stroke="#000" stroke-miterlimit="8" stroke-width="7"/> + <polyline transform="translate(-121.88 -68.4)" points="7547 1245 7427 1275 7547 1305" fill="none" stroke="#000" stroke-miterlimit="8" stroke-width="7"/> + <text x="5953.125" y="5256.6001" fill="#000000" font-family="sans-serif" font-size="144px" stroke-width=".025in" text-anchor="middle" xml:space="preserve">Effect duration</text> + <text x="10078.125" y="2931.5999" fill="#000000" font-family="sans-serif" font-size="144px" stroke-width=".025in" xml:space="preserve">Effect magnitude</text> + <text x="9028.125" y="3381.5999" fill="#000000" font-family="sans-serif" font-size="144px" stroke-width=".025in" xml:space="preserve">Fade level</text> + <text x="4153.125" y="1131.6" fill="#000000" font-family="sans-serif" font-size="144px" stroke-width=".025in" text-anchor="middle" xml:space="preserve">Attack length</text> + <text x="8053.125" y="1131.6" fill="#000000" font-family="sans-serif" font-size="144px" stroke-width=".025in" text-anchor="middle" xml:space="preserve">Fade length</text> + <text x="2803.125" y="3306.5999" fill="#000000" font-family="sans-serif" font-size="144px" stroke-width=".025in" text-anchor="end" xml:space="preserve">Attack level</text> +</svg>
Signature · 1 line
2.9.3
PATCH v2 32/37 docs: input/interactive: convert from xfig to svg
We're using svg as the standard format for vectorial images.
Convert it to .svg, in a way that it is easily editable.
--- Documentation/input/interactive.fig | 42 ------------------------------------- Documentation/input/interactive.svg | 24 +++++++++++++++++++++ 2 files changed, 24 insertions(+), 42 deletions(-) delete mode 100644 Documentation/input/interactive.fig create mode 100644 Documentation/input/interactive.svg
Documentation/input/interactive.fig deleted +0 -42
@@ -1,42 +0,0 @@ -#FIG 3.2 -Landscape -Center -Inches -Letter -100.00 -Single --2 -1200 2 -2 1 0 2 0 7 50 0 -1 6.000 0 0 -1 0 0 6 - 1200 3600 1800 3600 2400 4800 3000 4800 4200 5700 4800 5700 -2 2 0 1 0 7 50 0 -1 4.000 0 0 -1 0 0 5 - 1200 3150 4800 3150 4800 6300 1200 6300 1200 3150 -2 1 0 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 - 1200 4800 4800 4800 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 4 - 2400 4800 2400 6525 1950 7125 1950 7800 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 4 - 3000 4800 3000 6525 3600 7125 3600 7800 -2 1 0 1 0 7 50 0 -1 4.000 0 0 -1 0 1 3 - 0 0 1.00 60.00 120.00 - 3825 5400 4125 5100 5400 5100 -2 1 0 1 0 7 50 0 -1 4.000 0 0 -1 0 1 3 - 0 0 1.00 60.00 120.00 - 2100 4200 2400 3900 5400 3900 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 - 4800 5700 5400 5700 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 2 - 1800 3600 5400 3600 -2 1 0 1 0 7 50 0 -1 4.000 0 0 -1 0 1 3 - 0 0 1.00 60.00 120.00 - 2700 4800 2700 4425 5400 4425 -2 1 0 1 0 7 50 0 -1 4.000 0 0 -1 1 1 2 - 0 0 1.00 60.00 120.00 - 0 0 1.00 60.00 120.00 - 1950 7800 3600 7800 -4 1 0 50 0 0 12 0.0000 4 135 810 2775 7725 Dead band\001 -4 0 0 50 0 0 12 0.0000 4 180 1155 5400 5700 right saturation\001 -4 0 0 50 0 0 12 0.0000 4 135 1065 5400 3600 left saturation\001 -4 0 0 50 0 0 12 0.0000 4 180 2505 5400 3900 left coeff ( positive in that case )\001 -4 0 0 50 0 0 12 0.0000 4 180 2640 5475 5100 right coeff ( negative in that case )\001 -4 0 0 50 0 0 12 0.0000 4 105 480 5400 4425 center\001
Documentation/input/interactive.svg new file +24 -0
@@ -0,0 +1,24 @@ +<svg width="5.75in" height="3.90in" version="1.1" viewBox="1178 3138 6779.9424 4671.3427" xmlns="http://www.w3.org/2000/svg"> + <polyline transform="translate(-18.5,-16.294)" points="1200 3600 1800 3600 2400 4800 3e3 4800 4200 5700 4800 5700" fill="none" stroke="#000" stroke-width="15"/> + <rect x="1181.5" y="3133.7" width="3600" height="3150" rx="0" fill="none" stroke="#000" stroke-width="7"/> + <polyline transform="translate(-18.5,-16.294)" points="1200 4800 4800 4800" fill="none" stroke="#000" stroke-width="7"/> + <polyline transform="translate(-18.5,-16.294)" points="2400 4800 2400 6525 1950 7125 1950 7800" fill="none" stroke="#000" stroke-dasharray="40, 40" stroke-width="7"/> + <polyline transform="translate(-18.5,-16.294)" points="3e3 4800 3e3 6525 3600 7125 3600 7800" fill="none" stroke="#000" stroke-dasharray="40, 40" stroke-width="7"/> + <polyline transform="translate(-18.5,-16.294)" points="3837 5389 4125 5100 5400 5100" fill="none" stroke="#000" stroke-width="7"/> + <polyline transform="translate(-18.5,-16.294)" points="3889 5292 3826 5398 3932 5334" fill="none" stroke="#000" stroke-miterlimit="8" stroke-width="7"/> + <polyline transform="translate(-18.5,-16.294)" points="2112 4189 2400 3900 5400 3900" fill="none" stroke="#000" stroke-width="7"/> + <polyline transform="translate(-18.5,-16.294)" points="2164 4092 2101 4198 2207 4134" fill="none" stroke="#000" stroke-miterlimit="8" stroke-width="7"/> + <polyline transform="translate(-18.5,-16.294)" points="4800 5700 5400 5700" fill="none" stroke="#000" stroke-dasharray="40, 40" stroke-width="7"/> + <polyline transform="translate(-18.5,-16.294)" points="1800 3600 5400 3600" fill="none" stroke="#000" stroke-dasharray="40, 40" stroke-width="7"/> + <polyline transform="translate(-18.5,-16.294)" points="2700 4784 2700 4425 5400 4425" fill="none" stroke="#000" stroke-width="7"/> + <polyline transform="translate(-18.5,-16.294)" points="2670 4678 2700 4798 2730 4678" fill="none" stroke="#000" stroke-miterlimit="8" stroke-width="7"/> + <polyline transform="translate(-18.5,-16.294)" points="1967 7800 3583 7800" fill="none" stroke="#000" stroke-width="7"/> + <polyline transform="translate(-18.5,-16.294)" points="3478 7830 3598 7800 3478 7770" fill="none" stroke="#000" stroke-miterlimit="8" stroke-width="7"/> + <polyline transform="translate(-18.5,-16.294)" points="2072 7770 1952 7800 2072 7830" fill="none" stroke="#000" stroke-miterlimit="8" stroke-width="7"/> + <text x="2775" y="7725" font-family="sans-serif" font-size="144px" stroke="#000000" stroke-width=".025in" text-anchor="middle" xml:space="preserve">Dead band</text> + <text x="5400" y="5700" font-family="sans-serif" font-size="144px" stroke="#000000" stroke-width=".025in" xml:space="preserve">right saturation</text> + <text x="5400" y="3600" font-family="sans-serif" font-size="144px" stroke="#000000" stroke-width=".025in" xml:space="preserve">left saturation</text> + <text x="5400" y="3900" font-family="sans-serif" font-size="144px" stroke="#000000" stroke-width=".025in" xml:space="preserve">left coeff ( positive in that case )</text> + <text x="5475" y="5100" font-family="sans-serif" font-size="144px" stroke="#000000" stroke-width=".025in" xml:space="preserve">right coeff ( negative in that case )</text> + <text x="5400" y="4425" font-family="sans-serif" font-size="144px" stroke="#000000" stroke-width=".025in" xml:space="preserve">center</text> +</svg>
Signature · 1 line
2.9.3
PATCH v2 33/37 docs: ff.rst: use svg files instead of xfig
Now that the images got converted to svg, add them at the ff.rst file.
NOTE: After merging upstream, the "figure" tag should be replaced by the new "kernel-figure" tag, in order for the SVG images to be included at the PDF files.
--- Documentation/input/ff.rst | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)
Documentation/input/ff.rst +11 -4
@@ -5,8 +5,8 @@ Force feedback for Linux :Author: Johann Deneux <[email protected]> on 2001/04/22. :Updated: Anssi Hannula <[email protected]> on 2006/04/09. -You may redistribute this file. Please remember to include shape.fig and -interactive.fig as well. +You may redistribute this file. Please remember to include shape.svg and +interactive.svg as well. Introduction ~~~~~~~~~~~~
@@ -127,8 +127,15 @@ allocate a new effect. Effects are file descriptor specific. See <linux/input.h> for a description of the ff_effect struct. You should also -find help in a few sketches, contained in files shape.fig and interactive.fig. -You need xfig to visualize these files. +find help in a few sketches, contained in files shape.svg and interactive.svg: + +.. figure:: shape.svg + + Shape + +.. figure:: interactive.svg + + Interactive Removing an effect from the device
Signature · 1 line
2.9.3
PATCH v2 34/37 input: add an EV_REL event for high-res vertical wheel
As some devices can produce either low-res or high-res vertical wheel EV_REL events, add a new event to allow userspace to distinguish between them.
--- Documentation/input/event-codes.rst | 16 +++++++++++++--- include/uapi/linux/input-event-codes.h | 1 + 2 files changed, 14 insertions(+), 3 deletions(-)
Documentation/input/event-codes.rst +13 -3
@@ -185,10 +185,20 @@ instead of EV_REL codes. A few EV_REL codes have special meanings: -* REL_WHEEL, REL_HWHEEL: +* REL_WHEEL: - - These codes are used for vertical and horizontal scroll wheels, - respectively. + - These codes are used for vertical scroll wheels. + + - REL_WHEEL is for normal wheel operational mode, e. g. low-resolution + (line-based) scroll. + + - REL_HIRES_WHEEL should be used when the wheel has two resolutions and it + is in high-resolution mode, e. g. the same angular movement that would + produce a single REL_WHEEL will produce multiple REL_HIRES_WHEEL events. + +* REL_HWHEEL: + + - This code is used for horizontal scroll wheels. EV_ABS ------
include/uapi/linux/input-event-codes.h +1 -0
@@ -703,6 +703,7 @@#define REL_DIAL 0x07#define REL_WHEEL 0x08#define REL_MISC 0x09 +#define REL_HIRES_WHEEL 0x0a#define REL_MAX 0x0f#define REL_CNT (REL_MAX+1)
Signature · 1 line
2.9.3
PATCH v2 35/37 input: add a EV_SW event for ratchet switch
Some mouses have a switch on their wheel, allowing to switch between ratchet or free wheel mode. Add support for it.
--- Documentation/input/event-codes.rst | 16 ++++++++++++++++ include/linux/mod_devicetable.h | 2 +- include/uapi/linux/input-event-codes.h | 4 +++- 3 files changed, 20 insertions(+), 2 deletions(-)
Documentation/input/event-codes.rst +16 -0
@@ -239,6 +239,22 @@ Upon resume, if the switch state is the same as before suspend, then the input subsystem will filter out the duplicate switch state reports. The driver does not need to keep the state of the switch at any time. +A few EV_SW codes have special meanings: + +* SW_RATCHET: + + - Some mouses have a special switch at their wheel that allows to change + from free wheel mode to ratchet mode. + + When such switch is ratchet mode (ON state), the wheel will offer some + resistance for movements movement. It will also provide a tactile + feedback when scrolled. + + When pressed while in ratchet mode, the wheel will switch to free wheel + mode (OFF state). In this mode, it will offer no resistance to wheel + movements nor any tactile feedback. Pressing again returns to ratchet + mode. + EV_MSC ------
include/linux/mod_devicetable.h +1 -1
@@ -292,7 +292,7 @@ struct pcmcia_device_id {#define INPUT_DEVICE_ID_LED_MAX 0x0f#define INPUT_DEVICE_ID_SND_MAX 0x07#define INPUT_DEVICE_ID_FF_MAX 0x7f -#define INPUT_DEVICE_ID_SW_MAX 0x0f +#define INPUT_DEVICE_ID_SW_MAX 0x1f#define INPUT_DEVICE_ID_MATCH_BUS 1#define INPUT_DEVICE_ID_MATCH_VENDOR 2
include/uapi/linux/input-event-codes.h +3 -1
@@ -782,7 +782,9 @@#define SW_LINEIN_INSERT 0x0d/* set = inserted */ #define SW_MUTE_DEVICE 0x0e/* set = device disabled */ #define SW_PEN_INSERTED 0x0f/* set = pen inserted */ -#define SW_MAX 0x0f +#define SW_RATCHET 0x10/* set = ratchet mode, +unset: free wheel */ +#define SW_MAX 0x1f#define SW_CNT (SW_MAX+1)/*
Signature · 1 line
2.9.3
PATCH v2 36/37 hid-logitech-hidpp: add support for high res wheel
Some Logitech mouses (MX Anyware 2 and MX Master) have support for a high-resolution wheel.
This wheel can work in backward-compatible mode, generating wheel events via HID normal events, or it can use new HID++ events that report not only the wheel movement, but also the resolution.
Add support for it.
--- drivers/hid/hid-logitech-hidpp.c | 199 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 199 insertions(+)
drivers/hid/hid-logitech-hidpp.c +199 -0
@@ -62,6 +62,7 @@ MODULE_PARM_DESC(disable_tap_to_click,#define HIDPP_QUIRK_WTP_PHYSICAL_BUTTONS BIT(22)#define HIDPP_QUIRK_NO_HIDINPUT BIT(23)#define HIDPP_QUIRK_FORCE_OUTPUT_REPORTS BIT(24) +#define HIDPP_QUIRK_HIRES_SCROLL BIT(25)#define HIDPP_QUIRK_DELAYED_INIT (HIDPP_QUIRK_NO_HIDINPUT | \ HIDPP_QUIRK_CONNECT_EVENTS)
@@ -1361,6 +1362,67 @@ static int hidpp_ff_deinit(struct hid_device *hid)return 0 ; } +/* -------------------------------------------------------------------------- */ +/* 0x2121: High Resolution Wheel */ +/* -------------------------------------------------------------------------- */ + +#define HIDPP_HIGH_RES_WHEEL 0x2121 + +#define CMD_MOUSE_SET_WHEEL_MODE 0x20 +#define CMD_MOUSE_GET_WHEEL_RATCHET 0x30 + +struct high_res_wheel_data { +u8 feature_index; +struct input_dev *input; +bool ratchet; +}; + +/** +* hidpp_mouse_set_wheel_mode - Sets high resolution wheel mode +* +* @invert: if true, inverts wheel movement +* @high_res: if true, wheel is in high-resolution mode. Otherwise, low res +* @hidpp: if true, report wheel events via HID++ notification. If false, +* use standard HID events +*/ +static int hidpp_mouse_set_wheel_mode (struct hidpp_device *hidpp, +bool invert, +bool high_res, +bool hidpp_mode) +{ +struct high_res_wheel_data *hrd = hidpp->private_data; +u8 feature_type; +struct hidpp_report response; +int ret; +u8 params[16 ] = {0 }; + +if (!hrd->feature_index) { + ret =hidpp_root_get_feature (hidpp, +HIDPP_HIGH_RES_WHEEL , + &hrd->feature_index, + &feature_type); +if (ret) +/* means that the device is not powered up */ +return ret; + } + + params[0 ] = invert ?0x4 :0 | + high_res ?0x2 :0 | + hidpp_mode ?0x1 :0 ; + + ret =hidpp_send_fap_command_sync (hidpp, hrd->feature_index, +CMD_MOUSE_SET_WHEEL_MODE , + params,16 , &response); +if (ret >0 ) { +hid_err (hidpp->hid_dev,"%s: received protocol error 0x%02x\n" , + __func__, ret); +return -EPROTO ; + } +if (ret) +return ret; + +return 0 ; +}/* ************************************************************************** */ /* */
@@ -1816,6 +1878,119 @@ static int m560_input_mapping(struct hid_device *hdev, struct hid_input *hi, }/* ------------------------------------------------------------------------- */ +/* Logitech mouse devices with high resolution wheel */ +/* ------------------------------------------------------------------------- */ + +static int high_res_raw_event (struct hid_device *hdev,u8 *data,int size) +{ +struct hidpp_device *hidpp =hid_get_drvdata (hdev); +struct high_res_wheel_data *hrd = hidpp->private_data; + +/* Don't handle special raw events before setting feature_index */ +if (!hrd || !hrd->feature_index) +return 0 ; + +if (data[0 ] !=REPORT_ID_HIDPP_LONG || + data[2 ] != hrd->feature_index) +return 1 ; + +if (size <8 ) { +hid_err (hdev,"error in report: size = %d: %*ph\n" , size, + size, data); +return 0 ; + } + +/* +* high res wheel mouse events +* +* Wheel movement events are like: +* +* 11 03 0b 00 01 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 +* +* data[0] = 0x11 +* data[1] = device-id +* data[2] = feature index (0b) +* data[3] = event type: 0x00 - wheel movement +* data[4] = bitmask: +* bits 0-3: number of sampling periods combined +* bit 4: +* 0 = low resolution +* 1 = high resolution +* data[5] - deltaV MSB +* data[6] = deltaV LSB +* Remaining payload is reserved +* +* Ratchet events are like: +* 11 03 0b 10 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +* +* data[0] = 0x11 +* data[1] = device-id +* data[2] = feature index +* data[3] = event type: 0x10 - ratchet state +* data[4] = bit 0: +* 1 = ratchet +* 0 = free wheel +* Remaining payload is reserved +*/ + +if (data[3 ] ==0 ) { +s16 delta = data[6 ] | data[5 ] <<8 ; +bool res = data[4 ] &0x10 ; + +/* +* Report high-resolution events as REL_HWHEEL and +* low-resolution events as REL_WHEEL. +*/ +if (res) +input_report_rel (hrd->input,REL_HIRES_WHEEL , delta); +else +input_report_rel (hrd->input,REL_WHEEL , delta); + } + +/* FIXME: also report ratchet events to userspace */ + +return 1 ; +} + +static void high_res_populate_input (struct hidpp_device *hidpp, +struct input_dev *input_dev,bool origin_is_hid_core) +{ +struct high_res_wheel_data *hrd = hidpp->private_data; + + hrd->input = input_dev; + +__set_bit (REL_WHEEL , hrd->input->relbit); +__set_bit (REL_HIRES_WHEEL , hrd->input->relbit); +} + + +static int high_res_allocate (struct hid_device *hdev) +{ +struct hidpp_device *hidpp =hid_get_drvdata (hdev); +struct high_res_wheel_data *hrd; + + hrd =devm_kzalloc (&hdev->dev,sizeof (struct high_res_wheel_data ), +GFP_KERNEL ); +if (!hrd) +return -ENOMEM ; + + hidpp->private_data = hrd; + +return 0 ; +}; + +static int high_res_connect (struct hid_device *hdev,bool connected) +{ +struct hidpp_device *hidpp =hid_get_drvdata (hdev); + +if (!connected) +return 0 ; + +/* Enable HID++ wheel event output mode */ +return hidpp_mouse_set_wheel_mode (hidpp, false, false, true); +} + +/* ------------------------------------------------------------------------- */ /* Logitech K400 devices */ /* ------------------------------------------------------------------------- */
@@ -1955,6 +2130,9 @@ static void hidpp_populate_input(struct hidpp_device *hidpp,wtp_populate_input (hidpp, input, origin_is_hid_core); else if (hidpp->quirks & HIDPP_QUIRK_CLASS_M560) m560_populate_input(hidpp, input, origin_is_hid_core); + else if (hidpp->quirks & HIDPP_QUIRK_HIRES_SCROLL) + high_res_populate_input(hidpp, input, origin_is_hid_core); + } static int hidpp_input_configured(struct hid_device *hdev,
@@ -2054,6 +2232,8 @@ static int hidpp_raw_event(struct hid_device *hdev, struct hid_report *report,return wtp_raw_event (hdev, data, size); else if (hidpp->quirks & HIDPP_QUIRK_CLASS_M560) return m560_raw_event(hdev, data, size); + else if (hidpp->quirks & HIDPP_QUIRK_HIRES_SCROLL) + return high_res_raw_event(hdev, data, size);return 0 ; }
@@ -2141,6 +2321,10 @@ static void hidpp_connect_event(struct hidpp_device *hidpp) ret =k400_connect (hdev, connected);if (ret)return ; + }else if (hidpp->quirks &HIDPP_QUIRK_HIRES_SCROLL ) { + ret =high_res_connect (hdev, connected); +if (ret) +return ; }if (!connected || hidpp->delayed_input)
@@ -2215,6 +2399,7 @@ static int hidpp_probe(struct hid_device *hdev, const struct hid_device_id *id) hidpp->quirks &= ~HIDPP_QUIRK_CLASS_WTP ; hidpp->quirks &= ~HIDPP_QUIRK_CONNECT_EVENTS ; hidpp->quirks &= ~HIDPP_QUIRK_NO_HIDINPUT ; + hidpp->quirks &= ~HIDPP_QUIRK_HIRES_SCROLL ; }if (hidpp->quirks &HIDPP_QUIRK_CLASS_WTP ) {
@@ -2229,6 +2414,10 @@ static int hidpp_probe(struct hid_device *hdev, const struct hid_device_id *id) ret =k400_allocate (hdev);if (ret) goto allocate_fail; + }else if (hidpp->quirks &HIDPP_QUIRK_HIRES_SCROLL ) { + ret =high_res_allocate (hdev); +if (ret) + goto allocate_fail; }INIT_WORK (&hidpp->work, delayed_work_cb);
@@ -2354,6 +2543,16 @@ static const struct hid_device_id hidpp_devices[] = { HID_DEVICE(BUS_USB, HID_GROUP_LOGITECH_DJ_DEVICE, USB_VENDOR_ID_LOGITECH, 0x402d), .driver_data = HIDPP_QUIRK_DELAYED_INIT | HIDPP_QUIRK_CLASS_M560 }, + {/* Logitech MX Master with high resolution scroll */ +HID_DEVICE (BUS_USB ,HID_GROUP_LOGITECH_DJ_DEVICE , + USB_VENDOR_ID_LOGITECH, 0x4041), + .driver_data =HIDPP_QUIRK_CONNECT_EVENTS | + HIDPP_QUIRK_HIRES_SCROLL }, + { /* Logitech MX Anywhere 2 with high resolution scroll */ + HID_DEVICE(BUS_USB, HID_GROUP_LOGITECH_DJ_DEVICE, + USB_VENDOR_ID_LOGITECH, 0x404a), + .driver_data =HIDPP_QUIRK_CONNECT_EVENTS | + HIDPP_QUIRK_HIRES_SCROLL }, { /* Keyboard logitech K400 */HID_DEVICE (BUS_USB ,HID_GROUP_LOGITECH_DJ_DEVICE , USB_VENDOR_ID_LOGITECH, 0x4024),
Signature · 1 line
2.9.3
PATCH v2 37/37 hid-logitech-hidpp: add support for ratchet switch
Logitech Anywhere MX2 and MX master produce events for the wheel ratchet/free wheel button. Add support for it.
--- drivers/hid/hid-logitech-hidpp.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-)
drivers/hid/hid-logitech-hidpp.c +21 -2
@@ -1406,6 +1406,19 @@ static int hidpp_mouse_set_wheel_mode(struct hidpp_device *hidpp,return ret; } + ret =hidpp_send_fap_command_sync (hidpp, hrd->feature_index, +CMD_MOUSE_GET_WHEEL_RATCHET , + params,16 , &response); +if (ret >0 ) { +hid_err (hidpp->hid_dev,"%s: received protocol error 0x%02x\n" , + __func__, ret); +return -EPROTO ; + } +if (ret) +return ret; + + hrd->ratchet = response.fap.params[0 ] &0x01 ; + params[0 ] = invert ?0x4 :0 | high_res ?0x2 :0 | hidpp_mode ?0x1 :0 ;
@@ -1945,10 +1958,11 @@ static int high_res_raw_event(struct hid_device *hdev, u8 *data, int size)input_report_rel (hrd->input,REL_HIRES_WHEEL , delta); else input_report_rel(hrd->input, REL_WHEEL, delta); + }else if (data[3 ] ==0x10 ) { + hrd->ratchet = data[4 ] &0x01 ; +input_report_switch (hrd->input,SW_RATCHET , hrd->ratchet); } -/* FIXME: also report ratchet events to userspace */ -return 1 ; }
@@ -1961,6 +1975,11 @@ static void high_res_populate_input(struct hidpp_device *hidpp,__set_bit (REL_WHEEL , hrd->input->relbit);__set_bit (REL_HIRES_WHEEL , hrd->input->relbit); +__set_bit (EV_SW , hrd->input->evbit); +__set_bit (SW_RATCHET , hrd->input->swbit); + +/* Report current state of the ratchet switch */ +input_report_switch (hrd->input,SW_RATCHET , hrd->ratchet); }
Signature · 1 line
2.9.3
Re: [PATCH v2 35/37] input: add a EV_SW event for ratchet switch
In reply to Mauro Carvalho ChehabQuoted 1 line · Mauro Carvalho Chehab
Some mouses have a switch on their wheel, allowing to switch
isnt' the plural of mouse mice? (non-native english speaker myself)
Quoted 1 line
between ratchet or free wheel mode. Add support for it.
s/or/and/
Quoted 13 lines
Signed-off-by Mauro Carvalho Chehab <[email protected]>--- Documentation/input/event-codes.rst | 16 ++++++++++++++++ include/linux/mod_devicetable.h | 2 +- include/uapi/linux/input-event-codes.h | 4 +++- 3 files changed, 20 insertions(+), 2 deletions(-)Documentation/input/event-codes.rst +0
-0
Documentation/input/event-codes.rst Upon resume, if the switch state is the same as before suspend, then the input · line 247
Quoted 9 lines
Documentation/input/event-codes.rst +6
-0@@ -239,6 +239,22 @@ Upon resume, if the switch state is the same as before suspend, then the input subsystem will filter out the duplicate switch state reports. The driver does not need to keep the state of the switch at any time. +A few EV_SW codes have special meanings: + +* SW_RATCHET: + + - Some mouses have a special switch at their wheel that allows to change + from free wheel mode to ratchet mode.
"between free wheel mode and ratchet mode"
Documentation/input/event-codes.rst Upon resume, if the switch state is the same as before suspend, then the input · line 249
Quoted 2 lines
Documentation/input/event-codes.rst +2
-0+ + When such switch is ratchet mode (ON state), the wheel will offer some
s/such/the/
Documentation/input/event-codes.rst Upon resume, if the switch state is the same as before suspend, then the input · line 251
Quoted 2 lines
Documentation/input/event-codes.rst +2
-0+ resistance for movements movement. It will also provide a tactile + feedback when scrolled.
this is too specific, you cannot guarantee that all devices in the future have exactly that behaviour. I would just skip the second sentence.
Documentation/input/event-codes.rst Upon resume, if the switch state is the same as before suspend, then the input · line 256
Quoted 5 lines
Documentation/input/event-codes.rst +5
-0+ + When pressed while in ratchet mode, the wheel will switch to free wheel + mode (OFF state). In this mode, it will offer no resistance to wheel + movements nor any tactile feedback. Pressing again returns to ratchet + mode.
nack to this, this is your device but not all future devices will have this behaviour. e.g. some devices have the ratchet switch below (i.e. south of) the weel. Just describe the effect the switch has, not the physical behaviour.
Cheers,
Peter
Quoted 35 lines
Documentation/input/event-codes.rst +1
-0+ EV_MSC ------include/linux/mod_devicetable.h +1
-1@@ -292,7 +292,7 @@ struct pcmcia_device_id {#define INPUT_DEVICE_ID_LED_MAX 0x0f#define INPUT_DEVICE_ID_SND_MAX 0x07#define INPUT_DEVICE_ID_FF_MAX 0x7f -#define INPUT_DEVICE_ID_SW_MAX 0x0f +#define INPUT_DEVICE_ID_SW_MAX 0x1f#define INPUT_DEVICE_ID_MATCH_BUS 1#define INPUT_DEVICE_ID_MATCH_VENDOR 2include/uapi/linux/input-event-codes.h +3
-1@@ -782,7 +782,9 @@#define SW_LINEIN_INSERT 0x0d/* set = inserted */ #define SW_MUTE_DEVICE 0x0e/* set = device disabled */ #define SW_PEN_INSERTED 0x0f/* set = pen inserted */ -#define SW_MAX 0x0f +#define SW_RATCHET 0x10/* set = ratchet mode, +unset: free wheel */ +#define SW_MAX 0x1f#define SW_CNT (SW_MAX+1)/* Signature · 1 line
2.9.3
Re: [PATCH v2 35/37] input: add a EV_SW event for ratchet switch
Em Wed, 5 Apr 2017 22:03:03 +1000
Peter Hutterer <[email protected]> escreveu:
Quoted 4 lines · Mauro Carvalho Chehab
Quoted 1 line
Some mouses have a switch on their wheel, allowing to switch
isnt' the plural of mouse mice? (non-native english speaker myself)
Yeah, true. I'll fix on a next review.
Quoted 33 lines
Quoted 2 lines
between ratchet or free wheel mode. Add support for it.
s/or/and/
Quoted 13 lines
Signed-off-by Mauro Carvalho Chehab <[email protected]>--- Documentation/input/event-codes.rst | 16 ++++++++++++++++ include/linux/mod_devicetable.h | 2 +- include/uapi/linux/input-event-codes.h | 4 +++- 3 files changed, 20 insertions(+), 2 deletions(-)Documentation/input/event-codes.rst +0
-0Documentation/input/event-codes.rst Upon resume, if the switch state is the same as before suspend, then the input · line 247
Quoted 9 lines
Documentation/input/event-codes.rst +6
-0@@ -239,6 +239,22 @@ Upon resume, if the switch state is the same as before suspend, then the input subsystem will filter out the duplicate switch state reports. The driver does not need to keep the state of the switch at any time. +A few EV_SW codes have special meanings: + +* SW_RATCHET: + + - Some mouses have a special switch at their wheel that allows to change + from free wheel mode to ratchet mode."between free wheel mode and ratchet mode"
Documentation/input/event-codes.rst Upon resume, if the switch state is the same as before suspend, then the input · line 249
Quoted 2 lines
Documentation/input/event-codes.rst +2
-0+ + When such switch is ratchet mode (ON state), the wheel will offer some
Quoted 7 lines
s/such/the/
Documentation/input/event-codes.rst Upon resume, if the switch state is the same as before suspend, then the input · line 251
Quoted 2 lines
Documentation/input/event-codes.rst +2
-0+ resistance for movements movement. It will also provide a tactile + feedback when scrolled.this is too specific, you cannot guarantee that all devices in the future have exactly that behaviour. I would just skip the second sentence.
I just wanted to let it clear about what's the difference between ratchet and free wheel mode. As a non-native speaker, I had to research myself about what the heck "ratchet" means, as I never heard this word before ;)
To be frank, when I received this mouse, I had some troubles to adapt to it, as on other mice I have here, the wheel is used generate the mid button event. On this specific model, there's a small button on south of the wheel the mid button event.
Quoted 10 lines
Documentation/input/event-codes.rst Upon resume, if the switch state is the same as before suspend, then the input · line 256
Quoted 5 lines
Documentation/input/event-codes.rst +5
-0+ + When pressed while in ratchet mode, the wheel will switch to free wheel + mode (OFF state). In this mode, it will offer no resistance to wheel + movements nor any tactile feedback. Pressing again returns to ratchet + mode.nack to this, this is your device but not all future devices will have this behaviour. e.g. some devices have the ratchet switch below (i.e. south of) the weel. Just describe the effect the switch has, not the physical behaviour.
Ok, I'll remove it. What about this:
* SW_RATCHET:
- Some mice have a special switch at their wheel that allows to change between free wheel mode and ratchet mode via a ratchet switch.
When the switch is ratchet mode (ON state), the wheel will offer some resistance for movements. It may also provide a tactile feedback when scrolled.
Regards,
Mauro
Re: [PATCH v2 35/37] input: add a EV_SW event for ratchet switch
Quoted 72 lines · Mauro Carvalho Chehab
Em Wed, 5 Apr 2017 22:03:03 +1000
Peter Hutterer <[email protected]> escreveu:Quoted 4 lines · Mauro Carvalho Chehab
Quoted 1 line
Some mouses have a switch on their wheel, allowing to switch
isnt' the plural of mouse mice? (non-native english speaker myself)
Yeah, true. I'll fix on a next review.
Quoted 33 lines
Quoted 2 lines
between ratchet or free wheel mode. Add support for it.
s/or/and/
Quoted 13 lines
Signed-off-by Mauro Carvalho Chehab <[email protected]>--- Documentation/input/event-codes.rst | 16 ++++++++++++++++ include/linux/mod_devicetable.h | 2 +- include/uapi/linux/input-event-codes.h | 4 +++- 3 files changed, 20 insertions(+), 2 deletions(-)Documentation/input/event-codes.rst +0
-0Documentation/input/event-codes.rst Upon resume, if the switch state is the same as before suspend, then the input · line 247
Quoted 9 lines
Documentation/input/event-codes.rst +6
-0@@ -239,6 +239,22 @@ Upon resume, if the switch state is the same as before suspend, then the input subsystem will filter out the duplicate switch state reports. The driver does not need to keep the state of the switch at any time. +A few EV_SW codes have special meanings: + +* SW_RATCHET: + + - Some mouses have a special switch at their wheel that allows to change + from free wheel mode to ratchet mode."between free wheel mode and ratchet mode"
Documentation/input/event-codes.rst Upon resume, if the switch state is the same as before suspend, then the input · line 249
Quoted 2 lines
Documentation/input/event-codes.rst +2
-0+ + When such switch is ratchet mode (ON state), the wheel will offer someQuoted 7 lines
s/such/the/
Documentation/input/event-codes.rst Upon resume, if the switch state is the same as before suspend, then the input · line 251
Quoted 2 lines
Documentation/input/event-codes.rst +2
-0+ resistance for movements movement. It will also provide a tactile + feedback when scrolled.this is too specific, you cannot guarantee that all devices in the future have exactly that behaviour. I would just skip the second sentence.
I just wanted to let it clear about what's the difference between ratchet and free wheel mode. As a non-native speaker, I had to research myself about what the heck "ratchet" means, as I never heard this word before ;)
To be frank, when I received this mouse, I had some troubles to adapt to it, as on other mice I have here, the wheel is used generate the mid button event. On this specific model, there's a small button on south of the wheel the mid button event.
Quoted 10 lines
Documentation/input/event-codes.rst Upon resume, if the switch state is the same as before suspend, then the input · line 256
Quoted 5 lines
Documentation/input/event-codes.rst +5
-0+ + When pressed while in ratchet mode, the wheel will switch to free wheel + mode (OFF state). In this mode, it will offer no resistance to wheel + movements nor any tactile feedback. Pressing again returns to ratchet + mode.nack to this, this is your device but not all future devices will have this behaviour. e.g. some devices have the ratchet switch below (i.e. south of) the weel. Just describe the effect the switch has, not the physical behaviour.
Ok, I'll remove it. What about this:
Quoted 8 lines
*
SW_RATCHET:- Some mice have a special switch at their wheel that allows to change between free wheel mode and ratchet mode via a ratchet switch.
When the switch is ratchet mode (ON state), the wheel will offer some resistance for movements. It may also provide a tactile feedback when scrolled.
yep, close, just a minor nitpick:
- Some mice have a special switch for their wheel that allows to change between free wheel mode and ratchet mode. When the switch is ratchet mode (ON state), the wheel will offer some resistance for movements. It may also provide a tactile feedback when scrolled.
And maybe add something like:
Note that some mice have a ratchet switch that does not generate a software event.
Cheers,
Peter