Date: Tue, 18 Dec 2007 20:33:42 GMT From: Hans Petter Selasky <hselasky@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 131176 for review Message-ID: <200712182033.lBIKXg5f035720@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=131176 Change 131176 by hselasky@hselasky_laptop001 on 2007/12/18 20:33:37 u Affected files ... .. //depot/projects/usb/src/sys/arm/at91/at91_pio.c#5 edit .. //depot/projects/usb/src/sys/arm/at91/at91_piovar.h#2 edit Differences ... ==== //depot/projects/usb/src/sys/arm/at91/at91_pio.c#5 (text) ==== @@ -349,6 +349,28 @@ PIO[PIO_CODR / 4] = data_mask; } +uint8_t +at91_pio_gpio_get(uint32_t pio, uint32_t data_mask) +{ + uint32_t *PIO = (uint32_t *)(AT91RM92_BASE + pio); + + data_mask &= PIO[PIO_PDSR / 4]; + + return (data_mask ? 1 : 0); +} + +void +at91_pio_gpio_set_deglitch(uint32_t pio, uint32_t data_mask, int use_deglitch) +{ + uint32_t *PIO = (uint32_t *)(AT91RM92_BASE + pio); + + if (use_deglitch) + PIO[PIO_IFER / 4] = data_mask; + else + PIO[PIO_IFDR / 4] = data_mask; + return; +} + static device_method_t at91_pio_methods[] = { /* Device interface */ DEVMETHOD(device_probe, at91_pio_probe), ==== //depot/projects/usb/src/sys/arm/at91/at91_piovar.h#2 (text+ko) ==== @@ -35,5 +35,8 @@ int use_pullup); void at91_pio_gpio_set(uint32_t pio, uint32_t data_mask); void at91_pio_gpio_clear(uint32_t pio, uint32_t data_mask); +uint8_t at91_pio_gpio_get(uint32_t pio, uint32_t data_mask); +void at91_pio_gpio_set_deglitch(uint32_t pio, uint32_t data_mask, + int use_deglitch); #endif /* ARM_AT91_AT91_PIOVAR_H */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200712182033.lBIKXg5f035720>