AMD Hopes To Get Sensor Fusion Hub Driver For AMD Laptop Gyroscopes And Other Sensors Into Linux 5.10

From LinuxReviews
Jump to navigationJump to search

AMD's Sandeep Singh has submitted yet another revision of AMD's Linux HID driver for the Sensor Fusion Hub hardware in all AMD laptops based on Ryzen processors. That makes it eight in total. This could be the lucky revision that makes it into the Linux kernel when the Linux 5.10 merge window opens up on Monday.

written by 林慧 (Wai Lin) 2020-10-11 - last edited 2020-10-11. © CC BY

Clicking on this image opens a 9272×3610 pixel large 2.04 MiB version of it.

Blender developer and freelance graphic designer Luya Tshimbalanga from Coolest Storm Design asked AMD this simple question on January third, 2019:

"Some touchscreen laptops, notably from HP, have an accelerometer based on AMD Sensor Fusion Hub which does not have a driver for Linux kernel needed for auto rotation of screen.


Would you mind providing a functional driver for AMD Sensor Fusion Hub or at least the information of that device for AMD users running on your hardware?"

AMD's Sandeep Singh, Senior Software Development Engineer at AMD Bengaluru, Karnataka, India, would no mind providing a functional driver for the AMD Sensor Fusion Hub. He submitted a patch-set titled "SFH: Add Support for AMD Sensor Fusion Hub to the Linux Kernel Mailing List on January 9th, 2020 - one year after Luya Tshimbalanga's request. That patch-set was ignored. So he tried again with a v2. It was also flat out ignored.

Sandeep Singh did not give up. He fixed and polished his patch-set and re-submitted a v3. That version was rejected by RedHat's Benjamin Tissoires on the grounds that:

"It's adding a kernel API for no gain, and we should already have the debug API available in the various subsystems involved."

The fourth revision of the Fusion Hub Driver was rejected by Intel's Linux driver engineer Andy Shevchenko who pointed out a long list of issues and concluded that "it requires a bit of work".

AMD's Sandeep Singh didn't give up after being absolutely crushed by the competitions Linux driver engineer. He optimistically submitted a fifth revision with hopes that this would be the one. Andy Shevchenko had several objections and Sandeep Singh had to go back to the drawing board.

Revision six was rejected by Randy Dunlap, Andy Shevchenko and the kernel test robot.

Revision seven was rejected by Randy Dunlap on the grounds that the documentation wasn't formatted correctly, Intel's Andy Shevchenko had some additional objections and Marco Felsch from Pengutronix objected on several grounds including amd_start_sensor() and amd_stop_sensor() having completely different APIs, the patch not being self-contained, problems with indentation and missing whitespaces and:

> +/* SFH Command register */
> +union sfh_cmd_base {
> +	u32 ul;
> +	struct {
> +		u32 cmd_id : 8;
> +		u32 sensor_id : 8;
> +		u32 period : 16;
> +	} s;
> +};
Why not just:
struct sfh_cmd_base {
	u8 cmd_id;
	u8 sensor_id;
	u16 period;
Please use the native data types. Furthermore the code in this driver
assumes that the host(x86) and client(ARM) are using the same
byte-order. I know that ARM is LE too but maybe this changes on newer

And that brings us to the eight revision of the AMD Sensor Fusion HUB driver submitted to the Linux Kernel Mailing List on October 10th, 2020 - two days before the Linux 5.10 merge window opens.

It is possible that the eight revision will be the lucky revision that makes it. It could be merged into Linux 5.10 and finally let Blender developer Luya Tshimbalanga use the auto-rotate screen functionality on his HP laptop almost two years after he got it. There is, of course, a chance that the eight revision gets rejected on additional grounds.. but that won't be the end of it. If there's anything to learn from this it's that AMD's Senior Software Development Engineer Sandeep Singh isn't someone who just packs it in and gives up if a patch or seven gets rejected. The AMD Sensor Fusion Hub driver will make it into the Linux kernel - if not this round then perhaps the next..

(3 votes)

Add your comment
LinuxReviews welcomes all comments. If you do not want to be anonymous, register or log in. It is free.