| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: leo.c,v 1.21 2014/07/25 08:10:32 dholland Exp $ */ | | 1 | /* $NetBSD: leo.c,v 1.22 2017/02/01 14:33:10 christos Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 1997 maximum entropy <entropy@zippy.bernstein.com> | | 4 | * Copyright (c) 1997 maximum entropy <entropy@zippy.bernstein.com> |
5 | * Copyright (c) 1997 The NetBSD Foundation, Inc. | | 5 | * Copyright (c) 1997 The NetBSD Foundation, Inc. |
6 | * All rights reserved. | | 6 | * All rights reserved. |
7 | * | | 7 | * |
8 | * Redistribution and use in source and binary forms, with or without | | 8 | * Redistribution and use in source and binary forms, with or without |
9 | * modification, are permitted provided that the following conditions | | 9 | * modification, are permitted provided that the following conditions |
10 | * are met: | | 10 | * are met: |
11 | * 1. Redistributions of source code must retain the above copyright | | 11 | * 1. Redistributions of source code must retain the above copyright |
12 | * notice, this list of conditions and the following disclaimer. | | 12 | * notice, this list of conditions and the following disclaimer. |
13 | * 2. Redistributions in binary form must reproduce the above copyright | | 13 | * 2. Redistributions in binary form must reproduce the above copyright |
14 | * notice, this list of conditions and the following disclaimer in the | | 14 | * notice, this list of conditions and the following disclaimer in the |
| @@ -37,27 +37,27 @@ | | | @@ -37,27 +37,27 @@ |
37 | * drivers in the NetBSD distribution as examples. The file I referred to | | 37 | * drivers in the NetBSD distribution as examples. The file I referred to |
38 | * the most was /sys/arch/atari/vme/if_le_vme.c. Due credits: | | 38 | * the most was /sys/arch/atari/vme/if_le_vme.c. Due credits: |
39 | * Copyright (c) 1997 Leo Weppelman. All rights reserved. | | 39 | * Copyright (c) 1997 Leo Weppelman. All rights reserved. |
40 | * Copyright (c) 1995 Charles M. Hannum. All rights reserved. | | 40 | * Copyright (c) 1995 Charles M. Hannum. All rights reserved. |
41 | * Copyright (c) 1992, 1993 | | 41 | * Copyright (c) 1992, 1993 |
42 | * The Regents of the University of California. All rights reserved. | | 42 | * The Regents of the University of California. All rights reserved. |
43 | * This code is derived from software contributed to Berkeley by | | 43 | * This code is derived from software contributed to Berkeley by |
44 | * Ralph Campbell and Rick Macklem. | | 44 | * Ralph Campbell and Rick Macklem. |
45 | * This product includes software developed by the University of | | 45 | * This product includes software developed by the University of |
46 | * California, Berkeley and its contributors. | | 46 | * California, Berkeley and its contributors. |
47 | */ | | 47 | */ |
48 | | | 48 | |
49 | #include <sys/cdefs.h> | | 49 | #include <sys/cdefs.h> |
50 | __KERNEL_RCSID(0, "$NetBSD: leo.c,v 1.21 2014/07/25 08:10:32 dholland Exp $"); | | 50 | __KERNEL_RCSID(0, "$NetBSD: leo.c,v 1.22 2017/02/01 14:33:10 christos Exp $"); |
51 | | | 51 | |
52 | #include <sys/param.h> | | 52 | #include <sys/param.h> |
53 | #include <sys/systm.h> | | 53 | #include <sys/systm.h> |
54 | #include <sys/proc.h> | | 54 | #include <sys/proc.h> |
55 | #include <sys/errno.h> | | 55 | #include <sys/errno.h> |
56 | #include <sys/device.h> | | 56 | #include <sys/device.h> |
57 | #include <sys/conf.h> | | 57 | #include <sys/conf.h> |
58 | #include <sys/ioctl.h> | | 58 | #include <sys/ioctl.h> |
59 | #include <machine/cpu.h> | | 59 | #include <machine/cpu.h> |
60 | #include <sys/bus.h> | | 60 | #include <sys/bus.h> |
61 | #include <machine/iomap.h> | | 61 | #include <machine/iomap.h> |
62 | #include <machine/scu.h> | | 62 | #include <machine/scu.h> |
63 | #include <atari/vme/vmevar.h> | | 63 | #include <atari/vme/vmevar.h> |
| @@ -323,29 +323,29 @@ leo_init(struct leo_softc *sc, int ysize | | | @@ -323,29 +323,29 @@ leo_init(struct leo_softc *sc, int ysize |
323 | else | | 323 | else |
324 | bus_space_write_2(sc->sc_iot, sc->sc_ioh, 0xc8, 0x20); | | 324 | bus_space_write_2(sc->sc_iot, sc->sc_ioh, 0xc8, 0x20); |
325 | bus_space_write_2(sc->sc_iot, sc->sc_ioh, 0xc0, 0x40); | | 325 | bus_space_write_2(sc->sc_iot, sc->sc_ioh, 0xc0, 0x40); |
326 | return 0; | | 326 | return 0; |
327 | } | | 327 | } |
328 | | | 328 | |
329 | static int | | 329 | static int |
330 | leo_scroll(struct leo_softc *sc, int scroll) | | 330 | leo_scroll(struct leo_softc *sc, int scroll) |
331 | { | | 331 | { |
332 | | | 332 | |
333 | if ((scroll < 0) || (scroll > 255)) | | 333 | if ((scroll < 0) || (scroll > 255)) |
334 | return EINVAL; | | 334 | return EINVAL; |
335 | bus_space_write_1(sc->sc_iot, sc->sc_ioh, LEO_REG_MSBSCROLL, | | 335 | bus_space_write_1(sc->sc_iot, sc->sc_ioh, LEO_REG_MSBSCROLL, |
336 | (scroll >> 6) && 0xff); | | 336 | (scroll >> 6) & 0xff); |
337 | bus_space_write_1(sc->sc_iot, sc->sc_ioh, LEO_REG_LSBSCROLL, | | 337 | bus_space_write_1(sc->sc_iot, sc->sc_ioh, LEO_REG_LSBSCROLL, |
338 | (scroll << 2) && 0xff); | | 338 | (scroll << 2) & 0xff); |
339 | return 0; | | 339 | return 0; |
340 | } | | 340 | } |
341 | | | 341 | |
342 | int | | 342 | int |
343 | leoclose(dev_t dev, int flags, int devtype, struct lwp *l) | | 343 | leoclose(dev_t dev, int flags, int devtype, struct lwp *l) |
344 | { | | 344 | { |
345 | struct leo_softc *sc; | | 345 | struct leo_softc *sc; |
346 | | | 346 | |
347 | sc = device_lookup_private(&leo_cd, minor(dev)); | | 347 | sc = device_lookup_private(&leo_cd, minor(dev)); |
348 | sc->sc_flags &= ~LEO_SC_FLAGS_INUSE; | | 348 | sc->sc_flags &= ~LEO_SC_FLAGS_INUSE; |
349 | return 0; | | 349 | return 0; |
350 | } | | 350 | } |
351 | | | 351 | |