From owner-svn-src-all@FreeBSD.ORG Mon Jan 26 13:53:39 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D596F106564A; Mon, 26 Jan 2009 13:53:39 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A869E8FC16; Mon, 26 Jan 2009 13:53:39 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0QDrdfD051457; Mon, 26 Jan 2009 13:53:39 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0QDrdT1051454; Mon, 26 Jan 2009 13:53:39 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <200901261353.n0QDrdT1051454@svn.freebsd.org> From: Rafal Jaworowski Date: Mon, 26 Jan 2009 13:53:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187709 - in head: share/man/man4 sys/dev/iicbus X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Jan 2009 13:53:40 -0000 Author: raj Date: Mon Jan 26 13:53:39 2009 New Revision: 187709 URL: http://svn.freebsd.org/changeset/base/187709 Log: Teach iic(4) the 'repeated start' I2C condition. This will be used by the upcoming i2c(8) diag utility. Reviewed by: bms, stas Obtained from: Semihalf Modified: head/share/man/man4/iic.4 head/sys/dev/iicbus/iic.c head/sys/dev/iicbus/iic.h Modified: head/share/man/man4/iic.4 ============================================================================== --- head/share/man/man4/iic.4 Mon Jan 26 12:59:11 2009 (r187708) +++ head/share/man/man4/iic.4 Mon Jan 26 13:53:39 2009 (r187709) @@ -45,13 +45,19 @@ In order to control I2C devices, use .Pa /dev/iic? with the following ioctls: -.Bl -tag -width ".Dv I2CRSTCARD" +.Bl -tag -width ".Dv I2CRPTSTART" .It Dv I2CSTART .Pq Vt "struct iiccmd" Sends the start condition to the slave specified by the .Va slave element to the bus. All other elements are ignored. +.It Dv I2CRPTSTART +.Pq Vt "struct iiccmd" +Sends the repeated start condition to the slave specified by the +.Va slave +element to the bus. +All other elements are ignored. .It Dv I2CSTOP No argument is passed. Sends the stop condition to the bus. Modified: head/sys/dev/iicbus/iic.c ============================================================================== --- head/sys/dev/iicbus/iic.c Mon Jan 26 12:59:11 2009 (r187708) +++ head/sys/dev/iicbus/iic.c Mon Jan 26 13:53:39 2009 (r187709) @@ -368,6 +368,11 @@ iicioctl(struct cdev *dev, u_long cmd, c } free(usrbufs, M_TEMP); break; + + case I2CRPTSTART: + error = iicbus_repeated_start(parent, s->slave, 0); + break; + default: error = ENOTTY; } Modified: head/sys/dev/iicbus/iic.h ============================================================================== --- head/sys/dev/iicbus/iic.h Mon Jan 26 12:59:11 2009 (r187708) +++ head/sys/dev/iicbus/iic.h Mon Jan 26 13:53:39 2009 (r187709) @@ -60,5 +60,6 @@ struct iic_rdwr_data { #define I2CWRITE _IOW('i', 4, struct iiccmd) /* send data */ #define I2CREAD _IOW('i', 5, struct iiccmd) /* receive data */ #define I2CRDWR _IOW('i', 6, struct iic_rdwr_data) /* General read/write interface */ +#define I2CRPTSTART _IOW('i', 7, struct iiccmd) /* repeated start */ #endif