mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
Second round of IIO fixes for the 3.13 cycle.
2 fixes here. * The gp2ap020a00f is a simple missing kconfig dependency. * The hid sensors hub fix is a work around for an issue introduced by hardware changes due to a certain large software vendor having an 'interesting' interpretation of the specification and hence indexing some arrays from 1 rather than 0. The fix takes advantage of the logical min and max reading facilities introduced by the precursor patch to figure out whether we have a 0 indexed or 1 indexed device and to adjust appropriately. It also drops a previous kconfig option that allowed this issue to be worked around at build time. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAABAgAGBQJSnkM1AAoJEFSFNJnE9BaIV/0P/26YRyWfInekegDN9nviEMno bBZIQy1iuiZOSqw78XdiN4NBfK3Vy4F/cx+yGkr2fVa6NV/B6p3iL0+Pv4HiZSqs VY4TlNs5el7GD399+nOatgCAM6NXvkSE9rOAEdNWgWUupy/XVRx6nCpghRltnmu3 mSZCywSnHuCCj2TG9Q/FVjMp3GR3GboSnF09Q/8Xxt7HNj2poxAuYCcMGl9SYgDw gfaKsmGZk488H5CA2FjIWQ5/5vOTCxoPr5MgTjqfpLD2tB5+ZsdMmDacsEa31nZS RHKzLDvYuAlBeaeR/FUeB5S6YgZpB0MulNsF2z2ms99mSmmjWTr1qun5cdMIh9su OBKtmew9MnXWlP6yxSVNTvmPbGHSzzb9x2grvptPN6x/08Qk/Sv0qJcmb267Vr0u EwqjSqIDdMOTfhlltpWeIF3+6bHj7RTrVfXvNi+plAKx1gp8/2pYZAp05eNHO6tD ITyOCiL7O1KNcG5si+EI5EdCqWj9Dmdul16gHFafPohDJWiCNo/aLhb3jQKZWZyA JnM6DENEmdicHeYuQKaBV95ptLdzAU9POapJzMMMQVNY5RS6DnHPBVCAuqrkdzAo 57FT5dewm6FI2+k+ckawtUgyf56nCzsbEHo3iFaHn0ElxWJeR8/Acn/jR6Agm1AN DGNgavLLU3kFN9lHjPk3 =BgVg -----END PGP SIGNATURE----- Merge tag 'iio-fixes-for-3.13b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus Jonathan writes: Second round of IIO fixes for the 3.13 cycle. 2 fixes here. * The gp2ap020a00f is a simple missing kconfig dependency. * The hid sensors hub fix is a work around for an issue introduced by hardware changes due to a certain large software vendor having an 'interesting' interpretation of the specification and hence indexing some arrays from 1 rather than 0. The fix takes advantage of the logical min and max reading facilities introduced by the precursor patch to figure out whether we have a 0 indexed or 1 indexed device and to adjust appropriately. It also drops a previous kconfig option that allowed this issue to be worked around at build time.
This commit is contained in:
commit
55ef003e4a
6 changed files with 38 additions and 26 deletions
|
|
@ -112,13 +112,15 @@ static int sensor_hub_get_physical_device_count(
|
|||
|
||||
static void sensor_hub_fill_attr_info(
|
||||
struct hid_sensor_hub_attribute_info *info,
|
||||
s32 index, s32 report_id, s32 units, s32 unit_expo, s32 size)
|
||||
s32 index, s32 report_id, struct hid_field *field)
|
||||
{
|
||||
info->index = index;
|
||||
info->report_id = report_id;
|
||||
info->units = units;
|
||||
info->unit_expo = unit_expo;
|
||||
info->size = size/8;
|
||||
info->units = field->unit;
|
||||
info->unit_expo = field->unit_exponent;
|
||||
info->size = (field->report_size * field->report_count)/8;
|
||||
info->logical_minimum = field->logical_minimum;
|
||||
info->logical_maximum = field->logical_maximum;
|
||||
}
|
||||
|
||||
static struct hid_sensor_hub_callbacks *sensor_hub_get_callback(
|
||||
|
|
@ -325,9 +327,7 @@ int sensor_hub_input_get_attribute_info(struct hid_sensor_hub_device *hsdev,
|
|||
if (field->physical == usage_id &&
|
||||
field->logical == attr_usage_id) {
|
||||
sensor_hub_fill_attr_info(info, i, report->id,
|
||||
field->unit, field->unit_exponent,
|
||||
field->report_size *
|
||||
field->report_count);
|
||||
field);
|
||||
ret = 0;
|
||||
} else {
|
||||
for (j = 0; j < field->maxusage; ++j) {
|
||||
|
|
@ -336,11 +336,7 @@ int sensor_hub_input_get_attribute_info(struct hid_sensor_hub_device *hsdev,
|
|||
field->usage[j].collection_index ==
|
||||
collection_index) {
|
||||
sensor_hub_fill_attr_info(info,
|
||||
i, report->id,
|
||||
field->unit,
|
||||
field->unit_exponent,
|
||||
field->report_size *
|
||||
field->report_count);
|
||||
i, report->id, field);
|
||||
ret = 0;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue