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 274670 2014-11-18 17:22:08Z loos $"); |
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> --- 172 unchanged lines hidden (view full) --- 214 for (i = 0; i < sc->gpio_npins; i++) { 215 if (sc->gpio_pins[i].gp_pin == pin) 216 break; 217 } 218 219 if (i >= sc->gpio_npins) 220 return (EINVAL); 221 |
222 octeon_gpio_pin_configure(sc, &sc->gpio_pins[i], flags); |
223 |
224 return (0); 225} 226 227static int 228octeon_gpio_pin_set(device_t dev, uint32_t pin, unsigned int value) 229{ 230 struct octeon_gpio_softc *sc = device_get_softc(dev); 231 int i; --- 255 unchanged lines hidden --- |