Thread (4 messages) 4 messages, 4 authors, 2017-12-20

Re: [PATCH] touchscreen: mms114: add support for mms152

From: Andi Shyti <hidden>
Date: 2017-12-19 06:22:52
Also in: linux-input

Hi Simon,
+	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.rst file.
quoted hunk ↗ jump to hunk
+	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 hunk ↗ jump to hunk
 	return 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);
 
 #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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help