Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/ofw add an addr_shift parameter to of_enter_i2c_devs
details: https://anonhg.NetBSD.org/src/rev/605445f2e3f8
branches: trunk
changeset: 342220:605445f2e3f8
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Sun Dec 13 11:51:13 2015 +0000
description:
add an addr_shift parameter to of_enter_i2c_devs
diffstat:
sys/dev/ofw/ofw_subr.c | 9 +++++----
sys/dev/ofw/openfirm.h | 4 ++--
2 files changed, 7 insertions(+), 6 deletions(-)
diffs (54 lines):
diff -r 9f4f68b32cae -r 605445f2e3f8 sys/dev/ofw/ofw_subr.c
--- a/sys/dev/ofw/ofw_subr.c Sun Dec 13 11:00:01 2015 +0000
+++ b/sys/dev/ofw/ofw_subr.c Sun Dec 13 11:51:13 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ofw_subr.c,v 1.25 2015/12/13 11:00:01 jmcneill Exp $ */
+/* $NetBSD: ofw_subr.c,v 1.26 2015/12/13 11:51:13 jmcneill Exp $ */
/*
* Copyright 1998
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ofw_subr.c,v 1.25 2015/12/13 11:00:01 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofw_subr.c,v 1.26 2015/12/13 11:51:13 jmcneill Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -377,7 +377,8 @@
* This is used by the i2c bus attach code to do direct configuration.
*/
void
-of_enter_i2c_devs(prop_dictionary_t props, int ofnode, size_t cell_size)
+of_enter_i2c_devs(prop_dictionary_t props, int ofnode, size_t cell_size,
+ int addr_shift)
{
int node, len;
char name[32], compatible[32];
@@ -412,7 +413,7 @@
} else {
continue;
}
- addr >>= 1;
+ addr >>= addr_shift;
if (addr == 0) continue;
if (array == NULL)
diff -r 9f4f68b32cae -r 605445f2e3f8 sys/dev/ofw/openfirm.h
--- a/sys/dev/ofw/openfirm.h Sun Dec 13 11:00:01 2015 +0000
+++ b/sys/dev/ofw/openfirm.h Sun Dec 13 11:51:13 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: openfirm.h,v 1.31 2015/12/12 22:22:51 jmcneill Exp $ */
+/* $NetBSD: openfirm.h,v 1.32 2015/12/13 11:51:13 jmcneill Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -118,6 +118,6 @@
int *of_network_decode_media(int, int *, int *);
char *of_get_mode_string(char *, int);
-void of_enter_i2c_devs(prop_dictionary_t, int, size_t);
+void of_enter_i2c_devs(prop_dictionary_t, int, size_t, int);
#endif /*_OPENFIRM_H_*/
Home |
Main Index |
Thread Index |
Old Index