Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torvalds/linux.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2021-12-30 02:14:28 +0300
committerHans de Goede <hdegoede@redhat.com>2022-01-05 13:31:19 +0300
commitf08aebe9af935422ec58ff3003eda4dfb91d2dd2 (patch)
tree6f8c12974b4b2b2cd829548f86f6b02b42cbd2bb /drivers/platform
parentef2ac11493e24f6c5ad850761aab39a9095010fe (diff)
platform/x86: x86-android-tablets: Add support for preloading modules
Since the x86-android-tablets code does all it work from module_init() it cannot use -EPROBE_DEFER to wait for e.g. interrupt providing GPIO-chips or PMIC-cells to show up. To make sure things will still work when some necessary resource providers are build as module allow the per board info to specify a list of modules to pre-load before instantiating the I2C clients. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20211229231431.437982-10-hdegoede@redhat.com
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/x86-android-tablets.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/platform/x86/x86-android-tablets.c b/drivers/platform/x86/x86-android-tablets.c
index 0b521e4671aa..3c01c8607c26 100644
--- a/drivers/platform/x86/x86-android-tablets.c
+++ b/drivers/platform/x86/x86-android-tablets.c
@@ -142,6 +142,7 @@ struct x86_serdev_info {
};
struct x86_dev_info {
+ const char * const *modules;
struct gpiod_lookup_table **gpiod_lookup_tables;
const struct x86_i2c_client_info *i2c_client_info;
const struct platform_device_info *pdev_info;
@@ -428,6 +429,13 @@ static __init int x86_android_tablet_init(void)
dev_info = id->driver_data;
+ /*
+ * Since this runs from module_init() it cannot use -EPROBE_DEFER,
+ * instead pre-load any modules which are listed as requirements.
+ */
+ for (i = 0; dev_info->modules && dev_info->modules[i]; i++)
+ request_module(dev_info->modules[i]);
+
gpiod_lookup_tables = dev_info->gpiod_lookup_tables;
for (i = 0; gpiod_lookup_tables && gpiod_lookup_tables[i]; i++)
gpiod_add_lookup_table(gpiod_lookup_tables[i]);