Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4606149ybl; Sat, 21 Dec 2019 10:05:18 -0800 (PST) X-Google-Smtp-Source: APXvYqyJiIt67chBjb38m6RHHprdW5QfRPRtW8Hw76P9teJLw933MW8As7qg+5A8cpkHXecgCBiB X-Received: by 2002:a9d:7b4a:: with SMTP id f10mr23135897oto.4.1576951518548; Sat, 21 Dec 2019 10:05:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576951518; cv=none; d=google.com; s=arc-20160816; b=URaC1YTpzFI2iMw/NJv8a7X/7n8Z9khBp5soca+1qUgkCGMUxrF+8V0vdvpC6x+UH+ 7ZGTs4zpoJ3ZENcVck6NttGrGzBe9TyC1yWhNYga895/M2XKTCiTDVil/RNOiH2RUkcq /N/Bk5JRZUM+2URwCbqo2FS/4D7kGt1ixkVJj1CTmfQe/3tJJlpXGxANeLxG29Khmpgr OG00JQ3cKjsfzsgSRwWd0N/HEKz+d5ksItLj+Hr8T7MYg6LaqpWzx+Mm4bbXsvaUVWR6 rdpK7oDRb21pyBmYbWRbsfaoU1ehbO8TQVeOp0WvnO8j3vv+8ATlbJwbY7Dc1R/Pay+5 m8GA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature:dkim-filter; bh=X+42fjabk+WLOB1bPd12eCpPGYMZu89kQtWGOPGu13I=; b=gSkxBVqKgqQ5TH9D1DWEdZwwIGMROmDkW4tYqtUY5MElHuRmvxeAnQDvPm/sncruRm 2H41scQRrfVNLgH9p/6qhxytwGT3ZerOQXJXMP/KV/vF4fPzSW15iShTv830HibaHv8Q +UDDEwkJoKc0I6+/BmarBBDhns3OqOMsoQB0jun8tZx/z6U0r/IpX9k3VzWsm+5hMX63 co5Q+g8U0waUX+qMeOQG3f925VccO8mt1QOTrNnLG2stfXszwaTF63Rd+ckP819K3jSC lsxU3GTkm6rziJL4vXBoXon+qZl3ff6jHbp1bsh/PjyF7RRcWdmfn7SSunuNHyop0kwe kOtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@upb.ro header.s=96342B8A-77E4-11E5-BA93-D93D0963A2DF header.b=dZumlSXG; 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 a14si8143802otk.2.2019.12.21.10.04.54; Sat, 21 Dec 2019 10:05:18 -0800 (PST) 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; dkim=pass header.i=@upb.ro header.s=96342B8A-77E4-11E5-BA93-D93D0963A2DF header.b=dZumlSXG; 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 S1726846AbfLUR66 (ORCPT + 99 others); Sat, 21 Dec 2019 12:58:58 -0500 Received: from mail-sender240.upb.ro ([141.85.13.240]:34520 "EHLO mx.upb.ro" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726107AbfLUR66 (ORCPT ); Sat, 21 Dec 2019 12:58:58 -0500 Received: from localhost (localhost [127.0.0.1]) by mx.upb.ro (Postfix) with ESMTP id 4D484B56279B; Sat, 21 Dec 2019 19:58:55 +0200 (EET) Received: from mx.upb.ro ([127.0.0.1]) by localhost (mx.upb.ro [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id rS-wCd-Av3WE; Sat, 21 Dec 2019 19:58:53 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by mx.upb.ro (Postfix) with ESMTP id 89D7EB56279C; Sat, 21 Dec 2019 19:58:53 +0200 (EET) DKIM-Filter: OpenDKIM Filter v2.10.3 mx.upb.ro 89D7EB56279C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=upb.ro; s=96342B8A-77E4-11E5-BA93-D93D0963A2DF; t=1576951133; bh=X+42fjabk+WLOB1bPd12eCpPGYMZu89kQtWGOPGu13I=; h=Message-ID:From:To:Date:MIME-Version; b=dZumlSXGZqk7S3vz0l3XH/E8QmWrWWByIdVC01rPRR7aoeOkRxc3uj07nRP6x9y7A PmxsYJL7TXSM3eOnSIIgub/Fue2hFRpmw8e+EJ6S77WDFyNbt/WlDuMA//J0hlldMu quytGl4caIT7zp5A4K1MSOTs2ONSdh17zC7RjTG0= X-Virus-Scanned: amavisd-new at upb.ro Received: from mx.upb.ro ([127.0.0.1]) by localhost (mx.upb.ro [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 5FG3taiS2m5M; Sat, 21 Dec 2019 19:58:53 +0200 (EET) Received: from sabertoorh (unknown [86.120.75.237]) by mx.upb.ro (Postfix) with ESMTPSA id ECE47B56279B; Sat, 21 Dec 2019 19:58:52 +0200 (EET) Message-ID: <0a09d9ed5fc5ae6c651491dead5f81bfecdbca4b.camel@upb.ro> Subject: Re: [PATCH] i2c: cadence: Added slave support From: Radu Nicolae Pirea To: Shubhrajyoti Datta Cc: Wolfram Sang , linux-arm-kernel , linux-i2c , linux-kernel , Michal Simek Date: Sat, 21 Dec 2019 19:58:50 +0200 In-Reply-To: References: <20191219124120.53754-1-radu_nicolae.pirea@upb.ro> <20191219130501.GA958@kunai> <6504123809effc310ade02dbb8a63f10db6b6c92.camel@upb.ro> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2019-12-20 at 14:55 +0530, Shubhrajyoti Datta wrote: > Hi , > > On Thu, Dec 19, 2019 at 7:00 PM Radu Pirea > wrote: > > On Thu, 2019-12-19 at 14:05 +0100, Wolfram Sang wrote: > > > > +/** > > > > + * enum cdns_i2c_mode - I2C Controller current operating mode > > > > + * > > > > + * @CDNS_I2C_MODE_SLAVE: I2C controller operating in > > > > slave > > > > mode > > > > + * @CDNS_I2C_MODE_MASTER: I2C Controller operating in > > > > master > > > > mode > > > > + */ > > > > > > Can't the hardware operate as master and slave at the same time? > > > > > > > Of course, it can. If the driver has a slave registered wait and > > listens and if the subsystem needs to use the controller as master, > > the > > driver changes the state of the controller to master, sends and > > reads > > data from the bus and after this change the state of the controller > > to > > slave. > > However that should be done only if no master is talking to the slave > right? Yes. The state of the slave must be IDLE, otherwise cdns_i2c_master_xfer will return -EAGAIN. > > > In cdns_i2c_master_xfer is done all the magic.