input: max77650-onkey: add of_match table
Subsystems (3)
PATCH 1/1 input: max77650-onkey: add of_match table
From: Bartosz Golaszewski <[email protected]>
We need the of_match table if we want to use the compatible string in the pmic's child node and get the onkey driver loaded automatically.
--- drivers/input/misc/max77650-onkey.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/input/misc/max77650-onkey.c +7 -0
@@ -108,9 +108,16 @@ static int max77650_onkey_probe(struct platform_device *pdev)return input_register_device (onkey->input); } +static const struct of_device_id max77650_onkey_of_match[] = { + { .compatible ="maxim,max77650-onkey" }, + { } +}; +MODULE_DEVICE_TABLE (of, max77650_onkey_of_match); +static struct platform_driver max77650_onkey_driver = { .driver = { .name ="max77650-onkey" , + .of_match_table = max77650_onkey_of_match, }, .probe = max77650_onkey_probe, };
Signature · 1 line
2.23.0
wt., 10 gru 2019 o 11:08 Bartosz Golaszewski <[email protected]> napisał(a):
Quoted 7 lines
From: Bartosz Golaszewski <[email protected]>
We need the
of_matchtable if we want to use the compatible string in the pmic's child node and get the onkey driver loaded automatically.Signed-off-by Bartosz Golaszewski <[email protected]>
Gentle ping.
Bart
pt., 3 sty 2020 o 14:12 Bartosz Golaszewski <[email protected]> napisał(a):
Quoted 5 lines
wt., 10 gru 2019 o 11:08 Bartosz Golaszewski <[email protected]> napisał(a):
Quoted 3 lines
From: Bartosz Golaszewski <[email protected]>
Quoted 8 lines
Quoted 4 lines
We need the
of_matchtable if we want to use the compatible string in the pmic's child node and get the onkey driver loaded automatically.Signed-off-by Bartosz Golaszewski <[email protected]>Gentle ping.
Bart
Another week, another ping.
Cheers,
Bart
Dmitry Torokhov
maintainerQuoted 4 lines · Bartosz Golaszewski
From: Bartosz Golaszewski <[email protected]>
We need the
of_matchtable if we want to use the compatible string in the pmic's child node and get the onkey driver loaded automatically.
Do we really need of_match table or adding
MODULE_ALIAS("platform:max77650-onkey");
will work as well?
In general, do we ever instantiate onkey portion from device tree? Or is it always an MFD cell that is instantiated unconditionally?
Quoted 30 lines
Signed-off-by Bartosz Golaszewski <[email protected]>--- drivers/input/misc/max77650-onkey.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/input/misc/max77650-onkey.c +7
-0@@ -108,9 +108,16 @@ static int max77650_onkey_probe(struct platform_device *pdev)return input_register_device (onkey->input); } +static const struct of_device_id max77650_onkey_of_match[] = { + { .compatible ="maxim,max77650-onkey" }, + { } +}; +MODULE_DEVICE_TABLE (of, max77650_onkey_of_match); +static struct platform_driver max77650_onkey_driver = { .driver = { .name ="max77650-onkey" , + .of_match_table = max77650_onkey_of_match, }, .probe = max77650_onkey_probe, };Signature · 1 line
2.23.0
Thanks.
Signature · 1 line
Dmitry
pt., 10 sty 2020 o 19:28 Dmitry Torokhov <[email protected]> napisał(a):
Quoted 9 lines · Bartosz Golaszewski
Quoted 4 lines
From: Bartosz Golaszewski <[email protected]>
We need the
of_matchtable if we want to use the compatible string in the pmic's child node and get the onkey driver loaded automatically.Do we really need
of_matchtable or adding
Not really. Technically not anyway but we merged bindings that define it (at the time I didn't know any better) and seems we're stuck with it. Please see the discussion below a similar patch for regulator subsystem[1].
Quoted 2 lines
MODULE_ALIAS("platform:max77650-onkey");
This is already in there, but if someone defines the compatible in the device tree as per bindings, the module won't be loaded despite the MODULE_ALIAS() definition.
Quoted 5 lines
will work as well?
In general, do we ever instantiate onkey portion from device tree? Or is it always an MFD cell that is instantiated unconditionally?
Bart
Dmitry Torokhov
maintainerQuoted 16 lines · Bartosz Golaszewski
pt., 10 sty 2020 o 19:28 Dmitry Torokhov <[email protected]> napisał(a):
Quoted 9 lines · Bartosz Golaszewski
Quoted 4 lines
From: Bartosz Golaszewski <[email protected]>
We need the
of_matchtable if we want to use the compatible string in the pmic's child node and get the onkey driver loaded automatically.Do we really need
of_matchtable or addingNot really. Technically not anyway but we merged bindings that define it (at the time I didn't know any better) and seems we're stuck with it. Please see the discussion below a similar patch for regulator subsystem[1].
Quoted 6 lines
Quoted 2 lines
MODULE_ALIAS("platform:max77650-onkey");This is already in there, but if someone defines the compatible in the device tree as per bindings, the module won't be loaded despite the
MODULE_ALIAS()definition.
I see. Applied, thank you.
Signature · 1 line
Dmitry