Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2353870imm; Thu, 16 Aug 2018 08:28:22 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzhhEQQy8kIiBSqfF1GhgGZmnWyXSgMeiW/XUH94Sk2SrjnUq3fbT3qDkfkP5e/uu9WRCCx X-Received: by 2002:a17:902:9a83:: with SMTP id w3-v6mr29658104plp.75.1534433302334; Thu, 16 Aug 2018 08:28:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534433302; cv=none; d=google.com; s=arc-20160816; b=ca6lqHZPjSPGxVBIfso6FGQiQUH3lTnsPjQ3OySyoGfTUloVPagfwxNFd3b3KPBTpN Ptfvw2FUNVfQo3/lF2mqayB0V1PS9jfFxOqmR0HEB2x8P3hVD7xSxrfoSfV6oWHKSYF6 trnBps3imnps+mErqKbzdYK4aRVmyq5P43kWzBBE8v+X4G5+1mPeQzOn5UkO5pMTpM6R iZAp6KlS+cVxywCCF5ydV1LmFKkCWk3TY8CAuO2S9mZCdecI/fUcKpjqkFMt1OsaEcba 6Ll8jmQvi24SvZFJa6NCRYPvaoQDMR+Fc/Z7kwPw3J1j7LuytUPGRZ2rUWBF4dKoFb6F RxCA== 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 :arc-authentication-results; bh=LFKp7xwWFVpolO3tGZrLzPUt23wDqlZDPpe3eGLPC1I=; b=CRYsWUK+mVVuui0cfiGTGztgjo9u4lENkP5Q5RSle5Xs11wCb9qBy9JArH0yrL94E2 wn2OWosourhMcvv1v8cY3N4rWOjrq6ZnGLFqse4B2Eun3NM0XP9Hr+TECoEyXpPdbvME j8fSuFUwztmdUYBK1d23xCql7PtmAtPKsTaht33LM749OJm5ofXUXNFA2HO7cA0FVLib yqyVr9Z9zwtIozsbLjF+z+slAThc3bT9KqBrYoITyLIozls4Dz5UR/aIazgwgMFCMwzR NCKJjTCMhvJQDXkTYXHITIBQ8aEU/8Pc1azxQN+ziN4WWlm2QpvpLzBfgZeZYjWgrqVN t+bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gEk9TK1Z; 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 ca2-v6si24214544plb.305.2018.08.16.08.27.50; Thu, 16 Aug 2018 08:28: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=@linaro.org header.s=google header.b=gEk9TK1Z; 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 S1725749AbeHPLIh (ORCPT + 99 others); Thu, 16 Aug 2018 07:08:37 -0400 Received: from mail-io0-f196.google.com ([209.85.223.196]:41986 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389825AbeHPLIg (ORCPT ); Thu, 16 Aug 2018 07:08:36 -0400 Received: by mail-io0-f196.google.com with SMTP id n18-v6so3181851ioa.9 for ; Thu, 16 Aug 2018 01:11:51 -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=LFKp7xwWFVpolO3tGZrLzPUt23wDqlZDPpe3eGLPC1I=; b=gEk9TK1Zijeju4uI8337fkR0p1kKrVVkCknwqksVUoDqSBFq+/mnaFRiOap2KAlPnz D7z1Z4tTh970gmXtHTA937cWjJD7/rxueNQ3V7TqhXq83C24o1gyYZyRkakpRJr3hwxV aSSNQCBBjBSvMb11i6no4CfeR5fDcQ1liqGJQ= 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=LFKp7xwWFVpolO3tGZrLzPUt23wDqlZDPpe3eGLPC1I=; b=FcIu4V5sWav7C5ta18Fkykadqa1vtBn0fOMXd05EaFExEmVGTlDZT/ETtMAclwOUry x6PjYbyjHEuD8cpqRUij+SZOsxdlmdPGzwHmBM6SLMm0h8yHtJoZRRLlA1cCoNwKheDN Vg34JseFaiE647/boAN0Of8Q2qvOOptcKJUWfvTd8pPW/hCA8ji+FedORHsOPmo3X5z5 X0GhPm2rmwnOIz0TAwF9xIUyQlAPcjKEop02l5M1HWi0Faa9xNHlVrfJNuTTzeTrgvBs iPy8QHne3Jq/iIlsMAbgU3NgJRYUNpc3XL/l1QVgptYIrYI5dTBN4D1UL/kiL1iJPM4D /Hsg== X-Gm-Message-State: AOUpUlGla9dsQDAgQ4ml4m+QBWSCKiCrJmHxGzwuwiOlkPv47uIg6xd6 t9AuLDjT6bGCx6W9vPMXRXB03ppQT7yXhzOalcJy2A== X-Received: by 2002:a6b:4006:: with SMTP id k6-v6mr23460879ioa.277.1534407110775; Thu, 16 Aug 2018 01:11:50 -0700 (PDT) MIME-Version: 1.0 References: <20180815201855.29738-1-mail@david-bauer.net> In-Reply-To: <20180815201855.29738-1-mail@david-bauer.net> From: Linus Walleij Date: Thu, 16 Aug 2018 10:11:38 +0200 Message-ID: Subject: Re: [PATCH] gpio: 74x164: add lines-initial-states property To: mail@david-bauer.net Cc: Rob Herring , Mark Rutland , "open list:GPIO SUBSYSTEM" , "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 Hi David, On Wed, Aug 15, 2018 at 10:19 PM David Bauer wrote: > This adds the ability to define the initial state of each output line on > device probe. > > Signed-off-by: David Bauer (...) > Optional properties: > - enable-gpios: GPIO connected to the OE (Output Enable) pin. > +- lines-initial-states: Bitmask that specifies the initial state of > + each line. When a bit is set to zero, the corresponding output line > + is initialized LOW. When a bit is set to one, the corresponding > + output line is initialized HIGH. In case this property is not > + defined, all lines will be initialized as LOW. This sounds like something that should be generic, and not use a bitmask, but offsets. It should work even if the number of GPIOs from the chip is > 32. Is the usecase different from hogs? See Documentation/devicetree/bindings/gpio.txt There has been extensive discussion about supporting initial values with something similar to hogs, but I haven't got anything ACKed by the DT maintainers so it has kind of stalled. I would make sure to both make it generic, get ACK from the DT mainatiners, and make sure to implement it in drivers/gpio/gpiolib-of.c and not locally in drivers. Yours, Linus Walleij