Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/gpio/gpiobus.c
Show First 20 Lines • Show All 482 Lines • ▼ Show 20 Lines | if (resource_int_value(dname, dunit, "irq", &irq) == 0) { | ||||
if (bus_set_resource(child, SYS_RES_IRQ, 0, irq, 1) != 0) | if (bus_set_resource(child, SYS_RES_IRQ, 0, irq, 1) != 0) | ||||
device_printf(bus, | device_printf(bus, | ||||
"warning: bus_set_resource() failed\n"); | "warning: bus_set_resource() failed\n"); | ||||
} | } | ||||
} | } | ||||
static int | static int | ||||
gpiobus_set_resource(device_t dev, device_t child, int type, int rid, | gpiobus_set_resource(device_t dev, device_t child, int type, int rid, | ||||
u_long start, u_long count) | rman_res_t start, rman_res_t count) | ||||
{ | { | ||||
struct gpiobus_ivar *devi; | struct gpiobus_ivar *devi; | ||||
struct resource_list_entry *rle; | struct resource_list_entry *rle; | ||||
dprintf("%s: entry (%p, %p, %d, %d, %p, %ld)\n", | dprintf("%s: entry (%p, %p, %d, %d, %p, %ld)\n", | ||||
__func__, dev, child, type, rid, (void *)(intptr_t)start, count); | __func__, dev, child, type, rid, (void *)(intptr_t)start, count); | ||||
devi = GPIOBUS_IVAR(child); | devi = GPIOBUS_IVAR(child); | ||||
rle = resource_list_add(&devi->rl, type, rid, start, | rle = resource_list_add(&devi->rl, type, rid, start, | ||||
start + count - 1, count); | start + count - 1, count); | ||||
if (rle == NULL) | if (rle == NULL) | ||||
return (ENXIO); | return (ENXIO); | ||||
return (0); | return (0); | ||||
} | } | ||||
static struct resource * | static struct resource * | ||||
gpiobus_alloc_resource(device_t bus, device_t child, int type, int *rid, | gpiobus_alloc_resource(device_t bus, device_t child, int type, int *rid, | ||||
u_long start, u_long end, u_long count, u_int flags) | rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) | ||||
{ | { | ||||
struct gpiobus_softc *sc; | struct gpiobus_softc *sc; | ||||
struct resource *rv; | struct resource *rv; | ||||
struct resource_list *rl; | struct resource_list *rl; | ||||
struct resource_list_entry *rle; | struct resource_list_entry *rle; | ||||
int isdefault; | int isdefault; | ||||
if (type != SYS_RES_IRQ) | if (type != SYS_RES_IRQ) | ||||
▲ Show 20 Lines • Show All 274 Lines • Show Last 20 Lines |