aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIiro Valkonen <iiro.valkonen@atmel.com>2011-02-24 00:07:20 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2011-02-25 12:27:00 -0500
commit0d3c07378bb7d423302d7cb0dcd3fa5a26c40220 (patch)
treebcf3554d15738f5e40706df1c294aa113fa0921b
parent5f62615ef5e50b0ad6c125fe1e38f2ac675012e2 (diff)
Input: atmel_mxt_ts - remove matrix size check
The mxt_check_matrix_size() is currently setting the CTE mode to match xline/yline information that is in the platform data, but it does not take into account for example the fact that we could have a key array in use too (key array would use some x/y lines as well). It would be better to simply rely on the configuration data, and make sure that the CTE mode set in there matches the touch object (touchscreen, key array, proximity) configuration (which are set in the config data too). Signed-off-by: Iiro Valkonen <iiro.valkonen@atmel.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
-rw-r--r--drivers/input/touchscreen/atmel_mxt_ts.c73
1 files changed, 0 insertions, 73 deletions
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
index d2e5864ca09..6264ba80c38 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -630,74 +630,6 @@ static int mxt_check_reg_init(struct mxt_data *data)
630 return 0; 630 return 0;
631} 631}
632 632
633static int mxt_check_matrix_size(struct mxt_data *data)
634{
635 const struct mxt_platform_data *pdata = data->pdata;
636 struct device *dev = &data->client->dev;
637 int mode = -1;
638 int error;
639 u8 val;
640
641 dev_dbg(dev, "Number of X lines: %d\n", pdata->x_line);
642 dev_dbg(dev, "Number of Y lines: %d\n", pdata->y_line);
643
644 switch (pdata->x_line) {
645 case 0 ... 15:
646 if (pdata->y_line <= 14)
647 mode = 0;
648 break;
649 case 16:
650 if (pdata->y_line <= 12)
651 mode = 1;
652 if (pdata->y_line == 13 || pdata->y_line == 14)
653 mode = 0;
654 break;
655 case 17:
656 if (pdata->y_line <= 11)
657 mode = 2;
658 if (pdata->y_line == 12 || pdata->y_line == 13)
659 mode = 1;
660 break;
661 case 18:
662 if (pdata->y_line <= 10)
663 mode = 3;
664 if (pdata->y_line == 11 || pdata->y_line == 12)
665 mode = 2;
666 break;
667 case 19:
668 if (pdata->y_line <= 9)
669 mode = 4;
670 if (pdata->y_line == 10 || pdata->y_line == 11)
671 mode = 3;
672 break;
673 case 20:
674 mode = 4;
675 }
676
677 if (mode < 0) {
678 dev_err(dev, "Invalid X/Y lines\n");
679 return -EINVAL;
680 }
681
682 error = mxt_read_object(data, MXT_SPT_CTECONFIG,
683 MXT_CTE_MODE, &val);
684 if (error)
685 return error;
686
687 if (mode == val)
688 return 0;
689
690 /* Change the CTE configuration */
691 mxt_write_object(data, MXT_SPT_CTECONFIG,
692 MXT_CTE_CTRL, 1);
693 mxt_write_object(data, MXT_SPT_CTECONFIG,
694 MXT_CTE_MODE, mode);
695 mxt_write_object(data, MXT_SPT_CTECONFIG,
696 MXT_CTE_CTRL, 0);
697
698 return 0;
699}
700
701static int mxt_make_highchg(struct mxt_data *data) 633static int mxt_make_highchg(struct mxt_data *data)
702{ 634{
703 struct device *dev = &data->client->dev; 635 struct device *dev = &data->client->dev;
@@ -864,11 +796,6 @@ static int mxt_initialize(struct mxt_data *data)
864 if (error) 796 if (error)
865 return error; 797 return error;
866 798
867 /* Check X/Y matrix size */
868 error = mxt_check_matrix_size(data);
869 if (error)
870 return error;
871
872 error = mxt_make_highchg(data); 799 error = mxt_make_highchg(data);
873 if (error) 800 if (error)
874 return error; 801 return error;