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
9 * Author: Pieter Truter<ptruter@intrinsyc.com>9 * Author: Pieter Truter<ptruter@intrinsyc.com>
10 */10 */
11 11
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>
18#include <linux/delay.h>12#include <linux/delay.h>
19#include <linux/gpio/consumer.h>
20#include <linux/device.h>13#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>
22#include <linux/input/mt.h>17#include <linux/input/mt.h>
23#include <linux/input/touchscreen.h>18#include <linux/input/touchscreen.h>
24#include <linux/platform_data/zforce_ts.h>19#include <linux/interrupt.h>
25#include <linux/regulator/consumer.h>20#include <linux/module.h>
26#include <linux/of.h>21#include <linux/of.h>
22#include <linux/property.h>
23#include <linux/regulator/consumer.h>
24#include <linux/slab.h>
27 25
28#define WAIT_TIMEOUT msecs_to_jiffies(1000)26#define WAIT_TIMEOUT msecs_to_jiffies(1000)
29 27
@@ -108,7 +106,6 @@ struct zforce_ts { · 78 unmodified lines
108 struct i2c_client *client;106 struct i2c_client *client;
109 struct input_dev *input;107 struct input_dev *input;
110 struct touchscreen_properties prop;108 struct touchscreen_properties prop;
111 const struct zforce_ts_platdata *pdata;
112 char phys[32];109 char phys[32];
113 110
114 struct regulator *reg_vdd;111 struct regulator *reg_vdd;
@@ -702,39 +699,24 @@ static void zforce_reset(void *data) · 587 unmodified lines
702 regulator_disable(ts->reg_vdd);699 regulator_disable(ts->reg_vdd);
703}700}
704 701
705static struct zforce_ts_platdata *zforce_parse_dt(struct device *dev)702static void zforce_ts_parse_legacy_properties(struct zforce_ts *ts)
706{703{
707 struct zforce_ts_platdata *pdata;704 u32 x_max = 0;
708 struct device_node *np = dev->of_node;705 u32 y_max = 0;
709
710 if (!np)
711 return ERR_PTR(-ENOENT);
712 706
713 pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);707 device_property_read_u32(&ts->client->dev, "x-size", &x_max);
714 if (!pdata) {708 input_set_abs_params(ts->input, ABS_MT_POSITION_X, 0, x_max, 0, 0);
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);
721 709
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);
723}712}
724 713
725static int zforce_probe(struct i2c_client *client)714static int zforce_probe(struct i2c_client *client)
726{715{
727 const struct zforce_ts_platdata *pdata = dev_get_platdata(&client->dev);
728 struct zforce_ts *ts;716 struct zforce_ts *ts;
729 struct input_dev *input_dev;717 struct input_dev *input_dev;
730 int ret;718 int ret;
731 719
732 if (!pdata) {
733 pdata = zforce_parse_dt(&client->dev);
734 if (IS_ERR(pdata))
735 return PTR_ERR(pdata);
736 }
737
738 ts = devm_kzalloc(&client->dev, sizeof(struct zforce_ts), GFP_KERNEL);720 ts = devm_kzalloc(&client->dev, sizeof(struct zforce_ts), GFP_KERNEL);
739 if (!ts)721 if (!ts)
740 return -ENOMEM;722 return -ENOMEM;
@@ -822,7 +804,6 @@ static int zforce_probe(struct i2c_client *client) · 81 unmodified lines
822 mutex_init(&ts->access_mutex);804 mutex_init(&ts->access_mutex);
823 mutex_init(&ts->command_mutex);805 mutex_init(&ts->command_mutex);
824 806
825 ts->pdata = pdata;
826 ts->client = client;807 ts->client = client;
827 ts->input = input_dev;808 ts->input = input_dev;
828 809
@@ -837,12 +818,7 @@ static int zforce_probe(struct i2c_client *client) · 8 unmodified lines
837 __set_bit(EV_SYN, input_dev->evbit);818 __set_bit(EV_SYN, input_dev->evbit);
838 __set_bit(EV_ABS, input_dev->evbit);819 __set_bit(EV_ABS, input_dev->evbit);
839 820
840 /* For multi touch */821 zforce_ts_parse_legacy_properties(ts);
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
846 touchscreen_parse_properties(input_dev, true, &ts->prop);822 touchscreen_parse_properties(input_dev, true, &ts->prop);
847 if (ts->prop.max_x == 0 || ts->prop.max_y == 0) {823 if (ts->prop.max_x == 0 || ts->prop.max_y == 0) {
848 dev_err(&client->dev, "no size specified\n");824 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
10struct 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