* [PATCH 1/2] Input: mms114 - add extra compatible for mms345l
@ 2020-04-23 10:24 Stephan Gerhold
2020-04-23 10:24 ` [PATCH 2/2] dt-bindings: mms114: document melfas,mms345l binding Stephan Gerhold
2020-04-24 9:29 ` [PATCH 1/2] Input: mms114 - add extra compatible for mms345l Andi Shyti
0 siblings, 2 replies; 8+ messages in thread
From: Stephan Gerhold @ 2020-04-23 10:24 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Andi Shyti, linux-input, Rob Herring, Mark Rutland, devicetree,
Stephan Gerhold
MMS345L is another first generation touch screen from Melfas,
which uses mostly the same registers as MMS152.
However, there is some garbage printed during initialization.
Apparently MMS345L does not have the MMS152_COMPAT_GROUP register
that is read+printed during initialization.
TSP FW Rev: bootloader 0x6 / core 0x26 / config 0x26, Compat group: \x06
On earlier kernel versions the compat group was actually printed as
an ASCII control character, seems like it gets escaped now.
But we probably shouldn't print something from a random register.
Add a separate "melfas,mms345l" compatible that avoids reading
from the MMS152_COMPAT_GROUP register. This might also help in case
there is some other device-specific quirk in the future.
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
---
Adding an extra compatible just for a log message that looks weird
might be a bit exaggerated, I'm not sure. But so far I got the impression
that it's better to add separate compatibles if devices behave slightly
different (in case more differences are discovered later).
Alternatively we could also:
- Remove the "Compat group:" from the log message
(I'm not sure how useful it is since it's just printed but nothing
is done with it...)
- Just accept that we might be reading from some invalid register
on MMS345L (It doesn't seem to affect functionality at the moment...)
I just thought we should discuss this before I upstream the patch
that adds the touchscreen to the device tree of my board.
---
drivers/input/touchscreen/mms114.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/drivers/input/touchscreen/mms114.c b/drivers/input/touchscreen/mms114.c
index 2ef1adaed9af..5bdf4ac1a303 100644
--- a/drivers/input/touchscreen/mms114.c
+++ b/drivers/input/touchscreen/mms114.c
@@ -54,6 +54,7 @@
enum mms_type {
TYPE_MMS114 = 114,
TYPE_MMS152 = 152,
+ TYPE_MMS345L = 345,
};
struct mms114_data {
@@ -250,6 +251,15 @@ static int mms114_get_version(struct mms114_data *data)
int error;
switch (data->type) {
+ case TYPE_MMS345L:
+ error = __mms114_read_reg(data, MMS152_FW_REV, 3, buf);
+ if (error)
+ return error;
+
+ dev_info(dev, "TSP FW Rev: bootloader 0x%x / core 0x%x / config 0x%x\n",
+ buf[0], buf[1], buf[2]);
+ break;
+
case TYPE_MMS152:
error = __mms114_read_reg(data, MMS152_FW_REV, 3, buf);
if (error)
@@ -287,8 +297,8 @@ static int mms114_setup_regs(struct mms114_data *data)
if (error < 0)
return error;
- /* MMS152 has no configuration or power on registers */
- if (data->type == TYPE_MMS152)
+ /* Only MMS114 has configuration and power on registers */
+ if (data->type != TYPE_MMS114)
return 0;
error = mms114_set_active(data, true);
@@ -597,6 +607,9 @@ static const struct of_device_id mms114_dt_match[] = {
}, {
.compatible = "melfas,mms152",
.data = (void *)TYPE_MMS152,
+ }, {
+ .compatible = "melfas,mms345l",
+ .data = (void *)TYPE_MMS345L,
},
{ }
};
--
2.26.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/2] dt-bindings: mms114: document melfas,mms345l binding
2020-04-23 10:24 [PATCH 1/2] Input: mms114 - add extra compatible for mms345l Stephan Gerhold
@ 2020-04-23 10:24 ` Stephan Gerhold
2020-04-25 20:06 ` Dmitry Torokhov
2020-04-24 9:29 ` [PATCH 1/2] Input: mms114 - add extra compatible for mms345l Andi Shyti
1 sibling, 1 reply; 8+ messages in thread
From: Stephan Gerhold @ 2020-04-23 10:24 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Andi Shyti, linux-input, Rob Herring, Mark Rutland, devicetree,
Stephan Gerhold, Rob Herring
The mms114 driver now supports MMS345L; document the
melfas,mms345l binding that is used for it.
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Reviewed-by: Andi Shyti <andi@etezian.org>
Acked-by: Rob Herring <robh@kernel.org>
---
Documentation/devicetree/bindings/input/touchscreen/mms114.txt | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/input/touchscreen/mms114.txt b/Documentation/devicetree/bindings/input/touchscreen/mms114.txt
index 2cd954051d29..707234cfd7e6 100644
--- a/Documentation/devicetree/bindings/input/touchscreen/mms114.txt
+++ b/Documentation/devicetree/bindings/input/touchscreen/mms114.txt
@@ -1,9 +1,10 @@
-* MELFAS MMS114/MMS152 touchscreen controller
+* MELFAS MMS114/MMS152/MMS345L touchscreen controller
Required properties:
- compatible: should be one of:
- "melfas,mms114"
- "melfas,mms152"
+ - "melfas,mms345l"
- reg: I2C address of the chip
- interrupts: interrupt to which the chip is connected
- touchscreen-size-x: See [1]
--
2.26.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] Input: mms114 - add extra compatible for mms345l
2020-04-23 10:24 [PATCH 1/2] Input: mms114 - add extra compatible for mms345l Stephan Gerhold
2020-04-23 10:24 ` [PATCH 2/2] dt-bindings: mms114: document melfas,mms345l binding Stephan Gerhold
@ 2020-04-24 9:29 ` Andi Shyti
2020-04-24 11:34 ` Stephan Gerhold
1 sibling, 1 reply; 8+ messages in thread
From: Andi Shyti @ 2020-04-24 9:29 UTC (permalink / raw)
To: Stephan Gerhold
Cc: Dmitry Torokhov, Andi Shyti, linux-input, Rob Herring,
Mark Rutland, devicetree
Hi guys,
> }, {
> .compatible = "melfas,mms152",
> .data = (void *)TYPE_MMS152,
> + }, {
> + .compatible = "melfas,mms345l",
> + .data = (void *)TYPE_MMS345L,
> },
it's been some times I haven't been doing this, but is the order
of the patches correct? shouldn't the binding be updated first?
Andi
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] Input: mms114 - add extra compatible for mms345l
2020-04-24 9:29 ` [PATCH 1/2] Input: mms114 - add extra compatible for mms345l Andi Shyti
@ 2020-04-24 11:34 ` Stephan Gerhold
2020-04-24 13:22 ` Andi Shyti
0 siblings, 1 reply; 8+ messages in thread
From: Stephan Gerhold @ 2020-04-24 11:34 UTC (permalink / raw)
To: Andi Shyti
Cc: Dmitry Torokhov, linux-input, Rob Herring, Mark Rutland,
devicetree
On Fri, Apr 24, 2020 at 12:29:37PM +0300, Andi Shyti wrote:
> Hi guys,
>
> > }, {
> > .compatible = "melfas,mms152",
> > .data = (void *)TYPE_MMS152,
> > + }, {
> > + .compatible = "melfas,mms345l",
> > + .data = (void *)TYPE_MMS345L,
> > },
>
> it's been some times I haven't been doing this, but is the order
> of the patches correct? shouldn't the binding be updated first?
>
Yes. I had it correct in my original patch, but apparently swapped the
order accidentally for this one. I will do it correct again next time :)
Thanks,
Stephan
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] Input: mms114 - add extra compatible for mms345l
2020-04-24 11:34 ` Stephan Gerhold
@ 2020-04-24 13:22 ` Andi Shyti
2020-04-25 18:24 ` Stephan Gerhold
0 siblings, 1 reply; 8+ messages in thread
From: Andi Shyti @ 2020-04-24 13:22 UTC (permalink / raw)
To: Stephan Gerhold
Cc: Andi Shyti, Dmitry Torokhov, linux-input, Rob Herring,
Mark Rutland, devicetree
Hi Stephan,
On Fri, Apr 24, 2020 at 01:34:46PM +0200, Stephan Gerhold wrote:
> On Fri, Apr 24, 2020 at 12:29:37PM +0300, Andi Shyti wrote:
> > Hi guys,
> >
> > > }, {
> > > .compatible = "melfas,mms152",
> > > .data = (void *)TYPE_MMS152,
> > > + }, {
> > > + .compatible = "melfas,mms345l",
> > > + .data = (void *)TYPE_MMS345L,
> > > },
> >
> > it's been some times I haven't been doing this, but is the order
> > of the patches correct? shouldn't the binding be updated first?
> >
>
> Yes. I had it correct in my original patch, but apparently swapped the
> order accidentally for this one. I will do it correct again next time :)
then with that change:
Reviewed-by: Andi Shyti <andi@etezian.org>
Thanks,
Andi
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] Input: mms114 - add extra compatible for mms345l
2020-04-24 13:22 ` Andi Shyti
@ 2020-04-25 18:24 ` Stephan Gerhold
2020-04-25 20:07 ` Dmitry Torokhov
0 siblings, 1 reply; 8+ messages in thread
From: Stephan Gerhold @ 2020-04-25 18:24 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Andi Shyti, linux-input, Rob Herring, Mark Rutland, devicetree
On Fri, Apr 24, 2020 at 04:22:43PM +0300, Andi Shyti wrote:
> Hi Stephan,
>
> On Fri, Apr 24, 2020 at 01:34:46PM +0200, Stephan Gerhold wrote:
> > On Fri, Apr 24, 2020 at 12:29:37PM +0300, Andi Shyti wrote:
> > > Hi guys,
> > >
> > > > }, {
> > > > .compatible = "melfas,mms152",
> > > > .data = (void *)TYPE_MMS152,
> > > > + }, {
> > > > + .compatible = "melfas,mms345l",
> > > > + .data = (void *)TYPE_MMS345L,
> > > > },
> > >
> > > it's been some times I haven't been doing this, but is the order
> > > of the patches correct? shouldn't the binding be updated first?
> > >
> >
> > Yes. I had it correct in my original patch, but apparently swapped the
> > order accidentally for this one. I will do it correct again next time :)
>
> then with that change:
>
> Reviewed-by: Andi Shyti <andi@etezian.org>
>
Hi Dmitry,
I assume there is little reason to resend just to swap the order.
(You could just apply them in reverse order since they do not depend
on each other...)
But if there is something else I should change just let me know.
Thanks,
Stephan
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] dt-bindings: mms114: document melfas,mms345l binding
2020-04-23 10:24 ` [PATCH 2/2] dt-bindings: mms114: document melfas,mms345l binding Stephan Gerhold
@ 2020-04-25 20:06 ` Dmitry Torokhov
0 siblings, 0 replies; 8+ messages in thread
From: Dmitry Torokhov @ 2020-04-25 20:06 UTC (permalink / raw)
To: Stephan Gerhold
Cc: Andi Shyti, linux-input, Rob Herring, Mark Rutland, devicetree,
Rob Herring
On Thu, Apr 23, 2020 at 12:24:31PM +0200, Stephan Gerhold wrote:
> The mms114 driver now supports MMS345L; document the
> melfas,mms345l binding that is used for it.
>
> Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> Reviewed-by: Andi Shyti <andi@etezian.org>
> Acked-by: Rob Herring <robh@kernel.org>
Applied, thank you.
> ---
> Documentation/devicetree/bindings/input/touchscreen/mms114.txt | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/input/touchscreen/mms114.txt b/Documentation/devicetree/bindings/input/touchscreen/mms114.txt
> index 2cd954051d29..707234cfd7e6 100644
> --- a/Documentation/devicetree/bindings/input/touchscreen/mms114.txt
> +++ b/Documentation/devicetree/bindings/input/touchscreen/mms114.txt
> @@ -1,9 +1,10 @@
> -* MELFAS MMS114/MMS152 touchscreen controller
> +* MELFAS MMS114/MMS152/MMS345L touchscreen controller
>
> Required properties:
> - compatible: should be one of:
> - "melfas,mms114"
> - "melfas,mms152"
> + - "melfas,mms345l"
> - reg: I2C address of the chip
> - interrupts: interrupt to which the chip is connected
> - touchscreen-size-x: See [1]
> --
> 2.26.2
>
--
Dmitry
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] Input: mms114 - add extra compatible for mms345l
2020-04-25 18:24 ` Stephan Gerhold
@ 2020-04-25 20:07 ` Dmitry Torokhov
0 siblings, 0 replies; 8+ messages in thread
From: Dmitry Torokhov @ 2020-04-25 20:07 UTC (permalink / raw)
To: Stephan Gerhold
Cc: Andi Shyti, linux-input, Rob Herring, Mark Rutland, devicetree
On Sat, Apr 25, 2020 at 08:24:17PM +0200, Stephan Gerhold wrote:
> On Fri, Apr 24, 2020 at 04:22:43PM +0300, Andi Shyti wrote:
> > Hi Stephan,
> >
> > On Fri, Apr 24, 2020 at 01:34:46PM +0200, Stephan Gerhold wrote:
> > > On Fri, Apr 24, 2020 at 12:29:37PM +0300, Andi Shyti wrote:
> > > > Hi guys,
> > > >
> > > > > }, {
> > > > > .compatible = "melfas,mms152",
> > > > > .data = (void *)TYPE_MMS152,
> > > > > + }, {
> > > > > + .compatible = "melfas,mms345l",
> > > > > + .data = (void *)TYPE_MMS345L,
> > > > > },
> > > >
> > > > it's been some times I haven't been doing this, but is the order
> > > > of the patches correct? shouldn't the binding be updated first?
> > > >
> > >
> > > Yes. I had it correct in my original patch, but apparently swapped the
> > > order accidentally for this one. I will do it correct again next time :)
> >
> > then with that change:
> >
> > Reviewed-by: Andi Shyti <andi@etezian.org>
> >
>
> Hi Dmitry,
>
> I assume there is little reason to resend just to swap the order.
> (You could just apply them in reverse order since they do not depend
> on each other...)
>
> But if there is something else I should change just let me know.
No, that is it, I just applied the both.
Thanks.
--
Dmitry
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2020-04-25 20:07 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-23 10:24 [PATCH 1/2] Input: mms114 - add extra compatible for mms345l Stephan Gerhold
2020-04-23 10:24 ` [PATCH 2/2] dt-bindings: mms114: document melfas,mms345l binding Stephan Gerhold
2020-04-25 20:06 ` Dmitry Torokhov
2020-04-24 9:29 ` [PATCH 1/2] Input: mms114 - add extra compatible for mms345l Andi Shyti
2020-04-24 11:34 ` Stephan Gerhold
2020-04-24 13:22 ` Andi Shyti
2020-04-25 18:24 ` Stephan Gerhold
2020-04-25 20:07 ` Dmitry Torokhov
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).