linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/3] Input: silead - Add OF device ID table
@ 2017-02-22 14:40 Javier Martinez Canillas
  2017-02-22 14:40 ` [PATCH v2 2/3] Input: synaptics_i2c " Javier Martinez Canillas
  2017-02-22 14:40 ` [PATCH v2 3/3] Input: qt1070 " Javier Martinez Canillas
  0 siblings, 2 replies; 6+ messages in thread
From: Javier Martinez Canillas @ 2017-02-22 14:40 UTC (permalink / raw)
  To: linux-kernel
  Cc: Javier Martinez Canillas, Hans de Goede, platform-driver-x86,
	Dmitry Torokhov, linux-input

The driver doesn't have a struct of_device_id table but supported devices
are registered via Device Trees. This is working on the assumption that a
I2C device registered via OF will always match a legacy I2C device ID and
that the MODALIAS reported will always be of the form i2c:<device>.

But this could change in the future so the correct approach is to have an
OF device ID table if the devices are registered via OF.

As pointed by Hans de Goede, there's no mssl1680 and this is just used in
some ACPI systems to identify the gsl1680 chip. So isn't included in the
OF device ID table since a DT should use the proper device name instead.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>

---

Changes in v2:
- Remove the mssl1680 entry from the OF device ID table (Hans de Goede).

 drivers/input/touchscreen/silead.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/input/touchscreen/silead.c b/drivers/input/touchscreen/silead.c
index 404830a4a366..813dd68a5c82 100644
--- a/drivers/input/touchscreen/silead.c
+++ b/drivers/input/touchscreen/silead.c
@@ -580,12 +580,25 @@ static const struct acpi_device_id silead_ts_acpi_match[] = {
 MODULE_DEVICE_TABLE(acpi, silead_ts_acpi_match);
 #endif
 
+#ifdef CONFIG_OF
+static const struct of_device_id silead_ts_of_match[] = {
+	{ .compatible = "silead,gsl1680" },
+	{ .compatible = "silead,gsl1688" },
+	{ .compatible = "silead,gsl3670" },
+	{ .compatible = "silead,gsl3675" },
+	{ .compatible = "silead,gsl3692" },
+	{ },
+};
+MODULE_DEVICE_TABLE(of, silead_ts_of_match);
+#endif
+
 static struct i2c_driver silead_ts_driver = {
 	.probe = silead_ts_probe,
 	.id_table = silead_ts_id,
 	.driver = {
 		.name = SILEAD_TS_NAME,
 		.acpi_match_table = ACPI_PTR(silead_ts_acpi_match),
+		.of_match_table = of_match_ptr(silead_ts_of_match),
 		.pm = &silead_ts_pm,
 	},
 };
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2 2/3] Input: synaptics_i2c - Add OF device ID table
  2017-02-22 14:40 [PATCH v2 1/3] Input: silead - Add OF device ID table Javier Martinez Canillas
@ 2017-02-22 14:40 ` Javier Martinez Canillas
  2017-02-22 14:40 ` [PATCH v2 3/3] Input: qt1070 " Javier Martinez Canillas
  1 sibling, 0 replies; 6+ messages in thread
From: Javier Martinez Canillas @ 2017-02-22 14:40 UTC (permalink / raw)
  To: linux-kernel
  Cc: Javier Martinez Canillas, Igor Grinberg, Aniroop Mathur,
	Dmitry Torokhov, linux-input

The driver doesn't have a struct of_device_id table but supported devices
are registered via Device Trees. This is working on the assumption that a
I2C device registered via OF will always match a legacy I2C device ID and
that the MODALIAS reported will always be of the form i2c:<device>.

But this could change in the future so the correct approach is to have an
OF device ID table if the devices are registered via OF.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
---

Changes in v2: None

 drivers/input/mouse/synaptics_i2c.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/input/mouse/synaptics_i2c.c b/drivers/input/mouse/synaptics_i2c.c
index cb2bf203f4ca..8538318d332c 100644
--- a/drivers/input/mouse/synaptics_i2c.c
+++ b/drivers/input/mouse/synaptics_i2c.c
@@ -652,9 +652,18 @@ static const struct i2c_device_id synaptics_i2c_id_table[] = {
 };
 MODULE_DEVICE_TABLE(i2c, synaptics_i2c_id_table);
 
+#ifdef CONFIG_OF
+static const struct of_device_id synaptics_i2c_of_match[] = {
+	{ .compatible = "synaptics,synaptics_i2c", },
+	{ },
+};
+MODULE_DEVICE_TABLE(of, synaptics_i2c_of_match);
+#endif
+
 static struct i2c_driver synaptics_i2c_driver = {
 	.driver = {
 		.name	= DRIVER_NAME,
+		.of_match_table = of_match_ptr(synaptics_i2c_of_match),
 		.pm	= &synaptics_i2c_pm,
 	},
 
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2 3/3] Input: qt1070 - Add OF device ID table
  2017-02-22 14:40 [PATCH v2 1/3] Input: silead - Add OF device ID table Javier Martinez Canillas
  2017-02-22 14:40 ` [PATCH v2 2/3] Input: synaptics_i2c " Javier Martinez Canillas
@ 2017-02-22 14:40 ` Javier Martinez Canillas
  2017-03-23 19:14   ` Javier Martinez Canillas
  1 sibling, 1 reply; 6+ messages in thread
From: Javier Martinez Canillas @ 2017-02-22 14:40 UTC (permalink / raw)
  To: linux-kernel; +Cc: Javier Martinez Canillas, Dmitry Torokhov, linux-input

The driver doesn't have a struct of_device_id table but supported devices
are registered via Device Trees. This is working on the assumption that a
I2C device registered via OF will always match a legacy I2C device ID and
that the MODALIAS reported will always be of the form i2c:<device>.

But this could change in the future so the correct approach is to have an
OF device ID table if the devices are registered via OF.

The compatible strings don't have a vendor prefix because that's how it's
used currently, and changing this will be a Device Tree ABI break.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
---

Changes in v2: None

 drivers/input/keyboard/qt1070.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/input/keyboard/qt1070.c b/drivers/input/keyboard/qt1070.c
index 5a5778729e37..76bb51309a78 100644
--- a/drivers/input/keyboard/qt1070.c
+++ b/drivers/input/keyboard/qt1070.c
@@ -274,9 +274,18 @@ static const struct i2c_device_id qt1070_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, qt1070_id);
 
+#ifdef CONFIG_OF
+static const struct of_device_id qt1070_of_match[] = {
+	{ .compatible = "qt1070", },
+	{ },
+};
+MODULE_DEVICE_TABLE(of, qt1070_of_match);
+#endif
+
 static struct i2c_driver qt1070_driver = {
 	.driver	= {
 		.name	= "qt1070",
+		.of_match_table = of_match_ptr(qt1070_of_match),
 		.pm	= &qt1070_pm_ops,
 	},
 	.id_table	= qt1070_id,
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 3/3] Input: qt1070 - Add OF device ID table
  2017-02-22 14:40 ` [PATCH v2 3/3] Input: qt1070 " Javier Martinez Canillas
@ 2017-03-23 19:14   ` Javier Martinez Canillas
  2017-03-23 21:45     ` Dmitry Torokhov
  0 siblings, 1 reply; 6+ messages in thread
From: Javier Martinez Canillas @ 2017-03-23 19:14 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-kernel, linux-input

Hello Dmitry,

On 02/22/2017 11:40 AM, Javier Martinez Canillas wrote:
> The driver doesn't have a struct of_device_id table but supported devices
> are registered via Device Trees. This is working on the assumption that a
> I2C device registered via OF will always match a legacy I2C device ID and
> that the MODALIAS reported will always be of the form i2c:<device>.
> 
> But this could change in the future so the correct approach is to have an
> OF device ID table if the devices are registered via OF.
> 
> The compatible strings don't have a vendor prefix because that's how it's
> used currently, and changing this will be a Device Tree ABI break.
> 
> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
> ---
> 

What's your decision about this patch series?

Best regards,
-- 
Javier Martinez Canillas
Open Source Group
Samsung Research America

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 3/3] Input: qt1070 - Add OF device ID table
  2017-03-23 19:14   ` Javier Martinez Canillas
@ 2017-03-23 21:45     ` Dmitry Torokhov
  2017-03-27 15:16       ` Javier Martinez Canillas
  0 siblings, 1 reply; 6+ messages in thread
From: Dmitry Torokhov @ 2017-03-23 21:45 UTC (permalink / raw)
  To: Javier Martinez Canillas; +Cc: linux-kernel, linux-input

On Thu, Mar 23, 2017 at 04:14:56PM -0300, Javier Martinez Canillas wrote:
> Hello Dmitry,
> 
> On 02/22/2017 11:40 AM, Javier Martinez Canillas wrote:
> > The driver doesn't have a struct of_device_id table but supported devices
> > are registered via Device Trees. This is working on the assumption that a
> > I2C device registered via OF will always match a legacy I2C device ID and
> > that the MODALIAS reported will always be of the form i2c:<device>.
> > 
> > But this could change in the future so the correct approach is to have an
> > OF device ID table if the devices are registered via OF.
> > 
> > The compatible strings don't have a vendor prefix because that's how it's
> > used currently, and changing this will be a Device Tree ABI break.
> > 
> > Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
> > ---
> > 
> 
> What's your decision about this patch series?

OK, I queued them for -next. Could you also make a patch to update
binding docs for silead?

Thanks!

-- 
Dmitry

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 3/3] Input: qt1070 - Add OF device ID table
  2017-03-23 21:45     ` Dmitry Torokhov
@ 2017-03-27 15:16       ` Javier Martinez Canillas
  0 siblings, 0 replies; 6+ messages in thread
From: Javier Martinez Canillas @ 2017-03-27 15:16 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-kernel, linux-input

Hello Dmitry,

On 03/23/2017 06:45 PM, Dmitry Torokhov wrote:
> On Thu, Mar 23, 2017 at 04:14:56PM -0300, Javier Martinez Canillas wrote:
>> Hello Dmitry,
>>
>> On 02/22/2017 11:40 AM, Javier Martinez Canillas wrote:
>>> The driver doesn't have a struct of_device_id table but supported devices
>>> are registered via Device Trees. This is working on the assumption that a
>>> I2C device registered via OF will always match a legacy I2C device ID and
>>> that the MODALIAS reported will always be of the form i2c:<device>.
>>>
>>> But this could change in the future so the correct approach is to have an
>>> OF device ID table if the devices are registered via OF.
>>>
>>> The compatible strings don't have a vendor prefix because that's how it's
>>> used currently, and changing this will be a Device Tree ABI break.
>>>
>>> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
>>> ---
>>>
>>
>> What's your decision about this patch series?
> 
> OK, I queued them for -next. Could you also make a patch to update

Great, thanks a lot!

> binding docs for silead?
> 

Of course, I will.

> Thanks!
> 

Best regards,
-- 
Javier Martinez Canillas
Open Source Group
Samsung Research America

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-03-27 15:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-22 14:40 [PATCH v2 1/3] Input: silead - Add OF device ID table Javier Martinez Canillas
2017-02-22 14:40 ` [PATCH v2 2/3] Input: synaptics_i2c " Javier Martinez Canillas
2017-02-22 14:40 ` [PATCH v2 3/3] Input: qt1070 " Javier Martinez Canillas
2017-03-23 19:14   ` Javier Martinez Canillas
2017-03-23 21:45     ` Dmitry Torokhov
2017-03-27 15:16       ` Javier Martinez Canillas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).