Skip to content

Commit 2cefdb1

Browse files
ndyerdtor
authored andcommitted
Input: atmel_mxt_ts - remove unnecessary platform data
It is not necessary to download these values to the maXTouch chip on every probe, since they are stored in NVRAM. It makes life difficult when tuning the device to keep them in sync with the config array/file, and requires a new kernel build for minor tweaks. These parameters only represent a tiny subset of the available configuration options, tracking all of these options in platform data would be a endless task. In addition, different versions of maXTouch chips may have these values in different places or may not even have them at all. Having these values also makes life more complex for device tree and other platforms where having to define a static configuration isn't helpful. Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk> Acked-by: Benson Leung <bleung@chromium.org> Acked-by: Yufeng Shen <miletus@chromium.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent 7cdcb8d commit 2cefdb1

4 files changed

Lines changed: 1 addition & 70 deletions

File tree

‎arch/arm/mach-s5pv210/mach-goni.c‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -239,13 +239,8 @@ static void __init goni_radio_init(void)
239239

240240
/* TSP */
241241
static struct mxt_platform_data qt602240_platform_data = {
242-
.x_line = 17,
243-
.y_line = 11,
244242
.x_size = 800,
245243
.y_size = 480,
246-
.blen = 0x21,
247-
.threshold = 0x28,
248-
.voltage = 2800000, /* 2.8V */
249244
.orient = MXT_DIAGONAL,
250245
.irqflags = IRQF_TRIGGER_FALLING,
251246
};

‎drivers/input/touchscreen/atmel_mxt_ts.c‎

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -685,54 +685,6 @@ static int mxt_make_highchg(struct mxt_data *data)
685685
return 0;
686686
}
687687

688-
static void mxt_handle_pdata(struct mxt_data *data)
689-
{
690-
const struct mxt_platform_data *pdata = data->pdata;
691-
u8 voltage;
692-
693-
/* Set touchscreen lines */
694-
mxt_write_object(data, MXT_TOUCH_MULTI_T9, MXT_TOUCH_XSIZE,
695-
pdata->x_line);
696-
mxt_write_object(data, MXT_TOUCH_MULTI_T9, MXT_TOUCH_YSIZE,
697-
pdata->y_line);
698-
699-
/* Set touchscreen orient */
700-
mxt_write_object(data, MXT_TOUCH_MULTI_T9, MXT_TOUCH_ORIENT,
701-
pdata->orient);
702-
703-
/* Set touchscreen burst length */
704-
mxt_write_object(data, MXT_TOUCH_MULTI_T9,
705-
MXT_TOUCH_BLEN, pdata->blen);
706-
707-
/* Set touchscreen threshold */
708-
mxt_write_object(data, MXT_TOUCH_MULTI_T9,
709-
MXT_TOUCH_TCHTHR, pdata->threshold);
710-
711-
/* Set touchscreen resolution */
712-
mxt_write_object(data, MXT_TOUCH_MULTI_T9,
713-
MXT_TOUCH_XRANGE_LSB, (pdata->x_size - 1) & 0xff);
714-
mxt_write_object(data, MXT_TOUCH_MULTI_T9,
715-
MXT_TOUCH_XRANGE_MSB, (pdata->x_size - 1) >> 8);
716-
mxt_write_object(data, MXT_TOUCH_MULTI_T9,
717-
MXT_TOUCH_YRANGE_LSB, (pdata->y_size - 1) & 0xff);
718-
mxt_write_object(data, MXT_TOUCH_MULTI_T9,
719-
MXT_TOUCH_YRANGE_MSB, (pdata->y_size - 1) >> 8);
720-
721-
/* Set touchscreen voltage */
722-
if (pdata->voltage) {
723-
if (pdata->voltage < MXT_VOLTAGE_DEFAULT) {
724-
voltage = (MXT_VOLTAGE_DEFAULT - pdata->voltage) /
725-
MXT_VOLTAGE_STEP;
726-
voltage = 0xff - voltage + 1;
727-
} else
728-
voltage = (pdata->voltage - MXT_VOLTAGE_DEFAULT) /
729-
MXT_VOLTAGE_STEP;
730-
731-
mxt_write_object(data, MXT_SPT_CTECONFIG_T28,
732-
MXT_CTE_VOLTAGE, voltage);
733-
}
734-
}
735-
736688
static int mxt_get_info(struct mxt_data *data)
737689
{
738690
struct i2c_client *client = data->client;
@@ -840,8 +792,6 @@ static int mxt_initialize(struct mxt_data *data)
840792
if (error)
841793
goto err_free_object_table;
842794

843-
mxt_handle_pdata(data);
844-
845795
/* Backup to memory */
846796
mxt_write_object(data, MXT_GEN_COMMAND_T6,
847797
MXT_COMMAND_BACKUPNV,

‎drivers/platform/chrome/chromeos_laptop.c‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,8 @@ static struct i2c_board_info tsl2563_als_device = {
8585
};
8686

8787
static struct mxt_platform_data atmel_224s_tp_platform_data = {
88-
.x_line = 18,
89-
.y_line = 12,
9088
.x_size = 102*20,
9189
.y_size = 68*20,
92-
.blen = 0x80, /* Gain setting is in upper 4 bits */
93-
.threshold = 0x32,
94-
.voltage = 0, /* 3.3V */
9590
.orient = MXT_VERTICAL_FLIP,
9691
.irqflags = IRQF_TRIGGER_FALLING,
9792
.is_tp = true,
@@ -110,13 +105,8 @@ static struct i2c_board_info atmel_224s_tp_device = {
110105
};
111106

112107
static struct mxt_platform_data atmel_1664s_platform_data = {
113-
.x_line = 32,
114-
.y_line = 50,
115108
.x_size = 1700,
116109
.y_size = 2560,
117-
.blen = 0x89, /* Gain setting is in upper 4 bits */
118-
.threshold = 0x28,
119-
.voltage = 0, /* 3.3V */
120110
.orient = MXT_ROTATED_90_COUNTER,
121111
.irqflags = IRQF_TRIGGER_FALLING,
122112
.is_tp = false,

‎include/linux/i2c/atmel_mxt_ts.h‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,10 @@ struct mxt_platform_data {
3333
const u8 *config;
3434
size_t config_length;
3535

36-
unsigned int x_line;
37-
unsigned int y_line;
3836
unsigned int x_size;
3937
unsigned int y_size;
40-
unsigned int blen;
41-
unsigned int threshold;
42-
unsigned int voltage;
4338
unsigned char orient;
39+
4440
unsigned long irqflags;
4541
bool is_tp;
4642
const unsigned int key_map[MXT_NUM_GPIO];

0 commit comments

Comments
 (0)