Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions pkg/hwinfo/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ import (
"fmt"
"log/slog"

"github.com/numtide/nixos-facter/pkg/udev"

"github.com/numtide/nixos-facter/pkg/linux/input"
"github.com/numtide/nixos-facter/pkg/udev"
)

// captureTouchpads scans the input devices and identifies touchpads, returning a slice of HardwareDevice structs or an
Expand All @@ -22,7 +21,6 @@ func captureTouchpads(deviceIdx uint) ([]HardwareDevice, error) {
var result []HardwareDevice //nolint:prealloc

for _, inputDevice := range inputDevices {

path := "/sys" + inputDevice.Sysfs

udevData, err := udev.Read(path)
Expand Down Expand Up @@ -81,6 +79,17 @@ func captureTouchpads(deviceIdx uint) ([]HardwareDevice, error) {
Value: uint16(SubClassMousePs2),
}

case input.BusRmi:
// RMI is a protocol which runs over other physical buses, typically i2c, but it can also be over others
// such as USB or SPI.
// I'm not sure how to map this into hwinfo's bus classification, so for now we will use other for both the
// bus and mouse subclass.
hd.BusType = NewBusID(BusOther)
hd.SubClass = &ID{
Name: SubClassMouseOther.String(),
Value: uint16(SubClassMouseOther),
}

case input.BusPci,
input.BusIsapnp,
input.BusHil,
Expand All @@ -97,7 +106,6 @@ func captureTouchpads(deviceIdx uint) ([]HardwareDevice, error) {
input.BusGsc,
input.BusAtari,
input.BusSpi,
input.BusRmi,
input.BusCec,
input.BusIntelIshtp,
input.BusAmdSfh:
Expand Down