From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 91B38C43142 for ; Wed, 27 Jun 2018 13:21:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3D17A26347 for ; Wed, 27 Jun 2018 13:21:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3D17A26347 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965366AbeF0NVk (ORCPT ); Wed, 27 Jun 2018 09:21:40 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:53578 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964910AbeF0NVi (ORCPT ); Wed, 27 Jun 2018 09:21:38 -0400 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w5RDJH2b123065 for ; Wed, 27 Jun 2018 09:21:38 -0400 Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.153]) by mx0a-001b2d01.pphosted.com with ESMTP id 2jvafujyaa-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 27 Jun 2018 09:21:38 -0400 Received: from localhost by e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 27 Jun 2018 07:21:37 -0600 Received: from b03cxnp08026.gho.boulder.ibm.com (9.17.130.18) by e35.co.us.ibm.com (192.168.1.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 27 Jun 2018 07:21:33 -0600 Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w5RDLWQv49807586 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 27 Jun 2018 06:21:32 -0700 Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9153A136055; Wed, 27 Jun 2018 07:21:32 -0600 (MDT) Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 738DC13604F; Wed, 27 Jun 2018 07:21:31 -0600 (MDT) Received: from [9.41.102.69] (unknown [9.41.102.69]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 27 Jun 2018 07:21:31 -0600 (MDT) Subject: Re: [PATCH v10 5/7] i2c: fsi: Add transfer implementation To: Wolfram Sang 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 References: <1528918579-27602-1-git-send-email-eajames@linux.vnet.ibm.com> <1528918579-27602-6-git-send-email-eajames@linux.vnet.ibm.com> <20180626023823.i3fmdegn2sric5kx@ninjato> From: Eddie James Date: Wed, 27 Jun 2018 08:21:30 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180626023823.i3fmdegn2sric5kx@ninjato> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-TM-AS-GCONF: 00 x-cbid: 18062713-0012-0000-0000-000016831DF1 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009263; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000266; SDB=6.01053072; UDB=6.00539911; IPR=6.00830997; MB=3.00021878; MTD=3.00000008; XFM=3.00000015; UTC=2018-06-27 13:21:37 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18062713-0013-0000-0000-000053784E0D Message-Id: <6713efb9-c4c3-f648-a1e9-7918110091e4@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-06-27_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1806270146 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/25/2018 09:38 PM, Wolfram Sang wrote: > 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? Hm, I don't really understand the purpose of that flag. From the docs: This toggles the Rd/Wr flag. That is, if you want to do a write, but     need to emit an Rd instead of a Wr, or vice versa, you set this     flag. For example: S Addr Rd [A] Data [A] Data [A] ... [A] Data [A] P I don't think our hardware supports this type of operation. Thanks, Eddie >