<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/hid/hid-sensor-hub.c, branch linux-7.1.y</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=linux-7.1.y</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=linux-7.1.y'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2026-02-21T09:02:28+00:00</updated>
<entry>
<title>treewide: Replace kmalloc with kmalloc_obj for non-scalar types</title>
<updated>2026-02-21T09:02:28+00:00</updated>
<author>
<name>Kees Cook</name>
<email>kees@kernel.org</email>
</author>
<published>2026-02-21T07:49:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=69050f8d6d075dc01af7a5f2f550a8067510366f'/>
<id>urn:sha1:69050f8d6d075dc01af7a5f2f550a8067510366f</id>
<content type='text'>
This is the result of running the Coccinelle script from
scripts/coccinelle/api/kmalloc_objs.cocci. The script is designed to
avoid scalar types (which need careful case-by-case checking), and
instead replace kmalloc-family calls that allocate struct or union
object instances:

Single allocations:	kmalloc(sizeof(TYPE), ...)
are replaced with:	kmalloc_obj(TYPE, ...)

Array allocations:	kmalloc_array(COUNT, sizeof(TYPE), ...)
are replaced with:	kmalloc_objs(TYPE, COUNT, ...)

Flex array allocations:	kmalloc(struct_size(PTR, FAM, COUNT), ...)
are replaced with:	kmalloc_flex(*PTR, FAM, COUNT, ...)

(where TYPE may also be *VAR)

The resulting allocations no longer return "void *", instead returning
"TYPE *".

Signed-off-by: Kees Cook &lt;kees@kernel.org&gt;
</content>
</entry>
<entry>
<title>HID: hid-sensor-hub: Use pm_ptr instead of #ifdef CONFIG_PM</title>
<updated>2026-01-28T18:23:17+00:00</updated>
<author>
<name>Bastien Nocera</name>
<email>hadess@hadess.net</email>
</author>
<published>2026-01-13T09:24:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b3e5bcffda372bea49555fef4e311687bed439bc'/>
<id>urn:sha1:b3e5bcffda372bea49555fef4e311687bed439bc</id>
<content type='text'>
This increases build coverage and allows to drop an #ifdef.

Signed-off-by: Bastien Nocera &lt;hadess@hadess.net&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.com&gt;
</content>
</entry>
<entry>
<title>HID: hid-sensor-hub: don't use stale platform-data on remove</title>
<updated>2024-12-17T13:14:06+00:00</updated>
<author>
<name>Heiko Stuebner</name>
<email>heiko@sntech.de</email>
</author>
<published>2024-11-07T11:47:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8a5b38c3fd709e8acd2bfdedf66c25e6af759576'/>
<id>urn:sha1:8a5b38c3fd709e8acd2bfdedf66c25e6af759576</id>
<content type='text'>
The hid-sensor-hub creates the individual device structs and transfers them
to the created mfd platform-devices via the platform_data in the mfd_cell.

Before e651a1da442a ("HID: hid-sensor-hub: Allow parallel synchronous reads")
the sensor-hub was managing access centrally, with one "completion" in the
hub's data structure, which needed to be finished on removal at the latest.

The mentioned commit then moved this central management to each hid sensor
device, resulting on a completion in each struct hid_sensor_hub_device.
The remove procedure was adapted to go through all sensor devices and
finish any pending "completion".

What this didn't take into account was, platform_device_add_data() that is
used by mfd_add{_hotplug}_devices() does a kmemdup on the submitted
platform-data. So the data the platform-device gets is a copy of the
original data, meaning that the device worked on a different completion
than what sensor_hub_remove() currently wants to access.

To fix that, use device_for_each_child() to go through each child-device
similar to how mfd_remove_devices() unregisters the devices later and
with that get the live platform_data to finalize the correct completion.

Fixes: e651a1da442a ("HID: hid-sensor-hub: Allow parallel synchronous reads")
Cc: stable@vger.kernel.org
Signed-off-by: Heiko Stuebner &lt;heiko@sntech.de&gt;
Acked-by: Benjamin Tissoires &lt;bentiss@kernel.org&gt;
Acked-by: Srinivas Pandruvada &lt;srinivas.pandruvada@linux.intel.com&gt;
Acked-by: Jiri Kosina &lt;jkosina@suse.com&gt;
Link: https://lore.kernel.org/r/20241107114712.538976-2-heiko@sntech.de
Signed-off-by: Lee Jones &lt;lee@kernel.org&gt;
</content>
</entry>
<entry>
<title>HID: change return type of report_fixup() to const</title>
<updated>2024-08-27T14:29:55+00:00</updated>
<author>
<name>Thomas Weißschuh</name>
<email>linux@weissschuh.net</email>
</author>
<published>2024-08-03T12:34:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=fe73965d078670406acee0218f118c0870d6a58b'/>
<id>urn:sha1:fe73965d078670406acee0218f118c0870d6a58b</id>
<content type='text'>
By allowing the drivers to return a "const *" they can constify their
static report arrays.
This makes it clear to driver authors that the HID core will not modify
those reports and they can be reused for multiple devices.
Furthermore security is slightly improved as those reports are protected
against accidental or malicious modifications.

[bentiss: fixup hid-cougar.c and hid-multitouch.c for latest version of
the master branch]

Signed-off-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt;
Link: https://patch.msgid.link/20240803-hid-const-fixup-v2-6-f53d7a7b29d8@weissschuh.net
Signed-off-by: Benjamin Tissoires &lt;bentiss@kernel.org&gt;
</content>
</entry>
<entry>
<title>HID: sensor-hub: Enable hid core report processing for all devices</title>
<updated>2023-12-22T18:16:33+00:00</updated>
<author>
<name>Yauhen Kharuzhy</name>
<email>jekhor@gmail.com</email>
</author>
<published>2023-12-19T23:15:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8e2f79f41a5d1b1a4a53ec524eb7609ca89f3c65'/>
<id>urn:sha1:8e2f79f41a5d1b1a4a53ec524eb7609ca89f3c65</id>
<content type='text'>
After the commit 666cf30a589a ("HID: sensor-hub: Allow multi-function
sensor devices") hub devices are claimed by hidraw driver in hid_connect().
This causes stoppping of processing HID reports by hid core due to
optimization.

In such case, the hid-sensor-custom driver cannot match a known custom
sensor in hid_sensor_custom_get_known() because it try to check custom
properties which weren't filled from the report because hid core didn't
parsed it.

As result, custom sensors like hinge angle sensor and LISS sensors
don't work.

Mark the sensor hub devices claimed by some driver to avoid hidraw-related
optimizations.

Fixes: 666cf30a589a ("HID: sensor-hub: Allow multi-function sensor devices")
Cc: stable@vger.kernel.org
Signed-off-by: Yauhen Kharuzhy &lt;jekhor@gmail.com&gt;
Tested-by: Daniel Thompson &lt;daniel.thompson@linaro.org&gt;
Acked-by: Srinivas Pandruvada &lt;srinivas.pandruvada@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20231219231503.1506801-1-jekhor@gmail.com
Signed-off-by: Benjamin Tissoires &lt;bentiss@kernel.org&gt;
</content>
</entry>
<entry>
<title>HID: sensor-hub: Allow multi-function sensor devices</title>
<updated>2023-08-14T09:12:56+00:00</updated>
<author>
<name>Daniel Thompson</name>
<email>daniel.thompson@linaro.org</email>
</author>
<published>2023-05-28T09:24:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=666cf30a589a00d89c3775e27a698a2370cbe3db'/>
<id>urn:sha1:666cf30a589a00d89c3775e27a698a2370cbe3db</id>
<content type='text'>
The Lenovo Yoga C630 has a combined keyboard and accelerometer that
interfaces via i2c-hid. Currently this laptop either has a working
keyboard (if CONFIG_HID_SENSOR_HUB is disabled) or a working accelerometer.
only works on kernels. Put another way, most distro kernels enable
CONFIG_HID_SENSOR_HUB and therefore cannot work on this device since the
keyboard doesn't work!

Fix this by providing a richer connect mask during the probe. With this
change both keyboard and screen orientation sensors work correctly.

Signed-off-by: Daniel Thompson &lt;daniel.thompson@linaro.org&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: Recognize sensors with application collections</title>
<updated>2023-01-18T08:53:12+00:00</updated>
<author>
<name>Ronald Tschalär</name>
<email>ronald@innovation.ch</email>
</author>
<published>2023-01-11T10:07:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e04955db6a7c3fc4a1e6978649b61a6f5f8028e3'/>
<id>urn:sha1:e04955db6a7c3fc4a1e6978649b61a6f5f8028e3</id>
<content type='text'>
According to HUTRR39 logical sensor devices may be nested inside
physical collections or may be specified in multiple top-level
application collections (see page 59, strategies 1 and 2). However,
the current code was only recognizing those with physical collections.

This issue turned up in the T2 MacBook Pros which define the ALS in
a top-level application collection.

Signed-off-by: Ronald Tschalär &lt;ronald@innovation.ch&gt;
Signed-off-by: Aditya Garg &lt;gargaditya08@live.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-hub: Return error for hid_set_field() failure</title>
<updated>2021-05-05T12:36:18+00:00</updated>
<author>
<name>Srinivas Pandruvada</name>
<email>srinivas.pandruvada@linux.intel.com</email>
</author>
<published>2021-04-15T18:52:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=edb032033da0dc850f6e7740fa1023c73195bc89'/>
<id>urn:sha1:edb032033da0dc850f6e7740fa1023c73195bc89</id>
<content type='text'>
In the function sensor_hub_set_feature(), return error when hid_set_field()
fails.

Signed-off-by: Srinivas Pandruvada &lt;srinivas.pandruvada@linux.intel.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-hub: Move 'hsdev' description to correct struct definition</title>
<updated>2021-04-07T16:46:21+00:00</updated>
<author>
<name>Lee Jones</name>
<email>lee.jones@linaro.org</email>
</author>
<published>2021-03-26T14:34:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ff0e9ee3a6d40c8a1c6e19ea8620ef94816eb51c'/>
<id>urn:sha1:ff0e9ee3a6d40c8a1c6e19ea8620ef94816eb51c</id>
<content type='text'>
Fixes the following W=1 kernel build warning(s):

 drivers/hid/hid-sensor-hub.c:54: warning: Function parameter or member 'hsdev' not described in 'hid_sensor_hub_callbacks_list'

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-hub: Remove unused struct member 'quirks'</title>
<updated>2021-04-07T16:46:20+00:00</updated>
<author>
<name>Lee Jones</name>
<email>lee.jones@linaro.org</email>
</author>
<published>2021-03-26T14:34:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=07b34ddd759b7b1580eee6fd754dec824a280f0d'/>
<id>urn:sha1:07b34ddd759b7b1580eee6fd754dec824a280f0d</id>
<content type='text'>
Commit b0f847e16c1ea ("HID: hid-sensor-hub: Force logical minimum to 1
for power and report state") removed the last used quirk handled by
this driver.

Fixes the following W=1 kernel build warning(s):

 drivers/hid/hid-sensor-hub.c:39: warning: Function parameter or member 'quirks' not described in 'sensor_hub_data'

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>
</feed>
