Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/macppc/dev attach to iic, use direct config
details: https://anonhg.NetBSD.org/src/rev/b4b8c11dbfd1
branches: trunk
changeset: 356381:b4b8c11dbfd1
user: macallan <macallan%NetBSD.org@localhost>
date: Fri Sep 22 03:10:46 2017 +0000
description:
attach to iic, use direct config
diffstat:
sys/arch/macppc/dev/deq.c | 41 +++++++++++++++++++++++------------------
1 files changed, 23 insertions(+), 18 deletions(-)
diffs (82 lines):
diff -r 51120996b6d0 -r b4b8c11dbfd1 sys/arch/macppc/dev/deq.c
--- a/sys/arch/macppc/dev/deq.c Fri Sep 22 03:09:51 2017 +0000
+++ b/sys/arch/macppc/dev/deq.c Fri Sep 22 03:10:46 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: deq.c,v 1.9 2017/09/15 21:31:25 macallan Exp $ */
+/* $NetBSD: deq.c,v 1.10 2017/09/22 03:10:46 macallan Exp $ */
/*-
* Copyright (C) 2005 Michael Lorenz
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: deq.c,v 1.9 2017/09/15 21:31:25 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: deq.c,v 1.10 2017/09/22 03:10:46 macallan Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -44,7 +44,6 @@
#include <dev/i2c/i2cvar.h>
#include <machine/autoconf.h>
-#include <macppc/dev/ki2cvar.h>
#include <macppc/dev/deqvar.h>
static void deq_attach(device_t, device_t, void *);
@@ -53,19 +52,27 @@
CFATTACH_DECL_NEW(deq, sizeof(struct deq_softc),
deq_match, deq_attach, NULL, NULL);
+static const char * deq_compats[] = {
+ "deq",
+ "tas3004",
+ "pcm3052",
+ "cs8416",
+ "codec",
+ NULL
+};
+
int
deq_match(device_t parent, struct cfdata *cf, void *aux)
{
- struct ki2c_confargs *ka = aux;
- char buf[32];
+ struct i2c_attach_args *ia = aux;
- if (strcmp(ka->ka_name, "deq") == 0) {
- if (OF_getprop(ka->ka_node, "i2c-address", buf, sizeof(buf)))
+ if (ia->ia_name) {
+ if (ia->ia_ncompat > 0) {
+ if (iic_compat_match(ia, deq_compats))
+ return 1;
+ }
+ if (strcmp(ia->ia_name, "deq") == 0)
return 1;
- } else if (strcmp(ka->ka_name, "codec") == 0) {
- if (OF_getprop(ka->ka_node, "compatible", buf, sizeof(buf)))
- if (strcmp(buf, "tas3004") == 0)
- return 1;
}
return 0;
}
@@ -74,14 +81,12 @@
deq_attach(device_t parent, device_t self, void *aux)
{
struct deq_softc *sc = device_private(self);
- struct ki2c_confargs *ka = aux;
- int node;
+ struct i2c_attach_args *ia = aux;
sc->sc_dev = self;
- node = ka->ka_node;
- sc->sc_node = node;
+ sc->sc_node = ia->ia_cookie;
sc->sc_parent = parent;
- sc->sc_address = (ka->ka_addr & 0x7f);
- sc->sc_i2c = ka->ka_tag;
- aprint_normal(" Apple Digital Equalizer, addr 0x%x\n", sc->sc_address);
+ sc->sc_address = (ia->ia_addr & 0x7f);
+ sc->sc_i2c = ia->ia_tag;
+ aprint_normal(" Apple Digital Equalizer\n");
}
Home |
Main Index |
Thread Index |
Old Index