Module Name: src Committed By: phx Date: Sat May 28 13:59:31 UTC 2011
Modified Files: src/sys/dev/i2c: ds1307.c m41st84.c rs5c372.c s390.c Log Message: Add direct config support for all devices used by sandpoint. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/dev/i2c/ds1307.c cvs rdiff -u -r1.17 -r1.18 src/sys/dev/i2c/m41st84.c cvs rdiff -u -r1.10 -r1.11 src/sys/dev/i2c/rs5c372.c cvs rdiff -u -r1.1 -r1.2 src/sys/dev/i2c/s390.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/dev/i2c/ds1307.c diff -u src/sys/dev/i2c/ds1307.c:1.12 src/sys/dev/i2c/ds1307.c:1.13 --- src/sys/dev/i2c/ds1307.c:1.12 Sun Jun 8 03:49:26 2008 +++ src/sys/dev/i2c/ds1307.c Sat May 28 13:59:31 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: ds1307.c,v 1.12 2008/06/08 03:49:26 tsutsui Exp $ */ +/* $NetBSD: ds1307.c,v 1.13 2011/05/28 13:59:31 phx Exp $ */ /* * Copyright (c) 2003 Wasabi Systems, Inc. @@ -36,7 +36,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ds1307.c,v 1.12 2008/06/08 03:49:26 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ds1307.c,v 1.13 2011/05/28 13:59:31 phx Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -87,10 +87,16 @@ { struct i2c_attach_args *ia = arg; - if (ia->ia_addr == DS1307_ADDR) - return (1); - - return (0); + if (ia->ia_name) { + /* direct config - check name */ + if (strcmp(ia->ia_name, "dsrtc") == 0) + return 1; + } else { + /* indirect config - check typical address */ + if (ia->ia_addr == DS1307_ADDR) + return 1; + } + return 0; } static void Index: src/sys/dev/i2c/m41st84.c diff -u src/sys/dev/i2c/m41st84.c:1.17 src/sys/dev/i2c/m41st84.c:1.18 --- src/sys/dev/i2c/m41st84.c:1.17 Sun Apr 17 14:58:26 2011 +++ src/sys/dev/i2c/m41st84.c Sat May 28 13:59:31 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: m41st84.c,v 1.17 2011/04/17 14:58:26 phx Exp $ */ +/* $NetBSD: m41st84.c,v 1.18 2011/05/28 13:59:31 phx Exp $ */ /* * Copyright (c) 2003 Wasabi Systems, Inc. @@ -36,7 +36,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: m41st84.c,v 1.17 2011/04/17 14:58:26 phx Exp $"); +__KERNEL_RCSID(0, "$NetBSD: m41st84.c,v 1.18 2011/05/28 13:59:31 phx Exp $"); #include "opt_strtc.h" @@ -93,10 +93,16 @@ { struct i2c_attach_args *ia = arg; - if (ia->ia_addr == M41ST84_ADDR) - return (1); - - return (0); + if (ia->ia_name) { + /* direct config - check name */ + if (strcmp(ia->ia_name, "strtc") == 0) + return 1; + } else { + /* indirect config - check typical address */ + if (ia->ia_addr == M41ST84_ADDR) + return 1; + } + return 0; } static void Index: src/sys/dev/i2c/rs5c372.c diff -u src/sys/dev/i2c/rs5c372.c:1.10 src/sys/dev/i2c/rs5c372.c:1.11 --- src/sys/dev/i2c/rs5c372.c:1.10 Sat Dec 12 14:44:10 2009 +++ src/sys/dev/i2c/rs5c372.c Sat May 28 13:59:31 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: rs5c372.c,v 1.10 2009/12/12 14:44:10 tsutsui Exp $ */ +/* $NetBSD: rs5c372.c,v 1.11 2011/05/28 13:59:31 phx Exp $ */ /* * Copyright (c) 2005 Kimihiro Nonaka @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rs5c372.c,v 1.10 2009/12/12 14:44:10 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rs5c372.c,v 1.11 2011/05/28 13:59:31 phx Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -67,9 +67,16 @@ { struct i2c_attach_args *ia = arg; - if (ia->ia_addr == RS5C372_ADDR) - return (1); - return (0); + if (ia->ia_name) { + /* direct config - check name */ + if (strcmp(ia->ia_name, "rs5c372rtc") == 0) + return 1; + } else { + /* indirect config - check typical address */ + if (ia->ia_addr == RS5C372_ADDR) + return 1; + } + return 0; } static void Index: src/sys/dev/i2c/s390.c diff -u src/sys/dev/i2c/s390.c:1.1 src/sys/dev/i2c/s390.c:1.2 --- src/sys/dev/i2c/s390.c:1.1 Mon Apr 4 17:58:40 2011 +++ src/sys/dev/i2c/s390.c Sat May 28 13:59:31 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: s390.c,v 1.1 2011/04/04 17:58:40 phx Exp $ */ +/* $NetBSD: s390.c,v 1.2 2011/05/28 13:59:31 phx Exp $ */ /*- * Copyright (c) 2011 Frank Wille. @@ -29,7 +29,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: s390.c,v 1.1 2011/04/04 17:58:40 phx Exp $"); +__KERNEL_RCSID(0, "$NetBSD: s390.c,v 1.2 2011/05/28 13:59:31 phx Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -67,8 +67,15 @@ { struct i2c_attach_args *ia = arg; - if (ia->ia_addr == S390_ADDR) - return 1; + if (ia->ia_name) { + /* direct config - check name */ + if (strcmp(ia->ia_name, "s390rtc") == 0) + return 1; + } else { + /* indirect config - check typical address */ + if (ia->ia_addr == S390_ADDR) + return 1; + } return 0; }