Please enable HID_BATTERY_STRENGTH (on xorg-edgers and quantal kernel packages)

Bug #1003090 reported by Daniel Nicoletti on 2012-05-22
This bug affects 2 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Tim Gardner
Tim Gardner

Bug Description

since 3.4-r7 my HID patch got upstream but it defaults to disabled,
it provides the feature to probe HID devices that follow specs about
how to report battery strength, this way upower can show the status
of my Apple blue tooth keyboard and mouse.



Andy Whitcroft (apw) on 2012-05-22
tags: added: bot-stop-nagging
Changed in linux (Ubuntu):
status: New → Triaged
summary: - Please enable HID_BATTERY_STRENGTH on xorg-edgers and quantal packages
+ Please enable HID_BATTERY_STRENGTH (on xorg-edgers and quantal kernel
+ packages)
Changed in linux (Ubuntu):
importance: Undecided → Medium
Daniel Nicoletti (dantti) wrote :

any chance to get this into Quantal kernel?

Tim Gardner (timg-tpi) wrote :

Daniel - it appears that CONFIG_HID must be built-in before you can select CONFIG_HID_BATTERY_STRENGTH. Why is that ?

Changed in linux (Ubuntu Quantal):
assignee: nobody → Tim Gardner (timg-tpi)
status: Triaged → In Progress

Hi Daniel,

I took a look at enabling this. Unfortunately I noticed the depends line in the Kconfig as follows:

        bool "Battery level reporting for HID devices"
        depends on HID && POWER_SUPPLY && HID = POWER_SUPPLY

In the Ubuntu configs for Quantal, the following is set which does not satisfy the depends policy for HID_BATTERY_STRENGTH:

~/ubuntu-quantal/debian.master/config$ grep -rn "CONFIG_HID=" *
~/ubuntu-quantal/debian.master/config$ grep -rn "CONFIG_POWER_SUPPLY=" *

Is there a specific reason for depending on HID=POWER_SUPPLY?

I also noticed that the following upstream commit specifically notes issues with "recent userspace" which is why HID_BATTERY_STRENGTH has been defaulted to n because it's is causing problems on some systems. Have the userpace issues been resolved so we don't start breaking/regressing existing systems if we enable this?

commit 2198edddd8f0245d4c47419310c6cfb0f4e1a197
Author: Josh Boyer <email address hidden>
Date: Wed Apr 18 10:05:17 2012 -0400

    HID: default HID_BATTERY_STRENGTH to no

    Commit 4f5ca836b "HID: hid-input: add support for HID devices reporting
    Battery Strength" added the CONFIG_HID_BATTERY_STRENGTH option to report
    the battery strength of HID devices. The commit log explicitly mentions
    it not working properly with recent userspace, but it is default y
    anyway. This is rather odd, and actually causes problems on real

    This works around Fedora bug

Daniel Nicoletti (dantti) wrote :

Hi, first thanks for looking into this, it's been a while with no activity.
for #2 I'm not sure why HID must be build in, actually the config part of the patch wasn't added by me, I just did the reverse engineering making sure it worked fine for my Apple bluetooth Keyboard and Magic Track pad, on the thread another guy with a mouse from a different brand reported it worked fine.

For #3 the problem was that they enabled the feature but didn't upgrade upower, which had some fixes made by me and ones made by Richard. also starting from 3.4 it power_supply has a scope feature to avoid the confusion. So since Quantal has an up to date upower it will went fine.
It got disabled by default so at that time user space didn't get broken. Now I can say it's safe to enable it. So it's a feature users with devices that have this capability will be quite happy :)
Also about the RH bug I just confirmed and their 3.5 kernel in F17 has it enabled by default again.

And well from your grep it shows CONFIG_HID=m will make it not work, the problem is that I don't understand the kernel config system so I really dunno why this was done, maybe it could be changed to allow having it when using HID as a module. What do you think?

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package linux - 3.5.0-15.20

linux (3.5.0-15.20) quantal-proposed; urgency=low

  [ Tim Gardner ]

  * rebase to v3.5.4
    - LP: #1003090

  [ Upstream Kernel Changes ]

  * eCryptfs: Copy up attributes of the lower target inode after rename
    - LP: #561129
  * eCryptfs: Write out all dirty pages just before releasing the lower
    - LP: #1047261
  * eCryptfs: Call lower ->flush() from ecryptfs_flush()
    - LP: #1047261
  * af_netlink: force credentials passing [CVE-2012-3520]
    - LP: #1052097
    - CVE-2012-3520
  * drm/i915: clarify IBX dp workaround
    - LP: #1011440
  * drm/i915: Implement w/a for sporadic read failures on waking from rc6
    - LP: #1011440
  * drm/i915: support Haswell force waking
    - LP: #1011440
  * drm/i915: add RPS configuration for Haswell
    - LP: #1011440
  * drm/i915: enable RC6 by default on Haswell
    - LP: #1011440
  * drm/i915: introduce haswell_init_clock_gating
    - LP: #1011440
  * drm/i915: enable RC6 workaround on Haswell
    - LP: #1011440
  * drm/i915: re-initialize DDI buffer translations after resume
    - LP: #1011440
  * drm/i915: fix PIPE_DDI_PORT_MASK
    - LP: #1011440
  * drm/i915: try to train DP even harder
    - LP: #1011440
  * drm/i915: add more Haswell PCI IDs
    - LP: #1011440
  * rebase to v3.5.4
    - LP: #1038651
 -- Leann Ogasawara <email address hidden> Mon, 17 Sep 2012 13:41:39 -0700

Changed in linux (Ubuntu Quantal):
status: In Progress → Fix Released

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.