Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5888766imu; Mon, 26 Nov 2018 06:31:58 -0800 (PST) X-Google-Smtp-Source: AFSGD/WH2lQ7a4k74BWwVvtLOKe5NPtrtGo66brwHAuRQWZn55tPNYtBzmUbJu4xEgjkH9WoZRyJ X-Received: by 2002:a17:902:8bc6:: with SMTP id r6mr27814802plo.67.1543242718747; Mon, 26 Nov 2018 06:31:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543242718; cv=none; d=google.com; s=arc-20160816; b=u2H5kA6ODnWeszoYNl+F6qWoNXHmOC0fgJQIZcvcdRAL0DV9IS2Rt36WNyDiFkaAP6 J54q6xJay4DERD/DZAZFay3g/mDtQEqF6nfrgrlD21kR8sM0CrHtAX8vnaVIC9WvS6oe uMPpJqnSPTVUHb/mrcexymT+0L29exr7G8XW49DbwjlR6aL0pptKjY5+NLRwfu3vQe2i O4wsBWVHzajsIoBsz9nsOIvAQLX1KA+7GbqL8SPsyJKTDObRYSmsnPFSULdyKDWYT/XT sufYkBwYw3wYl0gwiKduVWDDo9Tigz1z9duF4PGbg7eET+ggd5AA8gJB8XMDOV8Rhpus SKzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=3udMrsqI1Hl9K2PdTY/j8mnuBC2jQ57LJlMyW/B7adQ=; b=M4RQ/vYH5OixjjN2yaMKIwnwdoYI2wLmMx+wGD8jrNZOpmw7kre+33YTTFzkR/Enwb 50WGPpJKwIPHw4vCD8GXB6wmrkUwpBDAO/nnpV/K/weHbSnV+oh+14dsyQZbHJ8i+VPl +mfKh9pEKet39Hvv+h5o+b8CUvt34fopy+/pJKR5Ifiw85ajt0BTfb/dz+EP4JdN83BB B5Qe+X5pWfbG2Dwl9j5M0m7MzCKHdpBVl5LEMwWhNGLqtNFhpobAtV0zaiaiVWy5PGhu c9MfRNJlClOu8lQuNwuKvoQ2JJMwT0WkAA6G85mzBfYpSDor3SyLPDMvAslJy0mQNEDw Zp+Q== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=cirrus.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q61-v6si418257plb.418.2018.11.26.06.31.25; Mon, 26 Nov 2018 06:31:58 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=cirrus.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726348AbeK0BY5 (ORCPT + 99 others); Mon, 26 Nov 2018 20:24:57 -0500 Received: from mx0b-001ae601.pphosted.com ([67.231.152.168]:1943 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726249AbeK0BY5 (ORCPT ); Mon, 26 Nov 2018 20:24:57 -0500 Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id wAQET6Dj017641; Mon, 26 Nov 2018 08:30:31 -0600 Authentication-Results: ppops.net; spf=none smtp.mailfrom=ckeepax@opensource.cirrus.com Received: from mail4.cirrus.com ([87.246.98.35]) by mx0b-001ae601.pphosted.com with ESMTP id 2ny3xu2h0y-1; Mon, 26 Nov 2018 08:30:29 -0600 Received: from EX17.ad.cirrus.com (unknown [172.20.9.81]) by mail4.cirrus.com (Postfix) with ESMTP id ECD7E611C8B6; Mon, 26 Nov 2018 08:33:57 -0600 (CST) Received: from imbe.wolfsonmicro.main (198.61.95.81) by EX17.ad.cirrus.com (172.20.9.81) with Microsoft SMTP Server id 14.3.408.0; Mon, 26 Nov 2018 14:30:29 +0000 Received: from imbe.wolfsonmicro.main (imbe.wolfsonmicro.main [198.61.95.81]) by imbe.wolfsonmicro.main (8.14.4/8.14.4) with ESMTP id wAQEUSSD000813; Mon, 26 Nov 2018 14:30:28 GMT Date: Mon, 26 Nov 2018 14:30:28 +0000 From: Charles Keepax To: Mark Brown CC: Linus Walleij , Liam Girdwood , Marek Szyprowski , "linux-kernel@vger.kernel.org" , Subject: Re: [PATCH 3/3] gpio: Add reference counting for non-exclusive GPIOs Message-ID: <20181126143028.GO16508@imbe.wolfsonmicro.main> References: <20181122173015.23905-1-ckeepax@opensource.cirrus.com> <20181122173015.23905-3-ckeepax@opensource.cirrus.com> <20181123105729.GM16508@imbe.wolfsonmicro.main> <20181123132522.GE2089@sirena.org.uk> <20181126130001.GN16508@imbe.wolfsonmicro.main> <20181126140927.GD9715@sirena.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20181126140927.GD9715@sirena.org.uk> User-Agent: Mutt/1.5.20 (2009-12-10) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=953 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1811260131 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 26, 2018 at 02:09:27PM +0000, Mark Brown wrote: > On Mon, Nov 26, 2018 at 01:00:01PM +0000, Charles Keepax wrote: > > On Fri, Nov 23, 2018 at 01:25:22PM +0000, Mark Brown wrote: > > > > help the multiple users find each other somehow. I think what we want > > > to do here is either push the gpiod requests into the regulator core or > > > change things so that once the regulator is registered with the > > > regulator core the regulator core owns and is responsible for freeing > > > the regulator. > > > On the co-ordinating do we expect that the behaviour will > > be that the GPIO should in the "enabled" state whenever any > > regulator is requesting it? IE. the GPIO state is an OR of > > the regulator states. Or are we expecting to handle more > > complex interaction? > > For the regulators that's what we do, yes - it's like they're all > sharing a single regulator. That probably won't be true in general for > all GPIO users. Would there perhaps be milage in looking at just making the regulator core request the GPIO, rather than the end drivers? Gives us a single request/free point. We don't need any special flags in the GPIO layer, as its just a single user as far as GPIO is concerned. Thanks, Charles