定义gpio_in
qdev_init_gpio_in_named
qdev_get_gpio_in_named
定义
/**
* qdev_init_gpio_in_named() - create an array of input GPIO lines
* @dev: device to add array to
* @handler: a &typedef qemu_irq_handler function to call when GPIO is set
* @name: Name of the GPIO input (must be unique for this device)
* @n: Number of GPIO lines in this input set
*
* Like qdev_init_gpio_in_named_with_opaque(), but the opaque pointer
* passed to the handler is @dev (which is the most commonly desired behaviour).
*/
static inline void qdev_init_gpio_in_named(DeviceState *dev,
qemu_irq_handler handler,
const char *name, int n)
使用
qdev_init_gpio_in_named(DEVICE(obj), FUNCTION_PROCESS_GPIO_PIN_IN(3,11