Beispiel #1
0
static int
at91_ssc_close(struct cdev *dev, int fflag, int devtype, struct thread *td)
{
	struct at91_ssc_softc *sc;

	sc = CDEV2SOFTC(dev);
	AT91_SSC_LOCK(sc);
	sc->flags &= ~OPENED;
	AT91_SSC_UNLOCK(sc);
	return (0);
}
Beispiel #2
0
static int 
at91_ssc_open(struct cdev *dev, int oflags, int devtype, struct thread *td)
{
	struct at91_ssc_softc *sc;

	sc = CDEV2SOFTC(dev);
	AT91_SSC_LOCK(sc);
	if (!(sc->flags & OPENED)) {
		sc->flags |= OPENED;
	}
	AT91_SSC_UNLOCK(sc);
    	return (0);
}
Beispiel #3
0
static int
at91_pio_close(struct cdev *dev, int fflag, int devtype, struct thread *td)
{
    struct at91_pio_softc *sc;

    sc = CDEV2SOFTC(dev);
    AT91_PIO_LOCK(sc);
    sc->flags &= ~OPENED;
#if 0
    /* Disable interrupts. */
#endif
    AT91_PIO_UNLOCK(sc);
    return (0);
}
Beispiel #4
0
static int
at91_pio_open(struct cdev *dev, int oflags, int devtype, struct thread *td)
{
    struct at91_pio_softc *sc;

    sc = CDEV2SOFTC(dev);
    AT91_PIO_LOCK(sc);
    if (!(sc->flags & OPENED)) {
        sc->flags |= OPENED;
#if 0
        /* Enable interrupts. */
#endif
    }
    AT91_PIO_UNLOCK(sc);
    return (0);
}