<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/hid/hid-input.c, branch v3.3</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>HID: hid-input: allow array fields out of range</title>
<updated>2012-03-05T09:28:58+00:00</updated>
<author>
<name>Nikolai Kondrashov</name>
<email>spbnick@gmail.com</email>
</author>
<published>2012-03-02T20:13:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=883e0e366209067e690356e58e19bb2e6693b839'/>
<id>883e0e366209067e690356e58e19bb2e6693b839</id>
<content type='text'>
Allow array field values out of range as per HID 1.11 specification,
section 6.2.25:

	Rather than returning a single bit for each button in the group, an
	array returns an index in each field that corresponds to the pressed
	button (like keyboard scan codes). An out-of range value in and array
	field is considered no controls asserted.

Apparently, "and" above is a typo and should be "an".

This fixes at least Waltop tablet pen clicks - otherwise BTN_TOUCH is never
released.

The relevant part of Waltop tablet report descriptors is this:

	0x09, 0x42,         /*          Usage (Tip Switch),         */
	0x09, 0x44,         /*          Usage (Barrel Switch),      */
	0x09, 0x46,         /*          Usage (Tablet Pick),        */
	0x15, 0x01,         /*          Logical Minimum (1),        */
	0x25, 0x03,         /*          Logical Maximum (3),        */
	0x75, 0x04,         /*          Report Size (4),            */
	0x95, 0x01,         /*          Report Count (1),           */
	0x80,               /*          Input,                      */

This is a regression fix for commit b4b583d ("HID: be more strict when
ignoring out-of-range fields").

Signed-off-by: Nikolai Kondrashov &lt;spbnick@gmail.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Allow array field values out of range as per HID 1.11 specification,
section 6.2.25:

	Rather than returning a single bit for each button in the group, an
	array returns an index in each field that corresponds to the pressed
	button (like keyboard scan codes). An out-of range value in and array
	field is considered no controls asserted.

Apparently, "and" above is a typo and should be "an".

This fixes at least Waltop tablet pen clicks - otherwise BTN_TOUCH is never
released.

The relevant part of Waltop tablet report descriptors is this:

	0x09, 0x42,         /*          Usage (Tip Switch),         */
	0x09, 0x44,         /*          Usage (Barrel Switch),      */
	0x09, 0x46,         /*          Usage (Tablet Pick),        */
	0x15, 0x01,         /*          Logical Minimum (1),        */
	0x25, 0x03,         /*          Logical Maximum (3),        */
	0x75, 0x04,         /*          Report Size (4),            */
	0x95, 0x01,         /*          Report Count (1),           */
	0x80,               /*          Input,                      */

This is a regression fix for commit b4b583d ("HID: be more strict when
ignoring out-of-range fields").

Signed-off-by: Nikolai Kondrashov &lt;spbnick@gmail.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'hid-battery' of git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen into for-linus</title>
<updated>2012-01-09T10:24:59+00:00</updated>
<author>
<name>Jiri Kosina</name>
<email>jkosina@suse.cz</email>
</author>
<published>2012-01-09T10:24:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=420174afdc7023c000e5b5b1b6fe9e028470c713'/>
<id>420174afdc7023c000e5b5b1b6fe9e028470c713</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>hid-input/battery: add FEATURE quirk</title>
<updated>2012-01-08T07:31:25+00:00</updated>
<author>
<name>Jeremy Fitzhardinge</name>
<email>jeremy@goop.org</email>
</author>
<published>2011-12-09T08:10:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=652aa6a9ac4a5f8d3e1fa3f6466646519e83c01e'/>
<id>652aa6a9ac4a5f8d3e1fa3f6466646519e83c01e</id>
<content type='text'>
Apple keyboards require a FEATURE report to query the battery state,
even though they list as an input.  Without this, it returns an error.

Signed-off-by: Jeremy Fitzhardinge &lt;jeremy@goop.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Apple keyboards require a FEATURE report to query the battery state,
even though they list as an input.  Without this, it returns an error.

Signed-off-by: Jeremy Fitzhardinge &lt;jeremy@goop.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>hid-input/battery: remove battery_val</title>
<updated>2012-01-08T07:31:18+00:00</updated>
<author>
<name>Jeremy Fitzhardinge</name>
<email>jeremy@goop.org</email>
</author>
<published>2011-12-03T05:57:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=ce63920b395f1476e2d28cca16a56919289f0b62'/>
<id>ce63920b395f1476e2d28cca16a56919289f0b62</id>
<content type='text'>
hidinput_get_battery_property() now directly polls the device for the
current battery strength, so there's no need for battery_val, or the
code to set it on the input event path.

Signed-off-by: Jeremy Fitzhardinge &lt;jeremy@goop.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
hidinput_get_battery_property() now directly polls the device for the
current battery strength, so there's no need for battery_val, or the
code to set it on the input event path.

Signed-off-by: Jeremy Fitzhardinge &lt;jeremy@goop.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>hid-input/battery: power-supply type really *is* a battery</title>
<updated>2012-01-08T07:30:39+00:00</updated>
<author>
<name>Jeremy Fitzhardinge</name>
<email>jeremy@goop.org</email>
</author>
<published>2011-12-03T03:06:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=b3ca3839f344aa469e6f53c8bbb633e5ab9b96c8'/>
<id>b3ca3839f344aa469e6f53c8bbb633e5ab9b96c8</id>
<content type='text'>
It just isn't a battery which is powering the computer.  upower needs
a more nuanced understanding of this.

Signed-off-by: Jeremy Fitzhardinge &lt;jeremy@goop.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It just isn't a battery which is powering the computer.  upower needs
a more nuanced understanding of this.

Signed-off-by: Jeremy Fitzhardinge &lt;jeremy@goop.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>hid-input/battery: make the battery setup common for INPUTs and FEATUREs</title>
<updated>2012-01-08T07:30:38+00:00</updated>
<author>
<name>Jeremy Fitzhardinge</name>
<email>jeremy@goop.org</email>
</author>
<published>2011-12-03T03:05:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=2f2e3f6d7a24e7fceb0fef514767025cddb64dc2'/>
<id>2f2e3f6d7a24e7fceb0fef514767025cddb64dc2</id>
<content type='text'>
Signed-off-by: Jeremy Fitzhardinge &lt;jeremy@goop.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Jeremy Fitzhardinge &lt;jeremy@goop.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>hid-input/battery: deal with both FEATURE and INPUT report batteries</title>
<updated>2012-01-08T07:30:37+00:00</updated>
<author>
<name>Jeremy Fitzhardinge</name>
<email>jeremy@goop.org</email>
</author>
<published>2011-12-02T19:18:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=fb8ac91b4dccbdda0ad51d499079d05143783ba4'/>
<id>fb8ac91b4dccbdda0ad51d499079d05143783ba4</id>
<content type='text'>
Some devices seem to report batteries as FEATUREs, others as INPUTs.

Signed-off-by: Jeremy Fitzhardinge &lt;jeremy@goop.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some devices seem to report batteries as FEATUREs, others as INPUTs.

Signed-off-by: Jeremy Fitzhardinge &lt;jeremy@goop.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>hid-input/battery: add quirks for battery</title>
<updated>2012-01-08T07:30:37+00:00</updated>
<author>
<name>Jeremy Fitzhardinge</name>
<email>jeremy@goop.org</email>
</author>
<published>2011-12-02T19:12:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=bbc21cfd55858d7c3e55bfaa91fa934b0b13ad4d'/>
<id>bbc21cfd55858d7c3e55bfaa91fa934b0b13ad4d</id>
<content type='text'>
Some devices always report percentage, despite having 0/255 as their
min/max, so add a quirk for them.

Signed-off-by: Jeremy Fitzhardinge &lt;jeremy@goop.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some devices always report percentage, despite having 0/255 as their
min/max, so add a quirk for them.

Signed-off-by: Jeremy Fitzhardinge &lt;jeremy@goop.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>hid-input/battery: remove apparently redundant kmalloc</title>
<updated>2012-01-08T07:30:36+00:00</updated>
<author>
<name>Jeremy Fitzhardinge</name>
<email>jeremy@goop.org</email>
</author>
<published>2011-12-02T18:04:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=ef5251993c3597a88b893fe22ee830092dff35f9'/>
<id>ef5251993c3597a88b893fe22ee830092dff35f9</id>
<content type='text'>
Signed-off-by: Jeremy Fitzhardinge &lt;jeremy@goop.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Jeremy Fitzhardinge &lt;jeremy@goop.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>hid-input: add support for HID devices reporting Battery Strength</title>
<updated>2012-01-08T07:30:34+00:00</updated>
<author>
<name>Daniel Nicoletti</name>
<email>dantti12@gmail.com</email>
</author>
<published>2011-12-02T05:52:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=c5a92aa3eb7425da68797a820d208edad36551f7'/>
<id>c5a92aa3eb7425da68797a820d208edad36551f7</id>
<content type='text'>
I've sent an email earlier asking for help with a GetFeature code, and now I
have a second patch on top of Jeremy's to provide the battery functionality
for devices that support reporting it.

If I understood correctly when talking to Jeremy he said his device
never actually reported the status as an input event (sorry if I didn't
understand it correctly), and after reading HID specs I believe it's
really because it was meant to be probed, I have an Apple Keyboard and
Magic Trackpad both bluetooth batteries operated, so using PacketLogger
I saw that Mac OSX always ask the battery status using the so called
GetFeature.

What my patch does is basically:
- store the report id that matches the battery_strength
- setup the battery if 0x6.0x20 is found, even if that is reported as a feature
  (as it was meant to be but only the MagicTrackpad does)
- when upower or someone access /sys/class/power_supply/hid-*/capacity it
  will probe the device and return it's status.

It works great for both devices, but I have two concerns:
- the report_features function has a duplicated code
- it would be nice if it was possible for specific drivers to provide their own
  probe as there might be some strange devices... (but maybe it's
already possible)

I've talked to the upower dev and he fixed it to be able to show the
right percentage.

Here how the uevent file (in /sys/class/power_supply/hid-*/) looks like:
POWER_SUPPLY_NAME=hid-00:22:41:D9:18:E7-battery
POWER_SUPPLY_PRESENT=1
POWER_SUPPLY_ONLINE=1
POWER_SUPPLY_CAPACITY=66
POWER_SUPPLY_MODEL_NAME=MacAdmin’s keyboard
POWER_SUPPLY_STATUS=Discharging

POWER_SUPPLY_NAME=hid-70:CD:60:F5:FF:3F-battery
POWER_SUPPLY_PRESENT=1
POWER_SUPPLY_ONLINE=1
POWER_SUPPLY_CAPACITY=62
POWER_SUPPLY_MODEL_NAME=nexx’s Trackpad
POWER_SUPPLY_STATUS=Discharging

Signed-off-by: Daniel Nicoletti &lt;dantti12@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I've sent an email earlier asking for help with a GetFeature code, and now I
have a second patch on top of Jeremy's to provide the battery functionality
for devices that support reporting it.

If I understood correctly when talking to Jeremy he said his device
never actually reported the status as an input event (sorry if I didn't
understand it correctly), and after reading HID specs I believe it's
really because it was meant to be probed, I have an Apple Keyboard and
Magic Trackpad both bluetooth batteries operated, so using PacketLogger
I saw that Mac OSX always ask the battery status using the so called
GetFeature.

What my patch does is basically:
- store the report id that matches the battery_strength
- setup the battery if 0x6.0x20 is found, even if that is reported as a feature
  (as it was meant to be but only the MagicTrackpad does)
- when upower or someone access /sys/class/power_supply/hid-*/capacity it
  will probe the device and return it's status.

It works great for both devices, but I have two concerns:
- the report_features function has a duplicated code
- it would be nice if it was possible for specific drivers to provide their own
  probe as there might be some strange devices... (but maybe it's
already possible)

I've talked to the upower dev and he fixed it to be able to show the
right percentage.

Here how the uevent file (in /sys/class/power_supply/hid-*/) looks like:
POWER_SUPPLY_NAME=hid-00:22:41:D9:18:E7-battery
POWER_SUPPLY_PRESENT=1
POWER_SUPPLY_ONLINE=1
POWER_SUPPLY_CAPACITY=66
POWER_SUPPLY_MODEL_NAME=MacAdmin’s keyboard
POWER_SUPPLY_STATUS=Discharging

POWER_SUPPLY_NAME=hid-70:CD:60:F5:FF:3F-battery
POWER_SUPPLY_PRESENT=1
POWER_SUPPLY_ONLINE=1
POWER_SUPPLY_CAPACITY=62
POWER_SUPPLY_MODEL_NAME=nexx’s Trackpad
POWER_SUPPLY_STATUS=Discharging

Signed-off-by: Daniel Nicoletti &lt;dantti12@gmail.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
