Skip to content

Commit

Permalink
Change gpiochip driver name for Pi 5 to pinctrl-rp1
Browse files Browse the repository at this point in the history
  • Loading branch information
golemparts committed Oct 2, 2023
1 parent 3a199de commit dd4699e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/gpio/ioctl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ type IoctlLong = c_int;
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 DRIVER_NAME_BCM2711: &[u8] = b"pinctrl-bcm2711\0";
const DRIVER_NAME_BCM2712: &[u8] = b"pinctrl-rp1\0";
const NRBITS: u8 = 8;
const TYPEBITS: u8 = 8;
const SIZEBITS: u8 = 14;
Expand Down Expand Up @@ -428,7 +428,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_BCM2711.len()] == DRIVER_NAME_BCM2711[..]
|| chip_info.label[0..DRIVER_NAME_BCM2712.len()] == DRIVER_NAME_BCM2712[..]
{
return Ok(gpiochip);
Expand Down

0 comments on commit dd4699e

Please sign in to comment.