Skip to contentSkip to conversation

input: max77650-onkey: add of_match table

PATCH In review Bartosz Golaszewski 2 participants 6 messages Dec 10, 2019 – Jan 17, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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
index 4d875f2ac13d..ee55f22dbca5 100644
@@ -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
#2 lore raw

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_match table if we want to use the compatible string in the pmic's child node and get the onkey driver loaded automatically.

Gentle ping.

Bart

Another week, another ping.

Cheers,
Bart

maintainer
#3 lore raw
In reply to Bartosz Golaszewski
Quoted 4 lines · Bartosz Golaszewski

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.

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
---
 drivers/input/misc/max77650-onkey.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/input/misc/max77650-onkey.c +7 -0
index 4d875f2ac13d..ee55f22dbca5 100644
@@ -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
#4 lore raw

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_match table 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

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

[1] https://lkml.org/lkml/2019/12/10/271

maintainer
#5 lore raw
Quoted 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_match table 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

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 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