cambria_gpio.c (239351) | cambria_gpio.c (249449) |
---|---|
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> | 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 239351 2012-08-17 04:44:57Z rpaulo $"); | 42__FBSDID("$FreeBSD: head/sys/arm/xscale/ixp425/cambria_gpio.c 249449 2013-04-13 21:21:13Z dim $"); |
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 | 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 /* Filter out unwanted flags */ 321 if ((flags &= sc->sc_pins[pin].gp_caps) != flags) | 320 /* Check for unwanted flags. */ 321 if ((flags & sc->sc_pins[pin].gp_caps) != flags) |
322 return (EINVAL); 323 324 /* Can't mix input/output together */ 325 if ((flags & (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) == 326 (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) 327 return (EINVAL); 328 329 GPIO_LOCK(sc); --- 170 unchanged lines hidden --- | 322 return (EINVAL); 323 324 /* Can't mix input/output together */ 325 if ((flags & (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) == 326 (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) 327 return (EINVAL); 328 329 GPIO_LOCK(sc); --- 170 unchanged lines hidden --- |