Skip to content

Commit

Permalink
Add detection for pinctrl-bcm2712 driver
Browse files Browse the repository at this point in the history
  • Loading branch information
golemparts committed Sep 29, 2023
1 parent 69ce280 commit 3a199de
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/gpio/ioctl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const PATH_GPIOCHIP: &str = "/dev/gpiochip";
const CONSUMER_LABEL: &str = "RPPAL";
const DRIVER_NAME: &[u8] = b"pinctrl-bcm2835\0";
const DRIVER_NAME_CM4: &[u8] = b"pinctrl-bcm2711\0";
const DRIVER_NAME_BCM2712: &[u8] = b"pinctrl-bcm2712\0";
const NRBITS: u8 = 8;
const TYPEBITS: u8 = 8;
const SIZEBITS: u8 = 14;
Expand Down Expand Up @@ -428,6 +429,7 @@ pub fn find_gpiochip() -> Result<File> {
let chip_info = ChipInfo::new(gpiochip.as_raw_fd())?;
if chip_info.label[0..DRIVER_NAME.len()] == DRIVER_NAME[..]
|| chip_info.label[0..DRIVER_NAME_CM4.len()] == DRIVER_NAME_CM4[..]
|| chip_info.label[0..DRIVER_NAME_BCM2712.len()] == DRIVER_NAME_BCM2712[..]
{
return Ok(gpiochip);
}
Expand Down

0 comments on commit 3a199de

Please sign in to comment.