pcf.c (46743) | pcf.c (49195) |
---|---|
1/*- 2 * Copyright (c) 1998 Nicolas Souchu, Marc Bouget 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 --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 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 * | 1/*- 2 * Copyright (c) 1998 Nicolas Souchu, Marc Bouget 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 --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 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 * $Id: pcf.c,v 1.8 1999/05/06 18:54:18 peter Exp $ | 26 * $Id: pcf.c,v 1.9 1999/05/08 21:59:27 dfr Exp $ |
27 * 28 */ 29#include <sys/param.h> 30#include <sys/systm.h> 31#include <sys/kernel.h> 32#include <sys/module.h> 33#include <sys/bus.h> 34#include <sys/conf.h> --- 63 unchanged lines hidden (view full) --- 98static int pcfattach_isa(struct isa_device *); 99 100struct isa_driver pcfdriver = { 101 pcfprobe_isa, pcfattach_isa, "pcf" 102}; 103 104static int pcf_probe(device_t); 105static int pcf_attach(device_t); | 27 * 28 */ 29#include <sys/param.h> 30#include <sys/systm.h> 31#include <sys/kernel.h> 32#include <sys/module.h> 33#include <sys/bus.h> 34#include <sys/conf.h> --- 63 unchanged lines hidden (view full) --- 98static int pcfattach_isa(struct isa_device *); 99 100struct isa_driver pcfdriver = { 101 pcfprobe_isa, pcfattach_isa, "pcf" 102}; 103 104static int pcf_probe(device_t); 105static int pcf_attach(device_t); |
106static void pcf_print_child(device_t, device_t); | 106static int pcf_print_child(device_t, device_t); |
107 108static int pcf_repeated_start(device_t, u_char, int); 109static int pcf_start(device_t, u_char, int); 110static int pcf_stop(device_t); 111static int pcf_write(device_t, char *, int, int *, int); 112static int pcf_read(device_t, char *, int, int *, int, int); 113static ointhand2_t pcfintr; 114static int pcf_rst_card(device_t, u_char, u_char, u_char *); --- 99 unchanged lines hidden (view full) --- 214 pcf->iicbus = iicbus_alloc_bus(pcfdev); 215 216 /* probe and attach the iicbus */ 217 device_probe_and_attach(pcf->iicbus); 218 219 return (0); 220} 221 | 107 108static int pcf_repeated_start(device_t, u_char, int); 109static int pcf_start(device_t, u_char, int); 110static int pcf_stop(device_t); 111static int pcf_write(device_t, char *, int, int *, int); 112static int pcf_read(device_t, char *, int, int *, int, int); 113static ointhand2_t pcfintr; 114static int pcf_rst_card(device_t, u_char, u_char, u_char *); --- 99 unchanged lines hidden (view full) --- 214 pcf->iicbus = iicbus_alloc_bus(pcfdev); 215 216 /* probe and attach the iicbus */ 217 device_probe_and_attach(pcf->iicbus); 218 219 return (0); 220} 221 |
222static void | 222static int |
223pcf_print_child(device_t bus, device_t dev) 224{ 225 struct pcf_softc *pcf = (struct pcf_softc *)device_get_softc(bus); | 223pcf_print_child(device_t bus, device_t dev) 224{ 225 struct pcf_softc *pcf = (struct pcf_softc *)device_get_softc(bus); |
226 int retval = 0; |
|
226 | 227 |
227 printf(" on %s%d addr 0x%x", device_get_name(bus), 228 device_get_unit(bus), (int)pcf->pcf_addr); | 228 retval += bus_print_child_header(bus, dev); 229 retval += printf(" on %s addr 0x%x\n", device_get_nameunit(bus), 230 (int)pcf->pcf_addr); |
229 | 231 |
230 return; | 232 return (retval); |
231} 232 233/* 234 * PCF8584 datasheet : when operate at 8 MHz or more, a minimun time of 235 * 6 clocks cycles must be left between two consecutives access 236 */ 237#define pcf_nops() DELAY(10) 238 --- 407 unchanged lines hidden --- | 233} 234 235/* 236 * PCF8584 datasheet : when operate at 8 MHz or more, a minimun time of 237 * 6 clocks cycles must be left between two consecutives access 238 */ 239#define pcf_nops() DELAY(10) 240 --- 407 unchanged lines hidden --- |