aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>2014-07-24 15:49:08 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2014-07-25 21:53:47 -0400
commit10059cdc0ad0be9dc8f7df2fbf2e21b406a94539 (patch)
tree9fd25fb2b64384555176ecfd29e6b6d43a566f66
parentd2d13f18aaa51af070c7b6f20606d5cfdb7e87c1 (diff)
Input: wacom - split out the pad device for Intuos/Cintiq
MSC_SERIAL can be safely dropped for pad input devices. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Reviewed-by: Ping Cheng <pingc@wacom.com> Reviewed-by: Jason Gerecke <killertofu@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-rw-r--r--drivers/input/tablet/wacom_wac.c208
1 files changed, 122 insertions, 86 deletions
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index 4b16a34c95fb..8807ab511974 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -584,6 +584,7 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
584 584
585 /* pad packets. Works as a second tool and is always in prox */ 585 /* pad packets. Works as a second tool and is always in prox */
586 if (data[0] == WACOM_REPORT_INTUOSPAD || data[0] == WACOM_REPORT_INTUOS5PAD) { 586 if (data[0] == WACOM_REPORT_INTUOSPAD || data[0] == WACOM_REPORT_INTUOS5PAD) {
587 input = wacom->pad_input;
587 if (features->type >= INTUOS4S && features->type <= INTUOS4L) { 588 if (features->type >= INTUOS4S && features->type <= INTUOS4L) {
588 input_report_key(input, BTN_0, (data[2] & 0x01)); 589 input_report_key(input, BTN_0, (data[2] & 0x01));
589 input_report_key(input, BTN_1, (data[3] & 0x01)); 590 input_report_key(input, BTN_1, (data[3] & 0x01));
@@ -773,7 +774,6 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
773 input_report_abs(input, ABS_MISC, 0); 774 input_report_abs(input, ABS_MISC, 0);
774 } 775 }
775 } 776 }
776 input_event(input, EV_MSC, MSC_SERIAL, 0xffffffff);
777 return 1; 777 return 1;
778 } 778 }
779 779
@@ -1656,61 +1656,20 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev,
1656 break; 1656 break;
1657 1657
1658 case WACOM_24HD: 1658 case WACOM_24HD:
1659 __set_bit(BTN_A, input_dev->keybit);
1660 __set_bit(BTN_B, input_dev->keybit);
1661 __set_bit(BTN_C, input_dev->keybit);
1662 __set_bit(BTN_X, input_dev->keybit);
1663 __set_bit(BTN_Y, input_dev->keybit);
1664 __set_bit(BTN_Z, input_dev->keybit);
1665
1666 for (i = 6; i < 10; i++)
1667 __set_bit(BTN_0 + i, input_dev->keybit);
1668
1669 __set_bit(KEY_PROG1, input_dev->keybit);
1670 __set_bit(KEY_PROG2, input_dev->keybit);
1671 __set_bit(KEY_PROG3, input_dev->keybit);
1672
1673 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); 1659 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
1674 input_set_abs_params(input_dev, ABS_THROTTLE, 0, 71, 0, 0); 1660 input_set_abs_params(input_dev, ABS_THROTTLE, 0, 71, 0, 0);
1675 /* fall through */ 1661 /* fall through */
1676 1662
1677 case DTK: 1663 case DTK:
1678 for (i = 0; i < 6; i++)
1679 __set_bit(BTN_0 + i, input_dev->keybit);
1680
1681 __set_bit(INPUT_PROP_DIRECT, input_dev->propbit); 1664 __set_bit(INPUT_PROP_DIRECT, input_dev->propbit);
1682 1665
1683 wacom_setup_cintiq(wacom_wac); 1666 wacom_setup_cintiq(wacom_wac);
1684 break; 1667 break;
1685 1668
1686 case WACOM_22HD: 1669 case WACOM_22HD:
1687 __set_bit(KEY_PROG1, input_dev->keybit);
1688 __set_bit(KEY_PROG2, input_dev->keybit);
1689 __set_bit(KEY_PROG3, input_dev->keybit);
1690 /* fall through */
1691
1692 case WACOM_21UX2: 1670 case WACOM_21UX2:
1693 __set_bit(BTN_A, input_dev->keybit);
1694 __set_bit(BTN_B, input_dev->keybit);
1695 __set_bit(BTN_C, input_dev->keybit);
1696 __set_bit(BTN_X, input_dev->keybit);
1697 __set_bit(BTN_Y, input_dev->keybit);
1698 __set_bit(BTN_Z, input_dev->keybit);
1699 __set_bit(BTN_BASE, input_dev->keybit);
1700 __set_bit(BTN_BASE2, input_dev->keybit);
1701 /* fall through */
1702
1703 case WACOM_BEE: 1671 case WACOM_BEE:
1704 __set_bit(BTN_8, input_dev->keybit);
1705 __set_bit(BTN_9, input_dev->keybit);
1706 /* fall through */
1707
1708 case CINTIQ: 1672 case CINTIQ:
1709 for (i = 0; i < 8; i++)
1710 __set_bit(BTN_0 + i, input_dev->keybit);
1711
1712 input_set_abs_params(input_dev, ABS_RX, 0, 4096, 0, 0);
1713 input_set_abs_params(input_dev, ABS_RY, 0, 4096, 0, 0);
1714 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); 1673 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
1715 1674
1716 __set_bit(INPUT_PROP_DIRECT, input_dev->propbit); 1675 __set_bit(INPUT_PROP_DIRECT, input_dev->propbit);
@@ -1719,9 +1678,6 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev,
1719 break; 1678 break;
1720 1679
1721 case WACOM_13HD: 1680 case WACOM_13HD:
1722 for (i = 0; i < 9; i++)
1723 __set_bit(BTN_0 + i, input_dev->keybit);
1724
1725 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); 1681 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
1726 __set_bit(INPUT_PROP_DIRECT, input_dev->propbit); 1682 __set_bit(INPUT_PROP_DIRECT, input_dev->propbit);
1727 wacom_setup_cintiq(wacom_wac); 1683 wacom_setup_cintiq(wacom_wac);
@@ -1729,21 +1685,7 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev,
1729 1685
1730 case INTUOS3: 1686 case INTUOS3:
1731 case INTUOS3L: 1687 case INTUOS3L:
1732 __set_bit(BTN_4, input_dev->keybit);
1733 __set_bit(BTN_5, input_dev->keybit);
1734 __set_bit(BTN_6, input_dev->keybit);
1735 __set_bit(BTN_7, input_dev->keybit);
1736
1737 input_set_abs_params(input_dev, ABS_RY, 0, 4096, 0, 0);
1738 /* fall through */
1739
1740 case INTUOS3S: 1688 case INTUOS3S:
1741 __set_bit(BTN_0, input_dev->keybit);
1742 __set_bit(BTN_1, input_dev->keybit);
1743 __set_bit(BTN_2, input_dev->keybit);
1744 __set_bit(BTN_3, input_dev->keybit);
1745
1746 input_set_abs_params(input_dev, ABS_RX, 0, 4096, 0, 0);
1747 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); 1689 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
1748 /* fall through */ 1690 /* fall through */
1749 1691
@@ -1757,20 +1699,11 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev,
1757 case INTUOS5L: 1699 case INTUOS5L:
1758 case INTUOSPM: 1700 case INTUOSPM:
1759 case INTUOSPL: 1701 case INTUOSPL:
1760 if (features->device_type == BTN_TOOL_PEN) {
1761 __set_bit(BTN_7, input_dev->keybit);
1762 __set_bit(BTN_8, input_dev->keybit);
1763 }
1764 /* fall through */
1765
1766 case INTUOS5S: 1702 case INTUOS5S:
1767 case INTUOSPS: 1703 case INTUOSPS:
1768 __set_bit(INPUT_PROP_POINTER, input_dev->propbit); 1704 __set_bit(INPUT_PROP_POINTER, input_dev->propbit);
1769 1705
1770 if (features->device_type == BTN_TOOL_PEN) { 1706 if (features->device_type == BTN_TOOL_PEN) {
1771 for (i = 0; i < 7; i++)
1772 __set_bit(BTN_0 + i, input_dev->keybit);
1773
1774 input_set_abs_params(input_dev, ABS_DISTANCE, 0, 1707 input_set_abs_params(input_dev, ABS_DISTANCE, 0,
1775 features->distance_max, 1708 features->distance_max,
1776 0, 0); 1709 0, 0);
@@ -1791,14 +1724,7 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev,
1791 1724
1792 case INTUOS4: 1725 case INTUOS4:
1793 case INTUOS4L: 1726 case INTUOS4L:
1794 __set_bit(BTN_7, input_dev->keybit);
1795 __set_bit(BTN_8, input_dev->keybit);
1796 /* fall through */
1797
1798 case INTUOS4S: 1727 case INTUOS4S:
1799 for (i = 0; i < 7; i++)
1800 __set_bit(BTN_0 + i, input_dev->keybit);
1801
1802 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); 1728 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
1803 wacom_setup_intuos(wacom_wac); 1729 wacom_setup_intuos(wacom_wac);
1804 1730
@@ -1922,17 +1848,6 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev,
1922 break; 1848 break;
1923 1849
1924 case CINTIQ_HYBRID: 1850 case CINTIQ_HYBRID:
1925 __set_bit(BTN_1, input_dev->keybit);
1926 __set_bit(BTN_2, input_dev->keybit);
1927 __set_bit(BTN_3, input_dev->keybit);
1928 __set_bit(BTN_4, input_dev->keybit);
1929
1930 __set_bit(BTN_5, input_dev->keybit);
1931 __set_bit(BTN_6, input_dev->keybit);
1932 __set_bit(BTN_7, input_dev->keybit);
1933 __set_bit(BTN_8, input_dev->keybit);
1934 __set_bit(BTN_0, input_dev->keybit);
1935
1936 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); 1851 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
1937 __set_bit(INPUT_PROP_DIRECT, input_dev->propbit); 1852 __set_bit(INPUT_PROP_DIRECT, input_dev->propbit);
1938 1853
@@ -1946,6 +1861,7 @@ int wacom_setup_pad_input_capabilities(struct input_dev *input_dev,
1946 struct wacom_wac *wacom_wac) 1861 struct wacom_wac *wacom_wac)
1947{ 1862{
1948 struct wacom_features *features = &wacom_wac->features; 1863 struct wacom_features *features = &wacom_wac->features;
1864 int i;
1949 1865
1950 input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); 1866 input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
1951 1867
@@ -1957,6 +1873,126 @@ int wacom_setup_pad_input_capabilities(struct input_dev *input_dev,
1957 input_set_abs_params(input_dev, ABS_Y, 0, 1, 0, 0); 1873 input_set_abs_params(input_dev, ABS_Y, 0, 1, 0, 0);
1958 1874
1959 switch (features->type) { 1875 switch (features->type) {
1876 case WACOM_24HD:
1877 __set_bit(BTN_A, input_dev->keybit);
1878 __set_bit(BTN_B, input_dev->keybit);
1879 __set_bit(BTN_C, input_dev->keybit);
1880 __set_bit(BTN_X, input_dev->keybit);
1881 __set_bit(BTN_Y, input_dev->keybit);
1882 __set_bit(BTN_Z, input_dev->keybit);
1883
1884 for (i = 0; i < 10; i++)
1885 __set_bit(BTN_0 + i, input_dev->keybit);
1886
1887 __set_bit(KEY_PROG1, input_dev->keybit);
1888 __set_bit(KEY_PROG2, input_dev->keybit);
1889 __set_bit(KEY_PROG3, input_dev->keybit);
1890
1891 input_set_abs_params(input_dev, ABS_WHEEL, 0, 71, 0, 0);
1892 input_set_abs_params(input_dev, ABS_THROTTLE, 0, 71, 0, 0);
1893 break;
1894
1895 case DTK:
1896 for (i = 0; i < 6; i++)
1897 __set_bit(BTN_0 + i, input_dev->keybit);
1898
1899 break;
1900
1901 case WACOM_22HD:
1902 __set_bit(KEY_PROG1, input_dev->keybit);
1903 __set_bit(KEY_PROG2, input_dev->keybit);
1904 __set_bit(KEY_PROG3, input_dev->keybit);
1905 /* fall through */
1906
1907 case WACOM_21UX2:
1908 __set_bit(BTN_A, input_dev->keybit);
1909 __set_bit(BTN_B, input_dev->keybit);
1910 __set_bit(BTN_C, input_dev->keybit);
1911 __set_bit(BTN_X, input_dev->keybit);
1912 __set_bit(BTN_Y, input_dev->keybit);
1913 __set_bit(BTN_Z, input_dev->keybit);
1914 __set_bit(BTN_BASE, input_dev->keybit);
1915 __set_bit(BTN_BASE2, input_dev->keybit);
1916 /* fall through */
1917
1918 case WACOM_BEE:
1919 __set_bit(BTN_8, input_dev->keybit);
1920 __set_bit(BTN_9, input_dev->keybit);
1921 /* fall through */
1922
1923 case CINTIQ:
1924 for (i = 0; i < 8; i++)
1925 __set_bit(BTN_0 + i, input_dev->keybit);
1926
1927 input_set_abs_params(input_dev, ABS_RX, 0, 4096, 0, 0);
1928 input_set_abs_params(input_dev, ABS_RY, 0, 4096, 0, 0);
1929 break;
1930
1931 case WACOM_13HD:
1932 for (i = 0; i < 9; i++)
1933 __set_bit(BTN_0 + i, input_dev->keybit);
1934
1935 input_set_abs_params(input_dev, ABS_WHEEL, 0, 71, 0, 0);
1936 break;
1937
1938 case INTUOS3:
1939 case INTUOS3L:
1940 __set_bit(BTN_4, input_dev->keybit);
1941 __set_bit(BTN_5, input_dev->keybit);
1942 __set_bit(BTN_6, input_dev->keybit);
1943 __set_bit(BTN_7, input_dev->keybit);
1944
1945 input_set_abs_params(input_dev, ABS_RY, 0, 4096, 0, 0);
1946 /* fall through */
1947
1948 case INTUOS3S:
1949 __set_bit(BTN_0, input_dev->keybit);
1950 __set_bit(BTN_1, input_dev->keybit);
1951 __set_bit(BTN_2, input_dev->keybit);
1952 __set_bit(BTN_3, input_dev->keybit);
1953
1954 input_set_abs_params(input_dev, ABS_RX, 0, 4096, 0, 0);
1955 break;
1956
1957 case INTUOS5:
1958 case INTUOS5L:
1959 case INTUOSPM:
1960 case INTUOSPL:
1961 __set_bit(BTN_7, input_dev->keybit);
1962 __set_bit(BTN_8, input_dev->keybit);
1963 /* fall through */
1964
1965 case INTUOS5S:
1966 case INTUOSPS:
1967 /* touch interface does not have the pad device */
1968 if (features->device_type != BTN_TOOL_PEN)
1969 return 1;
1970
1971 for (i = 0; i < 7; i++)
1972 __set_bit(BTN_0 + i, input_dev->keybit);
1973
1974 input_set_abs_params(input_dev, ABS_WHEEL, 0, 71, 0, 0);
1975 break;
1976
1977 case INTUOS4:
1978 case INTUOS4L:
1979 __set_bit(BTN_7, input_dev->keybit);
1980 __set_bit(BTN_8, input_dev->keybit);
1981 /* fall through */
1982
1983 case INTUOS4S:
1984 for (i = 0; i < 7; i++)
1985 __set_bit(BTN_0 + i, input_dev->keybit);
1986
1987 input_set_abs_params(input_dev, ABS_WHEEL, 0, 71, 0, 0);
1988 break;
1989
1990 case CINTIQ_HYBRID:
1991 for (i = 0; i < 9; i++)
1992 __set_bit(BTN_0 + i, input_dev->keybit);
1993
1994 break;
1995
1960 default: 1996 default:
1961 /* no pad supported */ 1997 /* no pad supported */
1962 return 1; 1998 return 1;