<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/drivers/hid/hid-sensor-custom.c, branch linux-6.9.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.9.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.9.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2023-03-24T13:09:29Z</updated>
<entry>
<title>HID: hid-sensor-custom: Fix buffer overrun in device name</title>
<updated>2023-03-24T13:09:29Z</updated>
<author>
<name>Todd Brandt</name>
<email>todd.e.brandt@intel.com</email>
</author>
<published>2023-03-14T18:12:56Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=7c3650a8007c43bc1a60d8bdb4cdbea3ad9a7dd4'/>
<id>urn:sha1:7c3650a8007c43bc1a60d8bdb4cdbea3ad9a7dd4</id>
<content type='text'>
On some platforms there are some platform devices created with
invalid names. For example: "HID-SENSOR-INT-020b?.39.auto" instead
of "HID-SENSOR-INT-020b.39.auto"

This string include some invalid characters, hence it will fail to
properly load the driver which will handle this custom sensor. Also
it is a problem for some user space tools, which parses the device
names from ftrace and dmesg.

This is because the string, real_usage, is not NULL terminated and
printed with %s to form device name.

To address this, initialize the real_usage string with 0s.

Reported-and-tested-by: Todd Brandt &lt;todd.e.brandt@linux.intel.com&gt;
Link: https://bugzilla.kernel.org/show_bug.cgi?id=217169
Fixes: 98c062e82451 ("HID: hid-sensor-custom: Allow more custom iio sensors")
Cc: stable@vger.kernel.org
Suggested-by: Philipp Jungkamp &lt;p.jungkamp@gmx.net&gt;
Signed-off-by: Philipp Jungkamp &lt;p.jungkamp@gmx.net&gt;
Signed-off-by: Todd Brandt &lt;todd.e.brandt@intel.com&gt;
Reviewed-by: Andi Shyti &lt;andi.shyti@kernel.org&gt;
Reviewed-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Acked-by: Srinivas Pandruvada &lt;srinivas.pandruvada@linux.intel.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>HID: hid-sensor-custom: Fix big on-stack allocation in hid_sensor_custom_get_known()</title>
<updated>2023-01-06T14:49:55Z</updated>
<author>
<name>Jiri Kosina</name>
<email>jkosina@suse.cz</email>
</author>
<published>2023-01-06T14:49:55Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=f1f73651a0849c26b735e7cc1543fa650162b51c'/>
<id>urn:sha1:f1f73651a0849c26b735e7cc1543fa650162b51c</id>
<content type='text'>
struct hid_sensor_custom_properties is currently 384 bytes big, which consumes
too much stack space for no good reason. Make it dynamically allocated.

Fixes: 98c062e824519 ("HID: hid-sensor-custom: Allow more custom iio sensors")
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>HID: hid-sensor-custom: Add LISS custom sensors</title>
<updated>2022-12-20T14:24:57Z</updated>
<author>
<name>Philipp Jungkamp</name>
<email>p.jungkamp@gmx.net</email>
</author>
<published>2022-11-24T23:38:39Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=48c79bb0abc0429751c0de6616224f8e4aa891cf'/>
<id>urn:sha1:48c79bb0abc0429751c0de6616224f8e4aa891cf</id>
<content type='text'>
Add the Lenovo Intelligent Sensing Solution (LISS) custom sensors to the
known custom sensors.

Signed-off-by: Philipp Jungkamp &lt;p.jungkamp@gmx.net&gt;
Reviewed-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Acked-by: Srinivas Pandruvada &lt;srinivas.pandruvada@linux.intel.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>HID: hid-sensor-custom: Allow more custom iio sensors</title>
<updated>2022-12-20T14:24:57Z</updated>
<author>
<name>Philipp Jungkamp</name>
<email>p.jungkamp@gmx.net</email>
</author>
<published>2022-11-24T23:38:38Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=98c062e8245199fa9121141a0bf1035dc45ae90e'/>
<id>urn:sha1:98c062e8245199fa9121141a0bf1035dc45ae90e</id>
<content type='text'>
The known LUID table for established/known custom HID sensors was
limited to sensors with "INTEL" as manufacturer. But some vendors such
as Lenovo also include fairly standard iio sensors (e.g. ambient light)
in their custom sensors.

Expand the known custom sensors table by a tag used for the platform
device name and match sensors based on the LUID as well as optionally
on model and manufacturer properties.

Signed-off-by: Philipp Jungkamp &lt;p.jungkamp@gmx.net&gt;
Reviewed-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Acked-by: Srinivas Pandruvada &lt;srinivas.pandruvada@linux.intel.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>HID: hid-sensor-custom: set fixed size for custom attributes</title>
<updated>2022-11-21T21:13:40Z</updated>
<author>
<name>Marcus Folkesson</name>
<email>marcus.folkesson@gmail.com</email>
</author>
<published>2022-11-17T12:13:26Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=9d013910df22de91333a0acc81d1dbb115bd76f6'/>
<id>urn:sha1:9d013910df22de91333a0acc81d1dbb115bd76f6</id>
<content type='text'>
This is no bugfix (so no Fixes: tag is necessary) as it is
taken care of in hid_sensor_custom_add_attributes().

The motivation for this patch is that:
hid_sensor_custom_field.attr_name and
hid_sensor_custom_field.attrs
has the size of HID_CUSTOM_TOTAL_ATTRS and used in same context.

We compare against HID_CUSTOM_TOTAL_ATTRS when
looping through hid_custom_attrs.

We will silent the smatch error:
hid_sensor_custom_add_attributes() error: buffer overflow
'hid_custom_attrs' 8 &lt;= 10

Signed-off-by: Marcus Folkesson &lt;marcus.folkesson@gmail.com&gt;
Acked-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>HID: hid-sensor-custom: Allow more than one hinge angle sensor</title>
<updated>2022-11-14T14:01:05Z</updated>
<author>
<name>Yauhen Kharuzhy</name>
<email>jekhor@gmail.com</email>
</author>
<published>2022-11-05T22:34:22Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=9861a25fc248508c781c18b198436c0a97cb3d99'/>
<id>urn:sha1:9861a25fc248508c781c18b198436c0a97cb3d99</id>
<content type='text'>
Some devices has two sets of accelerometers and the sensor hub exports
two hinge angle 'sensors' based on accelerometer values. To allow more
than one sensor of the same type, use PLATFORM_DEVID_AUTO instead of
PLATFORM_DEVID_NONE when registering platform device for it.

Checked on the Lenovo Yoga Book YB1-X91L tablet.

Signed-off-by: Yauhen Kharuzhy &lt;jekhor@gmail.com&gt;
Reviewed-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Acked-by: Srinivas Pandruvada &lt;srinivas.pandruvada@linux.intel.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>HID: hid-sensor-custom: Process failure of sensor_hub_set_feature()</title>
<updated>2021-05-26T10:36:46Z</updated>
<author>
<name>Srinivas Pandruvada</name>
<email>srinivas.pandruvada@linux.intel.com</email>
</author>
<published>2021-04-15T18:52:32Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=3202f482417cefc0f8fad5aaba6eea00f68141a0'/>
<id>urn:sha1:3202f482417cefc0f8fad5aaba6eea00f68141a0</id>
<content type='text'>
When user modifies a custom feature value and sensor_hub_set_feature()
fails, return error.

Reported-by: Abaci Robot &lt;abaci@linux.alibaba.com&gt;
Signed-off-by: Srinivas Pandruvada &lt;srinivas.pandruvada@linux.intel.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>HID: hid-sensor-custom: Remove unused variable 'ret'</title>
<updated>2021-04-07T16:46:20Z</updated>
<author>
<name>Lee Jones</name>
<email>lee.jones@linaro.org</email>
</author>
<published>2021-03-26T14:34:53Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=dbf104fdd42e49310851fa258ce0493e69dd2221'/>
<id>urn:sha1:dbf104fdd42e49310851fa258ce0493e69dd2221</id>
<content type='text'>
Fixes the following W=1 kernel build warning(s):

 drivers/hid/hid-sensor-custom.c: In function ‘store_value’:
 drivers/hid/hid-sensor-custom.c:400:7: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]

Cc: Jiri Kosina &lt;jikos@kernel.org&gt;
Cc: Jonathan Cameron &lt;jic23@kernel.org&gt;
Cc: Srinivas Pandruvada &lt;srinivas.pandruvada@linux.intel.com&gt;
Cc: Benjamin Tissoires &lt;benjamin.tissoires@redhat.com&gt;
Cc: linux-input@vger.kernel.org
Cc: linux-iio@vger.kernel.org
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
Acked-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Signed-off-by: Benjamin Tissoires &lt;benjamin.tissoires@redhat.com&gt;
</content>
</entry>
<entry>
<title>HID: hid-sensor-custom: Add custom sensor iio support</title>
<updated>2021-01-22T08:52:02Z</updated>
<author>
<name>Ye Xiang</name>
<email>xiang.ye@intel.com</email>
</author>
<published>2020-12-15T05:44:42Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=239319670e2a7c405eeb4b3e7721cf8bf8eef840'/>
<id>urn:sha1:239319670e2a7c405eeb4b3e7721cf8bf8eef840</id>
<content type='text'>
Currently custom sensors properties are not decoded and it is up to
user space to interpret.

Some manufacturers already standardized the meaning of some custom sensors.
They can be presented as a proper IIO sensor. We can identify these sensors
based on manufacturer and serial number property in the report.

This change is identifying hinge sensor when the manufacturer is "INTEL".
This creates a platform device so that a sensor driver can be loaded to
process these sensors.

Signed-off-by: Ye Xiang &lt;xiang.ye@intel.com&gt;
Acked-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
Link: https://lore.kernel.org/r/20201215054444.9324-2-xiang.ye@intel.com
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>HID: hid-sensor-custom: Use scnprintf() for avoiding potential buffer overflow</title>
<updated>2020-03-11T10:58:58Z</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2020-03-11T07:38:24Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=62a1a58039595698f644f560f00105bb4d5f5c7f'/>
<id>urn:sha1:62a1a58039595698f644f560f00105bb4d5f5c7f</id>
<content type='text'>
Since snprintf() returns the would-be-output size instead of the
actual output size, the succeeding calls may go beyond the given
buffer limit.  Fix it by replacing with scnprintf().

Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
</feed>
