touchscreen: mms114: add support for mms152
Subsystems (3)
PATCH 1/1 touchscreen: mms114: add support for mms152
MMS152 has no configuration registers, but the packet format used in interrupts is identical to mms114.
--- .../bindings/input/touchscreen/mms114.txt | 8 ++-- drivers/input/touchscreen/mms114.c | 55 +++++++++++++++++++--- include/linux/platform_data/mms114.h | 6 +++ 3 files changed, 58 insertions(+), 11 deletions(-)
Documentation/devicetree/bindings/input/touchscreen/mms114.txt +4 -4
@@ -1,15 +1,15 @@ -* MELFAS MMS114 touchscreen controller +* MELFAS MMS114/MMS152 touchscreen controller Required properties: -- compatible: must be "melfas,mms114" +- compatible: "melfas,mms114" for MMS114, or "melfas,mms152" for MMS152 - reg: I2C address of the chip - interrupts: interrupt to which the chip is connected - x-size: horizontal resolution of touchscreen - y-size: vertical resolution of touchscreen Optional properties: -- contact-threshold: -- moving-threshold: +- contact-threshold: only with "melfas,mms114" +- moving-threshold: only with "melfas,mms114" - x-invert: invert X axis - y-invert: invert Y axis
drivers/input/touchscreen/mms114.c +48 -7
104 lines not on this page · raw message
include/linux/platform_data/mms114.h +6 -0
@@ -10,6 +10,11 @@ #ifndef __LINUX_MMS114_H #define __LINUX_MMS114_H +enum mms_type { + TYPE_MMS114, + TYPE_MMS152, +}; + struct mms114_platform_data { unsigned int x_size; unsigned int y_size;
@@ -17,6 +22,7 @@ struct mms114_platform_data {unsigned int moving_threshold;bool x_invert;bool y_invert; +enum mms_type type;void (*cfg_pin)(bool ); };
Signature · 6 lines
2.15.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi Simon,
drivers/input/touchscreen/mms114.c static int mms114_setup_regs(struct mms114_data *data) · line 297
Quoted 5 lines
drivers/input/touchscreen/mms114.c +5
-0+if (data->pdata->type ==TYPE_MMS152 ) { +/* MMS152 has no configuration or power on registers */ +return 0 ; + } +
Please drop the brackets here accorting to theDocumentation/process/coding-style.rst file.
drivers/input/touchscreen/mms114.c static struct mms114_platform_data *mms114_parse_dt(struct device *dev) · line 440
Quoted 10 lines
drivers/input/touchscreen/mms114.c +3
-0+ pdata->type = (enum mms_type )of_device_get_match_data (dev); +if (of_property_read_u32 (np,"x-size" , &pdata->x_size)) {dev_err (dev,"failed to get x-size property\n" );return NULL ;@@ -411,6 +437,7 @@ static struct mms114_platform_data *mms114_parse_dt(struct device *dev)if (of_find_property (np,"y-invert" ,NULL )) pdata->y_invert = true; +
Please do not add extra lines
Quoted 21 lines
drivers/input/touchscreen/mms114.c +9
-1return pdata; }#else @@ -456,7 +483,15 @@ static int mms114_probe(struct i2c_client *client, data->input_dev = input_dev; data->pdata = pdata; - input_dev->name ="MELFAS MMS114 Touchscreen" ; +switch (pdata->type) { +case TYPE_MMS114 : + input_dev->name ="MELFAS MMS114 Touchscreen" ; +break ; +case TYPE_MMS152 : + input_dev->name ="MELFAS MMS152 Touchscreen" ; +break ; + } + input_dev->id.bustype =BUS_I2C ; input_dev->dev.parent = &client->dev; input_dev->open = mms114_input_open;
drivers/input/touchscreen/mms114.c MODULE_DEVICE_TABLE(i2c, mms114_id); · line 612
Quoted 10 lines
drivers/input/touchscreen/mms114.c +6
-1@@ -569,7 +604,13 @@ MODULE_DEVICE_TABLE(i2c, mms114_id); #ifdef CONFIG_OF static const struct of_device_id mms114_dt_match[] = { - { .compatible = "melfas,mms114" }, + { + .compatible = "melfas,mms114", + .data = (void *)TYPE_MMS114, + }, { + .compatible = "melfas,mms152", + .data = (void *)TYPE_MMS152,
You are not documenting the new "melfas,mms152" compatible in Documentation/devicetree/bindings/input/touchscreen/mms114.txt
Andi
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi Andi,
Thanks for the review.
Quoted 46 lines · Andi Shyti
Hi Simon,
drivers/input/touchscreen/mms114.c static int mms114_setup_regs(struct mms114_data *data) · line 297
Quoted 5 lines
drivers/input/touchscreen/mms114.c +5
-0+if (data->pdata->type ==TYPE_MMS152 ) { +/* MMS152 has no configuration or power on registers */ +return 0 ; + } +Please drop the brackets here accorting to the
Documentation/process/coding-style.rstfile.drivers/input/touchscreen/mms114.c static struct mms114_platform_data *mms114_parse_dt(struct device *dev) · line 440
Quoted 10 lines
drivers/input/touchscreen/mms114.c +3
-0+ pdata->type = (enum mms_type )of_device_get_match_data (dev); +if (of_property_read_u32 (np,"x-size" , &pdata->x_size)) {dev_err (dev,"failed to get x-size property\n" );return NULL ;@@ -411,6 +437,7 @@ static struct mms114_platform_data *mms114_parse_dt(struct device *dev)if (of_find_property (np,"y-invert" ,NULL )) pdata->y_invert = true; +Please do not add extra lines
Quoted 22 lines
drivers/input/touchscreen/mms114.c +9
-1return pdata; }#else @@ -456,7 +483,15 @@ static int mms114_probe(struct i2c_client *client, data->input_dev = input_dev; data->pdata = pdata; - input_dev->name ="MELFAS MMS114 Touchscreen" ; +switch (pdata->type) { +case TYPE_MMS114 : + input_dev->name ="MELFAS MMS114 Touchscreen" ; +break ; +case TYPE_MMS152 : + input_dev->name ="MELFAS MMS152 Touchscreen" ; +break ; + } + input_dev->id.bustype =BUS_I2C ; input_dev->dev.parent = &client->dev; input_dev->open = mms114_input_open;@@ -569,7 +604,13 @@ MODULE_DEVICE_TABLE(i2c, mms114_id);
Quoted 12 lines
drivers/input/touchscreen/mms114.c MODULE_DEVICE_TABLE(i2c, mms114_id); · line 612
Quoted 9 lines
drivers/input/touchscreen/mms114.c +6
-1#ifdef CONFIG_OF static const struct of_device_id mms114_dt_match[] = { - { .compatible = "melfas,mms114" }, + { + .compatible = "melfas,mms114", + .data = (void *)TYPE_MMS114, + }, { + .compatible = "melfas,mms152", + .data = (void *)TYPE_MMS152,You are not documenting the new "melfas,mms152" compatible in
Documentation/devicetree/bindings/input/touchscreen/mms114.txt
Yes I am - "melfas,mms152" is added to the documentation as part of this patch. Is there something wrong with what I've done there?
Quoted 2 lines
Andi
I will send a v2 addressing the style issues.
Cheers,
Simon
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi Simon,
Quoted 13 lines
Quoted 4 lines
Quoted 4 lines
#ifdef
CONFIG_OF
static const structof_device_idmms114_dt_match[] = {drivers/input/touchscreen/mms114.c +1
-1- { .compatible = "melfas,mms114" }, + {Quoted 8 lines
drivers/input/touchscreen/mms114.c MODULE_DEVICE_TABLE(i2c, mms114_id); · line 612
Quoted 5 lines
drivers/input/touchscreen/mms114.c +5
-0+ .compatible = "melfas,mms114", + .data = (void *)TYPE_MMS114, + }, { + .compatible = "melfas,mms152", + .data = (void *)TYPE_MMS152,You are not documenting the new "melfas,mms152" compatible in
Documentation/devicetree/bindings/input/touchscreen/mms114.txt
Quoted 3 lines
Yes I am - "melfas,mms152" is added to the documentation as part of this patch. Is there something wrong with what I've done there?
Oh yes, sorry! I missed it while snipping the code :)
Please ignore this comment, then.
Andi
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v2 1/1 Input: mms114 - add support for mms152
In reply to Simon ShieldsMMS152 has no configuration registers, but the packet format used in interrupts is identical to mms114.
--- .../bindings/input/touchscreen/mms114.txt | 8 ++-- drivers/input/touchscreen/mms114.c | 53 +++++++++++++++++++--- include/linux/platform_data/mms114.h | 6 +++ 3 files changed, 56 insertions(+), 11 deletions(-)
Documentation/devicetree/bindings/input/touchscreen/mms114.txt +4 -4
@@ -1,15 +1,15 @@ -* MELFAS MMS114 touchscreen controller +* MELFAS MMS114/MMS152 touchscreen controller Required properties: -- compatible: must be "melfas,mms114" +- compatible: "melfas,mms114" for MMS114, or "melfas,mms152" for MMS152 - reg: I2C address of the chip - interrupts: interrupt to which the chip is connected - x-size: horizontal resolution of touchscreen - y-size: vertical resolution of touchscreen Optional properties: -- contact-threshold: -- moving-threshold: +- contact-threshold: only with "melfas,mms114" +- moving-threshold: only with "melfas,mms114" - x-invert: invert X axis - y-invert: invert Y axis
drivers/input/touchscreen/mms114.c +46 -7
96 lines not on this page · raw message
include/linux/platform_data/mms114.h +6 -0
@@ -10,6 +10,11 @@ #ifndef __LINUX_MMS114_H #define __LINUX_MMS114_H +enum mms_type { + TYPE_MMS114, + TYPE_MMS152, +}; + struct mms114_platform_data { unsigned int x_size; unsigned int y_size;
@@ -17,6 +22,7 @@ struct mms114_platform_data {unsigned int moving_threshold;bool x_invert;bool y_invert; +enum mms_type type;void (*cfg_pin)(bool ); };
Signature · 1 line
2.15.1
Dmitry Torokhov
maintainerRe: [PATCH v2] Input: mms114 - add support for mms152
[resending as plain text]
Hi Simon,
Quoted 2 lines · Simon Shields
MMS152 has no configuration registers, but the packet format used in interrupts is identical to mms114.
Since there seems to be renewed interest in mms114 driver, I would like for it to get a facelift and switch to using the standard touchscreen properties rather than the custom ones (we still need to keep compatibility though). Also, we do not seem to have any in-tree users of the mms114_platform_data structure. Can you please see if you can:
- switch the driver to use the generic device properties (device_property_*() API)
- use touchscreen_parse_properties() to parse the standard touchscreen properties
- use touchscreen_report_pos() to report coordinates
- drop mms114_platform_data
Thanks!
Signature · 1 line
Dmitry
A message that is not in the archive (sent off-list or not yet received): 20171218124933.1803-1-simon-WP75azK+jQYgsBAKwltoeQ@public.gmane.org
Quoted 15 lines · Simon Shields
MMS152 has no configuration registers, but the packet format used in interrupts is identical to mms114.
Signed-off-by Simon Shields <[email protected]>--- .../bindings/input/touchscreen/mms114.txt | 8 ++-- drivers/input/touchscreen/mms114.c | 55 +++++++++++++++++++--- include/linux/platform_data/mms114.h | 6 +++ 3 files changed, 58 insertions(+), 11 deletions(-)Documentation/devicetree/bindings/input/touchscreen/mms114.txt +0
-0
Documentation/devicetree/bindings/input/touchscreen/mms114.txt line 4
Quoted 6 lines
Documentation/devicetree/bindings/input/touchscreen/mms114.txt +2
-2@@ -1,15 +1,15 @@ -* MELFAS MMS114 touchscreen controller +* MELFAS MMS114/MMS152 touchscreen controller Required properties: -- compatible: must be "melfas,mms114" +- compatible: "melfas,mms114" for MMS114, or "melfas,mms152" for MMS152
Please reformat to 1 per line.
Documentation/devicetree/bindings/input/touchscreen/mms114.txt line 15
Quoted 13 lines
Documentation/devicetree/bindings/input/touchscreen/mms114.txt +2
-2- reg: I2C address of the chip - interrupts: interrupt to which the chip is connected - x-size: horizontal resolution of touchscreen - y-size: vertical resolution of touchscreen Optional properties: -- contact-threshold: -- moving-threshold: +- contact-threshold: only with "melfas,mms114" +- moving-threshold: only with "melfas,mms114" - x-invert: invert X axis - y-invert: invert Y axis
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html