Use DEVICE_COMPAT_EOL.diff -r1.19 -r1.20 src/sys/arch/macppc/dev/deq.c
(thorpej)
--- src/sys/arch/macppc/dev/deq.c 2021/01/25 14:20:39 1.19
+++ src/sys/arch/macppc/dev/deq.c 2021/01/27 02:17:27 1.20
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: deq.c,v 1.19 2021/01/25 14:20:39 thorpej Exp $ */ | 1 | /* $NetBSD: deq.c,v 1.20 2021/01/27 02:17:27 thorpej Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (C) 2005 Michael Lorenz | 4 | * Copyright (C) 2005 Michael Lorenz | |
5 | * | 5 | * | |
6 | * Redistribution and use in source and binary forms, with or without | 6 | * Redistribution and use in source and binary forms, with or without | |
7 | * modification, are permitted provided that the following conditions | 7 | * modification, are permitted provided that the following conditions | |
8 | * are met: | 8 | * are met: | |
9 | * 1. Redistributions of source code must retain the above copyright | 9 | * 1. Redistributions of source code must retain the above copyright | |
10 | * notice, this list of conditions and the following disclaimer. | 10 | * notice, this list of conditions and the following disclaimer. | |
11 | * 2. Redistributions in binary form must reproduce the above copyright | 11 | * 2. Redistributions in binary form must reproduce the above copyright | |
12 | * notice, this list of conditions and the following disclaimer in the | 12 | * notice, this list of conditions and the following disclaimer in the | |
13 | * documentation and/or other materials provided with the distribution. | 13 | * documentation and/or other materials provided with the distribution. | |
14 | * 3. The name of the author may not be used to endorse or promote products | 14 | * 3. The name of the author may not be used to endorse or promote products | |
@@ -22,53 +22,53 @@ | @@ -22,53 +22,53 @@ | |||
22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
26 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
27 | */ | 27 | */ | |
28 | 28 | |||
29 | /* | 29 | /* | |
30 | * a dummy device to attach to OF's deq node marking the TAS3004 audio mixer / | 30 | * a dummy device to attach to OF's deq node marking the TAS3004 audio mixer / | |
31 | * equalizer chip, needed by snapper | 31 | * equalizer chip, needed by snapper | |
32 | */ | 32 | */ | |
33 | 33 | |||
34 | #include <sys/cdefs.h> | 34 | #include <sys/cdefs.h> | |
35 | __KERNEL_RCSID(0, "$NetBSD: deq.c,v 1.19 2021/01/25 14:20:39 thorpej Exp $"); | 35 | __KERNEL_RCSID(0, "$NetBSD: deq.c,v 1.20 2021/01/27 02:17:27 thorpej Exp $"); | |
36 | 36 | |||
37 | #include <sys/param.h> | 37 | #include <sys/param.h> | |
38 | #include <sys/systm.h> | 38 | #include <sys/systm.h> | |
39 | #include <sys/kernel.h> | 39 | #include <sys/kernel.h> | |
40 | #include <sys/device.h> | 40 | #include <sys/device.h> | |
41 | #include <sys/malloc.h> | 41 | #include <sys/malloc.h> | |
42 | 42 | |||
43 | #include <dev/ofw/openfirm.h> | 43 | #include <dev/ofw/openfirm.h> | |
44 | #include <dev/i2c/i2cvar.h> | 44 | #include <dev/i2c/i2cvar.h> | |
45 | 45 | |||
46 | #include <machine/autoconf.h> | 46 | #include <machine/autoconf.h> | |
47 | #include <macppc/dev/deqvar.h> | 47 | #include <macppc/dev/deqvar.h> | |
48 | 48 | |||
49 | static void deq_attach(device_t, device_t, void *); | 49 | static void deq_attach(device_t, device_t, void *); | |
50 | static int deq_match(device_t, struct cfdata *, void *); | 50 | static int deq_match(device_t, struct cfdata *, void *); | |
51 | 51 | |||
52 | CFATTACH_DECL_NEW(deq, sizeof(struct deq_softc), | 52 | CFATTACH_DECL_NEW(deq, sizeof(struct deq_softc), | |
53 | deq_match, deq_attach, NULL, NULL); | 53 | deq_match, deq_attach, NULL, NULL); | |
54 | 54 | |||
55 | static const struct device_compatible_entry compat_data[] = { | 55 | static const struct device_compatible_entry compat_data[] = { | |
56 | { .compat = "deq" }, | 56 | { .compat = "deq" }, | |
57 | { .compat = "tas3004" }, | 57 | { .compat = "tas3004" }, | |
58 | { .compat = "pcm3052" }, | 58 | { .compat = "pcm3052" }, | |
59 | { .compat = "cs8416" }, | 59 | { .compat = "cs8416" }, | |
60 | { .compat = "codec" }, | 60 | { .compat = "codec" }, | |
61 | { } | 61 | DEVICE_COMPAT_EOL | |
62 | }; | 62 | }; | |
63 | 63 | |||
64 | int | 64 | int | |
65 | deq_match(device_t parent, struct cfdata *cf, void *aux) | 65 | deq_match(device_t parent, struct cfdata *cf, void *aux) | |
66 | { | 66 | { | |
67 | struct i2c_attach_args *ia = aux; | 67 | struct i2c_attach_args *ia = aux; | |
68 | int match_result; | 68 | int match_result; | |
69 | 69 | |||
70 | if (iic_use_direct_match(ia, cf, compat_data, &match_result)) | 70 | if (iic_use_direct_match(ia, cf, compat_data, &match_result)) | |
71 | return match_result; | 71 | return match_result; | |
72 | 72 | |||
73 | /* This driver is direct-config only. */ | 73 | /* This driver is direct-config only. */ | |
74 | 74 |
--- src/sys/arch/macppc/dev/lmu.c 2021/01/25 14:20:39 1.7
+++ src/sys/arch/macppc/dev/lmu.c 2021/01/27 02:17:28 1.8
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: lmu.c,v 1.7 2021/01/25 14:20:39 thorpej Exp $ */ | 1 | /* $NetBSD: lmu.c,v 1.8 2021/01/27 02:17:28 thorpej Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2020 Michael Lorenz | 4 | * Copyright (c) 2020 Michael Lorenz | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without | |
8 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions | |
9 | * are met: | 9 | * are met: | |
10 | * 1. Redistributions of source code must retain the above copyright | 10 | * 1. Redistributions of source code must retain the above copyright | |
11 | * notice, this list of conditions and the following disclaimer. | 11 | * notice, this list of conditions and the following disclaimer. | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | 12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | 13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | 14 | * documentation and/or other materials provided with the distribution. | |
@@ -21,27 +21,27 @@ | @@ -21,27 +21,27 @@ | |||
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
26 | * POSSIBILITY OF SUCH DAMAGE. | 26 | * POSSIBILITY OF SUCH DAMAGE. | |
27 | */ | 27 | */ | |
28 | 28 | |||
29 | /* | 29 | /* | |
30 | * ambient light controller found in PowerBook5,6 | 30 | * ambient light controller found in PowerBook5,6 | |
31 | */ | 31 | */ | |
32 | 32 | |||
33 | #include <sys/cdefs.h> | 33 | #include <sys/cdefs.h> | |
34 | __KERNEL_RCSID(0, "$NetBSD: lmu.c,v 1.7 2021/01/25 14:20:39 thorpej Exp $"); | 34 | __KERNEL_RCSID(0, "$NetBSD: lmu.c,v 1.8 2021/01/27 02:17:28 thorpej Exp $"); | |
35 | 35 | |||
36 | #include <sys/param.h> | 36 | #include <sys/param.h> | |
37 | #include <sys/systm.h> | 37 | #include <sys/systm.h> | |
38 | #include <sys/device.h> | 38 | #include <sys/device.h> | |
39 | #include <sys/conf.h> | 39 | #include <sys/conf.h> | |
40 | #include <sys/bus.h> | 40 | #include <sys/bus.h> | |
41 | #include <sys/time.h> | 41 | #include <sys/time.h> | |
42 | #include <sys/callout.h> | 42 | #include <sys/callout.h> | |
43 | #include <sys/sysctl.h> | 43 | #include <sys/sysctl.h> | |
44 | 44 | |||
45 | #include <dev/i2c/i2cvar.h> | 45 | #include <dev/i2c/i2cvar.h> | |
46 | 46 | |||
47 | #include <dev/sysmon/sysmonvar.h> | 47 | #include <dev/sysmon/sysmonvar.h> | |
@@ -73,27 +73,27 @@ static void lmu_attach(device_t, device_ | @@ -73,27 +73,27 @@ static void lmu_attach(device_t, device_ | |||
73 | static void lmu_sensors_refresh(struct sysmon_envsys *, envsys_data_t *); | 73 | static void lmu_sensors_refresh(struct sysmon_envsys *, envsys_data_t *); | |
74 | static void lmu_set_brightness(struct lmu_softc *, int); | 74 | static void lmu_set_brightness(struct lmu_softc *, int); | |
75 | static int lmu_get_brightness(struct lmu_softc *, int); | 75 | static int lmu_get_brightness(struct lmu_softc *, int); | |
76 | static void lmu_adjust(void *); | 76 | static void lmu_adjust(void *); | |
77 | static int lmu_sysctl(SYSCTLFN_ARGS); | 77 | static int lmu_sysctl(SYSCTLFN_ARGS); | |
78 | static int lmu_sysctl_thresh(SYSCTLFN_ARGS); | 78 | static int lmu_sysctl_thresh(SYSCTLFN_ARGS); | |
79 | 79 | |||
80 | CFATTACH_DECL_NEW(lmu, sizeof(struct lmu_softc), | 80 | CFATTACH_DECL_NEW(lmu, sizeof(struct lmu_softc), | |
81 | lmu_match, lmu_attach, NULL, NULL); | 81 | lmu_match, lmu_attach, NULL, NULL); | |
82 | 82 | |||
83 | static const struct device_compatible_entry compat_data[] = { | 83 | static const struct device_compatible_entry compat_data[] = { | |
84 | { .compat = "lmu-micro" }, | 84 | { .compat = "lmu-micro" }, | |
85 | { .compat = "lmu-controller" }, | 85 | { .compat = "lmu-controller" }, | |
86 | { } | 86 | DEVICE_COMPAT_EOL | |
87 | }; | 87 | }; | |
88 | 88 | |||
89 | /* time between polling the light sensors */ | 89 | /* time between polling the light sensors */ | |
90 | #define LMU_POLL (hz * 2) | 90 | #define LMU_POLL (hz * 2) | |
91 | /* time between updates to keyboard brightness */ | 91 | /* time between updates to keyboard brightness */ | |
92 | #define LMU_FADE (hz / 16) | 92 | #define LMU_FADE (hz / 16) | |
93 | 93 | |||
94 | static void | 94 | static void | |
95 | lmu_lid_open(device_t dev) | 95 | lmu_lid_open(device_t dev) | |
96 | { | 96 | { | |
97 | struct lmu_softc * const sc = device_private(dev); | 97 | struct lmu_softc * const sc = device_private(dev); | |
98 | 98 | |||
99 | sc->sc_lid_state = true; | 99 | sc->sc_lid_state = true; |
--- src/sys/arch/macppc/dev/psoc.c 2021/01/25 14:20:39 1.5
+++ src/sys/arch/macppc/dev/psoc.c 2021/01/27 02:17:28 1.6
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: psoc.c,v 1.5 2021/01/25 14:20:39 thorpej Exp $ */ | 1 | /* $NetBSD: psoc.c,v 1.6 2021/01/27 02:17:28 thorpej Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2019 Michael Lorenz | 4 | * Copyright (c) 2019 Michael Lorenz | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without | |
8 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions | |
9 | * are met: | 9 | * are met: | |
10 | * 1. Redistributions of source code must retain the above copyright | 10 | * 1. Redistributions of source code must retain the above copyright | |
11 | * notice, this list of conditions and the following disclaimer. | 11 | * notice, this list of conditions and the following disclaimer. | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | 12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | 13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | 14 | * documentation and/or other materials provided with the distribution. | |
@@ -32,27 +32,27 @@ | @@ -32,27 +32,27 @@ | |||
32 | * register values from OF: | 32 | * register values from OF: | |
33 | * fan1 - 0x20 ( status ), 0x31 ( data ) | 33 | * fan1 - 0x20 ( status ), 0x31 ( data ) | |
34 | * fan2 - 0x26 ( status ), 0x45 ( data ) | 34 | * fan2 - 0x26 ( status ), 0x45 ( data ) | |
35 | * fan status byte 0: | 35 | * fan status byte 0: | |
36 | * 0x5* - fan is running, 0x6* - fan stopped | 36 | * 0x5* - fan is running, 0x6* - fan stopped | |
37 | * byte 1: unknown, 0x80 seems always set, lower bits seem to fluctuate | 37 | * byte 1: unknown, 0x80 seems always set, lower bits seem to fluctuate | |
38 | * byte 2: lower 6 bit seem to indicate speed | 38 | * byte 2: lower 6 bit seem to indicate speed | |
39 | * fan speed may be lower 6 bit of byte 2 and lower 6 of byte 1 | 39 | * fan speed may be lower 6 bit of byte 2 and lower 6 of byte 1 | |
40 | * temperature sensors start at 6, two bytes each, first appears to be | 40 | * temperature sensors start at 6, two bytes each, first appears to be | |
41 | * the temperature in degrees Celsius | 41 | * the temperature in degrees Celsius | |
42 | */ | 42 | */ | |
43 | 43 | |||
44 | #include <sys/cdefs.h> | 44 | #include <sys/cdefs.h> | |
45 | __KERNEL_RCSID(0, "$NetBSD: psoc.c,v 1.5 2021/01/25 14:20:39 thorpej Exp $"); | 45 | __KERNEL_RCSID(0, "$NetBSD: psoc.c,v 1.6 2021/01/27 02:17:28 thorpej Exp $"); | |
46 | 46 | |||
47 | #include <sys/param.h> | 47 | #include <sys/param.h> | |
48 | #include <sys/systm.h> | 48 | #include <sys/systm.h> | |
49 | #include <sys/device.h> | 49 | #include <sys/device.h> | |
50 | #include <sys/conf.h> | 50 | #include <sys/conf.h> | |
51 | #include <sys/bus.h> | 51 | #include <sys/bus.h> | |
52 | #include <sys/time.h> | 52 | #include <sys/time.h> | |
53 | 53 | |||
54 | #include <dev/ofw/openfirm.h> | 54 | #include <dev/ofw/openfirm.h> | |
55 | 55 | |||
56 | #include <dev/i2c/i2cvar.h> | 56 | #include <dev/i2c/i2cvar.h> | |
57 | 57 | |||
58 | #include <dev/sysmon/sysmonvar.h> | 58 | #include <dev/sysmon/sysmonvar.h> | |
@@ -72,27 +72,27 @@ struct psoc_softc { | @@ -72,27 +72,27 @@ struct psoc_softc { | |||
72 | 72 | |||
73 | static int psoc_match(device_t, cfdata_t, void *); | 73 | static int psoc_match(device_t, cfdata_t, void *); | |
74 | static void psoc_attach(device_t, device_t, void *); | 74 | static void psoc_attach(device_t, device_t, void *); | |
75 | 75 | |||
76 | static void psoc_sensors_refresh(struct sysmon_envsys *, envsys_data_t *); | 76 | static void psoc_sensors_refresh(struct sysmon_envsys *, envsys_data_t *); | |
77 | 77 | |||
78 | static void psoc_dump(struct psoc_softc *); | 78 | static void psoc_dump(struct psoc_softc *); | |
79 | 79 | |||
80 | CFATTACH_DECL_NEW(psoc, sizeof(struct psoc_softc), | 80 | CFATTACH_DECL_NEW(psoc, sizeof(struct psoc_softc), | |
81 | psoc_match, psoc_attach, NULL, NULL); | 81 | psoc_match, psoc_attach, NULL, NULL); | |
82 | 82 | |||
83 | static const struct device_compatible_entry compat_data[] = { | 83 | static const struct device_compatible_entry compat_data[] = { | |
84 | { .compat = "Psoc" }, | 84 | { .compat = "Psoc" }, | |
85 | { } | 85 | DEVICE_COMPAT_EOL | |
86 | }; | 86 | }; | |
87 | 87 | |||
88 | static int | 88 | static int | |
89 | psoc_match(device_t parent, cfdata_t match, void *aux) | 89 | psoc_match(device_t parent, cfdata_t match, void *aux) | |
90 | { | 90 | { | |
91 | struct i2c_attach_args *ia = aux; | 91 | struct i2c_attach_args *ia = aux; | |
92 | int match_result; | 92 | int match_result; | |
93 | 93 | |||
94 | if (iic_use_direct_match(ia, match, compat_data, &match_result)) | 94 | if (iic_use_direct_match(ia, match, compat_data, &match_result)) | |
95 | return match_result; | 95 | return match_result; | |
96 | 96 | |||
97 | return 0; | 97 | return 0; | |
98 | } | 98 | } |
--- src/sys/arch/macppc/dev/smusat.c 2021/01/25 14:20:39 1.8
+++ src/sys/arch/macppc/dev/smusat.c 2021/01/27 02:17:28 1.9
@@ -98,27 +98,27 @@ static int smusat_match(device_t, struct | @@ -98,27 +98,27 @@ static int smusat_match(device_t, struct | |||
98 | static void smusat_attach(device_t, device_t, void *); | 98 | static void smusat_attach(device_t, device_t, void *); | |
99 | static void smusat_setup_sme(struct smusat_softc *); | 99 | static void smusat_setup_sme(struct smusat_softc *); | |
100 | static void smusat_sme_refresh(struct sysmon_envsys *, envsys_data_t *); | 100 | static void smusat_sme_refresh(struct sysmon_envsys *, envsys_data_t *); | |
101 | static int smusat_sensors_update(struct smusat_softc *); | 101 | static int smusat_sensors_update(struct smusat_softc *); | |
102 | static int smusat_sensor_read(struct smusat_sensor *, int *); | 102 | static int smusat_sensor_read(struct smusat_sensor *, int *); | |
103 | static int smusat_sysctl_sensor_value(SYSCTLFN_ARGS); | 103 | static int smusat_sysctl_sensor_value(SYSCTLFN_ARGS); | |
104 | 104 | |||
105 | CFATTACH_DECL_NEW(smusat, sizeof(struct smusat_softc), | 105 | CFATTACH_DECL_NEW(smusat, sizeof(struct smusat_softc), | |
106 | smusat_match, smusat_attach, NULL, NULL); | 106 | smusat_match, smusat_attach, NULL, NULL); | |
107 | 107 | |||
108 | static const struct device_compatible_entry compat_data[] = { | 108 | static const struct device_compatible_entry compat_data[] = { | |
109 | { .compat = "sat" }, | 109 | { .compat = "sat" }, | |
110 | { .compat = "smu-sat" }, | 110 | { .compat = "smu-sat" }, | |
111 | { } | 111 | DEVICE_COMPAT_EOL | |
112 | }; | 112 | }; | |
113 | 113 | |||
114 | static int | 114 | static int | |
115 | smusat_match(device_t parent, struct cfdata *cf, void *aux) | 115 | smusat_match(device_t parent, struct cfdata *cf, void *aux) | |
116 | { | 116 | { | |
117 | struct i2c_attach_args *ia = aux; | 117 | struct i2c_attach_args *ia = aux; | |
118 | int match_result; | 118 | int match_result; | |
119 | 119 | |||
120 | if (iic_use_direct_match(ia, cf, compat_data, &match_result)) | 120 | if (iic_use_direct_match(ia, cf, compat_data, &match_result)) | |
121 | return match_result; | 121 | return match_result; | |
122 | 122 | |||
123 | if (ia->ia_addr == 0x58) | 123 | if (ia->ia_addr == 0x58) | |
124 | return I2C_MATCH_ADDRESS_ONLY; | 124 | return I2C_MATCH_ADDRESS_ONLY; |