Rename of_match_compat_data() to of_compatible_match(). Similarly,

rename of_search_compatible() to of_compatible_lookup().

Standardize on of_compatible_match() for driver matching, and adapt
all call sites.
This commit is contained in:
thorpej 2021-01-27 03:10:18 +00:00
parent 18f3098ca5
commit 6e54367a22
330 changed files with 2152 additions and 1895 deletions

View File

@ -1,9 +1,9 @@
/* $NetBSD: cycv_clkmgr.c,v 1.7 2021/01/27 01:47:40 thorpej Exp $ */
/* $NetBSD: cycv_clkmgr.c,v 1.8 2021/01/27 03:10:18 thorpej Exp $ */
/* This file is in the public domain. */
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: cycv_clkmgr.c,v 1.7 2021/01/27 01:47:40 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: cycv_clkmgr.c,v 1.8 2021/01/27 03:10:18 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -121,7 +121,7 @@ cycv_clkmgr_match(device_t parent, cfdata_t cf, void *aux)
{
struct fdt_attach_args *faa = aux;
return of_match_compat_data(faa->faa_phandle, compat_data);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void
@ -239,7 +239,7 @@ cycv_clkmgr_clock_parse(struct cycv_clkmgr_softc *sc, int handle, u_int clkno)
clk->refcnt = 0;
const struct device_compatible_entry * const dce =
of_search_compatible(handle, clock_types);
of_compatible_lookup(handle, clock_types);
if (dce == NULL)
goto err;
clk->type = dce->value;

View File

@ -1,4 +1,4 @@
/* $NetBSD: cycv_dwcmmc.c,v 1.5 2020/03/20 06:23:51 skrll Exp $ */
/* $NetBSD: cycv_dwcmmc.c,v 1.6 2021/01/27 03:10:18 thorpej Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: cycv_dwcmmc.c,v 1.5 2020/03/20 06:23:51 skrll Exp $");
__KERNEL_RCSID(0, "$NetBSD: cycv_dwcmmc.c,v 1.6 2021/01/27 03:10:18 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -63,9 +63,9 @@ struct cycv_dwcmmc_softc {
CFATTACH_DECL_NEW(cycv_dwcmmc, sizeof(struct dwc_mmc_softc),
cycv_dwcmmc_match, cycv_dwcmmc_attach, NULL, NULL);
static const char * const cycv_dwcmmc_compat[] = {
"altr,socfpga-dw-mshc",
NULL
static const struct device_compatible_entry compat_data[] = {
{ .compat = "altr,socfpga-dw-mshc" },
DEVICE_COMPAT_EOL
};
static int
@ -73,7 +73,7 @@ cycv_dwcmmc_match(device_t parent, cfdata_t cf, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, cycv_dwcmmc_compat);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: cycv_gmac.c,v 1.4 2019/07/21 08:24:32 mrg Exp $ */
/* $NetBSD: cycv_gmac.c,v 1.5 2021/01/27 03:10:18 thorpej Exp $ */
/*-
* Copyright (c) 2017 Jared McNeill <jmcneill@invisible.ca>
@ -30,7 +30,7 @@
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: cycv_gmac.c,v 1.4 2019/07/21 08:24:32 mrg Exp $");
__KERNEL_RCSID(0, "$NetBSD: cycv_gmac.c,v 1.5 2021/01/27 03:10:18 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -51,7 +51,10 @@ __KERNEL_RCSID(0, "$NetBSD: cycv_gmac.c,v 1.4 2019/07/21 08:24:32 mrg Exp $");
#include <dev/fdt/fdtvar.h>
static const char * compatible[] = { "altr,socfpga-stmmac", NULL };
static const struct device_compatible_entry compat_data[] = {
{ .compat = "altr,socfpga-stmmac" },
DEVICE_COMPAT_EOL
};
static int
cycv_gmac_intr(void *arg)
@ -64,7 +67,7 @@ cycv_gmac_match(device_t parent, cfdata_t cf, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,9 +1,9 @@
/* $NetBSD: cycv_rstmgr.c,v 1.3 2019/10/18 06:50:08 skrll Exp $ */
/* $NetBSD: cycv_rstmgr.c,v 1.4 2021/01/27 03:10:18 thorpej Exp $ */
/* This file is in the public domain. */
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: cycv_rstmgr.c,v 1.3 2019/10/18 06:50:08 skrll Exp $");
__KERNEL_RCSID(0, "$NetBSD: cycv_rstmgr.c,v 1.4 2021/01/27 03:10:18 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -49,13 +49,17 @@ CFATTACH_DECL_NEW(cycvrstmgr, sizeof (struct cycv_rstmgr_softc),
static struct cycv_rstmgr_softc *cycv_rstmgr_sc;
static const struct device_compatible_entry compat_data[] = {
{ .compat = "altr,rst-mgr" },
DEVICE_COMPAT_EOL
};
static int
cycv_rstmgr_match(device_t parent, cfdata_t cf, void *aux)
{
const char *compatible[] = { "altr,rst-mgr", NULL };
struct fdt_attach_args *faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: meson6_timer.c,v 1.1 2019/08/14 15:08:53 skrll Exp $ */
/* $NetBSD: meson6_timer.c,v 1.2 2021/01/27 03:10:18 thorpej Exp $ */
/*-
* Copyright (c) 2019 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: meson6_timer.c,v 1.1 2019/08/14 15:08:53 skrll Exp $");
__KERNEL_RCSID(0, "$NetBSD: meson6_timer.c,v 1.2 2021/01/27 03:10:18 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -97,17 +97,17 @@ meson6_timer_get_timecount(struct timecounter *tc)
return TIMER_READ(sc, MESON_TIMERE);
}
static const struct device_compatible_entry compat_data[] = {
{ .compat = "amlogic,meson6-timer" },
DEVICE_COMPAT_EOL
};
static int
meson6_timer_match(device_t parent, cfdata_t cf, void *aux)
{
const char * const compatible[] = {
"amlogic,meson6-timer",
NULL
};
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: meson8b_clkc.c,v 1.5 2019/08/16 10:36:06 jmcneill Exp $ */
/* $NetBSD: meson8b_clkc.c,v 1.6 2021/01/27 03:10:18 thorpej Exp $ */
/*-
* Copyright (c) 2019 Jared McNeill <jmcneill@invisible.ca>
@ -28,7 +28,7 @@
#include <sys/cdefs.h>
__KERNEL_RCSID(1, "$NetBSD: meson8b_clkc.c,v 1.5 2019/08/16 10:36:06 jmcneill Exp $");
__KERNEL_RCSID(1, "$NetBSD: meson8b_clkc.c,v 1.6 2021/01/27 03:10:18 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -73,10 +73,10 @@ __KERNEL_RCSID(1, "$NetBSD: meson8b_clkc.c,v 1.5 2019/08/16 10:36:06 jmcneill Ex
static int meson8b_clkc_match(device_t, cfdata_t, void *);
static void meson8b_clkc_attach(device_t, device_t, void *);
static const char * const compatible[] = {
"amlogic,meson8-clkc",
"amlogic,meson8b-clkc",
NULL
static const struct device_compatible_entry compat_data[] = {
{ .compat = "amlogic,meson8-clkc" },
{ .compat = "amlogic,meson8b-clkc" },
DEVICE_COMPAT_EOL
};
CFATTACH_DECL_NEW(meson8b_clkc, sizeof(struct meson_clk_softc),
@ -326,7 +326,7 @@ meson8b_clkc_match(device_t parent, cfdata_t cf, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: meson_dwmac.c,v 1.10 2021/01/15 18:42:40 ryo Exp $ */
/* $NetBSD: meson_dwmac.c,v 1.11 2021/01/27 03:10:18 thorpej Exp $ */
/*-
* Copyright (c) 2017 Jared McNeill <jmcneill@invisible.ca>
@ -28,7 +28,7 @@
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: meson_dwmac.c,v 1.10 2021/01/15 18:42:40 ryo Exp $");
__KERNEL_RCSID(0, "$NetBSD: meson_dwmac.c,v 1.11 2021/01/27 03:10:18 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -57,12 +57,12 @@ __KERNEL_RCSID(0, "$NetBSD: meson_dwmac.c,v 1.10 2021/01/15 18:42:40 ryo Exp $")
#define TX_CLK_DELAY __BITS(6,5)
#define PHY_INTERFACE_SEL __BIT(0)
static const char * compatible[] = {
"amlogic,meson8b-dwmac",
"amlogic,meson-gx-dwmac",
"amlogic,meson-gxbb-dwmac",
"amlogic,meson-axg-dwmac",
NULL
static const struct device_compatible_entry compat_data[] = {
{ .compat = "amlogic,meson8b-dwmac" },
{ .compat = "amlogic,meson-gx-dwmac" },
{ .compat = "amlogic,meson-gxbb-dwmac" },
{ .compat = "amlogic,meson-axg-dwmac" },
DEVICE_COMPAT_EOL
};
static int
@ -146,7 +146,7 @@ meson_dwmac_match(device_t parent, cfdata_t cf, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: meson_genfb.c,v 1.1 2019/01/19 21:43:43 jmcneill Exp $ */
/* $NetBSD: meson_genfb.c,v 1.2 2021/01/27 03:10:18 thorpej Exp $ */
/*-
* Copyright (c) 2015-2019 Jared McNeill <jmcneill@invisible.ca>
@ -33,7 +33,7 @@
#include "opt_wsdisplay_compat.h"
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: meson_genfb.c,v 1.1 2019/01/19 21:43:43 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: meson_genfb.c,v 1.2 2021/01/27 03:10:18 thorpej Exp $");
#include <sys/param.h>
#include <sys/types.h>
@ -52,9 +52,9 @@ __KERNEL_RCSID(0, "$NetBSD: meson_genfb.c,v 1.1 2019/01/19 21:43:43 jmcneill Exp
#include <dev/wsfb/genfbvar.h>
static const char * const compatible[] = {
"amlogic,meson8b-fb",
NULL
static const struct device_compatible_entry compat_data[] = {
{ .compat = "amlogic,meson8b-fb" },
DEVICE_COMPAT_EOL
};
#define AMLOGIC_GENFB_DEFAULT_DEPTH 16
@ -172,7 +172,7 @@ meson_genfb_match(device_t parent, cfdata_t match, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void
@ -710,7 +710,7 @@ meson_genfb_ddb_trap_callback(int where)
static int
meson_genfb_console_match(int phandle)
{
return of_match_compatible(phandle, compatible);
return of_compatible_match(phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: meson_pinctrl.c,v 1.10 2021/01/27 01:49:36 thorpej Exp $ */
/* $NetBSD: meson_pinctrl.c,v 1.11 2021/01/27 03:10:18 thorpej Exp $ */
/*-
* Copyright (c) 2019 Jared D. McNeill <jmcneill@invisible.ca>
@ -29,7 +29,7 @@
#include "opt_soc.h"
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: meson_pinctrl.c,v 1.10 2021/01/27 01:49:36 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: meson_pinctrl.c,v 1.11 2021/01/27 03:10:18 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -574,7 +574,7 @@ meson_pinctrl_match(device_t parent, cfdata_t cf, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_match_compat_data(faa->faa_phandle, compat_data);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void
@ -586,7 +586,7 @@ meson_pinctrl_attach(device_t parent, device_t self, void *aux)
sc->sc_dev = self;
sc->sc_phandle = faa->faa_phandle;
sc->sc_bst = faa->faa_bst;
sc->sc_conf = of_search_compatible(sc->sc_phandle, compat_data)->data;
sc->sc_conf = of_compatible_lookup(sc->sc_phandle, compat_data)->data;
mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_VM);
if (meson_pinctrl_initres(sc) != 0)

View File

@ -1,4 +1,4 @@
/* $NetBSD: meson_pwm.c,v 1.4 2021/01/27 01:49:36 thorpej Exp $ */
/* $NetBSD: meson_pwm.c,v 1.5 2021/01/27 03:10:18 thorpej Exp $ */
/*
* Copyright (c) 2021 Ryo Shimizu <ryo@nerv.org>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: meson_pwm.c,v 1.4 2021/01/27 01:49:36 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: meson_pwm.c,v 1.5 2021/01/27 03:10:18 thorpej Exp $");
#include <sys/param.h>
#include <sys/types.h>
@ -327,7 +327,7 @@ meson_pwm_match(device_t parent, cfdata_t cf, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_match_compat_data(faa->faa_phandle, compat_data);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: meson_resets.c,v 1.3 2021/01/01 07:15:18 ryo Exp $ */
/* $NetBSD: meson_resets.c,v 1.4 2021/01/27 03:10:18 thorpej Exp $ */
/*-
* Copyright (c) 2017-2019 Jared McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: meson_resets.c,v 1.3 2021/01/01 07:15:18 ryo Exp $");
__KERNEL_RCSID(0, "$NetBSD: meson_resets.c,v 1.4 2021/01/27 03:10:18 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -43,11 +43,11 @@ __KERNEL_RCSID(0, "$NetBSD: meson_resets.c,v 1.3 2021/01/01 07:15:18 ryo Exp $")
#define LEVEL_OFFSET 0x7c
static const char * compatible[] = {
"amlogic,meson8b-reset",
"amlogic,meson-axg-reset",
"amlogic,meson-gxbb-reset",
NULL
static const struct device_compatible_entry compat_data[] = {
{ .compat = "amlogic,meson8b-reset" },
{ .compat = "amlogic,meson-axg-reset" },
{ .compat = "amlogic,meson-gxbb-reset" },
DEVICE_COMPAT_EOL
};
struct meson_resets_softc {
@ -118,7 +118,7 @@ meson_resets_match(device_t parent, cfdata_t cf, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: meson_rng.c,v 1.3 2020/04/30 03:40:52 riastradh Exp $ */
/* $NetBSD: meson_rng.c,v 1.4 2021/01/27 03:10:18 thorpej Exp $ */
/*-
* Copyright (c) 2015-2019 Jared D. McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: meson_rng.c,v 1.3 2020/04/30 03:40:52 riastradh Exp $");
__KERNEL_RCSID(0, "$NetBSD: meson_rng.c,v 1.4 2021/01/27 03:10:18 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -53,9 +53,9 @@ struct meson_rng_softc {
krndsource_t sc_rndsource;
};
static const char * const compatible[] = {
"amlogic,meson-rng",
NULL
static const struct device_compatible_entry compat_data[] = {
{ .compat = "amlogic,meson-rng" },
DEVICE_COMPAT_EOL
};
CFATTACH_DECL_NEW(meson_rng, sizeof(struct meson_rng_softc),
@ -66,7 +66,7 @@ meson_rng_match(device_t parent, cfdata_t cf, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: meson_rtc.c,v 1.2 2019/01/20 20:22:13 jmcneill Exp $ */
/* $NetBSD: meson_rtc.c,v 1.3 2021/01/27 03:10:18 thorpej Exp $ */
/*-
* Copyright (c) 2015 The NetBSD Foundation, Inc.
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: meson_rtc.c,v 1.2 2019/01/20 20:22:13 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: meson_rtc.c,v 1.3 2021/01/27 03:10:18 thorpej Exp $");
#include <sys/param.h>
#include <sys/atomic.h>
@ -55,9 +55,9 @@ struct meson_rtc_softc {
unsigned int sc_busy;
};
static const char * const compatible[] = {
"amlogic,meson8b-rtc",
NULL
static const struct device_compatible_entry compat_data[] = {
{ .compat = "amlogic,meson8b-rtc" },
DEVICE_COMPAT_EOL
};
static int meson_rtc_match(device_t, cfdata_t, void *);
@ -112,7 +112,7 @@ meson_rtc_match(device_t parent, cfdata_t cf, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: meson_sdhc.c,v 1.2 2021/01/15 18:42:40 ryo Exp $ */
/* $NetBSD: meson_sdhc.c,v 1.3 2021/01/27 03:10:18 thorpej Exp $ */
/*-
* Copyright (c) 2015-2019 Jared McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: meson_sdhc.c,v 1.2 2021/01/15 18:42:40 ryo Exp $");
__KERNEL_RCSID(0, "$NetBSD: meson_sdhc.c,v 1.3 2021/01/27 03:10:18 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -150,14 +150,14 @@ meson_sdhc_set_clear(struct meson_sdhc_softc *sc, bus_addr_t reg, uint32_t set,
SDHC_WRITE(sc, reg, new);
}
static const char * const compatible[] = {
"amlogic,meson8b-sdhc",
NULL
static const struct device_compatible_entry compat_data[] = {
{ .compat = "amlogic,meson8b-sdhc" },
DEVICE_COMPAT_EOL
};
static const char * const slot_compatible[] = {
"mmc-slot",
NULL
static const struct device_compatible_entry slot_compat_data[] = {
{ .compat = "mmc-slot" },
DEVICE_COMPAT_EOL
};
static int
@ -165,7 +165,7 @@ meson_sdhc_match(device_t parent, cfdata_t cf, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void
@ -215,7 +215,7 @@ meson_sdhc_attach(device_t parent, device_t self, void *aux)
sc->sc_port = -1;
for (child = OF_child(phandle); child; child = OF_peer(child))
if (of_match_compatible(child, slot_compatible) > 0) {
if (of_compatible_match(child, slot_compat_data)) {
if (fdtbus_get_reg(child, 0, &port, NULL) == 0) {
sc->sc_slot_phandle = child;
sc->sc_port = port;

View File

@ -1,4 +1,4 @@
/* $NetBSD: meson_sdio.c,v 1.2 2021/01/15 18:42:40 ryo Exp $ */
/* $NetBSD: meson_sdio.c,v 1.3 2021/01/27 03:10:18 thorpej Exp $ */
/*-
* Copyright (c) 2015-2019 Jared D. McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: meson_sdio.c,v 1.2 2021/01/15 18:42:40 ryo Exp $");
__KERNEL_RCSID(0, "$NetBSD: meson_sdio.c,v 1.3 2021/01/27 03:10:18 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -130,14 +130,14 @@ static struct sdmmc_chip_functions meson_sdio_chip_functions = {
#define SDIO_READ(sc, reg) \
bus_space_read_4((sc)->sc_bst, (sc)->sc_bsh, (reg))
static const char * const compatible[] = {
"amlogic,meson8b-sdio",
NULL
static const struct device_compatible_entry compat_data[] = {
{ .compat = "amlogic,meson8b-sdio" },
DEVICE_COMPAT_EOL
};
static const char * const slot_compatible[] = {
"mmc-slot",
NULL
static const struct device_compatible_entry slot_compat_data[] = {
{ .compat = "mmc-slot" },
DEVICE_COMPAT_EOL
};
static int
@ -145,7 +145,7 @@ meson_sdio_match(device_t parent, cfdata_t cf, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void
@ -195,7 +195,7 @@ meson_sdio_attach(device_t parent, device_t self, void *aux)
sc->sc_cur_port = -1;
for (child = OF_child(phandle); child; child = OF_peer(child))
if (of_match_compatible(child, slot_compatible) > 0) {
if (of_compatible_match(child, slot_compat_data)) {
if (fdtbus_get_reg(child, 0, &port, NULL) == 0) {
sc->sc_slot_phandle = child;
sc->sc_cur_port = port;

View File

@ -1,4 +1,4 @@
/* $NetBSD: meson_thermal.c,v 1.5 2021/01/27 01:49:36 thorpej Exp $ */
/* $NetBSD: meson_thermal.c,v 1.6 2021/01/27 03:10:18 thorpej Exp $ */
/*
* Copyright (c) 2021 Ryo Shimizu <ryo@nerv.org>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: meson_thermal.c,v 1.5 2021/01/27 01:49:36 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: meson_thermal.c,v 1.6 2021/01/27 03:10:18 thorpej Exp $");
#include <sys/param.h>
#include <sys/types.h>
@ -172,7 +172,7 @@ meson_thermal_match(device_t parent, cfdata_t cf, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_match_compat_data(faa->faa_phandle, compat_data);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void
@ -187,7 +187,7 @@ meson_thermal_attach(device_t parent, device_t self, void *aux)
sc->sc_dev = self;
sc->sc_bst = faa->faa_bst;
sc->sc_phandle = phandle = faa->faa_phandle;
sc->sc_conf = of_search_compatible(phandle, compat_data)->data;
sc->sc_conf = of_compatible_lookup(phandle, compat_data)->data;
if (fdtbus_get_reg(phandle, 0, &addr, &size) != 0) {
aprint_error(": couldn't get registers\n");

View File

@ -1,4 +1,4 @@
/* $NetBSD: meson_uart.c,v 1.4 2021/01/15 18:42:40 ryo Exp $ */
/* $NetBSD: meson_uart.c,v 1.5 2021/01/27 03:10:18 thorpej Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@ -34,7 +34,7 @@
#include <sys/cdefs.h>
__KERNEL_RCSID(1, "$NetBSD: meson_uart.c,v 1.4 2021/01/15 18:42:40 ryo Exp $");
__KERNEL_RCSID(1, "$NetBSD: meson_uart.c,v 1.5 2021/01/27 03:10:18 thorpej Exp $");
#define cn_trap() \
do { \
@ -75,12 +75,12 @@ static int meson_uart_param(struct tty *, struct termios *);
extern struct cfdriver mesonuart_cd;
static const char * const compatible[] = {
"amlogic,meson6-uart",
"amlogic,meson8-uart",
"amlogic,meson8b-uart",
"amlogic,meson-gx-uart",
NULL
static const struct device_compatible_entry compat_data[] = {
{ .compat = "amlogic,meson6-uart" },
{ .compat = "amlogic,meson8-uart" },
{ .compat = "amlogic,meson8b-uart" },
{ .compat = "amlogic,meson-gx-uart" },
DEVICE_COMPAT_EOL
};
struct meson_uart_softc {
@ -151,7 +151,7 @@ meson_uart_match(device_t parent, cfdata_t cf, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void
@ -513,7 +513,7 @@ meson_uart_rxsoft(void *priv)
static int
meson_uart_console_match(int phandle)
{
return of_match_compatible(phandle, compatible);
return of_compatible_match(phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: meson_usbctrl.c,v 1.4 2021/01/27 01:49:36 thorpej Exp $ */
/* $NetBSD: meson_usbctrl.c,v 1.5 2021/01/27 03:10:18 thorpej Exp $ */
/*
* Copyright (c) 2021 Ryo Shimizu <ryo@nerv.org>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: meson_usbctrl.c,v 1.4 2021/01/27 01:49:36 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: meson_usbctrl.c,v 1.5 2021/01/27 03:10:18 thorpej Exp $");
#include <sys/param.h>
#include <sys/types.h>
@ -252,7 +252,7 @@ meson_usbctrl_match(device_t parent, cfdata_t cf, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_match_compat_data(faa->faa_phandle, compat_data);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void
@ -267,7 +267,7 @@ meson_usbctrl_attach(device_t parent, device_t self, void *aux)
sc->sc_dev = self;
sc->sc_bst = faa->faa_bst;
sc->sc_phandle = phandle = faa->faa_phandle;
sc->sc_conf = of_search_compatible(phandle, compat_data)->data;
sc->sc_conf = of_compatible_lookup(phandle, compat_data)->data;
if (fdtbus_get_reg(phandle, 0, &addr, &size) != 0) {
aprint_error(": couldn't get registers\n");

View File

@ -1,4 +1,4 @@
/* $NetBSD: meson_usbphy.c,v 1.5 2021/01/27 01:49:36 thorpej Exp $ */
/* $NetBSD: meson_usbphy.c,v 1.6 2021/01/27 03:10:18 thorpej Exp $ */
/*-
* Copyright (c) 2019 Jared McNeill <jmcneill@invisible.ca>
@ -28,7 +28,7 @@
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: meson_usbphy.c,v 1.5 2021/01/27 01:49:36 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: meson_usbphy.c,v 1.6 2021/01/27 03:10:18 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -187,7 +187,7 @@ meson_usbphy_match(device_t parent, cfdata_t cf, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_match_compat_data(faa->faa_phandle, compat_data);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void
@ -205,7 +205,7 @@ meson_usbphy_attach(device_t parent, device_t self, void *aux)
sc->sc_dev = self;
sc->sc_bst = faa->faa_bst;
sc->sc_phandle = phandle;
sc->sc_type = of_search_compatible(phandle, compat_data)->value;
sc->sc_type = of_compatible_lookup(phandle, compat_data)->value;
if (fdtbus_get_reg(phandle, 0, &addr, &size) != 0) {
aprint_error(": couldn't get registers\n");

View File

@ -1,4 +1,4 @@
/* $NetBSD: meson_wdt.c,v 1.1 2019/01/19 20:56:03 jmcneill Exp $ */
/* $NetBSD: meson_wdt.c,v 1.2 2021/01/27 03:10:18 thorpej Exp $ */
/*-
* Copyright (c) 2019 Jared McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: meson_wdt.c,v 1.1 2019/01/19 20:56:03 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: meson_wdt.c,v 1.2 2021/01/27 03:10:18 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -53,9 +53,9 @@ __KERNEL_RCSID(0, "$NetBSD: meson_wdt.c,v 1.1 2019/01/19 20:56:03 jmcneill Exp $
#define WATCHDOG_PERIOD_MAX 8
#define WATCHDOG_TICKS_PER_SEC 7812
static const char * compatible[] = {
"amlogic,meson8b-wdt",
NULL
static const struct device_compatible_entry compat_data[] = {
{ .compat = "amlogic,meson8b-wdt" },
DEVICE_COMPAT_EOL
};
struct meson_wdt_softc {
@ -117,7 +117,7 @@ meson_wdt_match(device_t parent, cfdata_t cf, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: mesong12_aoclkc.c,v 1.1 2021/01/01 07:21:58 ryo Exp $ */
/* $NetBSD: mesong12_aoclkc.c,v 1.2 2021/01/27 03:10:18 thorpej Exp $ */
/*
* Copyright (c) 2021 Ryo Shimizu <ryo@nerv.org>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mesong12_aoclkc.c,v 1.1 2021/01/01 07:21:58 ryo Exp $");
__KERNEL_RCSID(0, "$NetBSD: mesong12_aoclkc.c,v 1.2 2021/01/27 03:10:18 thorpej Exp $");
#include <sys/param.h>
#include <sys/types.h>
@ -48,9 +48,9 @@ __KERNEL_RCSID(0, "$NetBSD: mesong12_aoclkc.c,v 1.1 2021/01/01 07:21:58 ryo Exp
static int mesong12_aoclkc_match(device_t, cfdata_t, void *);
static void mesong12_aoclkc_attach(device_t, device_t, void *);
static const char * const compatible[] = {
"amlogic,meson-g12a-aoclkc",
NULL
static const struct device_compatible_entry compat_data[] = {
{ .compat = "amlogic,meson-g12a-aoclkc" },
DEVICE_COMPAT_EOL
};
CFATTACH_DECL_NEW(mesong12_aoclkc, sizeof(struct meson_clk_softc),
@ -104,7 +104,7 @@ mesong12_aoclkc_match(device_t parent, cfdata_t cf, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: mesong12_clkc.c,v 1.4 2021/01/27 01:49:36 thorpej Exp $ */
/* $NetBSD: mesong12_clkc.c,v 1.5 2021/01/27 03:10:18 thorpej Exp $ */
/*-
* Copyright (c) 2019 Jared McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mesong12_clkc.c,v 1.4 2021/01/27 01:49:36 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: mesong12_clkc.c,v 1.5 2021/01/27 03:10:18 thorpej Exp $");
#include <sys/param.h>
#include <sys/types.h>
@ -1503,7 +1503,7 @@ mesong12_clkc_match(device_t parent, cfdata_t cf, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_match_compat_data(faa->faa_phandle, compat_data);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void
@ -1522,7 +1522,7 @@ mesong12_clkc_attach(device_t parent, device_t self, void *aux)
return;
}
conf = of_search_compatible(phandle, compat_data)->data;
conf = of_compatible_lookup(phandle, compat_data)->data;
sc->sc_clks = conf->clks;
sc->sc_nclks = conf->nclks;

View File

@ -1,4 +1,4 @@
/* $NetBSD: mesong12_usb2phy.c,v 1.1 2021/01/01 07:21:58 ryo Exp $ */
/* $NetBSD: mesong12_usb2phy.c,v 1.2 2021/01/27 03:10:18 thorpej Exp $ */
/*
* Copyright (c) 2021 Ryo Shimizu <ryo@nerv.org>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mesong12_usb2phy.c,v 1.1 2021/01/01 07:21:58 ryo Exp $");
__KERNEL_RCSID(0, "$NetBSD: mesong12_usb2phy.c,v 1.2 2021/01/27 03:10:18 thorpej Exp $");
#include <sys/param.h>
#include <sys/types.h>
@ -271,9 +271,9 @@ mesong12_usb2phy_enable(device_t dev, void *priv, bool enable)
return 0;
}
static const char *compatible[] = {
"amlogic,g12a-usb2-phy",
NULL
static const struct device_compatible_entry compat_data[] = {
{ .compat = "amlogic,g12a-usb2-phy" },
DEVICE_COMPAT_EOL
};
static int
@ -281,7 +281,7 @@ mesong12_usb2phy_match(device_t parent, cfdata_t cf, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static const struct fdtbus_phy_controller_func mesong12_usb2phy_funcs = {

View File

@ -1,4 +1,4 @@
/* $NetBSD: mesong12_usb3pciephy.c,v 1.1 2021/01/01 07:21:58 ryo Exp $ */
/* $NetBSD: mesong12_usb3pciephy.c,v 1.2 2021/01/27 03:10:18 thorpej Exp $ */
/*
* Copyright (c) 2021 Ryo Shimizu <ryo@nerv.org>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mesong12_usb3pciephy.c,v 1.1 2021/01/01 07:21:58 ryo Exp $");
__KERNEL_RCSID(0, "$NetBSD: mesong12_usb3pciephy.c,v 1.2 2021/01/27 03:10:18 thorpej Exp $");
#include <sys/param.h>
#include <sys/types.h>
@ -283,9 +283,9 @@ mesong12_usb3pciephy_enable(device_t dev, void *priv, bool enable)
return 0;
}
static const char *compatible[] = {
"amlogic,g12a-usb3-pcie-phy",
NULL
static const struct device_compatible_entry compat_data[] = {
{ .compat = "amlogic,g12a-usb3-pcie-phy" },
DEVICE_COMPAT_EOL
};
static int
@ -293,7 +293,7 @@ mesong12_usb3pciephy_match(device_t parent, cfdata_t cf, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static const struct fdtbus_phy_controller_func mesong12_usb3pciephy_funcs = {

View File

@ -1,4 +1,4 @@
/* $NetBSD: mesongx_mmc.c,v 1.12 2021/01/27 01:49:36 thorpej Exp $ */
/* $NetBSD: mesongx_mmc.c,v 1.13 2021/01/27 03:10:18 thorpej Exp $ */
/*-
* Copyright (c) 2019 Jared McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mesongx_mmc.c,v 1.12 2021/01/27 01:49:36 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: mesongx_mmc.c,v 1.13 2021/01/27 03:10:18 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -279,7 +279,7 @@ mesongx_mmc_match(device_t parent, cfdata_t cf, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_match_compat_data(faa->faa_phandle, compat_data);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void
@ -292,7 +292,7 @@ mesongx_mmc_attach(device_t parent, device_t self, void *aux)
bus_addr_t addr;
bus_size_t size;
sc->sc_hwtype = of_search_compatible(phandle, compat_data)->value;
sc->sc_hwtype = of_compatible_lookup(phandle, compat_data)->value;
if (fdtbus_get_reg(phandle, 0, &addr, &size) != 0) {
aprint_error(": couldn't get registers\n");

View File

@ -1,4 +1,4 @@
/* $NetBSD: mesongx_wdt.c,v 1.1 2019/04/21 13:51:04 jmcneill Exp $ */
/* $NetBSD: mesongx_wdt.c,v 1.2 2021/01/27 03:10:18 thorpej Exp $ */
/*-
* Copyright (c) 2019 Jared McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mesongx_wdt.c,v 1.1 2019/04/21 13:51:04 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: mesongx_wdt.c,v 1.2 2021/01/27 03:10:18 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -54,9 +54,9 @@ __KERNEL_RCSID(0, "$NetBSD: mesongx_wdt.c,v 1.1 2019/04/21 13:51:04 jmcneill Exp
#define WATCHDOG_PERIOD_DEFAULT 8
#define WATCHDOG_PERIOD_MAX 8
static const char * compatible[] = {
"amlogic,meson-gx-wdt",
NULL
static const struct device_compatible_entry compat_data[] = {
{ .compat = "amlogic,meson-gx-wdt" },
DEVICE_COMPAT_EOL
};
struct mesongx_wdt_softc {
@ -120,7 +120,7 @@ mesongx_wdt_match(device_t parent, cfdata_t cf, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: mesongxbb_aoclkc.c,v 1.2 2019/04/19 19:07:56 jmcneill Exp $ */
/* $NetBSD: mesongxbb_aoclkc.c,v 1.3 2021/01/27 03:10:18 thorpej Exp $ */
/*-
* Copyright (c) 2019 Jared McNeill <jmcneill@invisible.ca>
@ -28,7 +28,7 @@
#include <sys/cdefs.h>
__KERNEL_RCSID(1, "$NetBSD: mesongxbb_aoclkc.c,v 1.2 2019/04/19 19:07:56 jmcneill Exp $");
__KERNEL_RCSID(1, "$NetBSD: mesongxbb_aoclkc.c,v 1.3 2021/01/27 03:10:18 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -47,10 +47,10 @@ __KERNEL_RCSID(1, "$NetBSD: mesongxbb_aoclkc.c,v 1.2 2019/04/19 19:07:56 jmcneil
static int mesongxbb_aoclkc_match(device_t, cfdata_t, void *);
static void mesongxbb_aoclkc_attach(device_t, device_t, void *);
static const char * const compatible[] = {
"amlogic,meson-gxbb-aoclkc",
"amlogic,meson-gxl-aoclkc",
NULL
static const struct device_compatible_entry compat_data[] = {
{ .compat = "amlogic,meson-gxbb-aoclkc" },
{ .compat = "amlogic,meson-gxl-aoclkc" },
DEVICE_COMPAT_EOL
};
CFATTACH_DECL_NEW(mesongxbb_aoclkc, sizeof(struct meson_clk_softc),
@ -79,7 +79,7 @@ mesongxbb_aoclkc_match(device_t parent, cfdata_t cf, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: mesongxbb_clkc.c,v 1.5 2021/01/27 01:49:36 thorpej Exp $ */
/* $NetBSD: mesongxbb_clkc.c,v 1.6 2021/01/27 03:10:18 thorpej Exp $ */
/*-
* Copyright (c) 2019 Jared McNeill <jmcneill@invisible.ca>
@ -28,7 +28,7 @@
#include <sys/cdefs.h>
__KERNEL_RCSID(1, "$NetBSD: mesongxbb_clkc.c,v 1.5 2021/01/27 01:49:36 thorpej Exp $");
__KERNEL_RCSID(1, "$NetBSD: mesongxbb_clkc.c,v 1.6 2021/01/27 03:10:18 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -228,7 +228,7 @@ mesongxbb_clkc_match(device_t parent, cfdata_t cf, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_match_compat_data(faa->faa_phandle, compat_data);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void
@ -252,7 +252,7 @@ mesongxbb_clkc_attach(device_t parent, device_t self, void *aux)
meson_clk_attach(sc);
conf = of_search_compatible(phandle, compat_data)->data;
conf = of_compatible_lookup(phandle, compat_data)->data;
aprint_naive("\n");
aprint_normal(": %s clock controller\n", conf->name);

View File

@ -1,4 +1,4 @@
/* $NetBSD: mesongxl_usb2phy.c,v 1.1 2019/04/19 19:07:56 jmcneill Exp $ */
/* $NetBSD: mesongxl_usb2phy.c,v 1.2 2021/01/27 03:10:18 thorpej Exp $ */
/*-
* Copyright (c) 2019 Jared McNeill <jmcneill@invisible.ca>
@ -28,7 +28,7 @@
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mesongxl_usb2phy.c,v 1.1 2019/04/19 19:07:56 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: mesongxl_usb2phy.c,v 1.2 2021/01/27 03:10:18 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -48,9 +48,9 @@ __KERNEL_RCSID(0, "$NetBSD: mesongxl_usb2phy.c,v 1.1 2019/04/19 19:07:56 jmcneil
static int mesongxl_usb2phy_match(device_t, cfdata_t, void *);
static void mesongxl_usb2phy_attach(device_t, device_t, void *);
static const char *compatible[] = {
"amlogic,meson-gxl-usb2-phy",
NULL
static const struct device_compatible_entry compat_data[] = {
{ .compat = "amlogic,meson-gxl-usb2-phy" },
DEVICE_COMPAT_EOL
};
struct mesongxl_usb2phy_softc {
@ -139,7 +139,7 @@ mesongxl_usb2phy_match(device_t parent, cfdata_t cf, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: mesongxl_usb3phy.c,v 1.1 2019/04/19 19:07:56 jmcneill Exp $ */
/* $NetBSD: mesongxl_usb3phy.c,v 1.2 2021/01/27 03:10:18 thorpej Exp $ */
/*-
* Copyright (c) 2019 Jared McNeill <jmcneill@invisible.ca>
@ -28,7 +28,7 @@
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mesongxl_usb3phy.c,v 1.1 2019/04/19 19:07:56 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: mesongxl_usb3phy.c,v 1.2 2021/01/27 03:10:18 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -56,9 +56,9 @@ __KERNEL_RCSID(0, "$NetBSD: mesongxl_usb3phy.c,v 1.1 2019/04/19 19:07:56 jmcneil
static int mesongxl_usb3phy_match(device_t, cfdata_t, void *);
static void mesongxl_usb3phy_attach(device_t, device_t, void *);
static const char *compatible[] = {
"amlogic,meson-gxl-usb3-phy",
NULL
static const struct device_compatible_entry compat_data[] = {
{ .compat = "amlogic,meson-gxl-usb3-phy" },
DEVICE_COMPAT_EOL
};
struct mesongxl_usb3phy_softc {
@ -148,7 +148,7 @@ mesongxl_usb3phy_match(device_t parent, cfdata_t cf, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: bcm2835_aux.c,v 1.2 2018/09/09 07:21:17 aymeric Exp $ */
/* $NetBSD: bcm2835_aux.c,v 1.3 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2017 Jared D. McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: bcm2835_aux.c,v 1.2 2018/09/09 07:21:17 aymeric Exp $");
__KERNEL_RCSID(0, "$NetBSD: bcm2835_aux.c,v 1.3 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -97,13 +97,17 @@ struct bcmaux_softc {
CFATTACH_DECL_NEW(bcmaux_fdt, sizeof(struct bcmaux_softc),
bcmaux_match, bcmaux_attach, NULL, NULL);
static const struct device_compatible_entry compat_data[] = {
{ .compat = "brcm,bcm2835-aux" },
DEVICE_COMPAT_EOL
};
static int
bcmaux_match(device_t parent, cfdata_t cf, void *aux)
{
const char * const compatible[] = { "brcm,bcm2835-aux", NULL };
const struct fdt_attach_args *faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: bcm2835_bsc_fdt.c,v 1.4 2020/12/23 16:02:11 thorpej Exp $ */
/* $NetBSD: bcm2835_bsc_fdt.c,v 1.5 2021/01/27 03:10:19 thorpej Exp $ */
/*
* Copyright (c) 2019 Jason R. Thorpe
@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: bcm2835_bsc_fdt.c,v 1.4 2020/12/23 16:02:11 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: bcm2835_bsc_fdt.c,v 1.5 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -52,13 +52,17 @@ static void bsciic_fdt_attach(device_t, device_t, void *);
CFATTACH_DECL_NEW(bsciic_fdt, sizeof(struct bsciic_softc),
bsciic_fdt_match, bsciic_fdt_attach, NULL, NULL);
static const struct device_compatible_entry compat_data[] = {
{ .compat = "brcm,bcm2835-i2c" },
DEVICE_COMPAT_EOL
};
static int
bsciic_fdt_match(device_t parent, cfdata_t match, void *aux)
{
const char * const compatible[] = { "brcm,bcm2835-i2c", NULL };
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: bcm2835_cm.c,v 1.2 2017/12/10 21:38:26 skrll Exp $ */
/* $NetBSD: bcm2835_cm.c,v 1.3 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2015 The NetBSD Foundation, Inc.
@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: bcm2835_cm.c,v 1.2 2017/12/10 21:38:26 skrll Exp $");
__KERNEL_RCSID(0, "$NetBSD: bcm2835_cm.c,v 1.3 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -68,17 +68,18 @@ static int bcmcm_wait(struct bcm2835cm_softc *, int, int);
CFATTACH_DECL_NEW(bcmcm_fdt, sizeof(struct bcm2835cm_softc),
bcmcm_match, bcmcm_attach, NULL, NULL);
static const struct device_compatible_entry compat_data[] = {
{ .compat = "brcm,bcm2835-cprman" },
DEVICE_COMPAT_EOL
};
/* ARGSUSED */
static int
bcmcm_match(device_t parent, cfdata_t match, void *aux)
{
const char * const compatible[] = {
"brcm,bcm2835-cprman",
NULL
};
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: bcm2835_com.c,v 1.6 2020/09/28 11:54:23 jmcneill Exp $ */
/* $NetBSD: bcm2835_com.c,v 1.7 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2017 Jared McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: bcm2835_com.c,v 1.6 2020/09/28 11:54:23 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: bcm2835_com.c,v 1.7 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -50,9 +50,9 @@ static void bcm_com_attach(device_t, device_t, void *);
CFATTACH_DECL_NEW(bcmcom, sizeof(struct com_softc),
bcm_com_match, bcm_com_attach, NULL, NULL);
static const char * const compatible[] = {
"brcm,bcm2835-aux-uart",
NULL
static const struct device_compatible_entry compat_data[] = {
{ .compat = "brcm,bcm2835-aux-uart" },
DEVICE_COMPAT_EOL
};
static int
@ -60,7 +60,7 @@ bcm_com_match(device_t parent, cfdata_t cf, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void
@ -130,7 +130,7 @@ static int
bcmaux_com_console_match(int phandle)
{
return of_match_compatible(phandle, compatible);
return of_compatible_match(phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: bcm2835_cprman.c,v 1.4 2019/12/30 15:36:37 skrll Exp $ */
/* $NetBSD: bcm2835_cprman.c,v 1.5 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2017 Jared D. McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: bcm2835_cprman.c,v 1.4 2019/12/30 15:36:37 skrll Exp $");
__KERNEL_RCSID(0, "$NetBSD: bcm2835_cprman.c,v 1.5 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -155,16 +155,18 @@ cprman_add_clock(struct cprman_softc *sc, u_int id, const char *name)
sc->sc_clk[id].id = id;
}
static const struct device_compatible_entry compat_data[] = {
{ .compat = "brcm,bcm2835-cprman" },
{ .compat = "brcm,bcm2711-cprman" },
DEVICE_COMPAT_EOL
};
static int
cprman_match(device_t parent, cfdata_t cf, void *aux)
{
const char * const compatible[] = {
"brcm,bcm2835-cprman",
"brcm,bcm2711-cprman",
NULL };
const struct fdt_attach_args *faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: bcm2835_dmac.c,v 1.17 2020/09/30 23:58:13 jmcneill Exp $ */
/* $NetBSD: bcm2835_dmac.c,v 1.18 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2014 Jared D. McNeill <jmcneill@invisible.ca>
@ -29,7 +29,7 @@
#include "opt_ddb.h"
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: bcm2835_dmac.c,v 1.17 2020/09/30 23:58:13 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: bcm2835_dmac.c,v 1.18 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -96,16 +96,17 @@ void bcm_dmac_dump_regs(void);
CFATTACH_DECL_NEW(bcmdmac_fdt, sizeof(struct bcm_dmac_softc),
bcm_dmac_match, bcm_dmac_attach, NULL, NULL);
static const struct device_compatible_entry compat_data[] = {
{ .compat = "brcm,bcm2835-dma" },
DEVICE_COMPAT_EOL
};
static int
bcm_dmac_match(device_t parent, cfdata_t cf, void *aux)
{
const char * const compatible[] = {
"brcm,bcm2835-dma",
NULL
};
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: bcm2835_dwctwo.c,v 1.8 2017/12/10 21:38:26 skrll Exp $ */
/* $NetBSD: bcm2835_dwctwo.c,v 1.9 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: bcm2835_dwctwo.c,v 1.8 2017/12/10 21:38:26 skrll Exp $");
__KERNEL_RCSID(0, "$NetBSD: bcm2835_dwctwo.c,v 1.9 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -97,18 +97,19 @@ static void bcmdwc2_deferred(device_t);
CFATTACH_DECL_NEW(bcmdwctwo, sizeof(struct bcmdwc2_softc),
bcmdwc2_match, bcmdwc2_attach, NULL, NULL);
static const struct device_compatible_entry compat_data[] = {
{ .compat = "brcm,bcm2708-usb" },
{ .compat = "brcm,bcm2835-usb" },
DEVICE_COMPAT_EOL
};
/* ARGSUSED */
static int
bcmdwc2_match(device_t parent, struct cfdata *match, void *aux)
{
const char * const compatible[] = {
"brcm,bcm2708-usb",
"brcm,bcm2835-usb",
NULL
};
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
/* ARGSUSED */

View File

@ -1,4 +1,4 @@
/* $NetBSD: bcm2835_emmc.c,v 1.41 2021/01/25 14:20:38 thorpej Exp $ */
/* $NetBSD: bcm2835_emmc.c,v 1.42 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2012 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: bcm2835_emmc.c,v 1.41 2021/01/25 14:20:38 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: bcm2835_emmc.c,v 1.42 2021/01/27 03:10:19 thorpej Exp $");
#include "bcmdmac.h"
@ -99,7 +99,7 @@ enum bcmemmc_type {
static const struct device_compatible_entry compat_data[] = {
{ .compat = "brcm,bcm2835-sdhci", .value = BCM2835_SDHCI },
{ .compat = "brcm,bcm2711-emmc2", .value = BCM2711_EMMC2 },
{ }
DEVICE_COMPAT_EOL
};
/* ARGSUSED */
@ -108,7 +108,7 @@ bcmemmc_match(device_t parent, struct cfdata *match, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_match_compat_data(faa->faa_phandle, compat_data);
return of_compatible_match(faa->faa_phandle, compat_data);
}
/* ARGSUSED */
@ -184,7 +184,7 @@ bcmemmc_attach(device_t parent, device_t self, void *aux)
#if NBCMDMAC > 0
enum bcmemmc_type type =
of_search_compatible(phandle, compat_data)->value;
of_compatible_lookup(phandle, compat_data)->value;
if (type != BCM2835_SDHCI)
goto done;

View File

@ -1,4 +1,4 @@
/* $NetBSD: bcm2835_genfb.c,v 1.11 2020/12/01 04:17:10 rin Exp $ */
/* $NetBSD: bcm2835_genfb.c,v 1.12 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2013 Jared D. McNeill <jmcneill@invisible.ca>
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: bcm2835_genfb.c,v 1.11 2020/12/01 04:17:10 rin Exp $");
__KERNEL_RCSID(0, "$NetBSD: bcm2835_genfb.c,v 1.12 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/types.h>
@ -71,13 +71,17 @@ int (*bcmgenfb_ioctl_handler)(void *, void *, u_long, void *, int, struct lwp *)
CFATTACH_DECL_NEW(bcmgenfb, sizeof(struct bcmgenfb_softc),
bcmgenfb_match, bcmgenfb_attach, NULL, NULL);
static const struct device_compatible_entry compat_data[] = {
{ .compat = "brcm,bcm2835-fb" },
DEVICE_COMPAT_EOL
};
static int
bcmgenfb_match(device_t parent, cfdata_t match, void *aux)
{
const char * const compatible[] = { "brcm,bcm2835-fb", NULL };
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: bcm2835_gpio.c,v 1.17 2021/01/15 00:38:22 jmcneill Exp $ */
/* $NetBSD: bcm2835_gpio.c,v 1.18 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2013, 2014, 2017 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: bcm2835_gpio.c,v 1.17 2021/01/15 00:38:22 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: bcm2835_gpio.c,v 1.18 2021/01/27 03:10:19 thorpej Exp $");
/*
* Driver for BCM2835 GPIO
@ -238,18 +238,19 @@ bcm283x_pinctrl_set_config(device_t dev, const void *data, size_t len)
return 0;
}
static const struct device_compatible_entry compat_data[] = {
{ .compat = "brcm,bcm2835-gpio" },
{ .compat = "brcm,bcm2838-gpio" },
{ .compat = "brcm,bcm2711-gpio" },
DEVICE_COMPAT_EOL
};
static int
bcmgpio_match(device_t parent, cfdata_t cf, void *aux)
{
const char * const compatible[] = {
"brcm,bcm2835-gpio",
"brcm,bcm2838-gpio",
"brcm,bcm2711-gpio",
NULL
};
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: bcm2835_intr.c,v 1.36 2021/01/25 14:20:38 thorpej Exp $ */
/* $NetBSD: bcm2835_intr.c,v 1.37 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2012, 2015, 2019 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: bcm2835_intr.c,v 1.36 2021/01/25 14:20:38 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: bcm2835_intr.c,v 1.37 2021/01/27 03:10:19 thorpej Exp $");
#define _INTR_PRIVATE
@ -260,7 +260,7 @@ static const struct device_compatible_entry compat_data[] = {
{ .compat = "brcm,bcm2835-armctrl-ic", .value = 0 },
{ .compat = "brcm,bcm2836-armctrl-ic", .value = 0 },
{ .compat = "brcm,bcm2836-l1-intc", .value = 1 },
{ }
DEVICE_COMPAT_EOL
};
static int
@ -268,7 +268,7 @@ bcm2835_icu_match(device_t parent, cfdata_t cf, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_match_compat_data(faa->faa_phandle, compat_data);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void
@ -300,7 +300,7 @@ bcm2835_icu_attach(device_t parent, device_t self, void *aux)
sc->sc_ioh = ioh;
sc->sc_phandle = phandle;
dce = of_search_compatible(faa->faa_phandle, compat_data);
dce = of_compatible_lookup(faa->faa_phandle, compat_data);
KASSERT(dce != NULL);
if (dce->value != 0) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: bcm2835_mbox_fdt.c,v 1.1 2019/12/30 18:43:38 jmcneill Exp $ */
/* $NetBSD: bcm2835_mbox_fdt.c,v 1.2 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2012 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: bcm2835_mbox_fdt.c,v 1.1 2019/12/30 18:43:38 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: bcm2835_mbox_fdt.c,v 1.2 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -53,14 +53,18 @@ static void bcmmbox_fdt_attach(device_t, device_t, void *);
CFATTACH_DECL_NEW(bcmmbox_fdt, sizeof(struct bcm2835mbox_softc),
bcmmbox_fdt_match, bcmmbox_fdt_attach, NULL, NULL);
static const struct device_compatible_entry compat_data[] = {
{ .compat = "brcm,bcm2835-mbox" },
DEVICE_COMPAT_EOL
};
/* ARGSUSED */
static int
bcmmbox_fdt_match(device_t parent, cfdata_t match, void *aux)
{
const char * const compatible[] = { "brcm,bcm2835-mbox", NULL };
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: bcm2835_pmwdog.c,v 1.1 2017/12/10 21:38:26 skrll Exp $ */
/* $NetBSD: bcm2835_pmwdog.c,v 1.2 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2012, 2016 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: bcm2835_pmwdog.c,v 1.1 2017/12/10 21:38:26 skrll Exp $");
__KERNEL_RCSID(0, "$NetBSD: bcm2835_pmwdog.c,v 1.2 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
@ -85,14 +85,18 @@ static int bcmpmwdog_tickle(struct sysmon_wdog *);
CFATTACH_DECL_NEW(bcmpmwdog_fdt, sizeof(struct bcm2835pmwdog_softc),
bcmpmwdog_match, bcmpmwdog_attach, NULL, NULL);
static const struct device_compatible_entry compat_data[] = {
{ .compat = "brcm,bcm2835-pm-wdt" },
DEVICE_COMPAT_EOL
};
/* ARGSUSED */
static int
bcmpmwdog_match(device_t parent, cfdata_t match, void *aux)
{
const char * const compatible[] = { "brcm,bcm2835-pm-wdt", NULL };
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: bcm2835_pwm.c,v 1.3 2017/12/10 21:38:26 skrll Exp $ */
/* $NetBSD: bcm2835_pwm.c,v 1.4 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2015 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: bcm2835_pwm.c,v 1.3 2017/12/10 21:38:26 skrll Exp $");
__KERNEL_RCSID(0, "$NetBSD: bcm2835_pwm.c,v 1.4 2021/01/27 03:10:19 thorpej Exp $");
#include "bcmdmac.h"
@ -88,14 +88,18 @@ static int bcmpwm_wait(struct bcm2835pwm_softc *);
CFATTACH_DECL_NEW(bcmpwm, sizeof(struct bcm2835pwm_softc),
bcmpwm_match, bcmpwm_attach, NULL, NULL);
static const struct device_compatible_entry compat_data[] = {
{ .compat = "brcm,bcm2835-pwm" },
DEVICE_COMPAT_EOL
};
/* ARGSUSED */
static int
bcmpwm_match(device_t parent, cfdata_t match, void *aux)
{
const char * const compatible[] = { "brcm,bcm2835-pwm", NULL };
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: bcm2835_rng.c,v 1.14 2020/04/30 03:40:52 riastradh Exp $ */
/* $NetBSD: bcm2835_rng.c,v 1.15 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: bcm2835_rng.c,v 1.14 2020/04/30 03:40:52 riastradh Exp $");
__KERNEL_RCSID(0, "$NetBSD: bcm2835_rng.c,v 1.15 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -69,14 +69,18 @@ static void bcmrng_get(size_t, void *);
CFATTACH_DECL_NEW(bcmrng_fdt, sizeof(struct bcm2835rng_softc),
bcmrng_match, bcmrng_attach, NULL, NULL);
static const struct device_compatible_entry compat_data[] = {
{ .compat = "brcm,bcm2835-rng" },
DEVICE_COMPAT_EOL
};
/* ARGSUSED */
static int
bcmrng_match(device_t parent, cfdata_t match, void *aux)
{
const char * const compatible[] = { "brcm,bcm2835-rng", NULL };
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: bcm2835_sdhost.c,v 1.6 2020/12/01 04:15:04 rin Exp $ */
/* $NetBSD: bcm2835_sdhost.c,v 1.7 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2017 Jared McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: bcm2835_sdhost.c,v 1.6 2020/12/01 04:15:04 rin Exp $");
__KERNEL_RCSID(0, "$NetBSD: bcm2835_sdhost.c,v 1.7 2021/01/27 03:10:19 thorpej Exp $");
#include "bcmdmac.h"
@ -174,16 +174,17 @@ CFATTACH_DECL_NEW(bcmsdhost, sizeof(struct sdhost_softc),
#define SDHOST_READ(sc, reg) \
bus_space_read_4((sc)->sc_bst, (sc)->sc_bsh, (reg))
static const struct device_compatible_entry compat_data[] = {
{ .compat = "brcm,bcm2835-sdhost" },
DEVICE_COMPAT_EOL
};
static int
sdhost_match(device_t parent, cfdata_t cf, void *aux)
{
const char * const compatible[] = {
"brcm,bcm2835-sdhost",
NULL
};
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: bcm2835_spi.c,v 1.7 2020/08/04 13:20:45 kardel Exp $ */
/* $NetBSD: bcm2835_spi.c,v 1.8 2021/01/27 03:10:19 thorpej Exp $ */
/*
* Copyright (c) 2012 Jonathan A. Kollasch
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: bcm2835_spi.c,v 1.7 2020/08/04 13:20:45 kardel Exp $");
__KERNEL_RCSID(0, "$NetBSD: bcm2835_spi.c,v 1.8 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/device.h>
@ -77,16 +77,17 @@ static void bcmspi_recv(struct bcmspi_softc * const);
CFATTACH_DECL_NEW(bcmspi, sizeof(struct bcmspi_softc),
bcmspi_match, bcmspi_attach, NULL, NULL);
static const struct device_compatible_entry compat_data[] = {
{ .compat = "brcm,bcm2835-spi" },
DEVICE_COMPAT_EOL
};
static int
bcmspi_match(device_t parent, cfdata_t cf, void *aux)
{
const char * const compatible[] = {
"brcm,bcm2835-spi",
NULL
};
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: bcm2835_tmr.c,v 1.10 2019/06/07 13:43:44 skrll Exp $ */
/* $NetBSD: bcm2835_tmr.c,v 1.11 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2012 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: bcm2835_tmr.c,v 1.10 2019/06/07 13:43:44 skrll Exp $");
__KERNEL_RCSID(0, "$NetBSD: bcm2835_tmr.c,v 1.11 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -100,16 +100,18 @@ static struct timecounter bcm2835tmr_timecounter = {
CFATTACH_DECL_NEW(bcmtmr_fdt, sizeof(struct bcm2835tmr_softc),
bcmtmr_match, bcmtmr_attach, NULL, NULL);
static const struct device_compatible_entry compat_data[] = {
{ .compat = "brcm,bcm2835-system-timer" },
DEVICE_COMPAT_EOL
};
/* ARGSUSED */
static int
bcmtmr_match(device_t parent, cfdata_t match, void *aux)
{
const char * const compatible[] = {
"brcm,bcm2835-system-timer",
NULL
};
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: bcm2838_rng.c,v 1.1 2019/09/01 17:27:22 mlelstv Exp $ */
/* $NetBSD: bcm2838_rng.c,v 1.2 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2019 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: bcm2838_rng.c,v 1.1 2019/09/01 17:27:22 mlelstv Exp $");
__KERNEL_RCSID(0, "$NetBSD: bcm2838_rng.c,v 1.2 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/device.h>
@ -49,14 +49,18 @@ static void bcm2838rng_attach(device_t, device_t, void *);
CFATTACH_DECL_NEW(bcm2838rng_fdt, sizeof(struct bcm2838rng_softc),
bcm2838rng_match, bcm2838rng_attach, NULL, NULL);
static const struct device_compatible_entry compat_data[] = {
{ .compat = "brcm,bcm2838-rng200" },
DEVICE_COMPAT_EOL
};
/* ARGSUSED */
static int
bcm2838rng_match(device_t parent, cfdata_t match, void *aux)
{
const char * const compatible[] = { "brcm,bcm2838-rng200", NULL };
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: bcm283x_platform.c,v 1.45 2020/12/01 04:16:18 rin Exp $ */
/* $NetBSD: bcm283x_platform.c,v 1.46 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2017 Jared D. McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: bcm283x_platform.c,v 1.45 2020/12/01 04:16:18 rin Exp $");
__KERNEL_RCSID(0, "$NetBSD: bcm283x_platform.c,v 1.46 2021/01/27 03:10:19 thorpej Exp $");
#include "opt_arm_debug.h"
#include "opt_bcm283x.h"
@ -1485,12 +1485,12 @@ bcm283x_platform_uart_freq(void)
*/
const int phandle = fdtbus_get_stdout_phandle();
static const char * const aux_compatible[] = {
"brcm,bcm2835-aux-uart",
NULL
static const struct device_compatible_entry aux_compat_data[] = {
{ .compat = "brcm,bcm2835-aux-uart" },
DEVICE_COMPAT_EOL
};
if (of_match_compatible(phandle, aux_compatible))
if (of_compatible_match(phandle, aux_compat_data))
return core_clk * 2;
return uart_clk;

View File

@ -1,4 +1,4 @@
/* $NetBSD: a9ptmr_fdt.c,v 1.2 2021/01/15 18:42:40 ryo Exp $ */
/* $NetBSD: a9ptmr_fdt.c,v 1.3 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2019 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: a9ptmr_fdt.c,v 1.2 2021/01/15 18:42:40 ryo Exp $");
__KERNEL_RCSID(0, "$NetBSD: a9ptmr_fdt.c,v 1.3 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -57,17 +57,18 @@ struct a9ptmr_fdt_softc {
CFATTACH_DECL_NEW(a9ptmr_fdt, sizeof(struct a9ptmr_fdt_softc),
a9ptmr_fdt_match, a9ptmr_fdt_attach, NULL, NULL);
static const struct device_compatible_entry compat_data[] = {
{ .compat = "arm,cortex-a9-twd-timer" },
{ .compat = "arm,cortex-a5-twd-timer" },
DEVICE_COMPAT_EOL
};
static int
a9ptmr_fdt_match(device_t parent, cfdata_t cf, void *aux)
{
const char * const compatible[] = {
"arm,cortex-a9-twd-timer",
"arm,cortex-a5-twd-timer",
NULL
};
struct fdt_attach_args * const faa = aux;
return of_compatible(faa->faa_phandle, compatible) >= 0;
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: a9tmr_fdt.c,v 1.4 2021/01/15 18:42:40 ryo Exp $ */
/* $NetBSD: a9tmr_fdt.c,v 1.5 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2017 Jared McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: a9tmr_fdt.c,v 1.4 2021/01/15 18:42:40 ryo Exp $");
__KERNEL_RCSID(0, "$NetBSD: a9tmr_fdt.c,v 1.5 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -58,17 +58,18 @@ struct a9tmr_fdt_softc {
CFATTACH_DECL_NEW(a9tmr_fdt, sizeof(struct a9tmr_fdt_softc),
a9tmr_fdt_match, a9tmr_fdt_attach, NULL, NULL);
static const struct device_compatible_entry compat_data[] = {
{ .compat = "arm,cortex-a5-global-timer" },
{ .compat = "arm,cortex-a9-global-timer" },
DEVICE_COMPAT_EOL
};
static int
a9tmr_fdt_match(device_t parent, cfdata_t cf, void *aux)
{
const char * const compatible[] = {
"arm,cortex-a5-global-timer",
"arm,cortex-a9-global-timer",
NULL
};
struct fdt_attach_args * const faa = aux;
return of_compatible(faa->faa_phandle, compatible) >= 0;
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: a9wdt_fdt.c,v 1.1 2019/08/10 17:03:59 skrll Exp $ */
/* $NetBSD: a9wdt_fdt.c,v 1.2 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2019 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: a9wdt_fdt.c,v 1.1 2019/08/10 17:03:59 skrll Exp $");
__KERNEL_RCSID(0, "$NetBSD: a9wdt_fdt.c,v 1.2 2021/01/27 03:10:19 thorpej Exp $");
#if 0
#include <sys/param.h>
@ -67,17 +67,18 @@ struct a9wdt_fdt_softc {
CFATTACH_DECL_NEW(a9wdt_fdt, sizeof(struct a9wdt_fdt_softc),
a9wdt_fdt_match, a9wdt_fdt_attach, NULL, NULL);
static const struct device_compatible_entry compat_data[] = {
{ .compat = "arm,cortex-a9-twd-wdt" },
{ .compat = "arm,cortex-a5-twd-wdt" },
DEVICE_COMPAT_EOL
};
static int
a9wdt_fdt_match(device_t parent, cfdata_t cf, void *aux)
{
const char * const compatible[] = {
"arm,cortex-a9-twd-wdt",
"arm,cortex-a5-twd-wdt",
NULL
};
struct fdt_attach_args * const faa = aux;
return of_compatible(faa->faa_phandle, compatible) >= 0;
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: aaci_fdt.c,v 1.2 2021/01/15 18:42:40 ryo Exp $ */
/* $NetBSD: aaci_fdt.c,v 1.3 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2017 Jared McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: aaci_fdt.c,v 1.2 2021/01/15 18:42:40 ryo Exp $");
__KERNEL_RCSID(0, "$NetBSD: aaci_fdt.c,v 1.3 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -42,9 +42,9 @@ __KERNEL_RCSID(0, "$NetBSD: aaci_fdt.c,v 1.2 2021/01/15 18:42:40 ryo Exp $");
static int aaci_fdt_match(device_t, cfdata_t, void *);
static void aaci_fdt_attach(device_t, device_t, void *);
static const char * const compatible[] = {
"arm,pl041",
NULL
static const struct device_compatible_entry compat_data[] = {
{ .compat = "arm,pl041" },
DEVICE_COMPAT_EOL
};
CFATTACH_DECL_NEW(aaci_fdt, sizeof(struct aaci_softc),
@ -55,7 +55,7 @@ aaci_fdt_match(device_t parent, cfdata_t cf, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_compatible(faa->faa_phandle, compatible) >= 0;
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: acpi_fdt.c,v 1.17 2021/01/17 19:53:05 jmcneill Exp $ */
/* $NetBSD: acpi_fdt.c,v 1.18 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2015-2017 Jared McNeill <jmcneill@invisible.ca>
@ -30,7 +30,7 @@
#include "opt_efi.h"
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: acpi_fdt.c,v 1.17 2021/01/17 19:53:05 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: acpi_fdt.c,v 1.18 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -67,9 +67,9 @@ extern struct arm32_bus_dma_tag acpi_coherent_dma_tag;
static uint64_t smbios_table = 0;
static const char * const compatible[] = {
"netbsd,acpi",
NULL
static const struct device_compatible_entry compat_data[] = {
{ .compat = "netbsd,acpi" },
DEVICE_COMPAT_EOL
};
static const struct fdtbus_power_controller_func acpi_fdt_power_funcs = {
@ -83,7 +83,7 @@ acpi_fdt_match(device_t parent, cfdata_t cf, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_compatible(faa->faa_phandle, compatible) >= 0;
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: arm_fdt.c,v 1.13 2020/12/17 08:47:18 skrll Exp $ */
/* $NetBSD: arm_fdt.c,v 1.14 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2017 Jared D. McNeill <jmcneill@invisible.ca>
@ -31,7 +31,7 @@
#include "opt_modular.h"
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: arm_fdt.c,v 1.13 2020/12/17 08:47:18 skrll Exp $");
__KERNEL_RCSID(0, "$NetBSD: arm_fdt.c,v 1.14 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -118,8 +118,12 @@ arm_fdt_platform(void)
int match, best_match = 0;
__link_set_foreach(info, arm_platforms) {
const char * const compat[] = { (*info)->api_compat, NULL };
match = of_match_compatible(phandle, compat);
const struct device_compatible_entry compat_data[] = {
{ .compat = (*info)->api_compat },
DEVICE_COMPAT_EOL
};
match = of_compatible_match(phandle, compat_data);
if (match > best_match) {
best_match = match;
best_info = *info;

View File

@ -1,4 +1,4 @@
/* $NetBSD: arm_simplefb.c,v 1.7 2021/01/17 19:51:43 jmcneill Exp $ */
/* $NetBSD: arm_simplefb.c,v 1.8 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2019 The NetBSD Foundation, Inc.
@ -34,7 +34,7 @@
#include "opt_vcons.h"
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: arm_simplefb.c,v 1.7 2021/01/17 19:51:43 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: arm_simplefb.c,v 1.8 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -90,12 +90,14 @@ static bus_addr_t arm_simplefb_addr;
static bus_size_t arm_simplefb_size;
static bus_space_handle_t arm_simplefb_bsh;
static const struct device_compatible_entry compat_data[] = {
{ .compat = "simple-framebuffer" },
DEVICE_COMPAT_EOL
};
static int
arm_simplefb_find_node(void)
{
static const char * simplefb_compatible[] = {
"simple-framebuffer", NULL
};
int chosen_phandle, child;
chosen_phandle = OF_finddevice("/chosen");
@ -105,7 +107,7 @@ arm_simplefb_find_node(void)
for (child = OF_child(chosen_phandle); child; child = OF_peer(child)) {
if (!fdtbus_status_okay(child))
continue;
if (!of_match_compatible(child, simplefb_compatible))
if (!of_compatible_match(child, compat_data))
continue;
return child;

View File

@ -1,4 +1,4 @@
/* $NetBSD: gic_fdt.c,v 1.20 2021/01/15 00:38:22 jmcneill Exp $ */
/* $NetBSD: gic_fdt.c,v 1.21 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2015-2017 Jared McNeill <jmcneill@invisible.ca>
@ -29,7 +29,7 @@
#include "pci.h"
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: gic_fdt.c,v 1.20 2021/01/15 00:38:22 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: gic_fdt.c,v 1.21 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -109,19 +109,25 @@ struct gic_fdt_softc {
CFATTACH_DECL_NEW(gic_fdt, sizeof(struct gic_fdt_softc),
gic_fdt_match, gic_fdt_attach, NULL, NULL);
static const struct device_compatible_entry compat_data[] = {
{ .compat = "arm,gic-400" },
{ .compat = "arm,cortex-a15-gic" },
{ .compat = "arm,cortex-a9-gic" },
{ .compat = "arm,cortex-a7-gic" },
DEVICE_COMPAT_EOL
};
static const struct device_compatible_entry v2m_compat_data[] = {
{ .compat = "arm,gic-v2m-frame" },
DEVICE_COMPAT_EOL
};
static int
gic_fdt_match(device_t parent, cfdata_t cf, void *aux)
{
const char * const compatible[] = {
"arm,gic-400",
"arm,cortex-a15-gic",
"arm,cortex-a9-gic",
"arm,cortex-a7-gic",
NULL
};
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void
@ -183,8 +189,7 @@ gic_fdt_attach(device_t parent, device_t self, void *aux)
for (int child = OF_child(phandle); child; child = OF_peer(child)) {
if (!fdtbus_status_okay(child))
continue;
const char * const v2m_compat[] = { "arm,gic-v2m-frame", NULL };
if (of_match_compatible(child, v2m_compat))
if (of_compatible_match(child, v2m_compat_data))
gic_fdt_attach_v2m(sc, faa->faa_bst, child);
}
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: gicv3_fdt.c,v 1.14 2021/01/27 01:54:06 thorpej Exp $ */
/* $NetBSD: gicv3_fdt.c,v 1.15 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2015-2018 Jared McNeill <jmcneill@invisible.ca>
@ -31,7 +31,7 @@
#define _INTR_PRIVATE
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: gicv3_fdt.c,v 1.14 2021/01/27 01:54:06 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: gicv3_fdt.c,v 1.15 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -126,7 +126,7 @@ gicv3_fdt_match(device_t parent, cfdata_t cf, void *aux)
struct fdt_attach_args * const faa = aux;
const int phandle = faa->faa_phandle;
return of_match_compat_data(phandle, compat_data);
return of_compatible_match(phandle, compat_data);
}
static void
@ -162,7 +162,7 @@ gicv3_fdt_attach(device_t parent, device_t self, void *aux)
/* Apply quirks */
const struct device_compatible_entry *dce =
of_search_compatible(OF_finddevice("/"), gicv3_fdt_quirks);
of_compatible_lookup(OF_finddevice("/"), gicv3_fdt_quirks);
if (dce != NULL) {
sc->sc_gic.sc_quirks |= dce->value;
}
@ -188,7 +188,7 @@ gicv3_fdt_attach(device_t parent, device_t self, void *aux)
child = OF_peer(child)) {
if (!fdtbus_status_okay(child))
continue;
if (of_match_compat_data(child, its_compat))
if (of_compatible_match(child, its_compat))
gicv3_fdt_attach_its(sc, faa->faa_bst, child);
}
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: gtmr_fdt.c,v 1.8 2021/01/15 18:42:40 ryo Exp $ */
/* $NetBSD: gtmr_fdt.c,v 1.9 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2017 Jared McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: gtmr_fdt.c,v 1.8 2021/01/15 18:42:40 ryo Exp $");
__KERNEL_RCSID(0, "$NetBSD: gtmr_fdt.c,v 1.9 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -54,17 +54,18 @@ CFATTACH_DECL_NEW(gtmr_fdt, 0, gtmr_fdt_match, gtmr_fdt_attach, NULL, NULL);
/* The virtual timer list entry */
#define GTMR_VTIMER 2
static const struct device_compatible_entry compat_data[] = {
{ .compat = "arm,armv7-timer" },
{ .compat = "arm,armv8-timer" },
DEVICE_COMPAT_EOL
};
static int
gtmr_fdt_match(device_t parent, cfdata_t cf, void *aux)
{
const char * const compatible[] = {
"arm,armv7-timer",
"arm,armv8-timer",
NULL
};
struct fdt_attach_args * const faa = aux;
return of_compatible(faa->faa_phandle, compatible) >= 0;
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: l2cc_fdt.c,v 1.2 2019/01/19 20:56:03 jmcneill Exp $ */
/* $NetBSD: l2cc_fdt.c,v 1.3 2021/01/27 03:10:19 thorpej Exp $ */
/*
* Copyright (c) 2018 Genetec Corporation. All rights reserved.
* Written by Hashimoto Kenichi for Genetec Corporation.
@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: l2cc_fdt.c,v 1.2 2019/01/19 20:56:03 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: l2cc_fdt.c,v 1.3 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -46,16 +46,17 @@ static void l2cc_fdt_attach(device_t, device_t, void *);
CFATTACH_DECL_NEW(l2cc_fdt, 0, l2cc_fdt_match, l2cc_fdt_attach, NULL, NULL);
static const struct device_compatible_entry compat_data[] = {
{ .compat = "arm,pl310-cache" },
DEVICE_COMPAT_EOL
};
static int
l2cc_fdt_match(device_t parent, cfdata_t cf, void *aux)
{
const char * const compatible[] = {
"arm,pl310-cache",
NULL
};
struct fdt_attach_args * const faa = aux;
return of_compatible(faa->faa_phandle, compatible) >= 0;
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: pcihost_fdt.c,v 1.22 2021/01/27 01:54:06 thorpej Exp $ */
/* $NetBSD: pcihost_fdt.c,v 1.23 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2018 Jared D. McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pcihost_fdt.c,v 1.22 2021/01/27 01:54:06 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: pcihost_fdt.c,v 1.23 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
@ -106,7 +106,7 @@ pcihost_match(device_t parent, cfdata_t cf, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_match_compat_data(faa->faa_phandle, compat_data);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void
@ -133,7 +133,7 @@ pcihost_attach(device_t parent, device_t self, void *aux)
aprint_error(": couldn't map registers: %d\n", error);
return;
}
sc->sc_type = of_search_compatible(sc->sc_phandle, compat_data)->value;
sc->sc_type = of_compatible_lookup(sc->sc_phandle, compat_data)->value;
#ifdef __HAVE_PCI_MSI_MSIX
if (sc->sc_type == PCIHOST_ECAM) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: plcom_fdt.c,v 1.4 2021/01/15 18:42:40 ryo Exp $ */
/* $NetBSD: plcom_fdt.c,v 1.5 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2017 Jared McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: plcom_fdt.c,v 1.4 2021/01/15 18:42:40 ryo Exp $");
__KERNEL_RCSID(0, "$NetBSD: plcom_fdt.c,v 1.5 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -43,7 +43,10 @@ __KERNEL_RCSID(0, "$NetBSD: plcom_fdt.c,v 1.4 2021/01/15 18:42:40 ryo Exp $");
static int plcom_fdt_match(device_t, cfdata_t, void *);
static void plcom_fdt_attach(device_t, device_t, void *);
static const char * const compatible[] = { "arm,pl011", NULL };
static const struct device_compatible_entry compat_data[] = {
{ .compat = "arm,pl011" },
DEVICE_COMPAT_EOL
};
CFATTACH_DECL_NEW(plcom_fdt, sizeof(struct plcom_softc),
plcom_fdt_match, plcom_fdt_attach, NULL, NULL);
@ -53,7 +56,7 @@ plcom_fdt_match(device_t parent, cfdata_t cf, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_compatible(faa->faa_phandle, compatible) >= 0;
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void
@ -121,7 +124,7 @@ plcom_fdt_attach(device_t parent, device_t self, void *aux)
static int
plcom_fdt_console_match(int phandle)
{
return of_match_compatible(phandle, compatible);
return of_compatible_match(phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: plfb_fdt.c,v 1.4 2019/07/23 12:34:05 jmcneill Exp $ */
/* $NetBSD: plfb_fdt.c,v 1.5 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2017 Jared McNeill <jmcneill@invisible.ca>
@ -33,7 +33,7 @@
#include "opt_wsdisplay_compat.h"
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: plfb_fdt.c,v 1.4 2019/07/23 12:34:05 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: plfb_fdt.c,v 1.5 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/types.h>
@ -95,9 +95,9 @@ static bool plfb_shutdown(device_t, int);
static void plfb_init(struct plfb_softc *);
static const char * const compatible[] = {
"arm,pl111",
NULL
static const struct device_compatible_entry compat_data[] = {
{ .compat = "arm,pl111" },
DEVICE_COMPAT_EOL
};
CFATTACH_DECL_NEW(plfb_fdt, sizeof(struct plfb_softc),
@ -113,7 +113,7 @@ plfb_match(device_t parent, cfdata_t match, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void
@ -318,7 +318,7 @@ plfb_init(struct plfb_softc *sc)
static int
plfb_console_match(int phandle)
{
return of_match_compatible(phandle, compatible);
return of_compatible_match(phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: plkmi_fdt.c,v 1.2 2021/01/15 18:42:41 ryo Exp $ */
/* $NetBSD: plkmi_fdt.c,v 1.3 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2017 Jared McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: plkmi_fdt.c,v 1.2 2021/01/15 18:42:41 ryo Exp $");
__KERNEL_RCSID(0, "$NetBSD: plkmi_fdt.c,v 1.3 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -42,9 +42,9 @@ __KERNEL_RCSID(0, "$NetBSD: plkmi_fdt.c,v 1.2 2021/01/15 18:42:41 ryo Exp $");
static int plkmi_fdt_match(device_t, cfdata_t, void *);
static void plkmi_fdt_attach(device_t, device_t, void *);
static const char * const compatible[] = {
"arm,pl050",
NULL
static const struct device_compatible_entry compat_data[] = {
{ .compat = "arm,pl050" },
DEVICE_COMPAT_EOL
};
CFATTACH_DECL_NEW(plkmi_fdt, sizeof(struct plkmi_softc),
@ -55,7 +55,7 @@ plkmi_fdt_match(device_t parent, cfdata_t cf, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_compatible(faa->faa_phandle, compatible) >= 0;
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: plmmc_fdt.c,v 1.3 2021/01/15 18:42:41 ryo Exp $ */
/* $NetBSD: plmmc_fdt.c,v 1.4 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2017 Jared McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: plmmc_fdt.c,v 1.3 2021/01/15 18:42:41 ryo Exp $");
__KERNEL_RCSID(0, "$NetBSD: plmmc_fdt.c,v 1.4 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -43,10 +43,10 @@ __KERNEL_RCSID(0, "$NetBSD: plmmc_fdt.c,v 1.3 2021/01/15 18:42:41 ryo Exp $");
static int plmmc_fdt_match(device_t, cfdata_t, void *);
static void plmmc_fdt_attach(device_t, device_t, void *);
static const char * const compatible[] = {
"arm,pl180",
"arm,pl181",
NULL
static const struct device_compatible_entry compat_data[] = {
{ .compat = "arm,pl180" },
{ .compat = "arm,pl181" },
DEVICE_COMPAT_EOL
};
CFATTACH_DECL_NEW(plmmc_fdt, sizeof(struct plmmc_softc),
@ -57,7 +57,7 @@ plmmc_fdt_match(device_t parent, cfdata_t cf, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_compatible(faa->faa_phandle, compatible) >= 0;
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: plrtc_fdt.c,v 1.1 2017/06/08 21:01:06 jmcneill Exp $ */
/* $NetBSD: plrtc_fdt.c,v 1.2 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2017 Jared McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: plrtc_fdt.c,v 1.1 2017/06/08 21:01:06 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: plrtc_fdt.c,v 1.2 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -42,9 +42,9 @@ __KERNEL_RCSID(0, "$NetBSD: plrtc_fdt.c,v 1.1 2017/06/08 21:01:06 jmcneill Exp $
static int plrtc_fdt_match(device_t, cfdata_t, void *);
static void plrtc_fdt_attach(device_t, device_t, void *);
static const char * const compatible[] = {
"arm,pl031",
NULL
static const struct device_compatible_entry compat_data[] = {
{ .compat = "arm,pl031" },
DEVICE_COMPAT_EOL
};
CFATTACH_DECL_NEW(plrtc_fdt, sizeof(struct plrtc_softc),
@ -55,7 +55,7 @@ plrtc_fdt_match(device_t parent, cfdata_t cf, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_compatible(faa->faa_phandle, compatible) >= 0;
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmu_fdt.c,v 1.7 2021/01/15 18:42:41 ryo Exp $ */
/* $NetBSD: pmu_fdt.c,v 1.8 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2018 Jared McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pmu_fdt.c,v 1.7 2021/01/15 18:42:41 ryo Exp $");
__KERNEL_RCSID(0, "$NetBSD: pmu_fdt.c,v 1.8 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -62,22 +62,22 @@ static void pmu_fdt_attach(device_t, device_t, void *);
static void pmu_fdt_init(device_t);
static int pmu_fdt_intr_distribute(const int, int, void *);
static const char * const compatible[] = {
"arm,armv8-pmuv3",
"arm,cortex-a73-pmu",
"arm,cortex-a72-pmu",
"arm,cortex-a57-pmu",
"arm,cortex-a53-pmu",
static const struct device_compatible_entry compat_data[] = {
{ .compat = "arm,armv8-pmuv3" },
{ .compat = "arm,cortex-a73-pmu" },
{ .compat = "arm,cortex-a72-pmu" },
{ .compat = "arm,cortex-a57-pmu" },
{ .compat = "arm,cortex-a53-pmu" },
"arm,cortex-a35-pmu",
"arm,cortex-a17-pmu",
"arm,cortex-a12-pmu",
"arm,cortex-a9-pmu",
"arm,cortex-a8-pmu",
"arm,cortex-a7-pmu",
"arm,cortex-a5-pmu",
{ .compat = "arm,cortex-a35-pmu" },
{ .compat = "arm,cortex-a17-pmu" },
{ .compat = "arm,cortex-a12-pmu" },
{ .compat = "arm,cortex-a9-pmu" },
{ .compat = "arm,cortex-a8-pmu" },
{ .compat = "arm,cortex-a7-pmu" },
{ .compat = "arm,cortex-a5-pmu" },
NULL
DEVICE_COMPAT_EOL
};
struct pmu_fdt_softc {
@ -93,7 +93,7 @@ pmu_fdt_match(device_t parent, cfdata_t cf, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: psci_fdt.c,v 1.19 2018/10/17 05:30:24 skrll Exp $ */
/* $NetBSD: psci_fdt.c,v 1.20 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2017 Jared McNeill <jmcneill@invisible.ca>
@ -29,7 +29,7 @@
#include "opt_multiprocessor.h"
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: psci_fdt.c,v 1.19 2018/10/17 05:30:24 skrll Exp $");
__KERNEL_RCSID(0, "$NetBSD: psci_fdt.c,v 1.20 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/atomic.h>
@ -48,11 +48,11 @@ static void psci_fdt_attach(device_t, device_t, void *);
static int psci_fdt_init(const int);
static const char * const compatible[] = {
"arm,psci",
"arm,psci-0.2",
"arm,psci-1.0",
NULL
static const struct device_compatible_entry compat_data[] = {
{ .compat = "arm,psci" },
{ .compat = "arm,psci-0.2" },
{ .compat = "arm,psci-1.0" },
DEVICE_COMPAT_EOL
};
CFATTACH_DECL_NEW(psci_fdt, 0, psci_fdt_match, psci_fdt_attach, NULL, NULL);
@ -81,7 +81,7 @@ psci_fdt_match(device_t parent, cfdata_t cf, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: smsh_fdt.c,v 1.3 2021/01/15 18:42:41 ryo Exp $ */
/* $NetBSD: smsh_fdt.c,v 1.4 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2017 Jared McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: smsh_fdt.c,v 1.3 2021/01/15 18:42:41 ryo Exp $");
__KERNEL_RCSID(0, "$NetBSD: smsh_fdt.c,v 1.4 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -49,10 +49,10 @@ __KERNEL_RCSID(0, "$NetBSD: smsh_fdt.c,v 1.3 2021/01/15 18:42:41 ryo Exp $");
static int smsh_fdt_match(device_t, cfdata_t, void *);
static void smsh_fdt_attach(device_t, device_t, void *);
static const char * const compatible[] = {
"smsc,lan9118",
"smsc,lan9115",
NULL
static const struct device_compatible_entry compat_data[] = {
{ .compat = "smsc,lan9118" },
{ .compat = "smsc,lan9115" },
DEVICE_COMPAT_EOL
};
CFATTACH_DECL_NEW(smsh_fdt, sizeof(struct lan9118_softc),
@ -63,7 +63,7 @@ smsh_fdt_match(device_t parent, cfdata_t cf, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_compatible(faa->faa_phandle, compatible) >= 0;
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: tegra124_car.c,v 1.21 2020/08/12 10:21:00 jmcneill Exp $ */
/* $NetBSD: tegra124_car.c,v 1.22 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tegra124_car.c,v 1.21 2020/08/12 10:21:00 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: tegra124_car.c,v 1.22 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -724,19 +724,20 @@ static void tegra124_car_rnd_callback(size_t, void *);
CFATTACH_DECL_NEW(tegra124_car, sizeof(struct tegra124_car_softc),
tegra124_car_match, tegra124_car_attach, NULL, NULL);
static const struct device_compatible_entry compat_data[] = {
{ .compat = "nvidia,tegra124-car" },
DEVICE_COMPAT_EOL
};
static int
tegra124_car_match(device_t parent, cfdata_t cf, void *aux)
{
const char * const compatible[] = { "nvidia,tegra124-car", NULL };
struct fdt_attach_args * const faa = aux;
#if 0
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
#else
if (of_match_compatible(faa->faa_phandle, compatible) == 0)
return 0;
return 999;
return of_compatible_match(faa->faa_phandle, compat_data) ? 999 : 0;
#endif
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: tegra124_cpu.c,v 1.5 2020/08/25 13:33:43 skrll Exp $ */
/* $NetBSD: tegra124_cpu.c,v 1.6 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <jmcneill@invisible.ca>
@ -30,7 +30,7 @@
#include "opt_multiprocessor.h"
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tegra124_cpu.c,v 1.5 2020/08/25 13:33:43 skrll Exp $");
__KERNEL_RCSID(0, "$NetBSD: tegra124_cpu.c,v 1.6 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -119,16 +119,20 @@ static struct tegra124_speedo {
static struct clk *tegra124_clk_pllx = NULL;
static struct fdtbus_regulator *tegra124_reg_vddcpu = NULL;
static const struct device_compatible_entry compat_data[] = {
{ .compat = "nvidia,tegra124" },
DEVICE_COMPAT_EOL
};
static int
tegra124_cpu_match(device_t parent, cfdata_t cf, void *aux)
{
const char * const compatible[] = { "nvidia,tegra124", NULL };
struct fdt_attach_args *faa = aux;
if (OF_finddevice("/cpus/cpu@0") != faa->faa_phandle)
return 0;
return of_match_compatible(OF_finddevice("/"), compatible);
return of_compatible_match(OF_finddevice("/"), compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: tegra124_xusbpad.c,v 1.4 2019/10/13 06:11:31 skrll Exp $ */
/* $NetBSD: tegra124_xusbpad.c,v 1.5 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <jmcneill@invisible.ca>
@ -29,7 +29,7 @@
#include "opt_tegra.h"
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tegra124_xusbpad.c,v 1.4 2019/10/13 06:11:31 skrll Exp $");
__KERNEL_RCSID(0, "$NetBSD: tegra124_xusbpad.c,v 1.5 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -70,14 +70,17 @@ static void padregdump(void);
CFATTACH_DECL_NEW(tegra124_xusbpad, sizeof(struct tegra124_xusbpad_softc),
tegra124_xusbpad_match, tegra124_xusbpad_attach, NULL, NULL);
static const struct device_compatible_entry compat_data[] = {
{ .compat = "nvidia,tegra124-xusb-padctl" },
DEVICE_COMPAT_EOL
};
static int
tegra124_xusbpad_match(device_t parent, cfdata_t cf, void *aux)
{
const char * const compatible[] =
{ "nvidia,tegra124-xusb-padctl", NULL };
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: tegra210_car.c,v 1.26 2020/04/30 03:40:52 riastradh Exp $ */
/* $NetBSD: tegra210_car.c,v 1.27 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2015-2017 Jared McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tegra210_car.c,v 1.26 2020/04/30 03:40:52 riastradh Exp $");
__KERNEL_RCSID(0, "$NetBSD: tegra210_car.c,v 1.27 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -737,19 +737,20 @@ static void tegra210_car_parent_init(struct tegra210_car_softc *);
CFATTACH_DECL_NEW(tegra210_car, sizeof(struct tegra210_car_softc),
tegra210_car_match, tegra210_car_attach, NULL, NULL);
static const struct device_compatible_entry compat_data[] = {
{ .compat = "nvidia,tegra210-car" },
DEVICE_COMPAT_EOL
};
static int
tegra210_car_match(device_t parent, cfdata_t cf, void *aux)
{
const char * const compatible[] = { "nvidia,tegra210-car", NULL };
struct fdt_attach_args * const faa = aux;
#if 0
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
#else
if (of_match_compatible(faa->faa_phandle, compatible) == 0)
return 0;
return 999;
return of_compatible_match(faa->faa_phandle, compat_data) ? 999 : 0;
#endif
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: tegra210_xusbpad.c,v 1.13 2019/10/13 06:11:31 skrll Exp $ */
/* $NetBSD: tegra210_xusbpad.c,v 1.14 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2017 Jared McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tegra210_xusbpad.c,v 1.13 2019/10/13 06:11:31 skrll Exp $");
__KERNEL_RCSID(0, "$NetBSD: tegra210_xusbpad.c,v 1.14 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -964,16 +964,17 @@ static const struct tegra_xusbpad_ops tegra210_xusbpad_ops = {
.xhci_enable = tegra210_xusbpad_xhci_enable,
};
static const struct device_compatible_entry compat_data[] = {
{ .compat = "nvidia,tegra210-xusb-padctl" },
DEVICE_COMPAT_EOL
};
static int
tegra210_xusbpad_match(device_t parent, cfdata_t cf, void *aux)
{
const char * const compatible[] = {
"nvidia,tegra210-xusb-padctl",
NULL
};
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: tegra_ahcisata.c,v 1.17 2021/01/27 01:58:15 thorpej Exp $ */
/* $NetBSD: tegra_ahcisata.c,v 1.18 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tegra_ahcisata.c,v 1.17 2021/01/27 01:58:15 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: tegra_ahcisata.c,v 1.18 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -120,7 +120,7 @@ tegra_ahcisata_match(device_t parent, cfdata_t cf, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_match_compat_data(faa->faa_phandle, compat_data);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void
@ -169,7 +169,7 @@ tegra_ahcisata_attach(device_t parent, device_t self, void *aux)
return;
}
sc->sc_tad = of_search_compatible(faa->faa_phandle, compat_data)->data;
sc->sc_tad = of_compatible_lookup(faa->faa_phandle, compat_data)->data;
if (sc->sc_tad->tad_type == TEGRA124) {
sc->sc_clk_cml1 = fdtbus_clock_get(phandle, "cml1");
if (sc->sc_clk_cml1 == NULL) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: tegra_apbdma.c,v 1.8 2021/01/15 23:11:59 jmcneill Exp $ */
/* $NetBSD: tegra_apbdma.c,v 1.9 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2017 Jared D. McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tegra_apbdma.c,v 1.8 2021/01/15 23:11:59 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: tegra_apbdma.c,v 1.9 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -91,17 +91,18 @@ CFATTACH_DECL_NEW(tegra_apbdma, sizeof(struct tegra_apbdma_softc),
#define APBDMA_WRITE(sc, reg, val) \
bus_space_write_4((sc)->sc_bst, (sc)->sc_bsh, (reg), (val))
static const struct device_compatible_entry compat_data[] = {
{ .compat = "nvidia,tegra210-apbdma" },
{ .compat = "nvidia,tegra124-apbdma" },
DEVICE_COMPAT_EOL
};
static int
tegra_apbdma_match(device_t parent, cfdata_t cf, void *aux)
{
const char * const compatible[] = {
"nvidia,tegra210-apbdma",
"nvidia,tegra124-apbdma",
NULL
};
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: tegra_cec.c,v 1.7 2021/01/15 23:11:59 jmcneill Exp $ */
/* $NetBSD: tegra_cec.c,v 1.8 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tegra_cec.c,v 1.7 2021/01/15 23:11:59 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: tegra_cec.c,v 1.8 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -111,13 +111,17 @@ CFATTACH_DECL_NEW(tegra_cec, sizeof(struct tegra_cec_softc),
#define CEC_SET_CLEAR(sc, reg, set, clr) \
tegra_reg_set_clear((sc)->sc_bst, (sc)->sc_bsh, (reg), (set), (clr))
static const struct device_compatible_entry compat_data[] = {
{ .compat = "nvidia,tegra124-cec" },
DEVICE_COMPAT_EOL
};
static int
tegra_cec_match(device_t parent, cfdata_t cf, void *aux)
{
const char * const compatible[] = { "nvidia,tegra124-cec", NULL };
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: tegra_com.c,v 1.14 2021/01/15 23:11:59 jmcneill Exp $ */
/* $NetBSD: tegra_com.c,v 1.15 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@ -31,7 +31,7 @@
#include <sys/cdefs.h>
__KERNEL_RCSID(1, "$NetBSD: tegra_com.c,v 1.14 2021/01/15 23:11:59 jmcneill Exp $");
__KERNEL_RCSID(1, "$NetBSD: tegra_com.c,v 1.15 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -51,11 +51,11 @@ __KERNEL_RCSID(1, "$NetBSD: tegra_com.c,v 1.14 2021/01/15 23:11:59 jmcneill Exp
static int tegra_com_match(device_t, cfdata_t, void *);
static void tegra_com_attach(device_t, device_t, void *);
static const char * const compatible[] = {
"nvidia,tegra210-uart",
"nvidia,tegra124-uart",
"nvidia,tegra20-uart",
NULL
static const struct device_compatible_entry compat_data[] = {
{ .compat = "nvidia,tegra210-uart" },
{ .compat = "nvidia,tegra124-uart" },
{ .compat = "nvidia,tegra20-uart" },
DEVICE_COMPAT_EOL
};
struct tegra_com_softc {
@ -74,7 +74,7 @@ tegra_com_match(device_t parent, cfdata_t cf, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void
@ -146,7 +146,7 @@ tegra_com_attach(device_t parent, device_t self, void *aux)
static int
tegra_com_console_match(int phandle)
{
return of_match_compatible(phandle, compatible);
return of_compatible_match(phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: tegra_drm.c,v 1.10 2018/08/27 15:31:51 riastradh Exp $ */
/* $NetBSD: tegra_drm.c,v 1.11 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tegra_drm.c,v 1.10 2018/08/27 15:31:51 riastradh Exp $");
__KERNEL_RCSID(0, "$NetBSD: tegra_drm.c,v 1.11 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -87,15 +87,29 @@ static struct drm_driver tegra_drm_driver = {
CFATTACH_DECL_NEW(tegra_drm, sizeof(struct tegra_drm_softc),
tegra_drm_match, tegra_drm_attach, NULL, NULL);
static const struct device_compatible_entry compat_data[] = {
{ .compat = "nvidia,tegra124-host1x" },
DEVICE_COMPAT_EOL
};
static int
tegra_drm_match(device_t parent, cfdata_t cf, void *aux)
{
const char * compatible[] = { "nvidia,tegra124-host1x", NULL };
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static const struct device_compatible_entry hdmi_compat[] = {
{ .compat = "nvidia,tegra124-hdmi" },
DEVICE_COMPAT_EOL
};
static const struct device_compatible_entry dc_compat[] = {
{ .compat = "nvidia,tegra124-dc" },
DEVICE_COMPAT_EOL
};
static void
tegra_drm_attach(device_t parent, device_t self, void *aux)
{
@ -104,9 +118,7 @@ tegra_drm_attach(device_t parent, device_t self, void *aux)
struct drm_driver * const driver = &tegra_drm_driver;
prop_dictionary_t prop = device_properties(self);
int error, node, hdmi_phandle, ddc_phandle;
const char * const hdmi_compat[] = { "nvidia,tegra124-hdmi", NULL };
const char * const dc_compat[] = { "nvidia,tegra124-dc", NULL };
const char * const hdmi_supplies[] = {
static const char * const hdmi_supplies[] = {
"hdmi-supply", "pll-supply", "vdd-supply"
};
struct fdtbus_regulator *reg;
@ -134,13 +146,13 @@ tegra_drm_attach(device_t parent, device_t self, void *aux)
ndc = 0;
hdmi_phandle = -1;
for (node = OF_child(faa->faa_phandle); node; node = OF_peer(node)) {
if (of_match_compatible(node, hdmi_compat)) {
if (of_compatible_match(node, hdmi_compat)) {
sc->sc_clk_hdmi = fdtbus_clock_get(node, "hdmi");
sc->sc_clk_hdmi_parent = fdtbus_clock_get(node,
"parent");
sc->sc_rst_hdmi = fdtbus_reset_get(node, "hdmi");
hdmi_phandle = node;
} else if (of_match_compatible(node, dc_compat) &&
} else if (of_compatible_match(node, dc_compat) &&
ndc < __arraycount(sc->sc_clk_dc)) {
sc->sc_clk_dc[ndc] = fdtbus_clock_get(node, "dc");
sc->sc_clk_dc_parent[ndc] = fdtbus_clock_get(node,

View File

@ -1,4 +1,4 @@
/* $NetBSD: tegra_ehci.c,v 1.17 2021/01/15 23:11:59 jmcneill Exp $ */
/* $NetBSD: tegra_ehci.c,v 1.18 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tegra_ehci.c,v 1.17 2021/01/15 23:11:59 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: tegra_ehci.c,v 1.18 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -70,18 +70,19 @@ CFATTACH_DECL2_NEW(tegra_ehci, sizeof(struct tegra_ehci_softc),
tegra_ehci_match, tegra_ehci_attach, NULL,
ehci_activate, NULL, ehci_childdet);
static const struct device_compatible_entry compat_data[] = {
{ .compat = "nvidia,tegra210-ehci" },
{ .compat = "nvidia,tegra124-ehci" },
{ .compat = "nvidia,tegra30-ehci" },
DEVICE_COMPAT_EOL
};
static int
tegra_ehci_match(device_t parent, cfdata_t cf, void *aux)
{
const char * const compatible[] = {
"nvidia,tegra210-ehci",
"nvidia,tegra124-ehci",
"nvidia,tegra30-ehci",
NULL
};
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: tegra_fuse.c,v 1.8 2019/10/13 06:11:31 skrll Exp $ */
/* $NetBSD: tegra_fuse.c,v 1.9 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tegra_fuse.c,v 1.8 2019/10/13 06:11:31 skrll Exp $");
__KERNEL_RCSID(0, "$NetBSD: tegra_fuse.c,v 1.9 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -58,17 +58,18 @@ static struct tegra_fuse_softc *fuse_softc = NULL;
CFATTACH_DECL_NEW(tegra_fuse, sizeof(struct tegra_fuse_softc),
tegra_fuse_match, tegra_fuse_attach, NULL, NULL);
static const struct device_compatible_entry compat_data[] = {
{ .compat = "nvidia,tegra210-efuse" },
{ .compat = "nvidia,tegra124-efuse" },
DEVICE_COMPAT_EOL
};
static int
tegra_fuse_match(device_t parent, cfdata_t cf, void *aux)
{
const char * const compatible[] = {
"nvidia,tegra210-efuse",
"nvidia,tegra124-efuse",
NULL
};
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: tegra_gpio.c,v 1.11 2019/10/13 06:11:31 skrll Exp $ */
/* $NetBSD: tegra_gpio.c,v 1.12 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tegra_gpio.c,v 1.11 2019/10/13 06:11:31 skrll Exp $");
__KERNEL_RCSID(0, "$NetBSD: tegra_gpio.c,v 1.12 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -145,18 +145,19 @@ CFATTACH_DECL_NEW(tegra_gpio, sizeof(struct tegra_gpio_softc),
(bank)->bank_sc->sc_bsh, \
(bank)->bank_pb->base + (reg))
static const struct device_compatible_entry compat_data[] = {
{ .compat = "nvidia,tegra210-gpio" },
{ .compat = "nvidia,tegra124-gpio" },
{ .compat = "nvidia,tegra30-gpio" },
DEVICE_COMPAT_EOL
};
static int
tegra_gpio_match(device_t parent, cfdata_t cf, void *aux)
{
const char * const compatible[] = {
"nvidia,tegra210-gpio",
"nvidia,tegra124-gpio",
"nvidia,tegra30-gpio",
NULL
};
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: tegra_hdaudio.c,v 1.14 2021/01/15 23:11:59 jmcneill Exp $ */
/* $NetBSD: tegra_hdaudio.c,v 1.15 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tegra_hdaudio.c,v 1.14 2021/01/15 23:11:59 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: tegra_hdaudio.c,v 1.15 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -82,17 +82,18 @@ CFATTACH_DECL2_NEW(tegra_hdaudio, sizeof(struct tegra_hdaudio_softc),
tegra_hdaudio_match, tegra_hdaudio_attach, tegra_hdaudio_detach, NULL,
tegra_hdaudio_rescan, tegra_hdaudio_childdet);
static const struct device_compatible_entry compat_data[] = {
{ .compat = "nvidia,tegra210-hda" },
{ .compat = "nvidia,tegra124-hda" },
DEVICE_COMPAT_EOL
};
static int
tegra_hdaudio_match(device_t parent, cfdata_t cf, void *aux)
{
const char * const compatible[] = {
"nvidia,tegra210-hda",
"nvidia,tegra124-hda",
NULL
};
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: tegra_i2c.c,v 1.25 2021/01/15 23:11:59 jmcneill Exp $ */
/* $NetBSD: tegra_i2c.c,v 1.26 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tegra_i2c.c,v 1.25 2021/01/15 23:11:59 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: tegra_i2c.c,v 1.26 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -83,18 +83,19 @@ CFATTACH_DECL_NEW(tegra_i2c, sizeof(struct tegra_i2c_softc),
#define I2C_SET_CLEAR(sc, reg, setval, clrval) \
tegra_reg_set_clear((sc)->sc_bst, (sc)->sc_bsh, (reg), (setval), (clrval))
static const struct device_compatible_entry compat_data[] = {
{ .compat = "nvidia,tegra210-i2c" },
{ .compat = "nvidia,tegra124-i2c" },
{ .compat = "nvidia,tegra114-i2c" },
DEVICE_COMPAT_EOL
};
static int
tegra_i2c_match(device_t parent, cfdata_t cf, void *aux)
{
const char * const compatible[] = {
"nvidia,tegra210-i2c",
"nvidia,tegra124-i2c",
"nvidia,tegra114-i2c",
NULL
};
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: tegra_lic.c,v 1.7 2021/01/15 00:38:22 jmcneill Exp $ */
/* $NetBSD: tegra_lic.c,v 1.8 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tegra_lic.c,v 1.7 2021/01/15 00:38:22 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: tegra_lic.c,v 1.8 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -69,17 +69,18 @@ struct tegra_lic_softc {
CFATTACH_DECL_NEW(tegra_lic, sizeof(struct tegra_lic_softc),
tegra_lic_match, tegra_lic_attach, NULL, NULL);
static const struct device_compatible_entry compat_data[] = {
{ .compat = "nvidia,tegra210-ictlr" },
{ .compat = "nvidia,tegra124-ictlr" },
DEVICE_COMPAT_EOL
};
static int
tegra_lic_match(device_t parent, cfdata_t cf, void *aux)
{
const char * const compatible[] = {
"nvidia,tegra210-ictlr",
"nvidia,tegra124-ictlr",
NULL
};
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: tegra_mc.c,v 1.11 2021/01/15 23:11:59 jmcneill Exp $ */
/* $NetBSD: tegra_mc.c,v 1.12 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <jmcneill@invisible.ca>
@ -29,7 +29,7 @@
#include "locators.h"
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tegra_mc.c,v 1.11 2021/01/15 23:11:59 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: tegra_mc.c,v 1.12 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -68,13 +68,17 @@ CFATTACH_DECL_NEW(tegra_mc, sizeof(struct tegra_mc_softc),
#define MC_SET_CLEAR(sc, reg, set, clr) \
tegra_reg_set_clear((sc)->sc_bst, (sc)->sc_bsh, (reg), (set), (clr))
static const struct device_compatible_entry compat_data[] = {
{ .compat = "nvidia,tegra124-mc" },
DEVICE_COMPAT_EOL
};
static int
tegra_mc_match(device_t parent, cfdata_t cf, void *aux)
{
const char * const compatible[] = { "nvidia,tegra124-mc", NULL };
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: tegra_nouveau.c,v 1.15 2021/01/25 14:20:38 thorpej Exp $ */
/* $NetBSD: tegra_nouveau.c,v 1.16 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tegra_nouveau.c,v 1.15 2021/01/25 14:20:38 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: tegra_nouveau.c,v 1.16 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -113,7 +113,7 @@ static const struct nvkm_device_tegra_func gk20a_platform_data = {
static const struct device_compatible_entry compat_data[] = {
{ .compat = "nvidia,gk20a", .data = &gk20a_platform_data },
{ .compat = "nvidia,gm20b", .data = &gk20a_platform_data },
{ }
DEVICE_COMPAT_EOL
};
static int
@ -121,7 +121,7 @@ tegra_nouveau_match(device_t parent, cfdata_t cf, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_match_compat_data(faa->faa_phandle, compat_data);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void
@ -131,7 +131,7 @@ tegra_nouveau_attach(device_t parent, device_t self, void *aux)
struct fdt_attach_args * const faa = aux;
prop_dictionary_t prop = device_properties(self);
const struct device_compatible_entry *data =
of_search_compatible(faa->faa_phandle, compat_data);
of_compatible_lookup(faa->faa_phandle, compat_data);
const struct nvkm_device_tegra_func *tegra_func __diagused = data->data;
int error;

View File

@ -1,4 +1,4 @@
/* $NetBSD: tegra_pcie.c,v 1.35 2021/01/27 01:58:15 thorpej Exp $ */
/* $NetBSD: tegra_pcie.c,v 1.36 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tegra_pcie.c,v 1.35 2021/01/27 01:58:15 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: tegra_pcie.c,v 1.36 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
@ -147,7 +147,7 @@ tegra_pcie_match(device_t parent, cfdata_t cf, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_match_compat_data(faa->faa_phandle, compat_data);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void
@ -204,7 +204,7 @@ tegra_pcie_attach(device_t parent, device_t self, void *aux)
return;
}
dce = of_search_compatible(faa->faa_phandle, compat_data);
dce = of_compatible_lookup(faa->faa_phandle, compat_data);
KASSERT(dce != NULL);
sc->sc_type = dce->value;

View File

@ -1,4 +1,4 @@
/* $NetBSD: tegra_pinmux.c,v 1.8 2021/01/25 14:20:38 thorpej Exp $ */
/* $NetBSD: tegra_pinmux.c,v 1.9 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2015-2017 Jared McNeill <jmcneill@invisible.ca>
@ -29,7 +29,7 @@
#include "opt_tegra.h"
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tegra_pinmux.c,v 1.8 2021/01/25 14:20:38 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: tegra_pinmux.c,v 1.9 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/types.h>
@ -79,7 +79,7 @@ static const struct device_compatible_entry compat_data[] = {
#ifdef SOC_TEGRA210
{ .compat = "nvidia,tegra210-pinmux", .data = &tegra210_pinmux_conf },
#endif
{ }
DEVICE_COMPAT_EOL
};
static const struct tegra_pinmux_pins *
@ -249,7 +249,7 @@ tegra_pinmux_match(device_t parent, cfdata_t cf, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_match_compat_data(faa->faa_phandle, compat_data);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void
@ -277,7 +277,7 @@ tegra_pinmux_attach(device_t parent, device_t self, void *aux)
return;
}
}
sc->sc_conf = of_search_compatible(phandle, compat_data)->data;
sc->sc_conf = of_compatible_lookup(phandle, compat_data)->data;
aprint_naive("\n");
aprint_normal(": Pinmux\n");

View File

@ -1,4 +1,4 @@
/* $NetBSD: tegra_platform.c,v 1.24 2020/09/28 11:54:23 jmcneill Exp $ */
/* $NetBSD: tegra_platform.c,v 1.25 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2017 Jared D. McNeill <jmcneill@invisible.ca>
@ -34,7 +34,7 @@
#include "ukbd.h"
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tegra_platform.c,v 1.24 2020/09/28 11:54:23 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: tegra_platform.c,v 1.25 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -182,11 +182,12 @@ tegra_platform_device_register(device_t self, void *aux)
}
if (device_is_a(self, "tegrapcie")) {
const char * const jetsontk1_compat[] = {
"nvidia,jetson-tk1", NULL
static const struct device_compatible_entry jetsontk1[] = {
{ .compat = "nvidia,jetson-tk1" },
DEVICE_COMPAT_EOL
};
const int phandle = OF_peer(0);
if (of_match_compatible(phandle, jetsontk1_compat)) {
if (of_compatible_match(phandle, jetsontk1)) {
/* rfkill GPIO at GPIO X7 */
struct tegra_gpio_pin *pin =
tegra_gpio_acquire("X7", GPIO_PIN_OUTPUT);

View File

@ -1,4 +1,4 @@
/* $NetBSD: tegra_pmc.c,v 1.15 2019/10/13 06:11:31 skrll Exp $ */
/* $NetBSD: tegra_pmc.c,v 1.16 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tegra_pmc.c,v 1.15 2019/10/13 06:11:31 skrll Exp $");
__KERNEL_RCSID(0, "$NetBSD: tegra_pmc.c,v 1.16 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -56,17 +56,18 @@ static struct tegra_pmc_softc *pmc_softc = NULL;
CFATTACH_DECL_NEW(tegra_pmc, sizeof(struct tegra_pmc_softc),
tegra_pmc_match, tegra_pmc_attach, NULL, NULL);
static const struct device_compatible_entry compat_data[] = {
{ .compat = "nvidia,tegra210-pmc" },
{ .compat = "nvidia,tegra124-pmc" },
DEVICE_COMPAT_EOL
};
static int
tegra_pmc_match(device_t parent, cfdata_t cf, void *aux)
{
const char * const compatible[] = {
"nvidia,tegra210-pmc",
"nvidia,tegra124-pmc",
NULL
};
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: tegra_rtc.c,v 1.7 2019/10/13 06:11:31 skrll Exp $ */
/* $NetBSD: tegra_rtc.c,v 1.8 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tegra_rtc.c,v 1.7 2019/10/13 06:11:31 skrll Exp $");
__KERNEL_RCSID(0, "$NetBSD: tegra_rtc.c,v 1.8 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -67,18 +67,19 @@ CFATTACH_DECL_NEW(tegra_rtc, sizeof(struct tegra_rtc_softc),
#define RTC_WRITE(sc, reg, val) \
bus_space_write_4((sc)->sc_bst, (sc)->sc_bsh, (reg), (val))
static const struct device_compatible_entry compat_data[] = {
{ .compat = "nvidia,tegra210-rtc" },
{ .compat = "nvidia,tegra124-rtc" },
{ .compat = "nvidia,tegra20-rtc" },
DEVICE_COMPAT_EOL
};
static int
tegra_rtc_match(device_t parent, cfdata_t cf, void *aux)
{
const char * const compatible[] = {
"nvidia,tegra210-rtc",
"nvidia,tegra124-rtc",
"nvidia,tegra20-rtc",
NULL
};
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: tegra_sdhc.c,v 1.28 2021/01/15 23:11:59 jmcneill Exp $ */
/* $NetBSD: tegra_sdhc.c,v 1.29 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <jmcneill@invisible.ca>
@ -31,7 +31,7 @@
#include "locators.h"
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tegra_sdhc.c,v 1.28 2021/01/15 23:11:59 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: tegra_sdhc.c,v 1.29 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -78,17 +78,18 @@ struct tegra_sdhc_softc {
CFATTACH_DECL_NEW(tegra_sdhc, sizeof(struct tegra_sdhc_softc),
tegra_sdhc_match, tegra_sdhc_attach, NULL, NULL);
static const struct device_compatible_entry compat_data[] = {
{ .compat = "nvidia,tegra210-sdhci" },
{ .compat = "nvidia,tegra124-sdhci" },
DEVICE_COMPAT_EOL
};
static int
tegra_sdhc_match(device_t parent, cfdata_t cf, void *aux)
{
const char * const compatible[] = {
"nvidia,tegra210-sdhci",
"nvidia,tegra124-sdhci",
NULL
};
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: tegra_soctherm.c,v 1.12 2021/01/27 01:58:15 thorpej Exp $ */
/* $NetBSD: tegra_soctherm.c,v 1.13 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tegra_soctherm.c,v 1.12 2021/01/27 01:58:15 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: tegra_soctherm.c,v 1.13 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -171,7 +171,7 @@ tegra_soctherm_match(device_t parent, cfdata_t cf, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_match_compat_data(faa->faa_phandle, compat_data);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void
@ -215,7 +215,7 @@ tegra_soctherm_attach(device_t parent, device_t self, void *aux)
aprint_naive("\n");
aprint_normal(": SOC_THERM\n");
sc->sc_config = of_search_compatible(phandle, compat_data)->data;
sc->sc_config = of_compatible_lookup(phandle, compat_data)->data;
if (sc->sc_config == NULL) {
aprint_error_dev(self, "unsupported SoC\n");
return;

View File

@ -1,4 +1,4 @@
/* $NetBSD: tegra_timer.c,v 1.11 2019/10/13 06:11:31 skrll Exp $ */
/* $NetBSD: tegra_timer.c,v 1.12 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tegra_timer.c,v 1.11 2019/10/13 06:11:31 skrll Exp $");
__KERNEL_RCSID(0, "$NetBSD: tegra_timer.c,v 1.12 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -71,18 +71,19 @@ CFATTACH_DECL_NEW(tegra_timer, sizeof(struct tegra_timer_softc),
#define TIMER_SET_CLEAR(sc, reg, set, clr) \
tegra_reg_set_clear((sc)->sc_bst, (sc)->sc_bsh, (reg), (set), (clr))
static const struct device_compatible_entry compat_data[] = {
{ .compat = "nvidia,tegra210-timer" },
{ .compat = "nvidia,tegra124-timer" },
{ .compat = "nvidia,tegra20-timer" },
DEVICE_COMPAT_EOL
};
static int
tegra_timer_match(device_t parent, cfdata_t cf, void *aux)
{
const char * const compatible[] = {
"nvidia,tegra210-timer",
"nvidia,tegra124-timer",
"nvidia,tegra20-timer",
NULL
};
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: tegra_usbphy.c,v 1.10 2019/10/13 06:11:31 skrll Exp $ */
/* $NetBSD: tegra_usbphy.c,v 1.11 2021/01/27 03:10:19 thorpej Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tegra_usbphy.c,v 1.10 2019/10/13 06:11:31 skrll Exp $");
__KERNEL_RCSID(0, "$NetBSD: tegra_usbphy.c,v 1.11 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -76,18 +76,19 @@ static void tegra_usbphy_utmip_init(struct tegra_usbphy_softc *);
CFATTACH_DECL_NEW(tegra_usbphy, sizeof(struct tegra_usbphy_softc),
tegra_usbphy_match, tegra_usbphy_attach, NULL, NULL);
static const struct device_compatible_entry compat_data[] = {
{ .compat = "nvidia,tegra210-usb-phy" },
{ .compat = "nvidia,tegra124-usb-phy" },
{ .compat = "nvidia,tegra30-usb-phy" },
DEVICE_COMPAT_EOL
};
static int
tegra_usbphy_match(device_t parent, cfdata_t cf, void *aux)
{
const char * const compatible[] = {
"nvidia,tegra210-usb-phy",
"nvidia,tegra124-usb-phy",
"nvidia,tegra30-usb-phy",
NULL
};
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: tegra_xusb.c,v 1.25 2021/01/27 01:58:15 thorpej Exp $ */
/* $NetBSD: tegra_xusb.c,v 1.26 2021/01/27 03:10:19 thorpej Exp $ */
/*
* Copyright (c) 2016 Jonathan A. Kollasch
@ -30,7 +30,7 @@
#include "opt_tegra.h"
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tegra_xusb.c,v 1.25 2021/01/27 01:58:15 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: tegra_xusb.c,v 1.26 2021/01/27 03:10:19 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -193,7 +193,7 @@ tegra_xusb_match(device_t parent, cfdata_t cf, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_match_compat_data(faa->faa_phandle, compat_data);
return of_compatible_match(faa->faa_phandle, compat_data);
}
#define tegra_xusb_attach_check(sc, cond, fmt, ...) \
@ -230,7 +230,7 @@ tegra_xusb_attach(device_t parent, device_t self, void *aux)
sc->sc_quirks = XHCI_DEFERRED_START;
psc->sc_phandle = faa->faa_phandle;
psc->sc_txd = of_search_compatible(faa->faa_phandle, compat_data)->data;
psc->sc_txd = of_compatible_lookup(faa->faa_phandle, compat_data)->data;
if (fdtbus_get_reg_byname(faa->faa_phandle, "hcd", &addr, &size) != 0) {
aprint_error(": couldn't get registers\n");

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_enet_imx.c,v 1.5 2021/01/27 02:14:49 thorpej Exp $ */
/* $NetBSD: if_enet_imx.c,v 1.6 2021/01/27 03:10:20 thorpej Exp $ */
/*-
* Copyright (c) 2019 Genetec Corporation. All rights reserved.
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_enet_imx.c,v 1.5 2021/01/27 02:14:49 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_enet_imx.c,v 1.6 2021/01/27 03:10:20 thorpej Exp $");
#include "opt_fdt.h"
@ -66,7 +66,7 @@ enet_match(device_t parent, cfdata_t cf, void *aux)
{
struct fdt_attach_args * const faa = aux;
return of_match_compat_data(faa->faa_phandle, compat_data);
return of_compatible_match(faa->faa_phandle, compat_data);
}
void
@ -127,7 +127,7 @@ enet_attach(device_t parent, device_t self, void *aux)
sc->sc_ioh = bsh;
sc->sc_dmat = faa->faa_dmat;
sc->sc_imxtype = of_search_compatible(phandle, compat_data)->value;
sc->sc_imxtype = of_compatible_lookup(phandle, compat_data)->value;
sc->sc_unit = 0;
sc->sc_phyid = enet_phy_id(sc, phandle);

View File

@ -1,4 +1,4 @@
/* $NetBSD: imx6_clk.c,v 1.1 2020/12/23 14:42:38 skrll Exp $ */
/* $NetBSD: imx6_clk.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $ */
/*-
* Copyright (c) 2019 Genetec Corporation. All rights reserved.
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: imx6_clk.c,v 1.1 2020/12/23 14:42:38 skrll Exp $");
__KERNEL_RCSID(0, "$NetBSD: imx6_clk.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $");
#include "opt_fdt.h"
@ -91,13 +91,17 @@ static void imx6ccm_attach(device_t, device_t, void *);
CFATTACH_DECL_NEW(imx6ccm, sizeof(struct imx6ccm_softc),
imx6ccm_match, imx6ccm_attach, NULL, NULL);
static const struct device_compatible_entry compat_data[] = {
{ .compat = "fsl,imx6q-ccm" },
DEVICE_COMPAT_EOL
};
static int
imx6ccm_match(device_t parent, cfdata_t cfdata, void *aux)
{
const char * const compatible[] = { "fsl,imx6q-ccm", NULL };
struct fdt_attach_args * const faa = aux;
return of_match_compatible(faa->faa_phandle, compatible);
return of_compatible_match(faa->faa_phandle, compat_data);
}
static void

Some files were not shown because too many files have changed in this diff Show More