Commit graph

44 commits

Author SHA1 Message Date
Kate Hsuan
f26409e925 rules: 95-upower-hid: update hwdb from upstream NUT
Update to the latest hwdb from NUT.

Link: https://networkupstools.org
Link: https://raw.githubusercontent.com/networkupstools/nut/master/scripts/upower/95-upower-hid.hwdb
2025-09-16 15:51:36 +08:00
Kate Hsuan
df51aef98a rules: 95-upower-hid.hwdb: update hwdb for HID devices
Update HID hwdb.
2025-03-25 17:08:40 +08:00
Jelle van der Waa
6f9d84694d linux: rules: fix warnings from udevadm verify
rules/60-upower-battery.rules:5 style: whitespace after comma is expected.
rules/60-upower-battery.rules:5 style: a comma between tokens is expected.
2025-02-22 15:20:12 +01:00
Kate Hsuan
1a64550dad rules: 95-upower-hid.hwdb: Update hwdb for HID devices 2024-12-31 13:39:50 +08:00
Kate Hsuan
cca76c8684 rules: 60-upower-battery.hwdb: Change the threshold value to 75-80
The CHARGE_LIMIT is set to 75-80 to increase the start threshold value.

Resolves: #282
2024-09-02 14:48:10 +08:00
Kate Hsuan
5882721f19 linux: up-device-supply-battery: Allow skipping start or end charging threshold setting
This allows the one of charge_control_start|end_threshold can be ignored
by a "_" character.
The udev hwdb can be set in the following format.

- Skip charging start limit
CHARGE_LIMIT=_,80
- Skip charging end limit
CHARGE_LIMIT=30,_
2024-08-22 14:20:33 +08:00
Jelle van der Waa
16277c88c4 rules: add battery charge limit udev and hwdb files
Set per battery-specific start/stop charge limits in udev as environment
variable with the option to allow a user to override the default 60%
start and 80% stop charge limit.

Signed-off-by: Kate Hsuan <hpa@redhat.com>
2024-07-23 15:42:52 +08:00
Kate Hsuan
6ef7fcd1bd rules: Update hwdb from upstream NUT
Include:
Liebert
usb:v10AFp0000*
usb:v10AFp0002*

Link: https://github.com/networkupstools/nut
Link: https://raw.githubusercontent.com/networkupstools/nut/master/scripts/upower/95-upower-hid.hwdb
2024-03-05 15:32:48 +08:00
Kate Hsuan
efc8ac61af rules: Update hwdb from NUT
Link: https://github.com/networkupstools/nut
Link: https://raw.githubusercontent.com/networkupstools/nut/master/scripts/upower/95-upower-hid.hwdb
2024-02-27 10:56:40 +08:00
Pino Toscano
029651a96d build: make 'udevrulesdir' and 'udevhwdbdir' as Linux-only
udev is available only on Linux, so limit their usage when the backend
is 'linux'.

This fixes the build when the backend is different than 'linux', i.e.
typically on non-Linux OSes.
2023-07-07 06:50:31 +00:00
Bastien Nocera
a5acbad7f1 rules: Update hwdb from upstream NUT 2023-04-11 11:30:06 +02:00
Bastien Nocera
6b7ffaaa16 rules: Update hwdb from upstream NUT 2023-02-21 15:16:29 +01:00
Bastien Nocera
7f3a31447f rules: Update hwdb from upstream NUT 2022-11-16 16:16:34 +01:00
Benjamin Berg
10290e0e6d rules: Update hwdb from upstream NUT 2022-05-16 14:00:52 +02:00
Benjamin Berg
90c25b4fd1 rules: Update udev rules and migrate to use hwdb
This makes rule matching more efficient. We just need to copy the
variables over into the hiddev device so that there is no need to change
the C code to match the parent USB device. That said, the change in C
wouldn't be that hard either.

See https://github.com/networkupstools/nut/pull/1342
2022-04-01 11:47:17 +02:00
Bastien Nocera
9b93b6c402 build: Remove autotools 2021-09-06 14:06:40 +02:00
Benjamin Berg
f2e702d4dc build: Support building upower with meson 2021-09-02 17:47:30 +02:00
Bastien Nocera
daf15b0f91 data: Also remove HID++ udev rules
Now that HID++ user-space support has been removed.
2021-06-17 14:37:25 +02:00
Bastien Nocera
4227d0c439 linux: Remove support for CSR devices
Those devices date back from the mid-2000s. If they still work, and
somebody is still interested in having them export their battery status,
we would recommend moving this information to the appropriate kernel
drivers.
2021-01-19 13:29:23 +01:00
Bastien Nocera
56ff72fdf4 rules: Reduce our list of HID++ devices
Those devices have been supported in the Linux kernel since at least
3.19, so there's no need to try and support those with our user-space
handling.

Closes: #3
2019-05-09 11:03:01 +02:00
Bastien Nocera
fb10b80d44 rules: Split off HID++ rules
They should probably have been split off from the start.
2019-05-07 16:56:09 +02:00
Bastien Nocera
937760f491 linux: Don't talk to HID++ devices ourselves
If the kernel already extract the battery information out of them.
2017-01-23 15:27:33 +01:00
Arnaud Quette
fc27cbd5cb Update UPower HID rules - supported devices list
As per update on the NUT - Network UPS Tools project, this first patch
adds some more supported devices to the rules file

Signed-off-by: Richard Hughes <richard@hughsie.com>
2015-07-29 13:21:16 +01:00
Arnaud Quette
ae9f8521c6 Fix HID rules header, as per discussions
Signed-off-by: Richard Hughes <richard@hughsie.com>
2015-07-29 13:18:46 +01:00
muzena
305f62adf0 rules: Add support for Logitech G700s/G700 Gaming Mouse
https://bugs.freedesktop.org/show_bug.cgi?id=91270
2015-07-09 02:32:07 +02:00
Peter Wu
f8104a112e rules: support Logitech Unifying in Linux 3.19
Linux 3.19 changed the way in which devices get registered by
introducing a hid-logitech-hidpp module. The driver name therefore needs
to be adjusted.

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2015-04-02 16:07:44 +02:00
Bastien Nocera
c842f1a53e Remove obsolete battery recall properties
The recalls for that broken batch of Sony batteries dates back from
2006. All the batteries that could have been recalled have now
been recalled, and somebody particularly interested in supporting
them can match the batteries using the old rules file, in a
user session or a separate daemon.
2013-10-14 10:42:55 +02:00
Bastien Nocera
a10a61e181 rules: Update and correct Toshiba recall list
The list wrongly contained PA3465U, had all the batteries in duplicate,
and didn't contain a number of affected batteries.

https://bugs.freedesktop.org/show_bug.cgi?id=44370
2013-10-13 00:35:59 +02:00
Tom Gundersen
04faa0e143 build: detect udev rules dir
Udev rules may live in either /lib/udev/rules.d or /usr/lib/udev/rules.d depending on the distro.
Remove the heuristic for deciding the dir, use pkgconfig to detect the location and allow it to be
set manually.

v2: fix specifying --with-udevrulesdir

Signed-off-by: Richard Hughes <richard@hughsie.com>
2013-05-07 14:15:26 +01:00
Arkadiusz Miśkiewicz
32daed2dfa Add support for Logitech Wireless (NonUnifying) devices
There are Logitech Wireless devices similar to Unifying ones with the
difference that device is paired with single dongle and dongle doesn't
support pairing multiple devices.

Add support for these. Tested with Wireless Mouse M187 and M185/M225.

Signed-off-by: Arkadiusz Miśkiewicz <arekm@maven.pl>
Signed-off-by: Richard Hughes <richard@hughsie.com>
2013-03-22 19:44:58 +00:00
Arkadiusz Miśkiewicz
fd0286e871 Repair vendor handling for Logitech Unifying devices
Set proper vendor via udev rules for unifying devices and handle
that in code.

Signed-off-by: Arkadiusz Miśkiewicz <arekm@maven.pl>
Signed-off-by: Richard Hughes <richard@hughsie.com>
2013-03-22 19:43:50 +00:00
Richard Hughes
b1f12feb1f Factor out the Logitech Unifying support to support other devices 2013-01-10 12:08:46 +00:00
Peter Hurley
9f31068707 Fix device matching for recent kernels
In recent kernels, hiddev* devices now have class "usbmisc", rather
than "usb" (see http://www.spinics.net/lists/linux-usb/msg62276.html).
This change translates into a change in SUBSYSTEM matching for hiddev*
devices. This fix addresses this for recent kernels while retaining
existing behavior. For reference, here is an attribute-walk for a
CyberPower CPS 1500C on kernel 3.7.0:

[Ubuntu bug #1091702: udev rules fail to match hid devices with new kernels]

udevadm info --attribute-walk --path=/devices/pci0000:00/0000:00:1d.2/usb4/4-1/4-1:1.0/usbmisc/hiddev0

Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/pci0000:00/0000:00:1d.2/usb4/4-1/4-1:1.0/usbmisc/hiddev0':
    KERNEL=="hiddev0"
    SUBSYSTEM=="usbmisc"
    DRIVER==""

  looking at parent device '/devices/pci0000:00/0000:00:1d.2/usb4/4-1/4-1:1.0':
    KERNELS=="4-1:1.0"
    SUBSYSTEMS=="usb"
    DRIVERS=="usbhid"
    ATTRS{bInterfaceClass}=="03"
    ATTRS{bInterfaceSubClass}=="00"
    ATTRS{bInterfaceProtocol}=="00"
    ATTRS{bNumEndpoints}=="01"
    ATTRS{supports_autosuspend}=="1"
    ATTRS{bAlternateSetting}==" 0"
    ATTRS{bInterfaceNumber}=="00"

  looking at parent device '/devices/pci0000:00/0000:00:1d.2/usb4/4-1':
    KERNELS=="4-1"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{devpath}=="1"
    ATTRS{idVendor}=="0764"
    ATTRS{speed}=="1.5"
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bMaxPacketSize0}=="8"
    ATTRS{busnum}=="4"
    ATTRS{devnum}=="2"
    ATTRS{configuration}==""
    ATTRS{bMaxPower}==" 50mA"
    ATTRS{authorized}=="1"
    ATTRS{bmAttributes}=="c0"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{maxchild}=="0"
    ATTRS{bcdDevice}=="0001"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{quirks}=="0x0"
    ATTRS{version}==" 1.10"
    ATTRS{urbnum}=="36"
    ATTRS{ltm_capable}=="no"
    ATTRS{manufacturer}=="CPS"
    ATTRS{removable}=="unknown"
    ATTRS{idProduct}=="0501"
    ATTRS{bDeviceClass}=="00"
    ATTRS{product}==" CP 1500C"

  looking at parent device '/devices/pci0000:00/0000:00:1d.2/usb4':
    KERNELS=="usb4"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{devpath}=="0"
    ATTRS{idVendor}=="1d6b"
    ATTRS{speed}=="12"
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{authorized_default}=="1"
    ATTRS{busnum}=="4"
    ATTRS{devnum}=="1"
    ATTRS{configuration}==""
    ATTRS{bMaxPower}=="  0mA"
    ATTRS{authorized}=="1"
    ATTRS{bmAttributes}=="e0"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{maxchild}=="2"
    ATTRS{bcdDevice}=="0307"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{quirks}=="0x0"
    ATTRS{serial}=="0000:00:1d.2"
    ATTRS{version}==" 1.10"
    ATTRS{urbnum}=="50"
    ATTRS{ltm_capable}=="no"
    ATTRS{manufacturer}=="Linux 3.7.0-030700-generic uhci_hcd"
    ATTRS{removable}=="unknown"
    ATTRS{idProduct}=="0001"
    ATTRS{bDeviceClass}=="09"
    ATTRS{product}=="UHCI Host Controller"

  looking at parent device '/devices/pci0000:00/0000:00:1d.2':
    KERNELS=="0000:00:1d.2"
    SUBSYSTEMS=="pci"
    DRIVERS=="uhci_hcd"
    ATTRS{irq}=="18"
    ATTRS{subsystem_vendor}=="0x1028"
    ATTRS{broken_parity_status}=="0"
    ATTRS{class}=="0x0c0300"
    ATTRS{consistent_dma_mask_bits}=="32"
    ATTRS{dma_mask_bits}=="32"
    ATTRS{local_cpus}=="00000000,00000000,00000000,00000000,00000000,00000000,00000000,000000ff"
    ATTRS{device}=="0x268a"
    ATTRS{msi_bus}==""
    ATTRS{local_cpulist}=="0-7"
    ATTRS{vendor}=="0x8086"
    ATTRS{subsystem_device}=="0x021e"
    ATTRS{numa_node}=="-1"
    ATTRS{d3cold_allowed}=="0"

  looking at parent device '/devices/pci0000:00':
    KERNELS=="pci0000:00"
    SUBSYSTEMS==""
    DRIVERS==""

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Richard Hughes <richard@hughsie.com>
2012-12-29 13:13:56 +00:00
Richard Hughes
b19fca9637 Use git.mk and remove the manual .gitignore files 2011-07-19 12:40:21 +01:00
Arnaud Quette
2a6339f8ec Update the list of HID UPS devices
Signed-off-by: Richard Hughes <richard@hughsie.com>
2010-12-01 10:41:28 +00:00
Joseph Stockman
2aba7d4cfb Update the list of supported TrippLite HID Power Devices
Signed-off-by: Richard Hughes <richard@hughsie.com>
2010-06-02 19:19:02 +01:00
Richard Hughes
4c26054873 trivial: renamed the udev rule filenames 2010-01-21 15:04:07 +00:00
Richard Hughes
bc928f7ae8 trivial: switch to using the new udev attribute names (no ABI or API break) 2010-01-18 13:20:36 +00:00
Arnaud Quette
c289ef6791 Update the list of HID UPS 2009-11-20 09:31:52 +00:00
Richard Hughes
a5551d4d04 Fix the toshiba battery recal notices by matching up the double quotes properly 2009-11-17 09:43:48 +00:00
Martin Pitt
54f37398c0 Bug 24262 – incorrect battery recall warning for Lenovo T61
According to
http://www-307.ibm.com/pc/support/site.wss/document.do?sitestyle=lenovo&lndocid=BATT-LENOVO

the Sony batteris are only recalled on some particular models.
2009-10-20 12:57:04 +01:00
Arnaud Quette
5ef00f7287 Add another UPS device ID
Signed-off-by: Richard Hughes <richard@hughsie.com>
2009-07-31 08:57:54 +01:00
Arnaud Quette
8b16bc0cdf Update list of HID UPS devices 2009-07-27 17:21:55 +01:00
Richard Hughes
5380720f95 Move the udev rules to thier own directory 2009-07-03 11:53:34 +01:00