Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp2031775ybh; Fri, 24 Jul 2020 02:41:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEb8f3A9IwC0ZtMrwgUiKYaGa/zj0+YK45Vn/1nqOS8gGp4RRSEwB20MNE9FlO0aXDhTQA X-Received: by 2002:a50:f10c:: with SMTP id w12mr5244131edl.202.1595583679099; Fri, 24 Jul 2020 02:41:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595583679; cv=none; d=google.com; s=arc-20160816; b=P0tUHii//ehnXPGHcoWGA6EiVgwTDVutpTOhcNOg4ReODODO6xAbPdATQYaUPSxInU Xkzs2Rcq+0lJ6bGhHJUNVIMXx21a0FOyz/YmlxLtdoIZy7H4BfBC00rBsJ2Uq1ABeENO 1k/fZlKGXBuS2H460KUboxJEfRpQQ289Kr+fiP9730B/WLwDRnmDI2lKLg30Qy7m+/4A b9GKNZZ6phT6mMmFr/Decn5lMR0UD/2edoF12VlUPVSlHjDvTKzwGy1c3HB07DzTmUus 9eKZVe+b4YrcroxIhX/ZhictSKQuYCq9XAtcz6O6bvChPOSDtg6KMiTnrO4T+M8bPcap hR1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=5TQWChaGcld1X+jt6TSrRbT5d69VNh8YdsaNVfKXJuY=; b=AcSnxAQx9rikuwlbXmVlDbCIFbTz9RCmDHrpU11yf53W4vsLK6ag8qhWYbuZVNTm7c gbkxONDebkQEb3bnnWsrbn5nMZa3JvkxvEsO9Vy0yRdwrnHsjCAjMO0dluyY+M6OfNbs vKwQVigL+lcbv3YMwgXixRH6UZ3Y/YFVy4dkCHZ9HdXuW3ENgFArc7TXapg7ktSU+gkV LvFcHGnFsX+hhX+YQl34KBIzbLCEUii3Y5Tq0zUkbZf5V5nDApKQqlffCllYx3fIIccl 0zii6UZSBfDDL/EXU6P6BP63iaQC3JIMl5ftClvIOx68JLgIW6Yv9689g6Mj4uou/4yF a9Tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=Ne8qy7BB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i2si171337edn.115.2020.07.24.02.40.55; Fri, 24 Jul 2020 02:41:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=Ne8qy7BB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727029AbgGXJhn (ORCPT + 99 others); Fri, 24 Jul 2020 05:37:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726182AbgGXJhm (ORCPT ); Fri, 24 Jul 2020 05:37:42 -0400 Received: from mail-lf1-x141.google.com (mail-lf1-x141.google.com [IPv6:2a00:1450:4864:20::141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34570C0619D3 for ; Fri, 24 Jul 2020 02:37:42 -0700 (PDT) Received: by mail-lf1-x141.google.com with SMTP id b30so4843709lfj.12 for ; Fri, 24 Jul 2020 02:37:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5TQWChaGcld1X+jt6TSrRbT5d69VNh8YdsaNVfKXJuY=; b=Ne8qy7BB6Y/7TKH1bliOs0RBd4vcuED8WeR396vymk9sAlufq/RXK9OvvOAOKekoT6 pXymUgec0ISJT7TxLDIWTVDVglo9UcgR20dy/VLWWRY17kxHMlGG60UdnM0I48wQ9jeu fQUfUKlgsF2GuEOdu2DjPttH7ZNLTM7bwMDv0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5TQWChaGcld1X+jt6TSrRbT5d69VNh8YdsaNVfKXJuY=; b=kdJ1ZTeK0Y7sTcs2z+TC9fG9kTpn3cnWCqG+zScyMX1UI0Giz/wU8TiApVS11OQu6p U/g0J9F5mrst4AK0ZpGmqS8zya3mQNagY+8FNeq9xv7yQp4+ZHpdjt8VtPPH1CkrQqd2 C9FL1UCtRhGFnCjvSL/2troLjnXFmvJvsZUT39oMj92alcjIiXrcqbFT9smwASsaES9L lLEyiOsdA4sdpHxnmOaHVVyOe8w5IuGOFtxQ6DRLnNrBrR08lvxKFse5kpF3ONEXecE4 rsvHXuogmGJ3KCPidfql8q7WTeWlA0jiEzA3KLjBN0UAK2bmsIcLNJA5iaxwYoEJk72A QU8Q== X-Gm-Message-State: AOAM533vQHUV8k/yuOWR5katc/BOkcP2z77GNyRPU8dFko9XDMT0ZCZA cgVBb7S85mRHDjCJvwEmHBFDx39E8bsYkcIG+WBWjw== X-Received: by 2002:ac2:5f81:: with SMTP id r1mr4508456lfe.168.1595583460497; Fri, 24 Jul 2020 02:37:40 -0700 (PDT) MIME-Version: 1.0 References: <20200717090155.10383-1-rayagonda.kokatanur@broadcom.com> <20200717090155.10383-3-rayagonda.kokatanur@broadcom.com> <20200723202053.GD908@ninjato> In-Reply-To: <20200723202053.GD908@ninjato> From: Rayagonda Kokatanur Date: Fri, 24 Jul 2020 15:07:28 +0530 Message-ID: Subject: Re: [PATCH v2 2/2] i2c: iproc: add slave pec support To: Wolfram Sang Cc: linux-i2c , Linux Kernel Mailing List , Ray Jui , Scott Branden , BCM Kernel Feedback , Lori Hikichi , Robert Richter , Nishka Dasgupta , Andy Shevchenko , linux-arm Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 24, 2020 at 1:50 AM Wolfram Sang wrote: > > > > + /* Enable partial slave HW PEC support if requested by the client */ > > + iproc_i2c->en_s_pec = !!(slave->flags & I2C_CLIENT_PEC); > > + if (iproc_i2c->en_s_pec) > > + dev_info(iproc_i2c->device, "Enable PEC\n"); > > Where do you set the I2C_CLIENT_PEC flag for the slave? Is your backend > code publicly available? I2C_CLIENT_PEC should be set by backend before calling i2c_slave_register() ie client->flags |= I2C_CLIENT_PEC; ret = i2c_slave_register(client, i2c_slave_eeprom_slave_cb); ------ ------ ------ My backend code is not yet publicly available. > > I may need a second thought here, but I am not sure I2C_CLIENT_PEC is > the right way to enable PEC. Isn't it actually depending on the backend > if PEC is needed? I.e. is the backend an I2C device or an SMBus device? > Yes, it depends on the backend. If backend is SMBUS device and supports PEC then it should set client->flags |= I2C_CLIENT_PEC, before calling i2c_slave_register(), so that the slave bus driver will enable PEC in device. Best regards, Rayagonda