| 240 | } |
| 241 | |
| 242 | fn trigger_gpio_interrupt(&self) -> Result<()> { |
| 243 | // Bits set to high in GPIOIE(Interrupt mask register) allow the corresponding pins to |
| 244 | // trigger their individual interrupts and then the combined GPIOINTR line. |
| 245 | if (self.istate & self.im) == 0 { |
| 246 | warn!("Failed to trigger GPIO input interrupt (disabled by guest OS)"); |
| 247 | return Err(Error::GpioInterruptDisabled); |
| 248 | } |
| 249 | self.interrupt |
| 250 | .trigger(0) |
| 251 | .map_err(Error::GpioInterruptFailure)?; |
| 252 | Ok(()) |
| 253 | } |
| 254 | } |
| 255 | |
| 256 | impl BusDevice for Gpio { |