1/*- 2 * Copyright (c) 2010, Andrew Thompson <thompsa@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 --- 25 unchanged lines hidden (view full) --- 34 * times out and not write our latch. To get around this we grab the iicbus and 35 * then do our own bit banging. This is a comprimise to changing all the iicbb 36 * device methods to allow a flag to be passed down and is similir to how Linux 37 * does it. 38 * 39 */ 40 41#include <sys/cdefs.h> |
42__FBSDID("$FreeBSD: head/sys/arm/xscale/ixp425/cambria_gpio.c 274670 2014-11-18 17:22:08Z loos $"); |
43 44#include <sys/param.h> 45#include <sys/systm.h> 46#include <sys/bus.h> 47 48#include <sys/kernel.h> 49#include <sys/module.h> 50#include <sys/rman.h> --- 261 unchanged lines hidden (view full) --- 312 int error; 313 uint8_t mask; 314 315 mask = 1 << pin; 316 317 if (pin >= GPIO_PINS) 318 return (EINVAL); 319 |
320 GPIO_LOCK(sc); 321 sc->sc_pins[pin].gp_flags = flags; 322 323 /* 324 * Writing a logical one sets the signal high and writing a logical 325 * zero sets the signal low. To configure a digital I/O signal as an 326 * input, a logical one must first be written to the data bit to 327 * three-state the associated output. --- 164 unchanged lines hidden --- |