at91_pio.c (248911) | at91_pio.c (249232) |
---|---|
1/*- 2 * Copyright (c) 2006 M. Warner Losh. All rights reserved. 3 * Copyright (C) 2012 Ian Lepore. 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 --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2006 M. Warner Losh. All rights reserved. 3 * Copyright (C) 2012 Ian Lepore. 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 --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/arm/at91/at91_pio.c 248911 2013-03-29 19:52:57Z ian $"); | 28__FBSDID("$FreeBSD: head/sys/arm/at91/at91_pio.c 249232 2013-04-07 13:03:57Z hselasky $"); |
29 30#include <sys/param.h> 31#include <sys/systm.h> 32#include <sys/bus.h> 33#include <sys/conf.h> 34#include <sys/kernel.h> 35#include <sys/lock.h> 36#include <sys/mbuf.h> --- 512 unchanged lines hidden (view full) --- 549void 550at91_pio_gpio_clear(uint32_t pio, uint32_t data_mask) 551{ 552 uint32_t *PIO = (uint32_t *)(AT91_BASE + pio); 553 554 PIO[PIO_CODR / 4] = data_mask; 555} 556 | 29 30#include <sys/param.h> 31#include <sys/systm.h> 32#include <sys/bus.h> 33#include <sys/conf.h> 34#include <sys/kernel.h> 35#include <sys/lock.h> 36#include <sys/mbuf.h> --- 512 unchanged lines hidden (view full) --- 549void 550at91_pio_gpio_clear(uint32_t pio, uint32_t data_mask) 551{ 552 uint32_t *PIO = (uint32_t *)(AT91_BASE + pio); 553 554 PIO[PIO_CODR / 4] = data_mask; 555} 556 |
557uint8_t | 557uint32_t |
558at91_pio_gpio_get(uint32_t pio, uint32_t data_mask) 559{ 560 uint32_t *PIO = (uint32_t *)(AT91_BASE + pio); 561 | 558at91_pio_gpio_get(uint32_t pio, uint32_t data_mask) 559{ 560 uint32_t *PIO = (uint32_t *)(AT91_BASE + pio); 561 |
562 return ((PIO[PIO_PDSR / 4] & data_mask)); | 562 return (PIO[PIO_PDSR / 4] & data_mask); |
563} 564 565void 566at91_pio_gpio_set_deglitch(uint32_t pio, uint32_t data_mask, int use_deglitch) 567{ 568 uint32_t *PIO = (uint32_t *)(AT91_BASE + pio); 569 570 if (use_deglitch) --- 43 unchanged lines hidden --- | 563} 564 565void 566at91_pio_gpio_set_deglitch(uint32_t pio, uint32_t data_mask, int use_deglitch) 567{ 568 uint32_t *PIO = (uint32_t *)(AT91_BASE + pio); 569 570 if (use_deglitch) --- 43 unchanged lines hidden --- |