Skip to content

Commit

Permalink
fix(OrangePi NEO): Add 8800U varaint touchpad detection.
Browse files Browse the repository at this point in the history
  • Loading branch information
pastaq committed Jul 26, 2024
1 parent de268e5 commit b473d2b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
8 changes: 4 additions & 4 deletions rootfs/usr/share/inputplumber/devices/50-orangepi_neo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ source_devices:
- group: mouse
blocked: true
evdev:
name: OPI0001:00 0911:5288 Touchpad
phys_path: i2c-OPI0001:00
name: { OPI0001:00 0911:5288 Touchpad, SYNA3602:00 0911:5288 Touchpad }
phys_path: { i2c-OPI0001:00, i2c-SYNA3602:00 }
handler: event*
- group: mouse
blocked: true
evdev:
name: OPI0002:00 0911:5288 Touchpad
phys_path: i2c-OPI0002:00
name: { OPI0002:00 0911:5288 Touchpad, SYNA3602:01 0911:5288 Touchpad }
phys_path: { i2c-OPI0002:00, i2c-SYNA3602:01 }
handler: event*

## Gamepad Devices
Expand Down
6 changes: 6 additions & 0 deletions src/drivers/opineo/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,18 @@ use super::{
// Hardware ID's
pub const VID: u16 = 0x0911;
pub const PID: u16 = 0x5288;
pub const LPAD_NAMES: [&str; 2] = ["OPI0001:00", "SYNA3602:00"];
pub const RPAD_NAMES: [&str; 2] = ["OPI0002:00", "SYNA3602:01"];

// Report ID
pub const TOUCH_DATA: u8 = 0x04;

// Input report size
const TOUCHPAD_PACKET_SIZE: usize = 10;

// HID buffer read timeout
const HID_TIMEOUT: i32 = 10;

// Input report axis ranges
pub const PAD_X_MAX: f64 = 512.0;
pub const PAD_Y_MAX: f64 = 512.0;
Expand Down
6 changes: 3 additions & 3 deletions src/input/source/hidraw/opineo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::{error::Error, fmt::Debug};

use crate::{
drivers::opineo::{
driver::{self, Driver},
driver::{self, Driver, LPAD_NAMES, RPAD_NAMES},
event,
},
input::{
Expand Down Expand Up @@ -34,10 +34,10 @@ impl OrangePiNeoTouchpad {
// Query the udev module to determine if this is the left or right touchpad.
let name = device_info.name();
let touchpad_side = {
if name == "OPI0001:00" {
if LPAD_NAMES.contains(&name.as_str()) {
log::debug!("Detected left pad.");
TouchpadSide::Left
} else if name == "OPI0002:00" {
} else if RPAD_NAMES.contains(&name.as_str()) {
log::debug!("Detected right pad.");
TouchpadSide::Right
} else {
Expand Down

0 comments on commit b473d2b

Please sign in to comment.