aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorPrzemo Firszt <przemo@firszt.eu>2012-03-22 14:54:05 -0400
committerJiri Kosina <jkosina@suse.cz>2012-03-28 04:22:56 -0400
commit224b321b312e9c03989e1563beaa50f98f9b48e0 (patch)
tree556274ddcb84117bb4cb31b6e7e8cbab6ee4f665 /drivers/hid
parentd464c92b5234227c1698862a1906827e2e398ae0 (diff)
HID: wacom: Remove CONFIG_HID_WACOM_POWER_SUPPLY option
This option was ment as a safety mechanism in case the system treats the wacom tablet battery as the main power supply. It's no longer required as now we can distinguish between system power supply and device power supply. Signed-off-by: Przemo Firszt <przemo@firszt.eu> Reviewed-by: Chris Bagwell <chris@cnpbagwell.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/Kconfig8
-rw-r--r--drivers/hid/hid-wacom.c16
2 files changed, 1 insertions, 23 deletions
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
index a3d033252995..c2ab80e5f62a 100644
--- a/drivers/hid/Kconfig
+++ b/drivers/hid/Kconfig
@@ -595,16 +595,10 @@ config THRUSTMASTER_FF
595config HID_WACOM 595config HID_WACOM
596 tristate "Wacom Bluetooth devices support" 596 tristate "Wacom Bluetooth devices support"
597 depends on BT_HIDP 597 depends on BT_HIDP
598 ---help---
599 Support for Wacom Graphire Bluetooth tablet.
600
601config HID_WACOM_POWER_SUPPLY
602 bool "Wacom Bluetooth devices power supply status support"
603 depends on HID_WACOM 598 depends on HID_WACOM
604 select POWER_SUPPLY 599 select POWER_SUPPLY
605 ---help--- 600 ---help---
606 Say Y here if you want to enable power supply status monitoring for 601 Support for Wacom Graphire Bluetooth tablet.
607 Wacom Bluetooth devices.
608 602
609config HID_WIIMOTE 603config HID_WIIMOTE
610 tristate "Nintendo Wii Remote support" 604 tristate "Nintendo Wii Remote support"
diff --git a/drivers/hid/hid-wacom.c b/drivers/hid/hid-wacom.c
index 067e2963314c..46de2acada46 100644
--- a/drivers/hid/hid-wacom.c
+++ b/drivers/hid/hid-wacom.c
@@ -25,9 +25,7 @@
25#include <linux/hid.h> 25#include <linux/hid.h>
26#include <linux/module.h> 26#include <linux/module.h>
27#include <linux/slab.h> 27#include <linux/slab.h>
28#ifdef CONFIG_HID_WACOM_POWER_SUPPLY
29#include <linux/power_supply.h> 28#include <linux/power_supply.h>
30#endif
31 29
32#include "hid-ids.h" 30#include "hid-ids.h"
33 31
@@ -41,14 +39,11 @@ struct wacom_data {
41 __u32 id; 39 __u32 id;
42 __u32 serial; 40 __u32 serial;
43 unsigned char high_speed; 41 unsigned char high_speed;
44#ifdef CONFIG_HID_WACOM_POWER_SUPPLY
45 int battery_capacity; 42 int battery_capacity;
46 struct power_supply battery; 43 struct power_supply battery;
47 struct power_supply ac; 44 struct power_supply ac;
48#endif
49}; 45};
50 46
51#ifdef CONFIG_HID_WACOM_POWER_SUPPLY
52/*percent of battery capacity, 0 means AC online*/ 47/*percent of battery capacity, 0 means AC online*/
53static unsigned short batcap[8] = { 1, 15, 25, 35, 50, 70, 100, 0 }; 48static unsigned short batcap[8] = { 1, 15, 25, 35, 50, 70, 100, 0 };
54 49
@@ -120,7 +115,6 @@ static int wacom_ac_get_property(struct power_supply *psy,
120 } 115 }
121 return ret; 116 return ret;
122} 117}
123#endif
124 118
125static void wacom_set_features(struct hid_device *hdev) 119static void wacom_set_features(struct hid_device *hdev)
126{ 120{
@@ -310,12 +304,10 @@ static int wacom_gr_parse_report(struct hid_device *hdev,
310 input_sync(input); 304 input_sync(input);
311 } 305 }
312 306
313#ifdef CONFIG_HID_WACOM_POWER_SUPPLY
314 /* Store current battery capacity */ 307 /* Store current battery capacity */
315 rw = (data[7] >> 2 & 0x07); 308 rw = (data[7] >> 2 & 0x07);
316 if (rw != wdata->battery_capacity) 309 if (rw != wdata->battery_capacity)
317 wdata->battery_capacity = rw; 310 wdata->battery_capacity = rw;
318#endif
319 return 1; 311 return 1;
320} 312}
321 313
@@ -596,7 +588,6 @@ static int wacom_probe(struct hid_device *hdev,
596 break; 588 break;
597 } 589 }
598 590
599#ifdef CONFIG_HID_WACOM_POWER_SUPPLY
600 wdata->battery.properties = wacom_battery_props; 591 wdata->battery.properties = wacom_battery_props;
601 wdata->battery.num_properties = ARRAY_SIZE(wacom_battery_props); 592 wdata->battery.num_properties = ARRAY_SIZE(wacom_battery_props);
602 wdata->battery.get_property = wacom_battery_get_property; 593 wdata->battery.get_property = wacom_battery_get_property;
@@ -629,16 +620,13 @@ static int wacom_probe(struct hid_device *hdev,
629 } 620 }
630 621
631 power_supply_powers(&wdata->ac, &hdev->dev); 622 power_supply_powers(&wdata->ac, &hdev->dev);
632#endif
633 return 0; 623 return 0;
634 624
635#ifdef CONFIG_HID_WACOM_POWER_SUPPLY
636err_ac: 625err_ac:
637 power_supply_unregister(&wdata->battery); 626 power_supply_unregister(&wdata->battery);
638err_battery: 627err_battery:
639 device_remove_file(&hdev->dev, &dev_attr_speed); 628 device_remove_file(&hdev->dev, &dev_attr_speed);
640 hid_hw_stop(hdev); 629 hid_hw_stop(hdev);
641#endif
642err_free: 630err_free:
643 kfree(wdata); 631 kfree(wdata);
644 return ret; 632 return ret;
@@ -646,16 +634,12 @@ err_free:
646 634
647static void wacom_remove(struct hid_device *hdev) 635static void wacom_remove(struct hid_device *hdev)
648{ 636{
649#ifdef CONFIG_HID_WACOM_POWER_SUPPLY
650 struct wacom_data *wdata = hid_get_drvdata(hdev); 637 struct wacom_data *wdata = hid_get_drvdata(hdev);
651#endif
652 device_remove_file(&hdev->dev, &dev_attr_speed); 638 device_remove_file(&hdev->dev, &dev_attr_speed);
653 hid_hw_stop(hdev); 639 hid_hw_stop(hdev);
654 640
655#ifdef CONFIG_HID_WACOM_POWER_SUPPLY
656 power_supply_unregister(&wdata->battery); 641 power_supply_unregister(&wdata->battery);
657 power_supply_unregister(&wdata->ac); 642 power_supply_unregister(&wdata->ac);
658#endif
659 kfree(hid_get_drvdata(hdev)); 643 kfree(hid_get_drvdata(hdev));
660} 644}
661 645