<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/drivers/hid/hid-magicmouse.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-12-27T11:08:45Z</updated>
<entry>
<title>HID: magicmouse: fix kerneldoc for struct magicmouse_sc</title>
<updated>2023-12-27T11:08:45Z</updated>
<author>
<name>Jiri Kosina</name>
<email>jkosina@suse.com</email>
</author>
<published>2023-12-27T11:08:45Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=b0a1fe4610de5761a66de0e43540fc3d59638402'/>
<id>urn:sha1:b0a1fe4610de5761a66de0e43540fc3d59638402</id>
<content type='text'>
Description for hdev, work and battery_timer of struct magicmouse_sc were
missing. Fix that.

Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Closes: https://lore.kernel.org/oe-kbuild-all/202312261056.AmFPDIL5-lkp@intel.com/
Signed-off-by: Jiri Kosina &lt;jkosina@suse.com&gt;
</content>
</entry>
<entry>
<title>HID: magicmouse: Do not set BTN_MOUSE on double report</title>
<updated>2022-10-14T09:47:50Z</updated>
<author>
<name>José Expósito</name>
<email>jose.exposito89@gmail.com</email>
</author>
<published>2022-10-09T18:27:47Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=bb5f0c855dcfc893ae5ed90e4c646bde9e4498bf'/>
<id>urn:sha1:bb5f0c855dcfc893ae5ed90e4c646bde9e4498bf</id>
<content type='text'>
Under certain conditions the Magic Trackpad can group 2 reports in a
single packet. The packet is split and the raw event function is
invoked recursively for each part.

However, after processing each part, the BTN_MOUSE status is updated,
sending multiple click events. [1]

Return after processing double reports to avoid this issue.

Link: https://gitlab.freedesktop.org/libinput/libinput/-/issues/811  # [1]
Fixes: a462230e16ac ("HID: magicmouse: enable Magic Trackpad support")
Reported-by: Nulo &lt;git@nulo.in&gt;
Signed-off-by: José Expósito &lt;jose.exposito89@gmail.com&gt;
Signed-off-by: Benjamin Tissoires &lt;benjamin.tissoires@redhat.com&gt;
Link: https://lore.kernel.org/r/20221009182747.90730-1-jose.exposito89@gmail.com
</content>
</entry>
<entry>
<title>Merge branch 'for-5.17/magicmouse' into for-linus</title>
<updated>2022-01-10T08:58:34Z</updated>
<author>
<name>Jiri Kosina</name>
<email>jkosina@suse.cz</email>
</author>
<published>2022-01-10T08:58:34Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=f7716563441ae29cc91954a7744ff7bfdd344b2d'/>
<id>urn:sha1:f7716563441ae29cc91954a7744ff7bfdd344b2d</id>
<content type='text'>
- proper batter reporting for hid-magicmouse USB-connected devices (José Expósito)
</content>
</entry>
<entry>
<title>Merge branch 'for-5.17/apple' into for-linus</title>
<updated>2022-01-10T08:54:31Z</updated>
<author>
<name>Jiri Kosina</name>
<email>jkosina@suse.cz</email>
</author>
<published>2022-01-10T08:54:31Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=fce0d275843712db6f9b611856f539da29ad5529'/>
<id>urn:sha1:fce0d275843712db6f9b611856f539da29ad5529</id>
<content type='text'>
- Apple Magic Keyboard support improvements (José Expósito, Alex Henrie,
  Benjamin Berg)
</content>
</entry>
<entry>
<title>HID: magicmouse: Fix an error handling path in magicmouse_probe()</title>
<updated>2022-01-06T14:39:55Z</updated>
<author>
<name>Christophe JAILLET</name>
<email>christophe.jaillet@wanadoo.fr</email>
</author>
<published>2021-12-28T21:09:17Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=33812fc7c8d77a43b7e2bf36a0d5a57c277a4b0c'/>
<id>urn:sha1:33812fc7c8d77a43b7e2bf36a0d5a57c277a4b0c</id>
<content type='text'>
If the timer introduced by the commit below is started, then it must be
deleted in the error handling of the probe. Otherwise it would trigger
once the driver is no more.

Fixes: 0b91b4e4dae6 ("HID: magicmouse: Report battery level over USB")
Signed-off-by: Christophe JAILLET &lt;christophe.jaillet@wanadoo.fr&gt;
Tested-by: José Expósito &lt;jose.exposito89@gmail.com&gt;
Reported-by: &lt;syzbot+a437546ec71b04dfb5ac@syzkaller.appspotmail.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>HID: magicmouse: set Magic Trackpad 2021 name</title>
<updated>2022-01-06T12:58:29Z</updated>
<author>
<name>José Expósito</name>
<email>jose.exposito89@gmail.com</email>
</author>
<published>2021-12-12T18:21:00Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=5768701edcb7d7ff8abaa085996a5c1cb30d765e'/>
<id>urn:sha1:5768701edcb7d7ff8abaa085996a5c1cb30d765e</id>
<content type='text'>
The Apple Magic Trackpad 2021 (3rd generation) has the same product ID
as the 2nd generation. However, when connected through Bluetooth, the
version has changed from 0x107 to 0x110.

The other meaningful change is that the name has dropped the generation
number and now it is just "Apple Inc. Magic Trackpad", like the first
generation model.

Set the device name correctly to ensure the same driver settings are
loaded, whether connected via Bluetooth or USB.

Signed-off-by: José Expósito &lt;jose.exposito89@gmail.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>HID: magicmouse: set device name when it has been personalized</title>
<updated>2022-01-06T12:58:28Z</updated>
<author>
<name>José Expósito</name>
<email>jose.exposito89@gmail.com</email>
</author>
<published>2021-12-12T18:20:59Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=0aa45fcc42d82753a257abbc7138922d8250e06f'/>
<id>urn:sha1:0aa45fcc42d82753a257abbc7138922d8250e06f</id>
<content type='text'>
If the Apple Magic Trackpad 2 has been connected to a Mac, the name
is automatically personalized showing its owner name. For example:
"José Expósito's Trackpad".

When connected through Bluetooth, the personalized name is reported,
however, when connected through USB the generic name is reported.

Set the device name correctly to ensure the same driver settings are
loaded, whether connected via Bluetooth or USB.

Signed-off-by: José Expósito &lt;jose.exposito89@gmail.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>HID: magicmouse: Report battery level over USB</title>
<updated>2021-11-19T15:01:39Z</updated>
<author>
<name>José Expósito</name>
<email>jose.exposito89@gmail.com</email>
</author>
<published>2021-11-18T16:52:08Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=0b91b4e4dae63cd43871fc2012370b86ee588f91'/>
<id>urn:sha1:0b91b4e4dae63cd43871fc2012370b86ee588f91</id>
<content type='text'>
When connected over USB, the Apple Magic Mouse 2 and the Apple Magic
Trackpad 2 register multiple interfaces, one of them is used to report
the battery level.

However, unlike when connected over Bluetooth, the battery level is not
reported automatically and it is required to fetch it manually.

Fix the battery report descriptor and add a timer to fetch the battery
level.

Signed-off-by: José Expósito &lt;jose.exposito89@gmail.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>HID: magicmouse: prevent division by 0 on scroll</title>
<updated>2021-11-19T14:54:31Z</updated>
<author>
<name>Claudia Pellegrino</name>
<email>linux@cpellegrino.de</email>
</author>
<published>2021-11-14T02:53:27Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=a1091118e0d6d84c2fdb94e6c397ac790bfb9dd6'/>
<id>urn:sha1:a1091118e0d6d84c2fdb94e6c397ac790bfb9dd6</id>
<content type='text'>
In hid_magicmouse, if the user has set scroll_speed to a value between
55 and 63 and scrolls seven times in quick succession, the
step_hr variable in the magicmouse_emit_touch function becomes 0.

That causes a division by zero further down in the function when
it does `step_x_hr /= step_hr`.

To reproduce, create `/etc/modprobe.d/hid_magicmouse.conf` with the
following content:

```
options hid_magicmouse scroll_acceleration=1 scroll_speed=55
```

Then reboot, connect a Magic Mouse and scroll seven times quickly.
The system will freeze for a minute, and after that `dmesg` will
confirm that a division by zero occurred.

Enforce a minimum of 1 for the variable so the high resolution
step count can never reach 0 even at maximum scroll acceleration.

Fixes: d4b9f10a0eb6 ("HID: magicmouse: enable high-resolution scroll")

Signed-off-by: Claudia Pellegrino &lt;linux@cpellegrino.de&gt;
Tested-by: José Expósito &lt;jose.exposito89@gmail.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>HID: magicmouse: high-resolution scroll threshold</title>
<updated>2021-07-15T19:16:39Z</updated>
<author>
<name>José Expósito</name>
<email>jose.exposito89@gmail.com</email>
</author>
<published>2021-07-07T15:58:22Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=9d60648c607a2bfeef5e563e49de5d2e1b7a639a'/>
<id>urn:sha1:9d60648c607a2bfeef5e563e49de5d2e1b7a639a</id>
<content type='text'>
In order to avoid triggering involuntary high-resolution scroll events
due to tiny touch movement deltas, add a movement threshold.

The value chosen for the threshold, about 1.5 ~ 2 mm, is similar to the
threshold used on touchpads by libinput (see libinput
evdev-mt-touchpad-gestures.c) to try to keep the scroll experience
consistent.

Signed-off-by: José Expósito &lt;jose.exposito89@gmail.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
</feed>
