Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load soc_button_array module on Surface #23

Open
wants to merge 1 commit into
base: arcadia-x86
Choose a base branch
from

Conversation

FloofyPeachy
Copy link

On Microsoft Surface devices, the power and volume buttons are handled by soc_button_array. The commit enables this functionality in Android by loading the soc_button_array kernel module on startup.

(This is my first commit to Bliss btw, lmk if there's a different place I should push this)

On Microsoft Surface devices, the power and volume buttons are handled by soc_button_array. The commit enables this functionality in Android by loading the soc_button_array kernel module on startup.
@hmtheboy154
Copy link
Member

oh so it didn't load automatically huh

@hmtheboy154
Copy link
Member

Do you want we instead put CONFIG_INPUT_SOC_BUTTON_ARRAY into the kernel so you don't have to load ?

@FloofyPeachy
Copy link
Author

Sure, that will work!!

@jwrdegoede
Copy link

On standard Linux distributions (still learning how Android does things) soc_button_array indeed should autoload if build as a module. It binds to the platform_device the ACPI subsystem creates for it based on the following acpi_device_id-s: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/input/misc/soc_button_array.c#n598

And there is a MODULE_DEVICE_TABLE(acpi, soc_button_acpi_match); line there which causes modalias to be created for all those matches. So on standard Linux udev will call modprobe for the modalias of the platform_device.

So e.g. doing a cat on a modalias file for an involved platform_device will show:

# cat /sys/bus/platform/devices/INT33D3\:00/modalias
acpi:INT33D3:PNP0C60:

and then udev will run modprobe acpi:INT33D3:PNP0C60: which matches one of the modaliases for the module:

# modinfo soc_button_array | grep INT33D3
alias:          acpi*:INT33D3:*

So modprobe will then load soc_button_array. I have no idea if Android even has modprobe, I think it typically has init scripts which hardcode a bunch of insmod commands instead? And if Android does have modprobe I don't know if something is running "modprobe " for all devices with a uevent sysfs attribute like udev does (I believe that Android has its own udev equivalent, right?) .

@jwrdegoede
Copy link

Note if you want to give the above comments a try on Surface devices the soc_button_array driver uses MSHW0028 or MSHW0040 as ACPI Hardware ID (aka HID).

@hmtheboy154
Copy link
Member

So modprobe will then load soc_button_array. I have no idea if Android even has modprobe, I think it typically has init scripts which hardcode a bunch of insmod commands instead? And if Android does have modprobe I don't know if something is running "modprobe " for all devices with a uevent sysfs attribute like udev does (I believe that Android has its own udev equivalent, right?) .

We do have modprobe
https://github.com/BlissOS/platform_system_core/blob/typhoon-x86/toolbox/modprobe.cpp

And we use modalias_handling on ueventd to let it automatically load modules
BlissOS/platform_system_core@db19de3#diff-17392ed5df252d7e6293da185ba9563b642aabb17017cbded41ac62638ee3df3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants