ar5416_gpio.c (188976) | ar5416_gpio.c (188993) |
---|---|
1/* 2 * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting 3 * Copyright (c) 2002-2008 Atheros Communications, Inc. 4 * 5 * Permission to use, copy, modify, and/or distribute this software for any 6 * purpose with or without fee is hereby granted, provided that the above 7 * copyright notice and this permission notice appear in all copies. 8 * 9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 * | 1/* 2 * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting 3 * Copyright (c) 2002-2008 Atheros Communications, Inc. 4 * 5 * Permission to use, copy, modify, and/or distribute this software for any 6 * purpose with or without fee is hereby granted, provided that the above 7 * copyright notice and this permission notice appear in all copies. 8 * 9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 * |
17 * $FreeBSD: head/sys/dev/ath/ath_hal/ar5416/ar5416_gpio.c 188976 2009-02-24 00:33:08Z sam $ | 17 * $FreeBSD: head/sys/dev/ath/ath_hal/ar5416/ar5416_gpio.c 188993 2009-02-24 15:43:42Z sam $ |
18 */ 19#include "opt_ah.h" 20 21#include "ah.h" 22#include "ah_internal.h" 23#include "ah_devid.h" 24 25#include "ar5416/ar5416.h" --- 54 unchanged lines hidden (view full) --- 80 HALASSERT(gpio < AH_PRIVATE(ah)->ah_caps.halNumGpioPins); 81 82 /* NB: type maps directly to hardware */ 83 cfgOutputMux(ah, gpio, type); 84 gpio_shift = gpio << 1; /* 2 bits per output mode */ 85 86 reg = OS_REG_READ(ah, AR_GPIO_OE_OUT); 87 reg &= ~(AR_GPIO_OE_OUT_DRV << gpio_shift); | 18 */ 19#include "opt_ah.h" 20 21#include "ah.h" 22#include "ah_internal.h" 23#include "ah_devid.h" 24 25#include "ar5416/ar5416.h" --- 54 unchanged lines hidden (view full) --- 80 HALASSERT(gpio < AH_PRIVATE(ah)->ah_caps.halNumGpioPins); 81 82 /* NB: type maps directly to hardware */ 83 cfgOutputMux(ah, gpio, type); 84 gpio_shift = gpio << 1; /* 2 bits per output mode */ 85 86 reg = OS_REG_READ(ah, AR_GPIO_OE_OUT); 87 reg &= ~(AR_GPIO_OE_OUT_DRV << gpio_shift); |
88 reg |= AR_GPIO_OE_OUT_DRV_ALL << gpio_shift, | 88 reg |= AR_GPIO_OE_OUT_DRV_ALL << gpio_shift; |
89 OS_REG_WRITE(ah, AR_GPIO_OE_OUT, reg); 90 91 return AH_TRUE; 92} 93 94/* 95 * Configure GPIO Input lines 96 */ --- 5 unchanged lines hidden (view full) --- 102 HALASSERT(gpio < AH_PRIVATE(ah)->ah_caps.halNumGpioPins); 103 104 /* TODO: configure input mux for AR5416 */ 105 /* If configured as input, set output to tristate */ 106 gpio_shift = gpio << 1; 107 108 reg = OS_REG_READ(ah, AR_GPIO_OE_OUT); 109 reg &= ~(AR_GPIO_OE_OUT_DRV << gpio_shift); | 89 OS_REG_WRITE(ah, AR_GPIO_OE_OUT, reg); 90 91 return AH_TRUE; 92} 93 94/* 95 * Configure GPIO Input lines 96 */ --- 5 unchanged lines hidden (view full) --- 102 HALASSERT(gpio < AH_PRIVATE(ah)->ah_caps.halNumGpioPins); 103 104 /* TODO: configure input mux for AR5416 */ 105 /* If configured as input, set output to tristate */ 106 gpio_shift = gpio << 1; 107 108 reg = OS_REG_READ(ah, AR_GPIO_OE_OUT); 109 reg &= ~(AR_GPIO_OE_OUT_DRV << gpio_shift); |
110 reg |= AR_GPIO_OE_OUT_DRV_ALL << gpio_shift, | 110 reg |= AR_GPIO_OE_OUT_DRV_ALL << gpio_shift; |
111 OS_REG_WRITE(ah, AR_GPIO_OE_OUT, reg); 112 113 return AH_TRUE; 114} 115 116/* 117 * Once configured for I/O - set output lines 118 */ --- 111 unchanged lines hidden --- | 111 OS_REG_WRITE(ah, AR_GPIO_OE_OUT, reg); 112 113 return AH_TRUE; 114} 115 116/* 117 * Once configured for I/O - set output lines 118 */ --- 111 unchanged lines hidden --- |