Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/i2c add module support
details: https://anonhg.NetBSD.org/src/rev/920ba55f265a
branches: trunk
changeset: 767298:920ba55f265a
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Thu Jul 14 23:44:34 2011 +0000
description:
add module support
diffstat:
sys/dev/i2c/nxt2k.c | 17 ++++++++++++++---
1 files changed, 14 insertions(+), 3 deletions(-)
diffs (49 lines):
diff -r e0f719c00bdb -r 920ba55f265a sys/dev/i2c/nxt2k.c
--- a/sys/dev/i2c/nxt2k.c Thu Jul 14 23:43:37 2011 +0000
+++ b/sys/dev/i2c/nxt2k.c Thu Jul 14 23:44:34 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nxt2k.c,v 1.1 2011/07/11 00:30:23 jakllsch Exp $ */
+/* $NetBSD: nxt2k.c,v 1.2 2011/07/14 23:44:34 jmcneill Exp $ */
/*
* Copyright (c) 2008, 2011 Jonathan A. Kollasch
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nxt2k.c,v 1.1 2011/07/11 00:30:23 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nxt2k.c,v 1.2 2011/07/14 23:44:34 jmcneill Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -36,6 +36,7 @@
#include <sys/kmem.h>
#include <sys/condvar.h>
#include <sys/mutex.h>
+#include <sys/module.h>
#include <dev/firmload.h>
@@ -137,7 +138,7 @@
nxt2k_readreg(struct nxt2k *nxt, uint8_t reg, uint8_t *data, size_t len)
{
uint8_t buf, len2, attr;
- int i;
+ unsigned int i;
nxt2k_writedata(nxt, 0x35, ®, 1);
@@ -828,3 +829,13 @@
{
return nxt2k_fe_set_frontend(nxt, modulation);
}
+
+MODULE(MODULE_CLASS_DRIVER, nxt2k, NULL);
+
+static int
+nxt2k_modcmd(modcmd_t cmd, void *opaque)
+{
+ if (cmd == MODULE_CMD_INIT || cmd == MODULE_CMD_FINI)
+ return 0;
+ return ENOTTY;
+}
Home |
Main Index |
Thread Index |
Old Index