aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorNick Dyer <nick.dyer@itdev.co.uk>2014-05-19 01:59:20 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2014-05-19 02:27:21 -0400
commit2cefdb1f0a27150755ef2730bafc58bf2ed16571 (patch)
tree127925ae0d0eea796f8ef9465c591678f7145790 /drivers/input
parent7cdcb8d104e6f0ec5d253d29e4849cdb2cf03aed (diff)
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>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/touchscreen/atmel_mxt_ts.c50
1 files changed, 0 insertions, 50 deletions
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
index a70400754e92..7eb515caf215 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -685,54 +685,6 @@ static int mxt_make_highchg(struct mxt_data *data)
685 return 0; 685 return 0;
686} 686}
687 687
688static 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
736static int mxt_get_info(struct mxt_data *data) 688static int mxt_get_info(struct mxt_data *data)
737{ 689{
738 struct i2c_client *client = data->client; 690 struct i2c_client *client = data->client;
@@ -840,8 +792,6 @@ static int mxt_initialize(struct mxt_data *data)
840 if (error) 792 if (error)
841 goto err_free_object_table; 793 goto err_free_object_table;
842 794
843 mxt_handle_pdata(data);
844
845 /* Backup to memory */ 795 /* Backup to memory */
846 mxt_write_object(data, MXT_GEN_COMMAND_T6, 796 mxt_write_object(data, MXT_GEN_COMMAND_T6,
847 MXT_COMMAND_BACKUPNV, 797 MXT_COMMAND_BACKUPNV,