Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1568519ybz; Thu, 30 Apr 2020 01:30:33 -0700 (PDT) X-Google-Smtp-Source: APiQypIdWhoKIG0YiiOz+ufC5YsS23wzDTPF/xfpQPQXN6m7VcdNLEbo6ELw/sAZ5PvgTNnCnots X-Received: by 2002:aa7:c5cf:: with SMTP id h15mr1614437eds.213.1588235432955; Thu, 30 Apr 2020 01:30:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588235432; cv=none; d=google.com; s=arc-20160816; b=uTdJnofT/QjcQBk1cIwNaUb6oxHHLpJ8tsQeB8o/gEK8UZAnoxO5Tq+q+QrPHvvoou aSAaz5eeoaeko0qoYkN8HTchanAodfYMBp01ZeoKfEfttXra9lBBw7bmBDaaNBsxWU5b LKdgKv5VQNk3dE1aTH1Lf/EAqdJel9E76lxdBEbFfr3TPZ+Ar0+7xoKNFtvqOv106Ps9 0Wm6Ms5i1dbsISZLF0G432BBe4GlmQavyuMq2llGZ6/kB8weqbKcb8r1oAS4hdy3UQCP 1yIMzTgmRvVhwDj7sCmyxttZDYAjirMCmPIsZOUekz2cr7pABrWpsgYCC/JHuAhVjucZ aszw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=LXDuT+zyGwOMNyTmTsYthl+Wi+xniB67Z/MFEM9n6zI=; b=CQUJOGno8uxXbp97RCyFL2V1d7dK81Hnai9YOLjCp4Gxd/6Ycc+E8Fsm2RIIIXhSJh GYpojNw/yPRwwAoWf301Vg/ncJOYuFYA6txGN/VUfndRlwRosJ8y1HRtc1XPBDef6M5h JXEKTn6GbrfeZ7OwRZ72FsXiGPOkeBs6s5ImMCpj186LqoS6d/TSaBKmhh+7wopUccJn XgSurb91h9dcj7bUCjFva/nW/v69VMu62Q2UjPyczpaFpfOo4jOxVWGYuW1g4d7yX22G +z9nTuBLHOOzPaD+tFcM/Y8B42HKpIE5K5g57vW09Hn0DSqeLWMsKtJOytc+30hqiWHR Di0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NC3ifVGm; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u21si5486005ejz.518.2020.04.30.01.30.07; Thu, 30 Apr 2020 01:30:32 -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=@linaro.org header.s=google header.b=NC3ifVGm; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726784AbgD3I2q (ORCPT + 99 others); Thu, 30 Apr 2020 04:28:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726758AbgD3I2p (ORCPT ); Thu, 30 Apr 2020 04:28:45 -0400 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1B29C035494 for ; Thu, 30 Apr 2020 01:28:44 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id o27so446404wra.12 for ; Thu, 30 Apr 2020 01:28:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=LXDuT+zyGwOMNyTmTsYthl+Wi+xniB67Z/MFEM9n6zI=; b=NC3ifVGmMaCmp7oxNCFOQKQ2zpOmDHCSdE4+9gKuDrjd1a3OPhghlhXvl96rWxXvjg qDoqa5EvKHOg7jJnCyKEBYcEgvL/nu3KFcYelURkzVuOeumTb8ITNTLPv06+5vdSaU49 xD7vmkV8WkTnOxh6TR4objPG1vjBWVuDzFz1YobrqWF2nJUn3GSnVfQD1zk6+rEimFUh eUeRnfc1tbi3K1FsnEbBuNcWBzn1Csdj4ZOuDbViRqTpZJA78q7A1xga2EvUp12srDDJ o+pejIP8MCgfj+rCEa6prbLxjID3FxuLqKjoF5vIF4Sj/93ozvJt142otHVjgEeDkAEJ sHmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=LXDuT+zyGwOMNyTmTsYthl+Wi+xniB67Z/MFEM9n6zI=; b=NF/3Hf44Ug25doxNvfbBRHYACAPAz3ueP9x8Rz+feDtjrPYP25p57WYaPC1xk18Y3D 65vwxtZkTUOQJ9r79OyAtSTFiyebbPvnaYymwYPjsJh34MdbsyBbsXTM3iUiwA6eVKZD Rm3krXCi3FWzWCMj4R3HeTB50WKbr13XnddKiCAlnKsNg+eMk0wCyyf3JB3CXonK/Yg2 aHRFSBhlSkfHwZxUf3kDg7hQvZGT8vq6bCpjmNoW8XlURr3VEFT5VcpXWdr6nFRvDh27 yYZQvnhC3xEFvuYfe1S6fzVHTmvW5ZFdAoyMlQjDnIzcU8A34mwUY/xR8pwnVc4mFNkH Af/Q== X-Gm-Message-State: AGi0Pub3WxL3RIo/jctkT1aG7K+GG7TXLOMzm2uOAHWs9tBIn2UIZW4U LussKH6PmRir8Zu0quOKm0wi6Q== X-Received: by 2002:adf:dd4c:: with SMTP id u12mr2514666wrm.395.1588235323498; Thu, 30 Apr 2020 01:28:43 -0700 (PDT) Received: from dell ([2.31.163.63]) by smtp.gmail.com with ESMTPSA id i1sm751258wrx.22.2020.04.30.01.28.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Apr 2020 01:28:42 -0700 (PDT) Date: Thu, 30 Apr 2020 09:28:40 +0100 From: Lee Jones To: Tim Harvey Cc: Jean Delvare , Guenter Roeck , Linux HWMON List , Rob Herring , Frank Rowand , Device Tree Mailing List , open list , Robert Jones , Randy Dunlap Subject: Re: [PATCH v8 2/3] mfd: add Gateworks System Controller core driver Message-ID: <20200430082840.GB3118@dell> References: <1585341214-25285-1-git-send-email-tharvey@gateworks.com> <1585341214-25285-3-git-send-email-tharvey@gateworks.com> <20200428094426.GL3559@dell> <20200429063319.GV3559@dell> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 29 Apr 2020, Tim Harvey wrote: > On Tue, Apr 28, 2020 at 11:33 PM Lee Jones wrote: > > > > On Tue, 28 Apr 2020, Tim Harvey wrote: > > > > > On Tue, Apr 28, 2020 at 2:44 AM Lee Jones wrote: > > > > > > > > > > > > + > > > > > +static int gsc_probe(struct i2c_client *client) > > > > > +{ > > > > > + struct device *dev = &client->dev; > > > > > + struct gsc_dev *gsc; > > > > > + int ret; > > > > > + unsigned int reg; > > > > > + > > > > > + gsc = devm_kzalloc(dev, sizeof(*gsc), GFP_KERNEL); > > > > > + if (!gsc) > > > > > + return -ENOMEM; > > > > > + > > > > > + gsc->dev = &client->dev; > > > > > + gsc->i2c = client; > > > > > + i2c_set_clientdata(client, gsc); > > > > > + > > > > > + gsc->bus.reg_write = gsc_regmap_regwrite; > > > > > + gsc->bus.reg_read = gsc_regmap_regread; > > > > > > > > Why do you need to store these in ddata? > > > > > > Lee, > > > > > > Thanks for the review! > > > > > > I need the remap_bus* for devm_regmap_init() in the hwmon sub-module driver: > > > > > > hwmon->regmap = devm_regmap_init(dev, &gsc->bus, gsc->i2c_hwmon, > > > &gsc_hwmon_regmap_config); > > > > > > Is there something easier I'm missing? > > > > This is an odd setup. I haven't seen one driver registering another > > driver's Regmap call-backs before, related or otherwise. Normally the > > Regmap is setup (initialised) in the parent driver and child drivers > > just make use of it. Here it looks like you are registering 2 > > separate Regmaps, but using the same call-backs for both, which seems > > wrong to me. > > > > Lee, > > It is perhaps an odd setup. The hwmon sub-device is at a different i2c > slave address than the other sub-devices. The same callbacks are used > for reg read/write to take advantage of the retries due to the errata > resulting in occasional NAK'd register reads. Then I suggest putting them somewhere shared or exporting them. Passing pointers to the via ddata sounds a bit batty. -- Lee Jones [李琼斯] Linaro Services Technical Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog