diff options
author | Jeremy Fitzhardinge <jeremy@goop.org> | 2011-12-09 12:35:00 -0500 |
---|---|---|
committer | Jeremy Fitzhardinge <jeremy@goop.org> | 2011-12-09 12:54:17 -0500 |
commit | 35b4c01e29bdd9632dabf9784ed3486333f00427 (patch) | |
tree | d189be2bec132117aefff67a3d17f7414ac1199c /drivers/hid | |
parent | 73db88137bc732d01b615af9a9cdb24f3e47e78d (diff) |
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 <jeremy@goop.org>
Cc: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r-- | drivers/hid/hid-wacom.c | 4 | ||||
-rw-r--r-- | drivers/hid/hid-wiimote.c | 2 |
2 files changed, 6 insertions, 0 deletions
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, | |||
397 | wdata->battery.type = POWER_SUPPLY_TYPE_BATTERY; | 397 | wdata->battery.type = POWER_SUPPLY_TYPE_BATTERY; |
398 | wdata->battery.use_for_apm = 0; | 398 | wdata->battery.use_for_apm = 0; |
399 | 399 | ||
400 | power_supply_powers(&wdata->battery, &hdev->dev); | ||
401 | |||
400 | ret = power_supply_register(&hdev->dev, &wdata->battery); | 402 | ret = power_supply_register(&hdev->dev, &wdata->battery); |
401 | if (ret) { | 403 | if (ret) { |
402 | hid_warn(hdev, "can't create sysfs battery attribute, err: %d\n", | 404 | hid_warn(hdev, "can't create sysfs battery attribute, err: %d\n", |
@@ -411,6 +413,8 @@ static int wacom_probe(struct hid_device *hdev, | |||
411 | wdata->ac.type = POWER_SUPPLY_TYPE_MAINS; | 413 | wdata->ac.type = POWER_SUPPLY_TYPE_MAINS; |
412 | wdata->ac.use_for_apm = 0; | 414 | wdata->ac.use_for_apm = 0; |
413 | 415 | ||
416 | power_supply_powers(&wdata->battery, &hdev->dev); | ||
417 | |||
414 | ret = power_supply_register(&hdev->dev, &wdata->ac); | 418 | ret = power_supply_register(&hdev->dev, &wdata->ac); |
415 | if (ret) { | 419 | if (ret) { |
416 | hid_warn(hdev, | 420 | hid_warn(hdev, |
diff --git a/drivers/hid/hid-wiimote.c b/drivers/hid/hid-wiimote.c index 98e48281c0b2..fc0b4db5dab3 100644 --- a/drivers/hid/hid-wiimote.c +++ b/drivers/hid/hid-wiimote.c | |||
@@ -1263,6 +1263,8 @@ static int wiimote_hid_probe(struct hid_device *hdev, | |||
1263 | wdata->battery.type = POWER_SUPPLY_TYPE_BATTERY; | 1263 | wdata->battery.type = POWER_SUPPLY_TYPE_BATTERY; |
1264 | wdata->battery.use_for_apm = 0; | 1264 | wdata->battery.use_for_apm = 0; |
1265 | 1265 | ||
1266 | power_supply_powers(&wdata->battery, &hdev->dev); | ||
1267 | |||
1266 | ret = power_supply_register(&wdata->hdev->dev, &wdata->battery); | 1268 | ret = power_supply_register(&wdata->hdev->dev, &wdata->battery); |
1267 | if (ret) { | 1269 | if (ret) { |
1268 | hid_err(hdev, "Cannot register battery device\n"); | 1270 | hid_err(hdev, "Cannot register battery device\n"); |