Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1269186ybt; Thu, 18 Jun 2020 04:51:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqRHqh3LT1ablwAZQa8dxW2NsOYUy8KvckvNDUjM0lSjxK5oqCqMqnBX1lUsTrF5F/lXP/ X-Received: by 2002:a50:ee01:: with SMTP id g1mr3550779eds.44.1592481071674; Thu, 18 Jun 2020 04:51:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592481071; cv=none; d=google.com; s=arc-20160816; b=cmdgA0SJOiThrPOFt00bI/DfCR3oSaOI6+Br69Q5wqoRFY0xE7b+CtZqkc8AnNXTBe ysoHWa0aAaiJI+ChAG88zkhvoSB/KIOf0PVV6K/FfALAYLHFkjrTK7PFNl1Rh+wg0ZD5 GlqqUt8do6EbYDu+mNTCBGw3GA53gdQMxT9frHh3YAghCS9lbaX8p7DisjLnKwxqBeyx 3JeGvs788f+CnWB2/1AoEujWhfOF+S/JbBjE3zJQlkMTUCqIkubR6yM+r0bncIuJcKzx 9wF3FrjuojffBd0QTJMF/Qb69r+gU0GbIiLT5nLdEFYw4g3U4tyHFCedTi0Hfuanjn8f vU8Q== 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=CFOLMWfnNmFWmCXS3WsnXqGGhFh9R4n2y1mrs4wYTgA=; b=dSFS0Q+qVKOg+kxe1p0dzwFmEKzjm/1qzjRSkQSftvm+AuRWZxFv2l/Jm/gLcvrR4a amz3/yXY2vtCPa2dNNlyZbaCvJUwykk3fZKoCVDp8IejpMcsfcQB75UEB9BxU24nJrD6 t8SenMnk/zgXlm84BtxOe/n57DKhsmuFCy8Gf30azabpH5wvO4XV8iMLujz7Igb8Kr2S C/JsgyKLU79qpbW0TfIcf7Xkrynlyd42xKPTV+la0NwutnN6eoMHaJ4I1oS9/OJRlqkw i9y/wqdCKkdqMxFXpNxi7W8wd/X75iVleyJxlAiBsaFyOIg+cXQxZV44xetTY3N5WiCn XO+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GgCF78Uo; 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 nr21si1559632ejb.230.2020.06.18.04.50.49; Thu, 18 Jun 2020 04:51:11 -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=GgCF78Uo; 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 S1728608AbgFRKHK (ORCPT + 99 others); Thu, 18 Jun 2020 06:07:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726945AbgFRKHI (ORCPT ); Thu, 18 Jun 2020 06:07:08 -0400 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 392D9C06174E for ; Thu, 18 Jun 2020 03:07:08 -0700 (PDT) Received: by mail-wr1-x441.google.com with SMTP id p5so5385608wrw.9 for ; Thu, 18 Jun 2020 03:07:08 -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=CFOLMWfnNmFWmCXS3WsnXqGGhFh9R4n2y1mrs4wYTgA=; b=GgCF78UooGPORKj/H4XaMSc4Y4I+eLXTUWWmfn0WjNS8INYWIrt2KXINC3elkIU17Y Ska7Aks45lBvcbC1FcEJUtYMoo39TjLPdfNuIOF/ChQdvUIx6SGtNUOGK/EM+AOQX9ds rytLxdcpBhl+dXv4/FQIJxiDseItcrjjJwFLGYX9kjGmyRXijNMP3s/qaFpQ/6qDVUGh 8rrsyawXqhnV8dfbE1IBdv1HX/o5zx1dGKErWNzrJhyfcwytBTf3dkP6iZv4pbmfg6Jg dszGi5s7g9xHYNvO0nHlDNuduhVht2B5Fuaznix9U6eJjGiO0/CwmYwXGilO6hV2rYE0 z7Cg== 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=CFOLMWfnNmFWmCXS3WsnXqGGhFh9R4n2y1mrs4wYTgA=; b=isvwYPfhnQhc8C0fp7n9gSY0U/EJQLB5uxUt/46LaAmxUpb2WFpCcNbjea45O3IV2n Q8H872SfkHcJIuGe0AQzKuViEi4/CgSh/AHTjpK5ci7AR6SvOIEQpGMmtFbNxha7rcTv K5Pa4M85NoxJTmh/FXOCoN9IlNzXtUhATIIpgOxgQB/kZ63NPoVG6sT9XfBkXkydgVav dKPBQ9KoOhWasUdakd5gB5UBw7N93wXqWuw8K8RNAIycuoid7NwN8UhGjApMzaLjDxZ9 deX59KeLwKMpj9IUebWNhPUK60KBsZcegfz3zBdQbItcLLzantj6fc2Zeuw484Yn6hf4 MStQ== X-Gm-Message-State: AOAM5308/1WEwak9fjmI7hzsecb41Sp9MEcCaGSOmE3NOwDNRY1MfjpR jCvu0gENXVFRaauR48JBc0EHUW9XtHg= X-Received: by 2002:a5d:45cb:: with SMTP id b11mr3582258wrs.235.1592474826529; Thu, 18 Jun 2020 03:07:06 -0700 (PDT) Received: from dell ([95.149.164.118]) by smtp.gmail.com with ESMTPSA id c66sm3007519wma.20.2020.06.18.03.07.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jun 2020 03:07:05 -0700 (PDT) Date: Thu, 18 Jun 2020 11:07:04 +0100 From: Lee Jones To: Arnd Bergmann Cc: michael@walle.cc, Rob Herring , Mark Brown , gregkh , Andy Shevchenko , DTML , Linus Walleij , Bartosz Golaszewski , Linux ARM , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v3 1/1] mfd: Add I2C based System Configuaration (SYSCON) access Message-ID: <20200618100704.GC954398@dell> References: <20200618080223.951737-1-lee.jones@linaro.org> 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 Thu, 18 Jun 2020, Arnd Bergmann wrote: > On Thu, Jun 18, 2020 at 10:03 AM Lee Jones wrote: > > > > The existing SYSCON implementation only supports MMIO (memory mapped) > > accesses, facilitated by Regmap. This extends support for registers > > held behind I2C busses. > > > > Signed-off-by: Lee Jones > > The implementation looks fine to me, but can you explain how this is going to > be used, and what the advantage is over open-coding the devm_regmap_init_i2c() > in each driver that would use this? Does Regmap let you register/initialise an I2C address more than once? When I attempt it, I get: [ 0.522988] i2c i2c-0: Failed to register i2c client tmp105 at 0x32 (-16) [ 0.523341] i2c i2c-0: of_i2c: Failure registering /bus@4000000/motherboard/iofpga@7,00000000/i2c@16000/temp@32 [ 0.523691] i2c i2c-0: Failed to create I2C device for /bus@4000000/motherboard/iofpga@7,00000000/i2c@16000/temp@32 > Is this about using proper locking through the regmap framework for > shared i2c clients, or to reduce memory consumption when lots of drivers > access the same regmap? All of those things are valid. My use-case is regarding MFDs sharing an I2C interfaced address space with their children. > My impression of the existing syscon code is that the main value-add over > other ways of doing the same is the syscon_regmap_lookup_by_phandle() > interface that gives other drivers a much simpler way of getting the > regmap just based on the DT node. Are you planning to add something > like that here as well? An ideal driver interface might allow > syscon_regmap_lookup_by_phandle() to work for both mmio and i2c > based syscons, or additional ones as well, but implementing this would > be rather tricky when the i2c core is a loadable module. I expect the API would be expanded to cover other use-cases. This is a bare bones implementation which has been kept as atomic as possible for ease of review. -- Lee Jones [李琼斯] Senior Technical Lead - Developer Services Linaro.org │ Open source software for Arm SoCs Follow Linaro: Facebook | Twitter | Blog