Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1993335imm; Sat, 13 Oct 2018 08:00:01 -0700 (PDT) X-Google-Smtp-Source: ACcGV63o3S6iv7W/9H7KckO1kgiW4sHIGS0ODg56kfnaFEAam1gF+LsXfx6n4IxtS2KlryvSDMR3 X-Received: by 2002:a63:8c4:: with SMTP id 187-v6mr9601884pgi.396.1539442801791; Sat, 13 Oct 2018 08:00:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539442801; cv=none; d=google.com; s=arc-20160816; b=oMnsr4k+N7o32ZDBZju/HPO/YXTrXcyyRekeRAS7sFWy8Cfi63x9btM/Y7mDQkRxVO +QEq2JrK6roOllLMJQYbW7MaxW0SRbnUjlCQqjX4IN2W+48uIDv9D8dri86CWIx4zLTn MVsRKN982J1/UzgpVxgZ1DuedsYo8vUS06PYqaU4Y5feStPwQu69H2UGDHczvI426iUd YVRoEZx+Duccw6nly7XV9WEuOzFxvAFKwJVNcuAklwaAl/iPcPBTEsdG5rqMtEsXWuuI 19fiBGTCzu8hJOTm6AIhm4+NO70XhS/+zG0q1IlJmg6US1sdE/JYP8BkxElVg09L8p1C hjyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=NmMgcMZ3Bi7yDFgOClL/kYFrkcoISXSJfVtqo6AgyXk=; b=LVJOR+1s+xbEMdVWFlYGvgxiFKxX+07DyFHSmMfM9xVsXc2y5bWQHRQmxeCOt2/TO+ EDcSShRmUL+r8WMXhzPrBU8VwCRfBlluQy4wS+LaEorHu7eeZzzRPV3jXScS0/bolfRr JXQpY6xR4p/m4p7XpsEH/p9bKOTkIoWw6blrGGcWA7Vn+PiG2H1vuTalWOJZ3Ycdh+70 /1qBaofbKKa6vXKEm7LjQg2Wc2eBSN56SaZpbJ822jue/9FAFGjd46OP3vscjP0Sx9sD hIThwPxqSXQP+or/AS5Azr7yyF8T1Y+9alaw6DT9+DM8gk/s7/cKADjMea3tVCUALCYD Zl4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aWlo4v4d; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p5-v6si4711079pgi.411.2018.10.13.07.59.46; Sat, 13 Oct 2018 08:00:01 -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=@linaro.org header.s=google header.b=aWlo4v4d; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726862AbeJMWgx (ORCPT + 99 others); Sat, 13 Oct 2018 18:36:53 -0400 Received: from mail-it1-f193.google.com ([209.85.166.193]:36442 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726339AbeJMWgw (ORCPT ); Sat, 13 Oct 2018 18:36:52 -0400 Received: by mail-it1-f193.google.com with SMTP id c85-v6so22061201itd.1 for ; Sat, 13 Oct 2018 07:59:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NmMgcMZ3Bi7yDFgOClL/kYFrkcoISXSJfVtqo6AgyXk=; b=aWlo4v4dyOV+J20bV1tJLnxCPd+4H6cPAyyLAKMzOC+uNZWixSlYUltqICHVLPWmQj e1cR/moxP7mrMNOPJHYcvjxULv53bISuw17K9W9/1iVr30eczmTOcoCUni4zxu3gnEC9 TRUvozrj9prXB29sTBUypGOOy2iz+1bE9Fve4= 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; bh=NmMgcMZ3Bi7yDFgOClL/kYFrkcoISXSJfVtqo6AgyXk=; b=n99o91azeHFLJWZU9/IV/dxpDQOwjccc5DlKsv6dRdJ+PfiA12yz1xIkLWSDtN/mOX zCqlPEAw4lngEqY63GFa1xiUE8zoEmIfi7gM72lNUK/79HB+1RVuKu+oZxA7gn/UakAD a6bj9pIYf0ir3ymEFAZp2UJy6daOClz/Ec5IrR7Rg6QzfhOwweCNAoNuin5ydt4buzSo NZqTvYmXRhTxh0/bbWYt4UM1OdhcBtqrFtzVtonugY1vmU19NCHwQmky0lIK3j6ulTj5 HXwgpcNJ69qY9IyTyUqwJoS/NFyHlhv0kU63/itF68rync6kCtHjxGa0RxCe4BcLo5Po xYHg== X-Gm-Message-State: ABuFfoj8iCGPDz+LwnPfb6OezOW13fSfgJ/XHbyAGztV6gRsoAS5to8u 3emid6gdilPOWwh0oiAXvlLIsDfwbTCIjU+3ynffnA== X-Received: by 2002:a24:5e50:: with SMTP id h77-v6mr7894172itb.58.1539442764850; Sat, 13 Oct 2018 07:59:24 -0700 (PDT) MIME-Version: 1.0 References: <20181012125412.21324-1-linus.walleij@linaro.org> <20181012142612.GJ7677@w540> <20181012164424.GE2340@sirena.org.uk> In-Reply-To: <20181012164424.GE2340@sirena.org.uk> From: Linus Walleij Date: Sat, 13 Oct 2018 16:59:12 +0200 Message-ID: Subject: Re: [PATCH v2] regulator/gpio: Allow nonexclusive GPIO access To: Mark Brown Cc: jacopo , Liam Girdwood , "linux-kernel@vger.kernel.org" , Marek Szyprowski , Jon Hunter , Laurent Pinchart , cychiang@chromium.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 12, 2018 at 6:44 PM Mark Brown wrote: > On Fri, Oct 12, 2018 at 04:26:12PM +0200, jacopo mondi wrote: > > Do you think extending gpiod_lookup_flags with this newly introduced > > NONEXCLUSIVE one is an acceptable solution to avoid handling this in > > the sensor driver like we're doing today? > > One problem you've got there is that you need the two devices to know > about each other so they coordinate their use of the reset line. This > was relatively easy in the sysetm Cheng-yi has as it's just one driver > but what if there's mutiple drivers? That's relatively likely with > audio where you might have something like a CODEC with a separate power > amplifier. The regulator enable stuff is handling this in the core but > it's less clear where to put that for reset lines. Yes spot on. What we need to do for that to work is to move the reference counting for shared lines over to gpiolib as well, else every subsystem that needs to share a GPIO line essentially has to reimplement it. If the consumers are in different subsystems they would even have to share a reference count and this would lead to a big mess. So I was thinking to pull that over to gpiolib for the next kernel :) Hopefully I could do that without breaking anything, but I don't have a good track record on that so I think the fine people who saw this breakage will have to help me out. Yours, Linus Walleij