Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753874AbbFARwF (ORCPT ); Mon, 1 Jun 2015 13:52:05 -0400 Received: from down.free-electrons.com ([37.187.137.238]:35390 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751771AbbFARv4 (ORCPT ); Mon, 1 Jun 2015 13:51:56 -0400 Date: Mon, 1 Jun 2015 19:51:54 +0200 From: Alexandre Belloni To: Cyrille Pitchen Cc: ludovic.desroches@atmel.com, nicolas.ferre@atmel.com, linux-i2c@vger.kernel.org, wsa@the-dreams.de, mark.rutland@arm.com, devicetree@vger.kernel.org, pawel.moll@arm.com, ijc+devicetree@hellion.org.uk, linux-kernel@vger.kernel.org, robh+dt@kernel.org, galak@codeaurora.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 3/5] i2c: at91: add support for new alternative command mode Message-ID: <20150601175154.GN4710@piout.net> References: <82c39f262f553a43ea9208b4f9804bbf26a62d90.1433173031.git.cyrille.pitchen@atmel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <82c39f262f553a43ea9208b4f9804bbf26a62d90.1433173031.git.cyrille.pitchen@atmel.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1191 Lines: 33 Hi, On 01/06/2015 at 17:49:13 +0200, Cyrille Pitchen wrote : > @@ -504,8 +589,22 @@ static int at91_twi_xfer(struct i2c_adapter *adap, struct i2c_msg *msg, int num) > at91_twi_write(dev, AT91_TWI_IADR, internal_address); > } > > - at91_twi_write(dev, AT91_TWI_MMR, (m_start->addr << 16) | int_addr_flag > - | ((m_start->flags & I2C_M_RD) ? AT91_TWI_MREAD : 0)); > + is_read = (m_start->flags & I2C_M_RD); > + if (dev->pdata->has_alt_cmd) { > + if (m_start->len > 0) { > + at91_twi_write(dev, AT91_TWI_CR, AT91_TWI_ACMEN); > + at91_twi_write(dev, AT91_TWI_ACR, > + AT91_TWI_ACR_DATAL(m_start->len) | > + ((is_read) ? AT91_TWI_ACR_DIR : 0)); > + use_alt_cmd = true; > + } else > + at91_twi_write(dev, AT91_TWI_CR, AT91_TWI_ACMDIS); braces {} should be used on all arms of this statement -- Alexandre Belloni, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/