Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 224b321b authored by Przemo Firszt's avatar Przemo Firszt Committed by Jiri Kosina
Browse files

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: default avatarPrzemo Firszt <przemo@firszt.eu>
Reviewed-by: default avatarChris Bagwell <chris@cnpbagwell.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent d464c92b
Loading
Loading
Loading
Loading
+1 −7
Original line number Original line Diff line number Diff line
@@ -595,16 +595,10 @@ config THRUSTMASTER_FF
config HID_WACOM
config HID_WACOM
	tristate "Wacom Bluetooth devices support"
	tristate "Wacom Bluetooth devices support"
	depends on BT_HIDP
	depends on BT_HIDP
	---help---
	Support for Wacom Graphire Bluetooth tablet.

config HID_WACOM_POWER_SUPPLY
	bool "Wacom Bluetooth devices power supply status support"
	depends on HID_WACOM
	depends on HID_WACOM
	select POWER_SUPPLY
	select POWER_SUPPLY
	---help---
	---help---
	  Say Y here if you want to enable power supply status monitoring for
	Support for Wacom Graphire Bluetooth tablet.
	  Wacom Bluetooth devices.


config HID_WIIMOTE
config HID_WIIMOTE
	tristate "Nintendo Wii Remote support"
	tristate "Nintendo Wii Remote support"
+0 −16
Original line number Original line Diff line number Diff line
@@ -25,9 +25,7 @@
#include <linux/hid.h>
#include <linux/hid.h>
#include <linux/module.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/slab.h>
#ifdef CONFIG_HID_WACOM_POWER_SUPPLY
#include <linux/power_supply.h>
#include <linux/power_supply.h>
#endif


#include "hid-ids.h"
#include "hid-ids.h"


@@ -41,14 +39,11 @@ struct wacom_data {
	__u32 id;
	__u32 id;
	__u32 serial;
	__u32 serial;
	unsigned char high_speed;
	unsigned char high_speed;
#ifdef CONFIG_HID_WACOM_POWER_SUPPLY
	int battery_capacity;
	int battery_capacity;
	struct power_supply battery;
	struct power_supply battery;
	struct power_supply ac;
	struct power_supply ac;
#endif
};
};


#ifdef CONFIG_HID_WACOM_POWER_SUPPLY
/*percent of battery capacity, 0 means AC online*/
/*percent of battery capacity, 0 means AC online*/
static unsigned short batcap[8] = { 1, 15, 25, 35, 50, 70, 100, 0 };
static unsigned short batcap[8] = { 1, 15, 25, 35, 50, 70, 100, 0 };


@@ -120,7 +115,6 @@ static int wacom_ac_get_property(struct power_supply *psy,
	}
	}
	return ret;
	return ret;
}
}
#endif


static void wacom_set_features(struct hid_device *hdev)
static void wacom_set_features(struct hid_device *hdev)
{
{
@@ -310,12 +304,10 @@ static int wacom_gr_parse_report(struct hid_device *hdev,
		input_sync(input);
		input_sync(input);
	}
	}


#ifdef CONFIG_HID_WACOM_POWER_SUPPLY
	/* Store current battery capacity */
	/* Store current battery capacity */
	rw = (data[7] >> 2 & 0x07);
	rw = (data[7] >> 2 & 0x07);
	if (rw != wdata->battery_capacity)
	if (rw != wdata->battery_capacity)
		wdata->battery_capacity = rw;
		wdata->battery_capacity = rw;
#endif
	return 1;
	return 1;
}
}


@@ -596,7 +588,6 @@ static int wacom_probe(struct hid_device *hdev,
		break;
		break;
	}
	}


#ifdef CONFIG_HID_WACOM_POWER_SUPPLY
	wdata->battery.properties = wacom_battery_props;
	wdata->battery.properties = wacom_battery_props;
	wdata->battery.num_properties = ARRAY_SIZE(wacom_battery_props);
	wdata->battery.num_properties = ARRAY_SIZE(wacom_battery_props);
	wdata->battery.get_property = wacom_battery_get_property;
	wdata->battery.get_property = wacom_battery_get_property;
@@ -629,16 +620,13 @@ static int wacom_probe(struct hid_device *hdev,
	}
	}


	power_supply_powers(&wdata->ac, &hdev->dev);
	power_supply_powers(&wdata->ac, &hdev->dev);
#endif
	return 0;
	return 0;


#ifdef CONFIG_HID_WACOM_POWER_SUPPLY
err_ac:
err_ac:
	power_supply_unregister(&wdata->battery);
	power_supply_unregister(&wdata->battery);
err_battery:
err_battery:
	device_remove_file(&hdev->dev, &dev_attr_speed);
	device_remove_file(&hdev->dev, &dev_attr_speed);
	hid_hw_stop(hdev);
	hid_hw_stop(hdev);
#endif
err_free:
err_free:
	kfree(wdata);
	kfree(wdata);
	return ret;
	return ret;
@@ -646,16 +634,12 @@ err_free:


static void wacom_remove(struct hid_device *hdev)
static void wacom_remove(struct hid_device *hdev)
{
{
#ifdef CONFIG_HID_WACOM_POWER_SUPPLY
	struct wacom_data *wdata = hid_get_drvdata(hdev);
	struct wacom_data *wdata = hid_get_drvdata(hdev);
#endif
	device_remove_file(&hdev->dev, &dev_attr_speed);
	device_remove_file(&hdev->dev, &dev_attr_speed);
	hid_hw_stop(hdev);
	hid_hw_stop(hdev);


#ifdef CONFIG_HID_WACOM_POWER_SUPPLY
	power_supply_unregister(&wdata->battery);
	power_supply_unregister(&wdata->battery);
	power_supply_unregister(&wdata->ac);
	power_supply_unregister(&wdata->ac);
#endif
	kfree(hid_get_drvdata(hdev));
	kfree(hid_get_drvdata(hdev));
}
}