upd7210.c (150153) | upd7210.c (150525) |
---|---|
1/*- 2 * Copyright (c) 2005 Poul-Henning Kamp <phk@FreeBSD.org> 3 * 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 --- 14 unchanged lines hidden (view full) --- 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * 26 * High-level driver for �PD7210 based GPIB cards. 27 * 28 */ 29 30#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2005 Poul-Henning Kamp <phk@FreeBSD.org> 3 * 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 --- 14 unchanged lines hidden (view full) --- 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * 26 * High-level driver for �PD7210 based GPIB cards. 27 * 28 */ 29 30#include <sys/cdefs.h> |
31__FBSDID("$FreeBSD: head/sys/dev/ieee488/upd7210.c 150153 2005-09-15 13:07:38Z phk $"); | 31__FBSDID("$FreeBSD: head/sys/dev/ieee488/upd7210.c 150525 2005-09-24 20:44:55Z phk $"); |
32 33# define GPIB_DEBUG 34# undef GPIB_DEBUG 35 36#include <sys/param.h> 37#include <sys/systm.h> 38#include <sys/conf.h> 39#include <sys/malloc.h> 40#include <sys/kernel.h> 41#include <sys/limits.h> 42#include <sys/module.h> | 32 33# define GPIB_DEBUG 34# undef GPIB_DEBUG 35 36#include <sys/param.h> 37#include <sys/systm.h> 38#include <sys/conf.h> 39#include <sys/malloc.h> 40#include <sys/kernel.h> 41#include <sys/limits.h> 42#include <sys/module.h> |
43#include <sys/rman.h> |
|
43#include <sys/bus.h> 44#include <sys/lock.h> 45#include <sys/mutex.h> 46#include <sys/uio.h> 47#include <sys/time.h> 48#include <machine/bus.h> 49#include <machine/resource.h> 50#include <isa/isavar.h> --- 14 unchanged lines hidden (view full) --- 65 isr2, "\20\10INT\7SRQI\6LOK\5REM\4CO\3LOKC\2REMC\1ADSC"); 66} 67 68u_int 69upd7210_rd(struct upd7210 *u, enum upd7210_rreg reg) 70{ 71 u_int r; 72 | 44#include <sys/bus.h> 45#include <sys/lock.h> 46#include <sys/mutex.h> 47#include <sys/uio.h> 48#include <sys/time.h> 49#include <machine/bus.h> 50#include <machine/resource.h> 51#include <isa/isavar.h> --- 14 unchanged lines hidden (view full) --- 66 isr2, "\20\10INT\7SRQI\6LOK\5REM\4CO\3LOKC\2REMC\1ADSC"); 67} 68 69u_int 70upd7210_rd(struct upd7210 *u, enum upd7210_rreg reg) 71{ 72 u_int r; 73 |
73 r = bus_space_read_1( 74 u->reg_tag[reg], 75 u->reg_handle[reg], 76 u->reg_offset[reg]); | 74 r = bus_read_1(u->reg_res[reg], u->reg_offset[reg]); |
77 u->rreg[reg] = r; 78 return (r); 79} 80 81void 82upd7210_wr(struct upd7210 *u, enum upd7210_wreg reg, u_int val) 83{ 84 | 75 u->rreg[reg] = r; 76 return (r); 77} 78 79void 80upd7210_wr(struct upd7210 *u, enum upd7210_wreg reg, u_int val) 81{ 82 |
85 bus_space_write_1( 86 u->reg_tag[reg], 87 u->reg_handle[reg], 88 u->reg_offset[reg], val); | 83 bus_write_1(u->reg_res[reg], u->reg_offset[reg], val); |
89 u->wreg[reg] = val; 90 if (reg == AUXMR) 91 u->wreg[8 + (val >> 5)] = val & 0x1f; 92} 93 94void 95upd7210intr(void *arg) 96{ --- 209 unchanged lines hidden --- | 84 u->wreg[reg] = val; 85 if (reg == AUXMR) 86 u->wreg[8 + (val >> 5)] = val & 0x1f; 87} 88 89void 90upd7210intr(void *arg) 91{ --- 209 unchanged lines hidden --- |