From owner-p4-projects@FreeBSD.ORG Tue Nov 28 05:38:08 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 98D5416A55C; Tue, 28 Nov 2006 05:38:08 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7676816A553 for ; Tue, 28 Nov 2006 05:38:08 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8A75144194 for ; Tue, 28 Nov 2006 04:43:48 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id kAS1vo7p034593 for ; Tue, 28 Nov 2006 01:57:50 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id kAS1vocf034590 for perforce@freebsd.org; Tue, 28 Nov 2006 01:57:50 GMT (envelope-from imp@freebsd.org) Date: Tue, 28 Nov 2006 01:57:50 GMT Message-Id: <200611280157.kAS1vocf034590@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 110611 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Nov 2006 05:38:09 -0000 http://perforce.freebsd.org/chv.cgi?CH=110611 Change 110611 by imp@imp_lighthouse on 2006/11/28 01:57:40 Add new driver "icee" for reading IIC EEPROM devices. So far just tested for 8-bit devices. write to follow. Affected files ... .. //depot/projects/arm/src/sys/arm/conf/TSC4370#17 edit .. //depot/projects/arm/src/sys/conf/files#55 edit .. //depot/projects/arm/src/sys/dev/iicbus/icee.c#1 add .. //depot/projects/arm/src/sys/dev/iicbus/iic.c#10 edit Differences ... ==== //depot/projects/arm/src/sys/arm/conf/TSC4370#17 (text+ko) ==== @@ -102,6 +102,7 @@ # iic device iic device iicbus +device icee # SPI bus device spibus device at45d # at45db642 and maybe others ==== //depot/projects/arm/src/sys/conf/files#55 (text+ko) ==== @@ -666,6 +666,7 @@ dev/ieee488/upd7210.c optional pcii | tnt4882 dev/iicbus/ad7418.c optional ad7418 dev/iicbus/ds1672.c optional ds1672 +dev/iicbus/icee.c optional icee dev/iicbus/if_ic.c optional ic dev/iicbus/iic.c optional iic dev/iicbus/iicbb.c optional iicbb ==== //depot/projects/arm/src/sys/dev/iicbus/iic.c#10 (text+ko) ==== @@ -249,9 +249,8 @@ if (!sc) return (EINVAL); - if ((error = iicbus_request_bus(device_get_parent(iicdev), iicdev, - (flags & O_NONBLOCK) ? IIC_DONTWAIT : - (IIC_WAIT | IIC_INTR)))) + if ((error = iicbus_request_bus(parent, iicdev, + (flags & O_NONBLOCK) ? IIC_DONTWAIT : (IIC_WAIT | IIC_INTR)))) return (error); switch (cmd) { @@ -314,7 +313,7 @@ if (!(m->flags & IIC_M_RD)) copyin(usrbufs[i], m->buf, m->len); } - error = iicbus_transfer(parent, (struct iic_msg *)buf, d->nmsgs); + error = iicbus_transfer(iicdev, (struct iic_msg *)buf, d->nmsgs); /* Copyout all read segments, free up kernel buffers */ for (i = 0; i < d->nmsgs; i++) { m = &((struct iic_msg *)buf)[i]; @@ -328,7 +327,7 @@ error = ENOTTY; } - iicbus_release_bus(device_get_parent(iicdev), iicdev); + iicbus_release_bus(parent, iicdev); if (buf != NULL) free(buf, M_TEMP);