Wed Feb 23 07:55:56 2022 UTC ()
API naming consistency.  NFC.


(skrll)
diff -r1.14 -r1.15 src/sys/arch/arm/nvidia/tegra_drm.c
diff -r1.11 -r1.12 src/sys/dev/fdt/fdt_i2c.c
diff -r1.74 -r1.75 src/sys/dev/fdt/fdtvar.h

cvs diff -r1.14 -r1.15 src/sys/arch/arm/nvidia/tegra_drm.c (expand / switch to unified diff)

--- src/sys/arch/arm/nvidia/tegra_drm.c 2021/12/19 12:44:50 1.14
+++ src/sys/arch/arm/nvidia/tegra_drm.c 2022/02/23 07:55:56 1.15
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: tegra_drm.c,v 1.14 2021/12/19 12:44:50 riastradh Exp $ */ 1/* $NetBSD: tegra_drm.c,v 1.15 2022/02/23 07:55:56 skrll Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2015 Jared D. McNeill <jmcneill@invisible.ca> 4 * Copyright (c) 2015 Jared D. McNeill <jmcneill@invisible.ca>
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.
@@ -17,27 +17,27 @@ @@ -17,27 +17,27 @@
17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 23 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE. 26 * SUCH DAMAGE.
27 */ 27 */
28 28
29#include <sys/cdefs.h> 29#include <sys/cdefs.h>
30__KERNEL_RCSID(0, "$NetBSD: tegra_drm.c,v 1.14 2021/12/19 12:44:50 riastradh Exp $"); 30__KERNEL_RCSID(0, "$NetBSD: tegra_drm.c,v 1.15 2022/02/23 07:55:56 skrll Exp $");
31 31
32#include <sys/param.h> 32#include <sys/param.h>
33#include <sys/bus.h> 33#include <sys/bus.h>
34#include <sys/device.h> 34#include <sys/device.h>
35#include <sys/intr.h> 35#include <sys/intr.h>
36#include <sys/systm.h> 36#include <sys/systm.h>
37#include <sys/kernel.h> 37#include <sys/kernel.h>
38#include <sys/conf.h> 38#include <sys/conf.h>
39 39
40#include <uvm/uvm_extern.h> 40#include <uvm/uvm_extern.h>
41#include <uvm/uvm_device.h> 41#include <uvm/uvm_device.h>
42 42
43#include <drm/drm_drv.h> 43#include <drm/drm_drv.h>
@@ -160,27 +160,27 @@ tegra_drm_attach(device_t parent, device @@ -160,27 +160,27 @@ tegra_drm_attach(device_t parent, device
160 } else if (of_compatible_match(node, dc_compat) && 160 } else if (of_compatible_match(node, dc_compat) &&
161 ndc < __arraycount(sc->sc_clk_dc)) { 161 ndc < __arraycount(sc->sc_clk_dc)) {
162 sc->sc_clk_dc[ndc] = fdtbus_clock_get(node, "dc"); 162 sc->sc_clk_dc[ndc] = fdtbus_clock_get(node, "dc");
163 sc->sc_clk_dc_parent[ndc] = fdtbus_clock_get(node, 163 sc->sc_clk_dc_parent[ndc] = fdtbus_clock_get(node,
164 "parent"); 164 "parent");
165 sc->sc_rst_dc[ndc] = fdtbus_reset_get(node, "dc"); 165 sc->sc_rst_dc[ndc] = fdtbus_reset_get(node, "dc");
166 ++ndc; 166 ++ndc;
167 } 167 }
168 } 168 }
169 if (hdmi_phandle >= 0) { 169 if (hdmi_phandle >= 0) {
170 ddc_phandle = fdtbus_get_phandle(hdmi_phandle, 170 ddc_phandle = fdtbus_get_phandle(hdmi_phandle,
171 "nvidia,ddc-i2c-bus"); 171 "nvidia,ddc-i2c-bus");
172 if (ddc_phandle >= 0) { 172 if (ddc_phandle >= 0) {
173 sc->sc_ddc = fdtbus_get_i2c_tag(ddc_phandle); 173 sc->sc_ddc = fdtbus_i2c_get_tag(ddc_phandle);
174 } 174 }
175 175
176 sc->sc_pin_hpd = fdtbus_gpio_acquire(hdmi_phandle, 176 sc->sc_pin_hpd = fdtbus_gpio_acquire(hdmi_phandle,
177 "nvidia,hpd-gpio", GPIO_PIN_INPUT); 177 "nvidia,hpd-gpio", GPIO_PIN_INPUT);
178 178
179 for (n = 0; n < __arraycount(hdmi_supplies); n++) { 179 for (n = 0; n < __arraycount(hdmi_supplies); n++) {
180 const char *supply = hdmi_supplies[n]; 180 const char *supply = hdmi_supplies[n];
181 reg = fdtbus_regulator_acquire(hdmi_phandle, supply); 181 reg = fdtbus_regulator_acquire(hdmi_phandle, supply);
182 if (reg == NULL) { 182 if (reg == NULL) {
183 aprint_error_dev(self, "couldn't acquire %s\n", 183 aprint_error_dev(self, "couldn't acquire %s\n",
184 supply); 184 supply);
185 continue; 185 continue;
186 } 186 }

cvs diff -r1.11 -r1.12 src/sys/dev/fdt/fdt_i2c.c (expand / switch to unified diff)

--- src/sys/dev/fdt/fdt_i2c.c 2021/08/07 16:19:10 1.11
+++ src/sys/dev/fdt/fdt_i2c.c 2022/02/23 07:55:55 1.12
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: fdt_i2c.c,v 1.11 2021/08/07 16:19:10 thorpej Exp $ */ 1/* $NetBSD: fdt_i2c.c,v 1.12 2022/02/23 07:55:55 skrll Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2015 Jared D. McNeill <jmcneill@invisible.ca> 4 * Copyright (c) 2015 Jared D. McNeill <jmcneill@invisible.ca>
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.
@@ -17,27 +17,27 @@ @@ -17,27 +17,27 @@
17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 23 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE. 26 * SUCH DAMAGE.
27 */ 27 */
28 28
29#include <sys/cdefs.h> 29#include <sys/cdefs.h>
30__KERNEL_RCSID(0, "$NetBSD: fdt_i2c.c,v 1.11 2021/08/07 16:19:10 thorpej Exp $"); 30__KERNEL_RCSID(0, "$NetBSD: fdt_i2c.c,v 1.12 2022/02/23 07:55:55 skrll Exp $");
31 31
32#include <sys/param.h> 32#include <sys/param.h>
33#include <sys/bus.h> 33#include <sys/bus.h>
34#include <sys/kmem.h> 34#include <sys/kmem.h>
35#include <sys/queue.h> 35#include <sys/queue.h>
36 36
37#include <libfdt.h> 37#include <libfdt.h>
38#include <dev/fdt/fdtvar.h> 38#include <dev/fdt/fdtvar.h>
39 39
40struct fdtbus_i2c_controller { 40struct fdtbus_i2c_controller {
41 i2c_tag_t i2c_tag; 41 i2c_tag_t i2c_tag;
42 int i2c_phandle; 42 int i2c_phandle;
43 43
@@ -65,47 +65,47 @@ static struct fdtbus_i2c_controller * @@ -65,47 +65,47 @@ static struct fdtbus_i2c_controller *
65fdtbus_get_i2c_controller(int phandle) 65fdtbus_get_i2c_controller(int phandle)
66{ 66{
67 struct fdtbus_i2c_controller *i2c; 67 struct fdtbus_i2c_controller *i2c;
68 68
69 LIST_FOREACH(i2c, &fdtbus_i2c_controllers, i2c_next) { 69 LIST_FOREACH(i2c, &fdtbus_i2c_controllers, i2c_next) {
70 if (i2c->i2c_phandle == phandle) 70 if (i2c->i2c_phandle == phandle)
71 return i2c; 71 return i2c;
72 } 72 }
73 73
74 return NULL; 74 return NULL;
75} 75}
76 76
77i2c_tag_t 77i2c_tag_t
78fdtbus_get_i2c_tag(int phandle) 78fdtbus_i2c_get_tag(int phandle)
79{ 79{
80 struct fdtbus_i2c_controller *i2c; 80 struct fdtbus_i2c_controller *i2c;
81 81
82 i2c = fdtbus_get_i2c_controller(phandle); 82 i2c = fdtbus_get_i2c_controller(phandle);
83 if (i2c == NULL) 83 if (i2c == NULL)
84 return NULL; 84 return NULL;
85 85
86 return i2c->i2c_tag; 86 return i2c->i2c_tag;
87} 87}
88 88
89i2c_tag_t 89i2c_tag_t
90fdtbus_i2c_acquire(int phandle, const char *prop) 90fdtbus_i2c_acquire(int phandle, const char *prop)
91{ 91{
92 int i2c_phandle; 92 int i2c_phandle;
93 93
94 i2c_phandle = fdtbus_get_phandle(phandle, prop); 94 i2c_phandle = fdtbus_get_phandle(phandle, prop);
95 if (i2c_phandle == -1) 95 if (i2c_phandle == -1)
96 return NULL; 96 return NULL;
97 97
98 return fdtbus_get_i2c_tag(i2c_phandle); 98 return fdtbus_i2c_get_tag(i2c_phandle);
99} 99}
100 100
101device_t 101device_t
102fdtbus_attach_i2cbus(device_t dev, int phandle, i2c_tag_t tag, cfprint_t print) 102fdtbus_attach_i2cbus(device_t dev, int phandle, i2c_tag_t tag, cfprint_t print)
103{ 103{
104 struct i2cbus_attach_args iba; 104 struct i2cbus_attach_args iba;
105 prop_dictionary_t devs, props; 105 prop_dictionary_t devs, props;
106 device_t ret; 106 device_t ret;
107 u_int address_cells; 107 u_int address_cells;
108 108
109 devs = prop_dictionary_create(); 109 devs = prop_dictionary_create();
110 if (of_getprop_uint32(phandle, "#address-cells", &address_cells)) 110 if (of_getprop_uint32(phandle, "#address-cells", &address_cells))
111 address_cells = 1; 111 address_cells = 1;

cvs diff -r1.74 -r1.75 src/sys/dev/fdt/fdtvar.h (expand / switch to unified diff)

--- src/sys/dev/fdt/fdtvar.h 2022/01/14 07:40:52 1.74
+++ src/sys/dev/fdt/fdtvar.h 2022/02/23 07:55:55 1.75
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: fdtvar.h,v 1.74 2022/01/14 07:40:52 skrll Exp $ */ 1/* $NetBSD: fdtvar.h,v 1.75 2022/02/23 07:55:55 skrll Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2015 Jared D. McNeill <jmcneill@invisible.ca> 4 * Copyright (c) 2015 Jared D. McNeill <jmcneill@invisible.ca>
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.
@@ -312,27 +312,27 @@ void fdtbus_set_decoderegprop(bool); @@ -312,27 +312,27 @@ void fdtbus_set_decoderegprop(bool);
312 312
313int fdtbus_get_reg(int, u_int, bus_addr_t *, bus_size_t *); 313int fdtbus_get_reg(int, u_int, bus_addr_t *, bus_size_t *);
314int fdtbus_get_reg_byname(int, const char *, bus_addr_t *, 314int fdtbus_get_reg_byname(int, const char *, bus_addr_t *,
315 bus_size_t *); 315 bus_size_t *);
316int fdtbus_get_reg64(int, u_int, uint64_t *, uint64_t *); 316int fdtbus_get_reg64(int, u_int, uint64_t *, uint64_t *);
317int fdtbus_get_addr_cells(int); 317int fdtbus_get_addr_cells(int);
318int fdtbus_get_size_cells(int); 318int fdtbus_get_size_cells(int);
319uint64_t fdtbus_get_cells(const uint8_t *, int); 319uint64_t fdtbus_get_cells(const uint8_t *, int);
320int fdtbus_get_phandle(int, const char *); 320int fdtbus_get_phandle(int, const char *);
321int fdtbus_get_phandle_with_data(int, const char *, const char *, 321int fdtbus_get_phandle_with_data(int, const char *, const char *,
322 int, struct fdt_phandle_data *); 322 int, struct fdt_phandle_data *);
323int fdtbus_get_phandle_from_native(int); 323int fdtbus_get_phandle_from_native(int);
324 324
325i2c_tag_t fdtbus_get_i2c_tag(int); 325i2c_tag_t fdtbus_i2c_get_tag(int);
326i2c_tag_t fdtbus_i2c_acquire(int, const char *); 326i2c_tag_t fdtbus_i2c_acquire(int, const char *);
327 327
328void * fdtbus_intr_establish(int, u_int, int, int, 328void * fdtbus_intr_establish(int, u_int, int, int,
329 int (*func)(void *), void *arg); 329 int (*func)(void *), void *arg);
330void * fdtbus_intr_establish_xname(int, u_int, int, int, 330void * fdtbus_intr_establish_xname(int, u_int, int, int,
331 int (*func)(void *), void *arg, const char *); 331 int (*func)(void *), void *arg, const char *);
332void * fdtbus_intr_establish_byname(int, const char *, int, int, 332void * fdtbus_intr_establish_byname(int, const char *, int, int,
333 int (*func)(void *), void *arg, const char *); 333 int (*func)(void *), void *arg, const char *);
334void * fdtbus_intr_establish_raw(int, const u_int *, int, int, 334void * fdtbus_intr_establish_raw(int, const u_int *, int, int,
335 int (*func)(void *), void *arg, const char *); 335 int (*func)(void *), void *arg, const char *);
336void fdtbus_intr_mask(int, void *); 336void fdtbus_intr_mask(int, void *);
337void fdtbus_intr_unmask(int, void *); 337void fdtbus_intr_unmask(int, void *);
338void fdtbus_intr_disestablish(int, void *); 338void fdtbus_intr_disestablish(int, void *);