summaryrefslogtreecommitdiff
path: root/sys/dev/ofw
diff options
context:
space:
mode:
authorjmcneill <jmcneill@NetBSD.org>2015-12-13 11:51:13 +0000
committerjmcneill <jmcneill@NetBSD.org>2015-12-13 11:51:13 +0000
commit1c8aaf83bdfb1b3eec82fca5317c42f607db8d6c (patch)
tree5434209c213918f1bf61cdb42fc586bda766d28f /sys/dev/ofw
parent5794fbddb9a1f17eb0cced86a9385693fd822bc3 (diff)
add an addr_shift parameter to of_enter_i2c_devs
Diffstat (limited to 'sys/dev/ofw')
-rw-r--r--sys/dev/ofw/ofw_subr.c9
-rw-r--r--sys/dev/ofw/openfirm.h4
2 files changed, 7 insertions, 6 deletions
diff --git a/sys/dev/ofw/ofw_subr.c b/sys/dev/ofw/ofw_subr.c
index a94d59eae82..7585862f099 100644
--- a/sys/dev/ofw/ofw_subr.c
+++ b/sys/dev/ofw/ofw_subr.c
@@ -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 @@ of_get_mode_string(char *buffer, int len)
* 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 @@ of_enter_i2c_devs(prop_dictionary_t props, int ofnode, size_t cell_size)
} else {
continue;
}
- addr >>= 1;
+ addr >>= addr_shift;
if (addr == 0) continue;
if (array == NULL)
diff --git a/sys/dev/ofw/openfirm.h b/sys/dev/ofw/openfirm.h
index b134b861170..797136f2111 100644
--- a/sys/dev/ofw/openfirm.h
+++ b/sys/dev/ofw/openfirm.h
@@ -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 @@ boolean_t of_to_dataprop(prop_dictionary_t, int, const char *,
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_*/