@@ -1494,123 +1494,6 @@ static void wacom_calculate_res(struct wacom_features *features)
1494
1494
features -> unitExpo );
1495
1495
}
1496
1496
1497
- static void wacom_wireless_work (struct work_struct * work )
1498
- {
1499
- struct wacom * wacom = container_of (work , struct wacom , work );
1500
- struct usb_device * usbdev = wacom -> usbdev ;
1501
- struct wacom_wac * wacom_wac = & wacom -> wacom_wac ;
1502
- struct hid_device * hdev1 , * hdev2 ;
1503
- struct wacom * wacom1 , * wacom2 ;
1504
- struct wacom_wac * wacom_wac1 , * wacom_wac2 ;
1505
- int error ;
1506
-
1507
- /*
1508
- * Regardless if this is a disconnect or a new tablet,
1509
- * remove any existing input and battery devices.
1510
- */
1511
-
1512
- wacom_destroy_battery (wacom );
1513
-
1514
- /* Stylus interface */
1515
- hdev1 = usb_get_intfdata (usbdev -> config -> interface [1 ]);
1516
- wacom1 = hid_get_drvdata (hdev1 );
1517
- wacom_wac1 = & (wacom1 -> wacom_wac );
1518
- wacom_clean_inputs (wacom1 );
1519
-
1520
- /* Touch interface */
1521
- hdev2 = usb_get_intfdata (usbdev -> config -> interface [2 ]);
1522
- wacom2 = hid_get_drvdata (hdev2 );
1523
- wacom_wac2 = & (wacom2 -> wacom_wac );
1524
- wacom_clean_inputs (wacom2 );
1525
-
1526
- if (wacom_wac -> pid == 0 ) {
1527
- hid_info (wacom -> hdev , "wireless tablet disconnected\n" );
1528
- wacom_wac1 -> shared -> type = 0 ;
1529
- } else {
1530
- const struct hid_device_id * id = wacom_ids ;
1531
-
1532
- hid_info (wacom -> hdev , "wireless tablet connected with PID %x\n" ,
1533
- wacom_wac -> pid );
1534
-
1535
- while (id -> bus ) {
1536
- if (id -> vendor == USB_VENDOR_ID_WACOM &&
1537
- id -> product == wacom_wac -> pid )
1538
- break ;
1539
- id ++ ;
1540
- }
1541
-
1542
- if (!id -> bus ) {
1543
- hid_info (wacom -> hdev , "ignoring unknown PID.\n" );
1544
- return ;
1545
- }
1546
-
1547
- /* Stylus interface */
1548
- wacom_wac1 -> features =
1549
- * ((struct wacom_features * )id -> driver_data );
1550
- wacom_wac1 -> features .device_type |= WACOM_DEVICETYPE_PEN ;
1551
- wacom_set_default_phy (& wacom_wac1 -> features );
1552
- wacom_calculate_res (& wacom_wac1 -> features );
1553
- snprintf (wacom_wac1 -> pen_name , WACOM_NAME_MAX , "%s (WL) Pen" ,
1554
- wacom_wac1 -> features .name );
1555
- if (wacom_wac1 -> features .type < BAMBOO_PEN ||
1556
- wacom_wac1 -> features .type > BAMBOO_PT ) {
1557
- snprintf (wacom_wac1 -> pad_name , WACOM_NAME_MAX , "%s (WL) Pad" ,
1558
- wacom_wac1 -> features .name );
1559
- wacom_wac1 -> features .device_type |= WACOM_DEVICETYPE_PAD ;
1560
- }
1561
- wacom_wac1 -> shared -> touch_max = wacom_wac1 -> features .touch_max ;
1562
- wacom_wac1 -> shared -> type = wacom_wac1 -> features .type ;
1563
- wacom_wac1 -> pid = wacom_wac -> pid ;
1564
- error = wacom_allocate_inputs (wacom1 ) ||
1565
- wacom_register_inputs (wacom1 );
1566
- if (error )
1567
- goto fail ;
1568
-
1569
- /* Touch interface */
1570
- if (wacom_wac1 -> features .touch_max ||
1571
- (wacom_wac1 -> features .type >= INTUOSHT &&
1572
- wacom_wac1 -> features .type <= BAMBOO_PT )) {
1573
- wacom_wac2 -> features =
1574
- * ((struct wacom_features * )id -> driver_data );
1575
- wacom_wac2 -> features .pktlen = WACOM_PKGLEN_BBTOUCH3 ;
1576
- wacom_set_default_phy (& wacom_wac2 -> features );
1577
- wacom_wac2 -> features .x_max = wacom_wac2 -> features .y_max = 4096 ;
1578
- wacom_calculate_res (& wacom_wac2 -> features );
1579
- snprintf (wacom_wac2 -> touch_name , WACOM_NAME_MAX ,
1580
- "%s (WL) Finger" ,wacom_wac2 -> features .name );
1581
- if (wacom_wac1 -> features .touch_max )
1582
- wacom_wac2 -> features .device_type |= WACOM_DEVICETYPE_TOUCH ;
1583
- if (wacom_wac1 -> features .type >= INTUOSHT &&
1584
- wacom_wac1 -> features .type <= BAMBOO_PT ) {
1585
- snprintf (wacom_wac2 -> pad_name , WACOM_NAME_MAX ,
1586
- "%s (WL) Pad" ,wacom_wac2 -> features .name );
1587
- wacom_wac2 -> features .device_type |= WACOM_DEVICETYPE_PAD ;
1588
- }
1589
- wacom_wac2 -> pid = wacom_wac -> pid ;
1590
- error = wacom_allocate_inputs (wacom2 ) ||
1591
- wacom_register_inputs (wacom2 );
1592
- if (error )
1593
- goto fail ;
1594
-
1595
- if ((wacom_wac1 -> features .type == INTUOSHT ||
1596
- wacom_wac1 -> features .type == INTUOSHT2 ) &&
1597
- wacom_wac1 -> features .touch_max )
1598
- wacom_wac -> shared -> touch_input = wacom_wac2 -> touch_input ;
1599
- }
1600
-
1601
- error = wacom_initialize_battery (wacom );
1602
- if (error )
1603
- goto fail ;
1604
- }
1605
-
1606
- return ;
1607
-
1608
- fail :
1609
- wacom_clean_inputs (wacom1 );
1610
- wacom_clean_inputs (wacom2 );
1611
- return ;
1612
- }
1613
-
1614
1497
void wacom_battery_work (struct work_struct * work )
1615
1498
{
1616
1499
struct wacom * wacom = container_of (work , struct wacom , work );
@@ -1809,6 +1692,123 @@ static int wacom_parse_and_register(struct wacom *wacom)
1809
1692
return error ;
1810
1693
}
1811
1694
1695
+ static void wacom_wireless_work (struct work_struct * work )
1696
+ {
1697
+ struct wacom * wacom = container_of (work , struct wacom , work );
1698
+ struct usb_device * usbdev = wacom -> usbdev ;
1699
+ struct wacom_wac * wacom_wac = & wacom -> wacom_wac ;
1700
+ struct hid_device * hdev1 , * hdev2 ;
1701
+ struct wacom * wacom1 , * wacom2 ;
1702
+ struct wacom_wac * wacom_wac1 , * wacom_wac2 ;
1703
+ int error ;
1704
+
1705
+ /*
1706
+ * Regardless if this is a disconnect or a new tablet,
1707
+ * remove any existing input and battery devices.
1708
+ */
1709
+
1710
+ wacom_destroy_battery (wacom );
1711
+
1712
+ /* Stylus interface */
1713
+ hdev1 = usb_get_intfdata (usbdev -> config -> interface [1 ]);
1714
+ wacom1 = hid_get_drvdata (hdev1 );
1715
+ wacom_wac1 = & (wacom1 -> wacom_wac );
1716
+ wacom_clean_inputs (wacom1 );
1717
+
1718
+ /* Touch interface */
1719
+ hdev2 = usb_get_intfdata (usbdev -> config -> interface [2 ]);
1720
+ wacom2 = hid_get_drvdata (hdev2 );
1721
+ wacom_wac2 = & (wacom2 -> wacom_wac );
1722
+ wacom_clean_inputs (wacom2 );
1723
+
1724
+ if (wacom_wac -> pid == 0 ) {
1725
+ hid_info (wacom -> hdev , "wireless tablet disconnected\n" );
1726
+ wacom_wac1 -> shared -> type = 0 ;
1727
+ } else {
1728
+ const struct hid_device_id * id = wacom_ids ;
1729
+
1730
+ hid_info (wacom -> hdev , "wireless tablet connected with PID %x\n" ,
1731
+ wacom_wac -> pid );
1732
+
1733
+ while (id -> bus ) {
1734
+ if (id -> vendor == USB_VENDOR_ID_WACOM &&
1735
+ id -> product == wacom_wac -> pid )
1736
+ break ;
1737
+ id ++ ;
1738
+ }
1739
+
1740
+ if (!id -> bus ) {
1741
+ hid_info (wacom -> hdev , "ignoring unknown PID.\n" );
1742
+ return ;
1743
+ }
1744
+
1745
+ /* Stylus interface */
1746
+ wacom_wac1 -> features =
1747
+ * ((struct wacom_features * )id -> driver_data );
1748
+ wacom_wac1 -> features .device_type |= WACOM_DEVICETYPE_PEN ;
1749
+ wacom_set_default_phy (& wacom_wac1 -> features );
1750
+ wacom_calculate_res (& wacom_wac1 -> features );
1751
+ snprintf (wacom_wac1 -> pen_name , WACOM_NAME_MAX , "%s (WL) Pen" ,
1752
+ wacom_wac1 -> features .name );
1753
+ if (wacom_wac1 -> features .type < BAMBOO_PEN ||
1754
+ wacom_wac1 -> features .type > BAMBOO_PT ) {
1755
+ snprintf (wacom_wac1 -> pad_name , WACOM_NAME_MAX ,
1756
+ "%s (WL) Pad" , wacom_wac1 -> features .name );
1757
+ wacom_wac1 -> features .device_type |= WACOM_DEVICETYPE_PAD ;
1758
+ }
1759
+ wacom_wac1 -> shared -> touch_max = wacom_wac1 -> features .touch_max ;
1760
+ wacom_wac1 -> shared -> type = wacom_wac1 -> features .type ;
1761
+ wacom_wac1 -> pid = wacom_wac -> pid ;
1762
+ error = wacom_allocate_inputs (wacom1 ) ||
1763
+ wacom_register_inputs (wacom1 );
1764
+ if (error )
1765
+ goto fail ;
1766
+
1767
+ /* Touch interface */
1768
+ if (wacom_wac1 -> features .touch_max ||
1769
+ (wacom_wac1 -> features .type >= INTUOSHT &&
1770
+ wacom_wac1 -> features .type <= BAMBOO_PT )) {
1771
+ wacom_wac2 -> features =
1772
+ * ((struct wacom_features * )id -> driver_data );
1773
+ wacom_wac2 -> features .pktlen = WACOM_PKGLEN_BBTOUCH3 ;
1774
+ wacom_set_default_phy (& wacom_wac2 -> features );
1775
+ wacom_wac2 -> features .x_max = wacom_wac2 -> features .y_max = 4096 ;
1776
+ wacom_calculate_res (& wacom_wac2 -> features );
1777
+ snprintf (wacom_wac2 -> touch_name , WACOM_NAME_MAX ,
1778
+ "%s (WL) Finger" , wacom_wac2 -> features .name );
1779
+ if (wacom_wac1 -> features .touch_max )
1780
+ wacom_wac2 -> features .device_type |= WACOM_DEVICETYPE_TOUCH ;
1781
+ if (wacom_wac1 -> features .type >= INTUOSHT &&
1782
+ wacom_wac1 -> features .type <= BAMBOO_PT ) {
1783
+ snprintf (wacom_wac2 -> pad_name , WACOM_NAME_MAX ,
1784
+ "%s (WL) Pad" , wacom_wac2 -> features .name );
1785
+ wacom_wac2 -> features .device_type |= WACOM_DEVICETYPE_PAD ;
1786
+ }
1787
+ wacom_wac2 -> pid = wacom_wac -> pid ;
1788
+ error = wacom_allocate_inputs (wacom2 ) ||
1789
+ wacom_register_inputs (wacom2 );
1790
+ if (error )
1791
+ goto fail ;
1792
+
1793
+ if ((wacom_wac1 -> features .type == INTUOSHT ||
1794
+ wacom_wac1 -> features .type == INTUOSHT2 ) &&
1795
+ wacom_wac1 -> features .touch_max )
1796
+ wacom_wac -> shared -> touch_input = wacom_wac2 -> touch_input ;
1797
+ }
1798
+
1799
+ error = wacom_initialize_battery (wacom );
1800
+ if (error )
1801
+ goto fail ;
1802
+ }
1803
+
1804
+ return ;
1805
+
1806
+ fail :
1807
+ wacom_clean_inputs (wacom1 );
1808
+ wacom_clean_inputs (wacom2 );
1809
+ return ;
1810
+ }
1811
+
1812
1812
static int wacom_probe (struct hid_device * hdev ,
1813
1813
const struct hid_device_id * id )
1814
1814
{
0 commit comments