Module Name: src Committed By: macallan Date: Fri Sep 22 04:00:58 UTC 2017
Modified Files: src/sys/arch/macppc/dev: cuda.c Log Message: direct configure i2c devices To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/sys/arch/macppc/dev/cuda.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/macppc/dev/cuda.c diff -u src/sys/arch/macppc/dev/cuda.c:1.21 src/sys/arch/macppc/dev/cuda.c:1.22 --- src/sys/arch/macppc/dev/cuda.c:1.21 Sun Feb 14 19:54:20 2016 +++ src/sys/arch/macppc/dev/cuda.c Fri Sep 22 04:00:58 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: cuda.c,v 1.21 2016/02/14 19:54:20 chs Exp $ */ +/* $NetBSD: cuda.c,v 1.22 2017/09/22 04:00:58 macallan Exp $ */ /*- * Copyright (c) 2006 Michael Lorenz @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: cuda.c,v 1.21 2016/02/14 19:54:20 chs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cuda.c,v 1.22 2017/09/22 04:00:58 macallan Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -175,6 +175,9 @@ cuda_attach(device_t parent, device_t se struct cuda_softc *sc = device_private(self); struct i2cbus_attach_args iba; static struct cuda_attach_args caa; + prop_dictionary_t dict = device_properties(self); + prop_dictionary_t dev; + prop_array_t cfg; int irq = ca->ca_intr[0]; int node, i, child; char name[32]; @@ -250,6 +253,30 @@ cuda_attach(device_t parent, device_t se #if notyet config_found(self, &caa, cuda_print); #endif + cfg = prop_array_create(); + prop_dictionary_set(dict, "i2c-child-devices", cfg); + prop_object_release(cfg); + + /* we don't have OF nodes for i2c devices so we have to make our own */ + + node = OF_finddevice("/valkyrie"); + if (node != -1) { + dev = prop_dictionary_create(); + prop_dictionary_set_cstring(dev, "name", "videopll"); + prop_dictionary_set_uint32(dev, "addr", 0x50); + prop_array_add(cfg, dev); + prop_object_release(dev); + } + + node = OF_finddevice("/perch"); + if (node != -1) { + dev = prop_dictionary_create(); + prop_dictionary_set_cstring(dev, "name", "sgsmix"); + prop_dictionary_set_uint32(dev, "addr", 0x8a); + prop_array_add(cfg, dev); + prop_object_release(dev); + } + mutex_init(&sc->sc_buslock, MUTEX_DEFAULT, IPL_NONE); memset(&iba, 0, sizeof(iba)); iba.iba_tag = &sc->sc_i2c;