Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1311519ybp; Fri, 4 Oct 2019 12:42:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqxKJY+ZTz3SYVfxyOv4KbWmyO6fZj6oovWyJ/6JK6dsdgdjPOwSADeNEKcv4e/fBqFtM53p X-Received: by 2002:a50:b545:: with SMTP id z5mr17300129edd.203.1570218159379; Fri, 04 Oct 2019 12:42:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570218159; cv=none; d=google.com; s=arc-20160816; b=Yt7PYz2gKZ3KE7XbWQWMWXjcOE9s25oiBEK4G0ZrNMu7QNH+Bps22Kj0zvrZdijZzo r8K2pq9k4Tpb7yLRT2HlDYsm5EZQ0r9NUDz636ldRNViineNZbl/E6t80gktS9NA5JFK LD7eUSdYsL296xpi9JWqqu1r+i9KLS9ckW8pPIuTyKsMzLSEr6zUDKWdNMR+IaiI+bfG seBPKrZVoDsnDWiHQaVYt5ecRQy7oySxijmYWyt+LhGd1nPkp1Z5aUXIhi1VV18VrNDw A8LKzMndrDMCaxvKtIeHX4bIDHExBOBP/0G7fAk3YMXtcm27OHcHhs1ASB5fwrAgsAhS iJwQ== 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=lKdiNzyflX1qifC5XC0/R1ENRYDqFG5nqNIeHJGhC9c=; b=TNGpP49mKHrigPtmAaI+NbDG9ZqQEjyWBQwtB60pAcrIKkDuKudu78IAy6N0MczQ6L mMcir1aHkVg0zVDM8kwOzN6w9ABLCI2FucAaF3BNqyAy0JzRkc4CYu3VnyjkYE5rSbXv d4HKYNibSml7710L8gto1/Ivq4ph42E3yHJOMlaCnC3G1aBYKDUiooVjmGhQwtbddRjs L+5dgJVOAPNEAjmMmqlomxKtns5d1/2AUKCbXK2bjcRmfjvoAlBew7hVZyGoccqIzXE5 4mY2/Ef/EIv5PGgoDd1kO6f/+Yq4LI8lcabIPYb/9ipyuVs6ZJ3hv78ucMoFWW4crVgm /9cA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KTwXzKKX; 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 b33si4382679edc.265.2019.10.04.12.42.15; Fri, 04 Oct 2019 12:42:39 -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=KTwXzKKX; 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 S2387416AbfJDTl2 (ORCPT + 99 others); Fri, 4 Oct 2019 15:41:28 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:39434 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727978AbfJDTl1 (ORCPT ); Fri, 4 Oct 2019 15:41:27 -0400 Received: by mail-lj1-f196.google.com with SMTP id y3so7661746ljj.6 for ; Fri, 04 Oct 2019 12:41: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=lKdiNzyflX1qifC5XC0/R1ENRYDqFG5nqNIeHJGhC9c=; b=KTwXzKKXxYtdYVYAyRPHF5pabKA8YkMM0SRyWPhD/SpHiZ5JiNFPBkCEeMw9/3PqZU /KB8zyT7qfMfNp/S5nfmS2hQTwPdPfhP2er0Oeg2qOINbkqOCFnRkq4bUY3h6Rv2nlfT 1ZquD6PxAawVJm0tLCJVEep05bgPNEs2qJo2GQW84SP+GuErKh+d0I/iNYYb9s6sJVA0 X11fWhKRQeyVj1Qzx8a0cN+yz4sVpCJUNUMCE1bCrjz1IjvjMCt0UsgxpfvT3w/dWw6o 3RwY1eK31O/i6p8w6fbSMuXwfAsOiI2bPO1s7ITVaJFCNpVaBpsGwip2JYRX3fOOKL8H 58nw== 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=lKdiNzyflX1qifC5XC0/R1ENRYDqFG5nqNIeHJGhC9c=; b=LFbrPtkJ1MF2FObM9SI8JOowQI1CS/yaeGQZDXpgQ9Kt3I10o22sNAmMtv9KxN+96i RFcIuw4nPq3XCrTcOj57DXgN2VnodbKt1x5TLj5RlFODDNYwMruFdyKkytnk8onsxoKu HjwL4jn0kZ6gthGYLAZWJBGV413Mpp5AnOkaWppftOb5BXhGNSZdegwF9+nRBDyu40ll xlH0AL+/z9AzBVSGBlOBqR13GaKc2M7xE4NuECz1rb9HteReP7n5m84o1ofdW6IMQAbR s4jYVYU3IMBB8US/kZbn/i3wG6IEiKFLFkRcQNvJtOL5tdYOfK8Ob07yXWnbfaW/bwES gHqQ== X-Gm-Message-State: APjAAAXuuP4H/BteOPxy//qz5uKGZdZ+ZGhSLT7lubwBnmoy4kjTyKar EcXJJGlIWGZVplMdHJMZyIQFlCPqEjmx+5FdmyNbsg== X-Received: by 2002:a2e:80d3:: with SMTP id r19mr10309621ljg.41.1570218084405; Fri, 04 Oct 2019 12:41:24 -0700 (PDT) MIME-Version: 1.0 References: <20190917124246.11732-1-m.felsch@pengutronix.de> <20190917124246.11732-4-m.felsch@pengutronix.de> In-Reply-To: <20190917124246.11732-4-m.felsch@pengutronix.de> From: Linus Walleij Date: Fri, 4 Oct 2019 21:41:12 +0200 Message-ID: Subject: Re: [PATCH 3/5] regulator: da9062: add voltage selection gpio support To: Marco Felsch Cc: Support Opensource , Lee Jones , Rob Herring , Liam Girdwood , Mark Brown , stwiss.opensource@diasemi.com, Sascha Hauer , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "linux-kernel@vger.kernel.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 Tue, Sep 17, 2019 at 2:43 PM Marco Felsch wrote: > + /* > + * We only must ensure that the gpio device is probed before the > + * regulator driver so no need to store the reference global. Luckily > + * devm_* releases the gpio upon a unbound action. > + */ > + gpi = devm_gpiod_get_from_of_node(cfg->dev, np, prop, 0, GPIOD_IN | > + GPIOD_FLAGS_BIT_NONEXCLUSIVE, label); Do you really need the GPIOD_FLAGS_BIT_NONEXCLUSIVE flag here? I don't think so, but describe what usecase you have that warrants this being claimed twice. Normally that is just needed when you let the regulator core handle enablement of a regulator over GPIO, i.e. ena_gpiod in struct regulator_config. > + /* We need the local number */ > + nr = da9062_gpio_get_hwgpio(gpi); If you really need this we should add a public API to gpiolib and not create custom APIs. Just make a patch adding int gpiod_to_offset(struct gpio_desc *d); to the public gpiolib API in include/linux/gpio/consumer.h and add the code in gpiolib.c to do this trick. Yours, Linus Walleij