From owner-svn-src-head@FreeBSD.ORG Tue Jun 3 14:46:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3D72F836; Tue, 3 Jun 2014 14:46:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2B35A22CC; Tue, 3 Jun 2014 14:46:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s53Ekpdw009586; Tue, 3 Jun 2014 14:46:51 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s53EkpVg009585; Tue, 3 Jun 2014 14:46:51 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201406031446.s53EkpVg009585@svn.freebsd.org> From: Luiz Otavio O Souza Date: Tue, 3 Jun 2014 14:46:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267009 - head/sys/arm/ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2014 14:46:51 -0000 Author: loos Date: Tue Jun 3 14:46:50 2014 New Revision: 267009 URL: http://svnweb.freebsd.org/changeset/base/267009 Log: Remove the unnecessary i2c slave address assignment. The ti_i2c controller only works in the master mode and the i2c address passed on iicbus_reset() is used to set the controller slave address when operating as an i2c slave (which isn't currently supported). When talking to a slave, the slave address is correctly provided to ti_i2c_tranfer(). Modified: head/sys/arm/ti/ti_i2c.c Modified: head/sys/arm/ti/ti_i2c.c ============================================================================== --- head/sys/arm/ti/ti_i2c.c Tue Jun 3 13:47:00 2014 (r267008) +++ head/sys/arm/ti/ti_i2c.c Tue Jun 3 14:46:50 2014 (r267009) @@ -92,7 +92,6 @@ struct ti_i2c_softc volatile uint16_t sc_stat_flags; /* contains the status flags last IRQ */ - uint16_t sc_i2c_addr; uint16_t sc_rev; }; @@ -310,10 +309,6 @@ ti_i2c_reset(device_t dev, u_char speed, TI_I2C_LOCK(sc); - if (oldaddr) - *oldaddr = sc->sc_i2c_addr; - sc->sc_i2c_addr = addr; - /* First disable the controller while changing the clocks */ con_reg = ti_i2c_read_reg(sc, I2C_REG_CON); ti_i2c_write_reg(sc, I2C_REG_CON, 0x0000); @@ -325,9 +320,6 @@ ti_i2c_reset(device_t dev, u_char speed, ti_i2c_write_reg(sc, I2C_REG_SCLL, clkcfg->scll | (clkcfg->hsscll<<8)); ti_i2c_write_reg(sc, I2C_REG_SCLH, clkcfg->sclh | (clkcfg->hssclh<<8)); - /* Set the remote slave address */ - ti_i2c_write_reg(sc, I2C_REG_SA, addr); - /* Check if we are dealing with high speed mode */ if ((clkcfg->hsscll + clkcfg->hssclh) > 0) con_reg = I2C_CON_OPMODE_HS; @@ -339,7 +331,7 @@ ti_i2c_reset(device_t dev, u_char speed, TI_I2C_UNLOCK(sc); - return 0; + return (IIC_ENOADDR); } /**