Received: by 2002:a17:90a:88:0:0:0:0 with SMTP id a8csp149118pja; Fri, 22 Nov 2019 04:43:09 -0800 (PST) X-Google-Smtp-Source: APXvYqzitDravSL4JcvXkxHgTAVLUPWYwF+Osz24/4pQp+gCeF57Va0S/XXLTda7EAiGL1ZB9qwv X-Received: by 2002:a17:906:5959:: with SMTP id g25mr21441681ejr.248.1574426588765; Fri, 22 Nov 2019 04:43:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574426588; cv=none; d=google.com; s=arc-20160816; b=d3p9FAe+KGHe0iB0y4qcOjlkP2eq09eCpQ6fS9CSbOJ775Cqa01nB5WO0K3ivvGxzh Idc9XUGyt7YcU6ApReBvlfCi7d8BoKMN4xLVFJc5sraTOO11O3qiTgIqOCrnuWxq7Uhm CJNuU/8/wKXU7sOwErytHZRs3EdHcEYiqUTYk9LGS228O2IpdaphNCWj2IUW7T0FL6jo 0QI1GkVXP//QfsdNhF8eW6iZxwmOBXWkYuVSqEI+xxYL/T25yakAavszaHaDtBPyWOSl eZdMGMm+vIuBjp34bdNBdv6Y14rDb7eIqXSyCxYCg01ei1qwEie7nDYBajghz6dldTSf EHPQ== 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=aeL6ENOX7pztigFjtd4aneRHXGdD9m/NqUguyQGTLcQ=; b=slbdFmA0Ma4zdGbsMuZ2VaYJ0fIDl6ETfNZchDF8UsnKgBunp6fF8awQzc5b1kLBmu I/d/+R1Qj8cuqrB7NfseFsVc5zXvJJNNFffkbVcsT8S6600sdwrLMHV9NekCMIWk8B6/ ew9mOOjNQGfAFCa7k9blRG72EWUhys57q7CFuB1e98M0zN1xu3DZVOs4rgT/3SMa4vXt gljqAS1lOpzMtpPbGdvyx5phkRpTjlpChdVdw5gC2EVT950ywsaz2OgTgSNa0VgJWqkM DBIr6fgnyn/mAh7EJyDKZAMcPzC6O9jFgzsUjI0M2+s1A5oYj516iEHWM0BnP2p3F6fw 0OdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EgwPiUU0; 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 a13si3746142ejy.365.2019.11.22.04.42.44; Fri, 22 Nov 2019 04:43:08 -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; dkim=pass header.i=@linaro.org header.s=google header.b=EgwPiUU0; 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 S1727674AbfKVMlW (ORCPT + 99 others); Fri, 22 Nov 2019 07:41:22 -0500 Received: from mail-lf1-f68.google.com ([209.85.167.68]:41821 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727327AbfKVMlW (ORCPT ); Fri, 22 Nov 2019 07:41:22 -0500 Received: by mail-lf1-f68.google.com with SMTP id m30so3548601lfp.8 for ; Fri, 22 Nov 2019 04:41:21 -0800 (PST) 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=aeL6ENOX7pztigFjtd4aneRHXGdD9m/NqUguyQGTLcQ=; b=EgwPiUU0I/zOww52gVjxSaKx2o+qXH3R59PK7hE2xL8TZS/MFwbq43t+EcPen0Lkrj FyFN/fz5tJw0MPZnF1XhtfxfoHVfOaDV9WYgggpKAStLFk4MxL9P90sSiXmlJw2kqiIa yuZy/SZlYwXTlmTOYGBELJncgXjOd9oDYrTlDv/O7sifK4TyuZ+onndlwoI1iXVxRtyE jzUhMtSafH2S/KqPuImf5kNeNRrkYuxhLq592lw38BbnZfICR7G6VdKsO1ZvXkU+B8Ok UjOn4RjZ8g3J8Wj2QTotoZpaBD+/soPDWcAkdu9NhOPymBkH9KDWK5rgDCa4fcGchd9p YD4A== 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=aeL6ENOX7pztigFjtd4aneRHXGdD9m/NqUguyQGTLcQ=; b=mhdTTIsbi4TlY0bKZwTKwu/V3/d7M5DJyd7w6T8nKZzkA5mTEFzE+dyHGIZSygLRk2 TxJK2j4z7eb+btHunbkYrNNyYf23FA3ZjeR1XWDYw9m1FIAf3rYMzwepSo49mv0/hMBe EOk/O48UpKyUehsVDiCbSG2sH7gw3fXLslRL+EiD8wt4phw9qKEDdzqXfaL83coVbx7r v4gW/Rq+Ra/mjI+nSHNIiOTf9t0KWeSR5QrccfIXFyacI/RZrnlE5dJw9DesUXiRZNzH vwP1eK0+6H8Ky95ADwS5sDetGG1vozemrjLgMOHsnZThg9vT1F+lHDSjKkoahz1wSkFR EQyw== X-Gm-Message-State: APjAAAVYfFWENRi+NzgH97G+yZc6TxRuLyiZLMp7pNpNEOAHioYBtUQR 0HlQSVzhtbONQlaCCq4At3BKu/8T5ffMGaYiP9bDKQ== X-Received: by 2002:ac2:4945:: with SMTP id o5mr11533443lfi.93.1574426480231; Fri, 22 Nov 2019 04:41:20 -0800 (PST) MIME-Version: 1.0 References: <20191120142038.30746-1-ktouil@baylibre.com> <20191120142038.30746-2-ktouil@baylibre.com> In-Reply-To: <20191120142038.30746-2-ktouil@baylibre.com> From: Linus Walleij Date: Fri, 22 Nov 2019 13:41:08 +0100 Message-ID: Subject: Re: [PATCH 1/4] dt-bindings: nvmem: new optional property write-protect-gpios To: Khouloud Touil Cc: Bartosz Golaszewski , Rob Herring , Mark Rutland , Srinivas Kandagatla , baylibre-upstreaming@groups.io, "linux-kernel@vger.kernel.org" , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , linux-i2c 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 Khouloud, thanks for your patch! I just have a semantic comment: On Wed, Nov 20, 2019 at 3:21 PM Khouloud Touil wrote: > Instead of modifying all the memory drivers to check this pin, make > the NVMEM subsystem check if the write-protect GPIO being passed > through the nvmem_config or defined in the device tree and pull it > low whenever writing to the memory. It is claimed that this should be pulled low to assert it so by definition it is active low. > + wp-gpios: > + description: > + GPIO to which the write-protect pin of the chip is connected. > + maxItems: 1 Mandate that the flag in the second cell should be GPIO_ACTIVE_LOW > patternProperties: > "^.*@[0-9a-f]+$": > type: object > @@ -66,6 +71,7 @@ examples: > qfprom: eeprom@700000 { > #address-cells = <1>; > #size-cells = <1>; > + wp-gpios = <&gpio1 3 0>; #include wp-gpios = <&gpio1 3 GPIO_ACTIVE_LOW>; This will in Linux have the semantic effect that you need to set the output high with gpio_set_val(d, 1) to assert it (drive it low) but that really doesn't matter to the device tree bindings, those are OS-agnostic: if the line is active low then it should use this flag. It has the upside that the day you need a write-protect that is active high, it is simple to support that use case too. Yours, Linus Walleij