Skip to content

Commit 3f1fe73

Browse files
sjoerdsimonsdtor
authored andcommitted
Input: cros_ec_keyb - add of match table
To enable the cros_ec_keyb driver to be auto-loaded when build as module add an of match table (and export it) to match the modalias information passed on to userspace as the Cros EC MFD driver registers the MFD subdevices with an of_compatibility string. Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk> Reviewed-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent 0224ec9 commit 3f1fe73

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/input/keyboard/cros_ec_keyb.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,10 +348,19 @@ static int cros_ec_keyb_resume(struct device *dev)
348348

349349
static SIMPLE_DEV_PM_OPS(cros_ec_keyb_pm_ops, NULL, cros_ec_keyb_resume);
350350

351+
#ifdef CONFIG_OF
352+
static const struct of_device_id cros_ec_keyb_of_match[] = {
353+
{ .compatible = "google,cros-ec-keyb" },
354+
{},
355+
};
356+
MODULE_DEVICE_TABLE(of, cros_ec_keyb_of_match);
357+
#endif
358+
351359
static struct platform_driver cros_ec_keyb_driver = {
352360
.probe = cros_ec_keyb_probe,
353361
.driver = {
354362
.name = "cros-ec-keyb",
363+
.of_match_table = of_match_ptr(cros_ec_keyb_of_match),
355364
.pm = &cros_ec_keyb_pm_ops,
356365
},
357366
};

0 commit comments

Comments
 (0)