ar9300_gpio.c (278759) | ar9300_gpio.c (278762) |
---|---|
1/* 2 * Copyright (c) 2013 Qualcomm Atheros, Inc. 3 * 4 * Permission to use, copy, modify, and/or distribute this software for any 5 * purpose with or without fee is hereby granted, provided that the above 6 * copyright notice and this permission notice appear in all copies. 7 * 8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH --- 380 unchanged lines hidden (view full) --- 389/* 390 * Once configured for I/O - get input lines 391 */ 392u_int32_t 393ar9300_gpio_get(struct ath_hal *ah, u_int32_t gpio) 394{ 395 u_int32_t gpio_in; 396 HALASSERT(gpio < AH_PRIVATE(ah)->ah_caps.halNumGpioPins); | 1/* 2 * Copyright (c) 2013 Qualcomm Atheros, Inc. 3 * 4 * Permission to use, copy, modify, and/or distribute this software for any 5 * purpose with or without fee is hereby granted, provided that the above 6 * copyright notice and this permission notice appear in all copies. 7 * 8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH --- 380 unchanged lines hidden (view full) --- 389/* 390 * Once configured for I/O - get input lines 391 */ 392u_int32_t 393ar9300_gpio_get(struct ath_hal *ah, u_int32_t gpio) 394{ 395 u_int32_t gpio_in; 396 HALASSERT(gpio < AH_PRIVATE(ah)->ah_caps.halNumGpioPins); |
397 if ((gpio == AR9382_GPIO_PIN_8_RESERVED)) | 397 if (gpio == AR9382_GPIO_PIN_8_RESERVED) |
398 { 399 return 0xffffffff; 400 } 401 402 gpio_in = OS_REG_READ(ah, AR_HOSTIF_REG(ah, AR_GPIO_IN)); 403 OS_REG_RMW(ah, AR_HOSTIF_REG(ah, AR_GPIO_IN), 404 (1 << gpio), AR_GPIO_BIT(gpio)); 405 return (MS(gpio_in, AR_GPIO_IN_VAL) & AR_GPIO_BIT(gpio)) != 0; --- 235 unchanged lines hidden --- | 398 { 399 return 0xffffffff; 400 } 401 402 gpio_in = OS_REG_READ(ah, AR_HOSTIF_REG(ah, AR_GPIO_IN)); 403 OS_REG_RMW(ah, AR_HOSTIF_REG(ah, AR_GPIO_IN), 404 (1 << gpio), AR_GPIO_BIT(gpio)); 405 return (MS(gpio_in, AR_GPIO_IN_VAL) & AR_GPIO_BIT(gpio)) != 0; --- 235 unchanged lines hidden --- |