Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/spi Provide a spi_compatible_lookup() function to go...
details: https://anonhg.NetBSD.org/src/rev/0764b144ce1d
branches: trunk
changeset: 359734:0764b144ce1d
user: thorpej <thorpej%NetBSD.org@localhost>
date: Wed Jan 19 13:33:11 2022 +0000
description:
Provide a spi_compatible_lookup() function to go along with
spi_compatible_match().
diffstat:
sys/dev/spi/spi.c | 12 ++++++++++--
sys/dev/spi/spivar.h | 5 ++++-
2 files changed, 14 insertions(+), 3 deletions(-)
diffs (52 lines):
diff -r 9225f78cac11 -r 0764b144ce1d sys/dev/spi/spi.c
--- a/sys/dev/spi/spi.c Wed Jan 19 12:58:06 2022 +0000
+++ b/sys/dev/spi/spi.c Wed Jan 19 13:33:11 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: spi.c,v 1.22 2022/01/19 12:58:06 thorpej Exp $ */
+/* $NetBSD: spi.c,v 1.23 2022/01/19 13:33:11 thorpej Exp $ */
/*-
* Copyright (c) 2006 Urbana-Champaign Independent Media Center.
@@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: spi.c,v 1.22 2022/01/19 12:58:06 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spi.c,v 1.23 2022/01/19 13:33:11 thorpej Exp $");
#include "locators.h"
@@ -272,6 +272,14 @@
return 1;
}
+const struct device_compatible_entry *
+spi_compatible_lookup(const struct spi_attach_args *sa,
+ const struct device_compatible_entry *compats)
+{
+ return device_compatible_lookup(sa->sa_compat, sa->sa_ncompat,
+ compats);
+}
+
/*
* API for device drivers.
*
diff -r 9225f78cac11 -r 0764b144ce1d sys/dev/spi/spivar.h
--- a/sys/dev/spi/spivar.h Wed Jan 19 12:58:06 2022 +0000
+++ b/sys/dev/spi/spivar.h Wed Jan 19 13:33:11 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: spivar.h,v 1.11 2022/01/19 05:21:44 thorpej Exp $ */
+/* $NetBSD: spivar.h,v 1.12 2022/01/19 13:33:11 thorpej Exp $ */
/*-
* Copyright (c) 2006 Urbana-Champaign Independent Media Center.
@@ -142,6 +142,9 @@
int spi_compatible_match(const struct spi_attach_args *, const cfdata_t,
const struct device_compatible_entry *);
+const struct device_compatible_entry *
+ spi_compatible_lookup(const struct spi_attach_args *,
+ const struct device_compatible_entry *);
int spi_configure(device_t, struct spi_handle *, int, int);
int spi_transfer(struct spi_handle *, struct spi_transfer *);
void spi_transfer_init(struct spi_transfer *);
Home |
Main Index |
Thread Index |
Old Index