From 35b4c01e29bdd9632dabf9784ed3486333f00427 Mon Sep 17 00:00:00 2001 From: Jeremy Fitzhardinge Date: Fri, 9 Dec 2011 09:35:00 -0800 Subject: power_supply: add "powers" links to self-powered HID devices Make the relationship between the Wiimote and Wacom self-powered HID devices and their power supply explicit by adding a "powers" link. Signed-off-by: Jeremy Fitzhardinge Cc: Jiri Kosina --- drivers/hid/hid-wacom.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers/hid/hid-wacom.c') diff --git a/drivers/hid/hid-wacom.c b/drivers/hid/hid-wacom.c index ad39777d1111..3d28e4988f69 100644 --- a/drivers/hid/hid-wacom.c +++ b/drivers/hid/hid-wacom.c @@ -397,6 +397,8 @@ static int wacom_probe(struct hid_device *hdev, wdata->battery.type = POWER_SUPPLY_TYPE_BATTERY; wdata->battery.use_for_apm = 0; + power_supply_powers(&wdata->battery, &hdev->dev); + ret = power_supply_register(&hdev->dev, &wdata->battery); if (ret) { hid_warn(hdev, "can't create sysfs battery attribute, err: %d\n", @@ -411,6 +413,8 @@ static int wacom_probe(struct hid_device *hdev, wdata->ac.type = POWER_SUPPLY_TYPE_MAINS; wdata->ac.use_for_apm = 0; + power_supply_powers(&wdata->battery, &hdev->dev); + ret = power_supply_register(&hdev->dev, &wdata->ac); if (ret) { hid_warn(hdev, -- cgit v1.2.3