Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp161001ybb; Thu, 9 Apr 2020 19:56:22 -0700 (PDT) X-Google-Smtp-Source: APiQypIHJCkbafPiQrV777oCPPqSAAK5y3pcQhhJI9tyPEIlqaGT20Y5md5AqNuv1kguNzUIbTdm X-Received: by 2002:a05:620a:16c2:: with SMTP id a2mr2033053qkn.245.1586487382338; Thu, 09 Apr 2020 19:56:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586487382; cv=none; d=google.com; s=arc-20160816; b=OVwo0z7H098CHa/zMYXLL8oU/j886ndxmwvrG3/foJxPVsaqaDuLSwHlQfwnqzNTnQ b2Y1N8KdcgizKjMrEbenoquSSIAUAwa77Cll7A/jKlhppI0qAc0PqMqZmpH1LKEICe9Z I1AfapPbQIeX9zEvAgYf0CDjpgHfwPm8RkD3/uZV8SIUxxzqA+kCjPBMxOUG0Ufz7xrI 6h6lidQhsn41oarwFPl24jEisAaG6oHxhuv1EEs0ZqQYz7ZWR0eGBJnnitu8pkpAB0nu gV975NOxIK7u7l4Vmq3JSts6WULxPJ8psYiRib19eTJSUXvKS4IKx53wT0sp37KJGnIO rPcQ== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=0xzkMIDkyGduopP7KoTyproKxtGZnSVLA08rr6/YJvE=; b=i07FSK/ws67RwTpQg6xT6jF8WJVuRRnf1mxT1AS6ZuqKFW2j4kXAglcibqOAe7J09F Og7IH0JizwCJUK0B/3mNYjGAxr1GChYhgbHh9zcJ99qaGjyATJo1wdx7sCWkgmGfxXgP 5XYHrhzF+CrhEE2eTm9MtLLI2Cqn61rnEn+rOsx+2XMZFsHOuxjgwQVpXTjjpi4bzhqO wjAryIbIow5XJjlGTHH+y1sVBeOT8OPdkEUJPWZYAQdh84j8J5bqDREJQoHlZFr+/+Fn B1x84AE3B7NF/5rKBNq8N1zWNwwwmsmHFBNPpqDK9An/KPPsidXNrk47ua7i++gU/3ZY UFMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GUODPKUI; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d19si406783qtp.312.2020.04.09.19.56.06; Thu, 09 Apr 2020 19:56:22 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=GUODPKUI; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726622AbgDJCzb (ORCPT + 99 others); Thu, 9 Apr 2020 22:55:31 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:44316 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725987AbgDJCzb (ORCPT ); Thu, 9 Apr 2020 22:55:31 -0400 Received: by mail-lj1-f196.google.com with SMTP id z26so628133ljz.11 for ; Thu, 09 Apr 2020 19:55:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=0xzkMIDkyGduopP7KoTyproKxtGZnSVLA08rr6/YJvE=; b=GUODPKUI0ZdV2k3RdkQoIoWFHhrH90l1l+ZdhSzgFYhWSheBP7Kkw8a+X6mMiSCoLw ehwH/jSs/fZ/PxeQBT3fZgimeI548F13litdm/91m64Y9Fnf6FIz8EFH+FRQCwnENXQm CCySdt1tjC9jisab2u5YaieKg8Ufgdrf798r1Lq7r3s51ZsBFyFKsJIMXI/mP0cPnAGT Zss8ieGN8Zo8ev6viQJpkQsQtB73uz/kcTTEf5xsajwmnt68XNZHF96ZJnixkqz8IBuj t4BYP/c7SI3u8j+T6QMnytfx8u2RQuBqmymbmgSmh8PDJTr1REpmUfIIf7O4avW7GhUg bzTA== 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:content-transfer-encoding; bh=0xzkMIDkyGduopP7KoTyproKxtGZnSVLA08rr6/YJvE=; b=XqZ3mLv5qOVQfZkeQ/1pNRkVEE7NSNX0dtF3mqF06M/6SjYxw28T/KXP9/1m0IxHqt i55G+V99viYE6bFg9d/mcPqYB/wOCEnaJXfYNA2aT+v8iXzsHrSwiO6S2M9k/24nA4z1 b4zA5QAP8xkRUPupiEA4VIi+h9qIuqS+2hkAcGcw2AaiwKJ3zCITpPilUTeskfLWcKr+ ZC4z3uQO78ViOkDNJT7SYXjo0Hq19c7+SNv4L56YhXeYfWVSFA6mwL7u/++eHrOP93pB 306ewu8uzdwpytCDoZi8O6bt+hGKpvMykqPcFvu1HuDk7R1LDQ+X92XJ8NtzUzmJhT8E zQ7Q== X-Gm-Message-State: AGi0PuZJ2dRans2vMRDkAUxyzUxellJ4Adeh/+Np3fC0uCwpqvIQRmIK WgPHdet0FnYZJ1Exi7nbR9fpNKHbxgi+Zsbwif4= X-Received: by 2002:a2e:99c1:: with SMTP id l1mr1662346ljj.196.1586487327692; Thu, 09 Apr 2020 19:55:27 -0700 (PDT) MIME-Version: 1.0 References: <20200409104546.GA5399@sirena.org.uk> <20200409142620.GE5399@sirena.org.uk> In-Reply-To: <20200409142620.GE5399@sirena.org.uk> From: Baolin Wang Date: Fri, 10 Apr 2020 10:55:16 +0800 Message-ID: Subject: Re: [RFC PATCH 2/3] regmap: Add reg_update_bits() support To: Mark Brown Cc: Lee Jones , Arnd Bergmann , Orson Zhai , Chunyan Zhang , LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 9, 2020 at 10:26 PM Mark Brown wrote: > > On Thu, Apr 09, 2020 at 10:12:44PM +0800, Baolin Wang wrote: > > On Thu, Apr 9, 2020 at 6:45 PM Mark Brown wrote: > > > > MMIO devices clearly don't physically have an update_bits() operation= so > > > this should be implemented further up the stack where it applies to a= ll > > > buses without physical support. > > > I understood your concern. But the syscon driver need use the MMIO > > devices' resources (such as address mapping, clock management and so > > on), if move this to further up stack, I am afraid the update_bits() > > can not use the resources in 'struct regmap_mmio_context'. Do you have > > any good suggestion? Thanks. > > If the syscon driver needs to be peering into the regmap implementation > that seems like there's a serious abstraction problem - users of the > regmap shouldn't be looking at the implmentation at all. Why do you > think this is needed? Sorry for confusing, that's not what I mean. My point is the syscon driver will call the regmap_init_mmio() to use the MMIO regmap_bus, but as you said, MMIO bus should not a physical bus, so I suppose the syscon driver should create a new phycical regmap bus for our special case, but the problem is the phycical regmap bus implementation will be similar with the MMIO bus except adding a reg_update_bits() callback, which will introduce more duplicated code. What do you think=EF=BC=9F --=20 Baolin Wang