History

Input: zforce_ts - remove support for platfrom data

There are no in-tree users of platform data and any new ones should either use device tree or static device properties, so let's remove platform data support.

Dmitry Torokhov committed 2 years ago

Commit f820b431 parent 5e091a42 files · +16 −55Browse files

Unified · Split

2 files
  1. drivers/input/touchscreen/zforce_ts.c +16 −40
  2. include/linux/platform_data/zforce_ts.h +0 −15
drivers/input/touchscreen/zforce_ts.c+16−40
@@ -9,21 +9,19 @@ · 8 unmodified lines
99 * Author: Pieter Truter<ptruter@intrinsyc.com>
1010 */
1111
12−#include <linux/module.h>
13−#include <linux/hrtimer.h>
14−#include <linux/slab.h>
15−#include <linux/input.h>
16−#include <linux/interrupt.h>
17−#include <linux/i2c.h>
1812 #include <linux/delay.h>
19−#include <linux/gpio/consumer.h>
2013 #include <linux/device.h>
21−#include <linux/sysfs.h>
14+#include <linux/gpio/consumer.h>
15+#include <linux/i2c.h>
16+#include <linux/input.h>
2217 #include <linux/input/mt.h>
2318 #include <linux/input/touchscreen.h>
24−#include <linux/platform_data/zforce_ts.h>
25−#include <linux/regulator/consumer.h>
19+#include <linux/interrupt.h>
20+#include <linux/module.h>
2621 #include <linux/of.h>
22+#include <linux/property.h>
23+#include <linux/regulator/consumer.h>
24+#include <linux/slab.h>
2725
2826 #define WAIT_TIMEOUT msecs_to_jiffies(1000)
2927
@@ -108,7 +106,6 @@ struct zforce_ts { · 78 unmodified lines
108106 struct i2c_client *client;
109107 struct input_dev *input;
110108 struct touchscreen_properties prop;
111− const struct zforce_ts_platdata *pdata;
112109 char phys[32];
113110
114111 struct regulator *reg_vdd;
@@ -702,39 +699,24 @@ static void zforce_reset(void *data) · 587 unmodified lines
702699 regulator_disable(ts->reg_vdd);
703700 }
704701
705−static struct zforce_ts_platdata *zforce_parse_dt(struct device *dev)
702+static void zforce_ts_parse_legacy_properties(struct zforce_ts *ts)
706703 {
707− struct zforce_ts_platdata *pdata;
708− struct device_node *np = dev->of_node;
709−
710− if (!np)
711− return ERR_PTR(-ENOENT);
704+ u32 x_max = 0;
705+ u32 y_max = 0;
712706
713− pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
714− if (!pdata) {
715− dev_err(dev, "failed to allocate platform data\n");
716− return ERR_PTR(-ENOMEM);
717− }
718−
719− of_property_read_u32(np, "x-size", &pdata->x_max);
720− of_property_read_u32(np, "y-size", &pdata->y_max);
707+ device_property_read_u32(&ts->client->dev, "x-size", &x_max);
708+ input_set_abs_params(ts->input, ABS_MT_POSITION_X, 0, x_max, 0, 0);
721709
722− return pdata;
710+ device_property_read_u32(&ts->client->dev, "y-size", &y_max);
711+ input_set_abs_params(ts->input, ABS_MT_POSITION_Y, 0, y_max, 0, 0);
723712 }
724713
725714 static int zforce_probe(struct i2c_client *client)
726715 {
727− const struct zforce_ts_platdata *pdata = dev_get_platdata(&client->dev);
728716 struct zforce_ts *ts;
729717 struct input_dev *input_dev;
730718 int ret;
731719
732− if (!pdata) {
733− pdata = zforce_parse_dt(&client->dev);
734− if (IS_ERR(pdata))
735− return PTR_ERR(pdata);
736− }
737−
738720 ts = devm_kzalloc(&client->dev, sizeof(struct zforce_ts), GFP_KERNEL);
739721 if (!ts)
740722 return -ENOMEM;
@@ -822,7 +804,6 @@ static int zforce_probe(struct i2c_client *client) · 81 unmodified lines
822804 mutex_init(&ts->access_mutex);
823805 mutex_init(&ts->command_mutex);
824806
825− ts->pdata = pdata;
826807 ts->client = client;
827808 ts->input = input_dev;
828809
@@ -837,12 +818,7 @@ static int zforce_probe(struct i2c_client *client) · 8 unmodified lines
837818 __set_bit(EV_SYN, input_dev->evbit);
838819 __set_bit(EV_ABS, input_dev->evbit);
839820
840− /* For multi touch */
841− input_set_abs_params(input_dev, ABS_MT_POSITION_X, 0,
842− pdata->x_max, 0, 0);
843− input_set_abs_params(input_dev, ABS_MT_POSITION_Y, 0,
844− pdata->y_max, 0, 0);
845−
821+ zforce_ts_parse_legacy_properties(ts);
846822 touchscreen_parse_properties(input_dev, true, &ts->prop);
847823 if (ts->prop.max_x == 0 || ts->prop.max_y == 0) {
848824 dev_err(&client->dev, "no size specified\n");
include/linux/platform_data/zforce_ts.h+0−15
@@ -1,15 +0,0 @@
1−/* SPDX-License-Identifier: GPL-2.0-only */
2−/* drivers/input/touchscreen/zforce.c
3− *
4− * Copyright (C) 2012-2013 MundoReader S.L.
5− */
6−
7−#ifndef _LINUX_INPUT_ZFORCE_TS_H
8−#define _LINUX_INPUT_ZFORCE_TS_H
9−
10−struct zforce_ts_platdata {
11− unsigned int x_max;
12− unsigned int y_max;
13−};
14−
15−#endif /* _LINUX_INPUT_ZFORCE_TS_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t