<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/hid/hid-sensor-custom.c, branch v6.12.80</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.80</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.80'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2024-09-03T12:00:05+00:00</updated>
<entry>
<title>HID: hid-sensor-custom: Convert comma to semicolon</title>
<updated>2024-09-03T12:00:05+00:00</updated>
<author>
<name>Chen Ni</name>
<email>nichen@iscas.ac.cn</email>
</author>
<published>2024-09-03T02:50:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d11cfda966c18d8bf4f0e3f6d82a09c0771c955a'/>
<id>urn:sha1:d11cfda966c18d8bf4f0e3f6d82a09c0771c955a</id>
<content type='text'>
Replace a comma between expression statements by a semicolon.

Signed-off-by: Chen Ni &lt;nichen@iscas.ac.cn&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-6.10/plarform-driver-remove-new' into for-linus</title>
<updated>2024-05-14T11:55:14+00:00</updated>
<author>
<name>Jiri Kosina</name>
<email>jkosina@suse.com</email>
</author>
<published>2024-05-14T11:55:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ffff77dd1e1de3122e09811481f643e8ad171a39'/>
<id>urn:sha1:ffff77dd1e1de3122e09811481f643e8ad171a39</id>
<content type='text'>
- conversion of HID device drivers from platform_driver-&gt;remove() to
  platform_driver-&gt;remove_new() (Uwe Kleine-König)
</content>
</entry>
<entry>
<title>HID: hid-sensor-custom: Convert sprintf() family to sysfs_emit() family</title>
<updated>2024-04-03T11:42:04+00:00</updated>
<author>
<name>Li Zhijian</name>
<email>lizhijian@fujitsu.com</email>
</author>
<published>2024-03-19T05:45:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=460560fda31b8d22b7dac0f69965e3626536b5bb'/>
<id>urn:sha1:460560fda31b8d22b7dac0f69965e3626536b5bb</id>
<content type='text'>
Per filesystems/sysfs.rst, show() should only use sysfs_emit()
or sysfs_emit_at() when formatting the value to be returned to user space.

coccinelle complains that there are still a couple of functions that use
snprintf(). Convert them to sysfs_emit().

sprintf() and scnprintf() will be converted as well if they have.

Generally, this patch is generated by
make coccicheck M=&lt;path/to/file&gt; MODE=patch \
COCCI=scripts/coccinelle/api/device_attr_show.cocci

No functional change intended

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
Reviewed-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Signed-off-by: Li Zhijian &lt;lizhijian@fujitsu.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.com&gt;
</content>
</entry>
<entry>
<title>HID: hid-sensor-custom: Convert to platform remove callback returning void</title>
<updated>2024-04-03T11:23:23+00:00</updated>
<author>
<name>Uwe Kleine-König</name>
<email>u.kleine-koenig@pengutronix.de</email>
</author>
<published>2024-03-06T17:50:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=afbc301cc04f986cc54e678981bee1ca41707cf6'/>
<id>urn:sha1:afbc301cc04f986cc54e678981bee1ca41707cf6</id>
<content type='text'>
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Acked-by: Srinivas Pandruvada &lt;srinivas.pandruvada@linux.intel.com&gt;
Reviewed-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.com&gt;
</content>
</entry>
<entry>
<title>HID: hid-sensor-custom: Fix buffer overrun in device name</title>
<updated>2023-03-24T13:09:29+00:00</updated>
<author>
<name>Todd Brandt</name>
<email>todd.e.brandt@intel.com</email>
</author>
<published>2023-03-14T18:12:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/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:55+00:00</updated>
<author>
<name>Jiri Kosina</name>
<email>jkosina@suse.cz</email>
</author>
<published>2023-01-06T14:49:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/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:57+00:00</updated>
<author>
<name>Philipp Jungkamp</name>
<email>p.jungkamp@gmx.net</email>
</author>
<published>2022-11-24T23:38:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/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:57+00:00</updated>
<author>
<name>Philipp Jungkamp</name>
<email>p.jungkamp@gmx.net</email>
</author>
<published>2022-11-24T23:38:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/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:40+00:00</updated>
<author>
<name>Marcus Folkesson</name>
<email>marcus.folkesson@gmail.com</email>
</author>
<published>2022-11-17T12:13:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/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:05+00:00</updated>
<author>
<name>Yauhen Kharuzhy</name>
<email>jekhor@gmail.com</email>
</author>
<published>2022-11-05T22:34:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/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>
</feed>
