Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3411265pxj; Tue, 1 Jun 2021 04:52:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+d3W2HwrrTPXMpqFd0q1c/oHmdlSjnCtLz1t8tTJ7VnQbobDXRReBMbDSdMURrdEPd7A5 X-Received: by 2002:a05:6402:1d8e:: with SMTP id dk14mr32205339edb.385.1622548330046; Tue, 01 Jun 2021 04:52:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622548330; cv=none; d=google.com; s=arc-20160816; b=XXy6eOYcbGRtXEyqzipoWcHuvP3R0TKwMZ9QhKs0aO22SrJ+CgWSRGUa24FhhngiPn YQBCjS/ldxehpo/cu8piPXRIFAvn0e1Xy+FZyI4LId7M4daklgYs6eA7Rz+Mleo25+Yk 9RepM8V5+Pzo3Y+iUEBfww3vO9yPYjUMbW8V5p8hzUmK5mbHWraUwAwmUIaSvkA22W2W lG99KPEG2V/aoduuwG9eOYTBtAYA9boa9Jqbo++D7jpyhy1cpj0c6p5YpK2y+25+80v1 YkJYfgCC8ZwGkIvgFJ5Rh76bxo7UpKEJZU/YZBfu04Sp2aHBVW+ufWRlee/dqDP2d8+A zK7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:user-agent:references:in-reply-to :subject:cc:to:from:date:content-transfer-encoding:mime-version :dkim-signature; bh=HwyHo5KmOS+wJ8+Zmtt3LzoQ8VbBO0PvA0b+B+ROgHE=; b=k2GXJiQ9EJH0mxa8eXPRx6kacmA1uIoH6BwCW3NgCNS2gyhI/bo3HAmcC8xJHcQW/X xdAgkcR9adrd6xhSwfH1tIUyM8BQl9IJrHoDxMVqAEnwo2qgbaNPRlbEpLmsrlB+37zt XLxDknVHDqHORLfqsRUcyYGd497uJY9xzQ3VvxnxilJgpGzhzKfr58eGIPivJeNi44Cw lh4EEicgfO7NOUzTD3oydo46EZQcP3wErAHcPDNmmLpsU5sod2tk6LiTPO/raU0dYq0v rw3rKujTsqLGgss9QUwtaklLZoSyEHPjo1STFSsuYct3AZdgtZ8TOi8xjeYqZxuaW8jn NqWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=qmsy6VuD; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z4si17290697ejp.321.2021.06.01.04.51.46; Tue, 01 Jun 2021 04:52:10 -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=@walle.cc header.s=mail2016061301 header.b=qmsy6VuD; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233828AbhFALvZ (ORCPT + 99 others); Tue, 1 Jun 2021 07:51:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233064AbhFALvY (ORCPT ); Tue, 1 Jun 2021 07:51:24 -0400 Received: from ssl.serverraum.org (ssl.serverraum.org [IPv6:2a01:4f8:151:8464::1:2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98EAFC061574; Tue, 1 Jun 2021 04:49:43 -0700 (PDT) Received: from ssl.serverraum.org (web.serverraum.org [172.16.0.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id A4D492224A; Tue, 1 Jun 2021 13:49:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1622548178; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HwyHo5KmOS+wJ8+Zmtt3LzoQ8VbBO0PvA0b+B+ROgHE=; b=qmsy6VuDvoP/T3NCjWBNzLHxoXZ9hGk7/k/3Mjie29LAenUS6S91fKxxkIBGcY/BCll8w0 FJIfq5GU9Nwk4XtQee5kHnouso9MdowOaPjJ4Pw34j0m+pvbDj7nj00yMplNQSbHhwY2xD fo+13GXbZWJRZp6LCwFuAEp1QjrDINk= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 01 Jun 2021 13:49:38 +0200 From: Michael Walle To: Andy Shevchenko Cc: Sander Vanheule , Hans de Goede , Andrew Lunn , Pavel Machek , Rob Herring , Lee Jones , Mark Brown , Greg Kroah-Hartman , "Rafael J . Wysocki" , Linus Walleij , Bartosz Golaszewski , Linux LED Subsystem , devicetree , "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List Subject: Re: [PATCH 0/5] RTL8231 GPIO expander support In-Reply-To: References: <02bbf73ea8a14119247f07a677993aad2f45b088.camel@svanheule.net> <84352c93f27d7c8b7afea54f3932020e9cd97d02.camel@svanheule.net> <7a9978881e9ec5d4b811fa6e5d355fb6bce6f6d8.camel@svanheule.net> <0047200eecbd7ee480258cc904d6b7ee@walle.cc> <272ac6af4a5ba5df4bb085617c9267e5ece61c19.camel@svanheule.net> User-Agent: Roundcube Webmail/1.4.11 Message-ID: <8df77f619730b9e7b5cdd7ddefb60a03@walle.cc> X-Sender: michael@walle.cc Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 2021-05-31 17:48, schrieb Andy Shevchenko: > On Mon, May 31, 2021 at 6:33 PM Sander Vanheule > wrote: >> On Mon, 2021-05-31 at 14:16 +0300, Andy Shevchenko wrote: >> > On Monday, May 31, 2021, Michael Walle wrote: >> > > Am 2021-05-31 10:36, schrieb Sander Vanheule: > >> Am I missing something here? It seems to me like the regmap interface >> can't >> really accommodate what's required, unless maybe the rtl8231 regmap >> users >> perform some manual locking. This all seems terribly complicated >> compared to >> using an internal output-value cache inside regmap-gpio. > > Have you had a chance to look into the PCA953x driver? > Sounds to me that you are missing the APIs that regmap provides. What would that be? The register cache? We need to cache the value somehow, because (still assuming it is write only) we cannot read it back. Thus the read of the RMW, would need get the value from the cache. Thus the user of gpio-regmap would need to make sure, to (a) use a cache for the regmap supplied to gpio-regmap and (b) populate its initial values correctly. Is that what you are suggesting? And hopefully, no other user of the regmap will call regcache_mark_dirty() or something like that. I had a quick look at the PCA953x driver but it all its registers are readable according to the comment on the top of the file. -michael