Mon May 4 12:41:09 2009 UTC ()
struct cfdata * -> cfdata_t


(cegger)
diff -r1.6 -r1.7 src/sys/arch/i386/pci/gcscpcib.c
diff -r1.11 -r1.12 src/sys/arch/i386/pci/gscpcib.c

cvs diff -r1.6 -r1.7 src/sys/arch/i386/pci/Attic/gcscpcib.c (expand / switch to unified diff)

--- src/sys/arch/i386/pci/Attic/gcscpcib.c 2008/07/20 22:57:19 1.6
+++ src/sys/arch/i386/pci/Attic/gcscpcib.c 2009/05/04 12:41:09 1.7
@@ -1,40 +1,40 @@ @@ -1,40 +1,40 @@
1/* $NetBSD: gcscpcib.c,v 1.6 2008/07/20 22:57:19 martin Exp $ */ 1/* $NetBSD: gcscpcib.c,v 1.7 2009/05/04 12:41:09 cegger Exp $ */
2/* $OpenBSD: gcscpcib.c,v 1.6 2007/11/17 17:02:47 mbalmer Exp $ */ 2/* $OpenBSD: gcscpcib.c,v 1.6 2007/11/17 17:02:47 mbalmer Exp $ */
3 3
4/* 4/*
5 * Copyright (c) 2008 Yojiro UO <yuo@nui.org> 5 * Copyright (c) 2008 Yojiro UO <yuo@nui.org>
6 * Copyright (c) 2007 Marc Balmer <mbalmer@openbsd.org> 6 * Copyright (c) 2007 Marc Balmer <mbalmer@openbsd.org>
7 * Copyright (c) 2007 Michael Shalayeff 7 * Copyright (c) 2007 Michael Shalayeff
8 * All rights reserved. 8 * All rights reserved.
9 * 9 *
10 * Permission to use, copy, modify, and distribute this software for any 10 * Permission to use, copy, modify, and distribute this software for any
11 * purpose with or without fee is hereby granted, provided that the above 11 * purpose with or without fee is hereby granted, provided that the above
12 * copyright notice and this permission notice appear in all copies. 12 * copyright notice and this permission notice appear in all copies.
13 * 13 *
14 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 14 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
15 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 15 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
16 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 16 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
17 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 17 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
18 * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER IN 18 * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER IN
19 * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT 19 * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
20 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 20 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21 */ 21 */
22 22
23/* 23/*
24 * AMD CS5535/CS5536 series LPC bridge also containing timer, watchdog and GPIO. 24 * AMD CS5535/CS5536 series LPC bridge also containing timer, watchdog and GPIO.
25 */ 25 */
26#include <sys/cdefs.h> 26#include <sys/cdefs.h>
27__KERNEL_RCSID(0, "$NetBSD: gcscpcib.c,v 1.6 2008/07/20 22:57:19 martin Exp $"); 27__KERNEL_RCSID(0, "$NetBSD: gcscpcib.c,v 1.7 2009/05/04 12:41:09 cegger Exp $");
28 28
29#include "gpio.h" 29#include "gpio.h"
30 30
31#include <sys/param.h> 31#include <sys/param.h>
32#include <sys/systm.h> 32#include <sys/systm.h>
33#include <sys/device.h> 33#include <sys/device.h>
34#include <sys/gpio.h> 34#include <sys/gpio.h>
35#include <sys/sysctl.h> 35#include <sys/sysctl.h>
36#include <sys/timetc.h> 36#include <sys/timetc.h>
37#include <sys/wdog.h> 37#include <sys/wdog.h>
38 38
39#include <sys/bus.h> 39#include <sys/bus.h>
40#include <machine/cpufunc.h> 40#include <machine/cpufunc.h>
@@ -93,49 +93,49 @@ struct gcscpcib_softc { @@ -93,49 +93,49 @@ struct gcscpcib_softc {
93 struct gpio_chipset_tag sc_gpio_gc; 93 struct gpio_chipset_tag sc_gpio_gc;
94 gpio_pin_t sc_gpio_pins[AMD553X_GPIO_NPINS]; 94 gpio_pin_t sc_gpio_pins[AMD553X_GPIO_NPINS];
95 95
96 /* SMbus/i2c interface */  96 /* SMbus/i2c interface */
97#if 0 97#if 0
98 bus_space_tag_t sc_smbus_iot; 98 bus_space_tag_t sc_smbus_iot;
99 bus_space_handle_t sc_smbus_ioh; 99 bus_space_handle_t sc_smbus_ioh;
100 i2c_addr_t sc_smbus_slaveaddr; /* address of smbus slave */ 100 i2c_addr_t sc_smbus_slaveaddr; /* address of smbus slave */
101 struct i2c_controller sc_i2c; /* i2c controller info */ 101 struct i2c_controller sc_i2c; /* i2c controller info */
102 krwlock_t sc_smbus_rwlock; 102 krwlock_t sc_smbus_rwlock;
103#endif 103#endif
104}; 104};
105 105
106static int gcscpcib_match(device_t, struct cfdata *, void *); 106static int gcscpcib_match(device_t, cfdata_t, void *);
107static void gcscpcib_attach(device_t, device_t, void *); 107static void gcscpcib_attach(device_t, device_t, void *);
108 108
109CFATTACH_DECL_NEW(gcscpcib, sizeof(struct gcscpcib_softc), 109CFATTACH_DECL_NEW(gcscpcib, sizeof(struct gcscpcib_softc),
110 gcscpcib_match, gcscpcib_attach, NULL, NULL); 110 gcscpcib_match, gcscpcib_attach, NULL, NULL);
111 111
112static u_int gcscpcib_get_timecount(struct timecounter *tc); 112static u_int gcscpcib_get_timecount(struct timecounter *tc);
113static int gscspcib_scan_mfgpt(struct gcscpcib_softc *sc); 113static int gscspcib_scan_mfgpt(struct gcscpcib_softc *sc);
114static void gscspcib_wdog_update(struct gcscpcib_softc *, uint16_t); 114static void gscspcib_wdog_update(struct gcscpcib_softc *, uint16_t);
115static int gcscpcib_wdog_setmode(struct sysmon_wdog *smw); 115static int gcscpcib_wdog_setmode(struct sysmon_wdog *smw);
116static int gcscpcib_wdog_tickle(struct sysmon_wdog *smw); 116static int gcscpcib_wdog_tickle(struct sysmon_wdog *smw);
117static void gcscpcib_wdog_enable(struct gcscpcib_softc *sc); 117static void gcscpcib_wdog_enable(struct gcscpcib_softc *sc);
118static void gcscpcib_wdog_disable(struct gcscpcib_softc *sc); 118static void gcscpcib_wdog_disable(struct gcscpcib_softc *sc);
119static void gcscpcib_wdog_reset(struct gcscpcib_softc *sc); 119static void gcscpcib_wdog_reset(struct gcscpcib_softc *sc);
120 120
121#if NGPIO > 0 121#if NGPIO > 0
122static int gcscpcib_gpio_pin_read(void *, int); 122static int gcscpcib_gpio_pin_read(void *, int);
123static void gcscpcib_gpio_pin_write(void *, int, int); 123static void gcscpcib_gpio_pin_write(void *, int, int);
124static void gcscpcib_gpio_pin_ctl(void *, int, int); 124static void gcscpcib_gpio_pin_ctl(void *, int, int);
125#endif 125#endif
126 126
127static int 127static int
128gcscpcib_match(device_t parent, struct cfdata *match, void *aux) 128gcscpcib_match(device_t parent, cfdata_t match, void *aux)
129{  129{
130 struct pci_attach_args *pa = aux; 130 struct pci_attach_args *pa = aux;
131 131
132 if (PCI_CLASS(pa->pa_class) != PCI_CLASS_BRIDGE || 132 if (PCI_CLASS(pa->pa_class) != PCI_CLASS_BRIDGE ||
133 PCI_SUBCLASS(pa->pa_class) != PCI_SUBCLASS_BRIDGE_ISA) 133 PCI_SUBCLASS(pa->pa_class) != PCI_SUBCLASS_BRIDGE_ISA)
134 return 0; 134 return 0;
135 135
136 switch (PCI_PRODUCT(pa->pa_id)) { 136 switch (PCI_PRODUCT(pa->pa_id)) {
137 case PCI_PRODUCT_NS_CS5535_ISA: 137 case PCI_PRODUCT_NS_CS5535_ISA:
138 case PCI_PRODUCT_AMD_CS5536_PCIB: 138 case PCI_PRODUCT_AMD_CS5536_PCIB:
139 return 2; /* supersede pcib(4) */ 139 return 2; /* supersede pcib(4) */
140 } 140 }
141 141

cvs diff -r1.11 -r1.12 src/sys/arch/i386/pci/gscpcib.c (expand / switch to unified diff)

--- src/sys/arch/i386/pci/gscpcib.c 2008/05/05 11:49:40 1.11
+++ src/sys/arch/i386/pci/gscpcib.c 2009/05/04 12:41:09 1.12
@@ -1,39 +1,39 @@ @@ -1,39 +1,39 @@
1/* $NetBSD: gscpcib.c,v 1.11 2008/05/05 11:49:40 xtraeme Exp $ */ 1/* $NetBSD: gscpcib.c,v 1.12 2009/05/04 12:41:09 cegger Exp $ */
2/* $OpenBSD: gscpcib.c,v 1.3 2004/10/05 19:02:33 grange Exp $ */ 2/* $OpenBSD: gscpcib.c,v 1.3 2004/10/05 19:02:33 grange Exp $ */
3/* 3/*
4 * Copyright (c) 2004 Alexander Yurchenko <grange@openbsd.org> 4 * Copyright (c) 2004 Alexander Yurchenko <grange@openbsd.org>
5 * 5 *
6 * Permission to use, copy, modify, and distribute this software for any 6 * Permission to use, copy, modify, and distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above 7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies. 8 * copyright notice and this permission notice appear in all copies.
9 * 9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */ 17 */
18 18
19/* 19/*
20 * Special driver for the National Semiconductor Geode SC1100 PCI-ISA bridge 20 * Special driver for the National Semiconductor Geode SC1100 PCI-ISA bridge
21 * that attaches instead of pcib(4). In addition to the core pcib(4) 21 * that attaches instead of pcib(4). In addition to the core pcib(4)
22 * functionality this driver provides support for the GPIO interface. 22 * functionality this driver provides support for the GPIO interface.
23 */ 23 */
24 24
25#include <sys/cdefs.h> 25#include <sys/cdefs.h>
26__KERNEL_RCSID(0, "$NetBSD: gscpcib.c,v 1.11 2008/05/05 11:49:40 xtraeme Exp $"); 26__KERNEL_RCSID(0, "$NetBSD: gscpcib.c,v 1.12 2009/05/04 12:41:09 cegger Exp $");
27 27
28#include <sys/param.h> 28#include <sys/param.h>
29#include <sys/systm.h> 29#include <sys/systm.h>
30#include <sys/device.h> 30#include <sys/device.h>
31#include <sys/gpio.h> 31#include <sys/gpio.h>
32#include <sys/kernel.h> 32#include <sys/kernel.h>
33 33
34#include <machine/bus.h> 34#include <machine/bus.h>
35 35
36#include <dev/pci/pcireg.h> 36#include <dev/pci/pcireg.h>
37#include <dev/pci/pcivar.h> 37#include <dev/pci/pcivar.h>
38#include <dev/pci/pcidevs.h> 38#include <dev/pci/pcidevs.h>
39 39
@@ -68,27 +68,27 @@ CFATTACH_DECL2_NEW(gscpcib, sizeof(struc @@ -68,27 +68,27 @@ CFATTACH_DECL2_NEW(gscpcib, sizeof(struc
68 gscpcib_childdetached); 68 gscpcib_childdetached);
69 69
70extern struct cfdriver gscpcib_cd; 70extern struct cfdriver gscpcib_cd;
71 71
72void 72void
73gscpcib_childdetached(device_t self, device_t child) 73gscpcib_childdetached(device_t self, device_t child)
74{ 74{
75 /* We hold no pointers to child devices, so there is nothing 75 /* We hold no pointers to child devices, so there is nothing
76 * to do here. 76 * to do here.
77 */ 77 */
78} 78}
79 79
80int 80int
81gscpcib_match(device_t parent, struct cfdata *match, void *aux) 81gscpcib_match(device_t parent, cfdata_t match, void *aux)
82{ 82{
83 struct pci_attach_args *pa = aux; 83 struct pci_attach_args *pa = aux;
84 84
85 if (PCI_CLASS(pa->pa_class) != PCI_CLASS_BRIDGE || 85 if (PCI_CLASS(pa->pa_class) != PCI_CLASS_BRIDGE ||
86 PCI_SUBCLASS(pa->pa_class) != PCI_SUBCLASS_BRIDGE_ISA) 86 PCI_SUBCLASS(pa->pa_class) != PCI_SUBCLASS_BRIDGE_ISA)
87 return (0); 87 return (0);
88 88
89 if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_NS && 89 if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_NS &&
90 PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_NS_SC1100_ISA) 90 PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_NS_SC1100_ISA)
91 return (2); /* supersede pcib(4) */ 91 return (2); /* supersede pcib(4) */
92 92
93 return (0); 93 return (0);
94} 94}