Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp4591727imm; Mon, 25 Jun 2018 19:40:31 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL/LYi6vjAvwP2ezRqFJtg7IDcoXeTO/j+j0CALF7bQJG5dHfUy3fhHfMj8v03D6LoqTcAU X-Received: by 2002:a63:951e:: with SMTP id p30-v6mr12669922pgd.318.1529980831776; Mon, 25 Jun 2018 19:40:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529980831; cv=none; d=google.com; s=arc-20160816; b=BLJXv5aDIc2SRWXtN4emx0PJsWXLQjRRkviAFbv9bo84itNPstJApJ+M3G6L9LRobP 9t3ITnEHEunI7jf+mRtpU5GSWKUiyHzIdlW+FF5F7NfI6uM3FB8NLUJ439pVNtJvioF0 bRqUi+JSxImwcnfJKiOVgjiBixwyXBa2VDBXW2xQXRSYQO7yBtaUnhwW5Xl4mTUIcaaO AKEH+8zNI8gnz9vlhsrUjyuCub1uWhI11+3RvufQTo69y/EX+Pk6xvtdJrRp9CgcaZHo olEiMQEgZDJ8MgOKFdc05WyD/u90SjxeQ73YAjQH8YfJpoJ34Q2BP+QqJtpSgOfUAkrx ym9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=XCS25SamSL4O/ugZeDwDjkfq/otynThZ1iEF91G1HW8=; b=U0KeK4QSzBkFd6wtR4GmJzp8EhV9zakrrDmC4HK0ZqqGOLQvgT+hFwJKJMx/tqb/bR uXQ9Kkm40YtI+FWxhbtCIcBC3vJWhT/wxyf69VAdmAow+16+a9mNOLeNcsneGD2Zled4 GgMCIR7Pag36cydFaTm/iTHTyWE/Ckceb8mUTUIUxK1FOIthPzfEVpmneFtpYeO9A91w Y6RzrpSjCcMQ/Wpk04NX5Y5oEITpUau6D/TR9CbeS5Y2Av27TiqSbvkoBVz0YcUJI5dq cZW1z7LLFbyqABqxXiLWOeC9T90dpk9X+PM/w5iHQx5hYnfkkQuEV1Pw+n/02u+htMcC UDHQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d1-v6si453479pld.515.2018.06.25.19.40.17; Mon, 25 Jun 2018 19:40:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935280AbeFZCi3 (ORCPT + 99 others); Mon, 25 Jun 2018 22:38:29 -0400 Received: from sauhun.de ([88.99.104.3]:48896 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933574AbeFZCi1 (ORCPT ); Mon, 25 Jun 2018 22:38:27 -0400 Received: from localhost (unknown [91.73.131.157]) by pokefinder.org (Postfix) with ESMTPSA id AC72A56A487; Tue, 26 Jun 2018 04:38:25 +0200 (CEST) Date: Tue, 26 Jun 2018 11:38:24 +0900 From: Wolfram Sang To: Eddie James Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, robh+dt@kernel.org, benh@kernel.crashing.org, joel@jms.id.au, mark.rutland@arm.com, gregkh@linuxfoundation.org, rdunlap@infradead.org, andy.shevchenko@gmail.com, peda@axentia.se Subject: Re: [PATCH v10 5/7] i2c: fsi: Add transfer implementation Message-ID: <20180626023823.i3fmdegn2sric5kx@ninjato> References: <1528918579-27602-1-git-send-email-eajames@linux.vnet.ibm.com> <1528918579-27602-6-git-send-email-eajames@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1528918579-27602-6-git-send-email-eajames@linux.vnet.ibm.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 13, 2018 at 02:36:17PM -0500, Eddie James wrote: > Execute I2C transfers from the FSI-attached I2C master. Use polling > instead of interrupts as we have no hardware IRQ over FSI. > > Signed-off-by: Eddie James > --- > drivers/i2c/busses/i2c-fsi.c | 195 ++++++++++++++++++++++++++++++++++++++++++- > 1 file changed, 193 insertions(+), 2 deletions(-) > > diff --git a/drivers/i2c/busses/i2c-fsi.c b/drivers/i2c/busses/i2c-fsi.c > index 4611a0b..8c0a6cb 100644 > --- a/drivers/i2c/busses/i2c-fsi.c > +++ b/drivers/i2c/busses/i2c-fsi.c > @@ -155,6 +155,7 @@ struct fsi_i2c_port { > struct i2c_adapter adapter; > struct fsi_i2c_master *master; > u16 port; > + u16 xfrd; > }; > > static int fsi_i2c_read_reg(struct fsi_device *fsi, unsigned int reg, > @@ -230,6 +231,99 @@ static int fsi_i2c_set_port(struct fsi_i2c_port *port) > return fsi_i2c_write_reg(fsi, I2C_FSI_RESET_ERR, &dummy); > } > > +static int fsi_i2c_start(struct fsi_i2c_port *port, struct i2c_msg *msg, > + bool stop) > +{ > + struct fsi_i2c_master *i2c = port->master; > + u32 cmd = I2C_CMD_WITH_START | I2C_CMD_WITH_ADDR; > + > + port->xfrd = 0; > + > + if (msg->flags & I2C_M_RD) > + cmd |= I2C_CMD_READ; Since you support MANGLING, I'd think you can easily support I2C_M_REV_DIR_ADDR here, too?