octeon_gpio.c (232812) | octeon_gpio.c (239351) |
---|---|
1/*- 2 * Copyright (c) 2011, Oleksandr Tymoshenko <gonzo@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 16 unchanged lines hidden (view full) --- 25 * SUCH DAMAGE. 26 */ 27 28/* 29 * GPIO driver for Cavium Octeon 30 */ 31 32#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2011, Oleksandr Tymoshenko <gonzo@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 16 unchanged lines hidden (view full) --- 25 * SUCH DAMAGE. 26 */ 27 28/* 29 * GPIO driver for Cavium Octeon 30 */ 31 32#include <sys/cdefs.h> |
33__FBSDID("$FreeBSD: head/sys/mips/cavium/octeon_gpio.c 232812 2012-03-11 06:17:49Z jmallett $"); | 33__FBSDID("$FreeBSD: head/sys/mips/cavium/octeon_gpio.c 239351 2012-08-17 04:44:57Z rpaulo $"); |
34 35#include <sys/param.h> 36#include <sys/systm.h> 37#include <sys/bus.h> 38 39#include <sys/kernel.h> 40#include <sys/module.h> 41#include <sys/rman.h> --- 336 unchanged lines hidden (view full) --- 378 struct octeon_gpio_pin *pinp; 379 cvmx_gpio_bit_cfgx_t gpio_cfgx; 380 381 int i; 382 383 KASSERT((device_get_unit(dev) == 0), 384 ("octeon_gpio: Only one gpio module supported")); 385 | 34 35#include <sys/param.h> 36#include <sys/systm.h> 37#include <sys/bus.h> 38 39#include <sys/kernel.h> 40#include <sys/module.h> 41#include <sys/rman.h> --- 336 unchanged lines hidden (view full) --- 378 struct octeon_gpio_pin *pinp; 379 cvmx_gpio_bit_cfgx_t gpio_cfgx; 380 381 int i; 382 383 KASSERT((device_get_unit(dev) == 0), 384 ("octeon_gpio: Only one gpio module supported")); 385 |
386 mtx_init(&sc->gpio_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, 387 MTX_DEF); | 386 mtx_init(&sc->gpio_mtx, device_get_nameunit(dev), NULL, MTX_DEF); |
388 389 for ( i = 0; i < OCTEON_GPIO_IRQS; i++) { 390 if ((sc->gpio_irq_res[i] = bus_alloc_resource(dev, 391 SYS_RES_IRQ, &sc->gpio_irq_rid[i], 392 OCTEON_IRQ_GPIO0 + i, OCTEON_IRQ_GPIO0 + i, 1, 393 RF_SHAREABLE | RF_ACTIVE)) == NULL) { 394 device_printf(dev, "unable to allocate IRQ resource\n"); 395 return (ENXIO); --- 99 unchanged lines hidden --- | 387 388 for ( i = 0; i < OCTEON_GPIO_IRQS; i++) { 389 if ((sc->gpio_irq_res[i] = bus_alloc_resource(dev, 390 SYS_RES_IRQ, &sc->gpio_irq_rid[i], 391 OCTEON_IRQ_GPIO0 + i, OCTEON_IRQ_GPIO0 + i, 1, 392 RF_SHAREABLE | RF_ACTIVE)) == NULL) { 393 device_printf(dev, "unable to allocate IRQ resource\n"); 394 return (ENXIO); --- 99 unchanged lines hidden --- |