Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp19092777ybl; Fri, 3 Jan 2020 15:41:38 -0800 (PST) X-Google-Smtp-Source: APXvYqxwaxjtrZVL45crbcBGnfanVStMa+hZF0ae2bBkEiU54UX2VpwHavy/C0yCt4m7F1n8b1qg X-Received: by 2002:a05:6830:1f13:: with SMTP id u19mr72721201otg.237.1578094898887; Fri, 03 Jan 2020 15:41:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578094898; cv=none; d=google.com; s=arc-20160816; b=qS+GX4BlcNvxm44e+9tIfg1W/evke7OJ7BNQ+SqSacoKlo81SH2T13zRJBpXSCNY7T 8d511fn07Bh2JppLIymqUPAL46+wermBjnux3RlEa2xYSt3lsCqiATnpugZVNw2AIHGe MtJEV/NAG9qSEfLgV4bMMaBlLpnWN6VCM6Tl5b8jgPOGu9+8vXjKaI6R25Qpla77wQmf NQjI1BPSjOmSRwF4bbl+sVrFoHi2A5ZhUGoTvT1TFwc2GwYz8LNx0MSAXckRUqfVanKx C1GDKbNo3Z18K8SZlH792+P45+bCab/5KJ8H5Cnvq8mCej2/iADIhjRcYwP7T0KABrGr 5i5Q== 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=1G7HBZ/lx4jhuYMngmAkk5nXPN0Gyvary5PxJkGPU+Q=; b=dHN+mfyWpiFC62yT80xlAmMjF+hAmkvs/tPPRzmY4IGFXpU93Pbjpci+IwOIdEfJRg HYrChT9Mf5Pm5Ulp3tAo1JL1yTGevyYMZGUXuGr6U8BXl+SYgdaQvozRhvAGKuk2L2jt kBe/vb7V06T1sFAWfWCwBRHPUxDuMyIYwI9rEMjyNEdPSVcs/44+5O4nB4RlJEsf+WCw 9Jsbrwd4s5SZWM/mPU5VkorP6ydlxsIPhDCQv/soTQgKOePmOtsxQUqRJEnZgS7w2ukF phrnsIcJ8Zp+v1o8/aq+gEA2bQhg4qwPUXO0SzI6ohTqvPrCW+Qm1vE8QdAEbSP+bJ4k Q+eQ== 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q16si31497966otk.226.2020.01.03.15.41.27; Fri, 03 Jan 2020 15:41:38 -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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726548AbgACXkq (ORCPT + 99 others); Fri, 3 Jan 2020 18:40:46 -0500 Received: from mail-io1-f68.google.com ([209.85.166.68]:43218 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726232AbgACXkq (ORCPT ); Fri, 3 Jan 2020 18:40:46 -0500 Received: by mail-io1-f68.google.com with SMTP id n21so41472268ioo.10 for ; Fri, 03 Jan 2020 15:40:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=1G7HBZ/lx4jhuYMngmAkk5nXPN0Gyvary5PxJkGPU+Q=; b=akIi3v9DPNZ2BzuL6QiU0/3VvWGHv3IymfLcphyW9s98xksSOEmZTaI30AUdic88TM OVLPzPQJTQ6WYcwZNWAYAhBmd4MTT0OFrciQfZdxFmrqSU+ublGaSw8xaTZv/SOoM48e FpG3TN35Z7GvexroTflHXRl4kKgSHXxX8h6yiE92Uya5HZ+X0HM3NuyeR/B/VhCoSxsW vZSpvr+Oa3UT1qB1ZtAz2TbEF/iHofex+ZPCjgX9YLbER0tif/153OP+SvbPH9Z/WJjE 5fm4Dd7KA/nbGptGD7xGqKNXE31M75xJtVg6EoL5HwoLZce96vyRblVcQOXXjiMECNjs sypg== X-Gm-Message-State: APjAAAVorV7p8Zj9Jh/wBobpl1OdT41ihYgFy/lckfoTL+jJ/Umq0+Rx HztpQ+3Mmk9+4ZDl8Vfvomv+C7E= X-Received: by 2002:a02:6515:: with SMTP id u21mr69575122jab.82.1578094845225; Fri, 03 Jan 2020 15:40:45 -0800 (PST) Received: from rob-hp-laptop ([64.188.179.251]) by smtp.gmail.com with ESMTPSA id b1sm21244746ilc.33.2020.01.03.15.40.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jan 2020 15:40:44 -0800 (PST) Received: from rob (uid 1000) (envelope-from rob@rob-hp-laptop) id 2219a5 by rob-hp-laptop (DragonFly Mail Agent v0.11); Fri, 03 Jan 2020 16:40:42 -0700 Date: Fri, 3 Jan 2020 16:40:42 -0700 From: Rob Herring To: Khouloud Touil Cc: bgolaszewski@baylibre.com, mark.rutland@arm.com, srinivas.kandagatla@linaro.org, baylibre-upstreaming@groups.io, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-i2c@vger.kernel.org, linus.walleij@linaro.org Subject: Re: [PATCH v3 1/4] dt-bindings: nvmem: new optional property write-protect-gpios Message-ID: <20200103234042.GA14976@bogus> References: <20191219115141.24653-1-ktouil@baylibre.com> <20191219115141.24653-2-ktouil@baylibre.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191219115141.24653-2-ktouil@baylibre.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 19, 2019 at 12:51:38PM +0100, Khouloud Touil wrote: > Several memories have a write-protect pin, that when pulled high, it > blocks the write operation. Subject doesn't match the actual property name. > > On some boards, this pin is connected to a GPIO and pulled high by > default, which forces the user to manually change its state before > writing. > > 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. > > Add a new optional property to the device tree binding document, which > allows to specify the GPIO line to which the write-protect pin is > connected. > > Signed-off-by: Khouloud Touil > --- > Documentation/devicetree/bindings/nvmem/nvmem.yaml | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/Documentation/devicetree/bindings/nvmem/nvmem.yaml b/Documentation/devicetree/bindings/nvmem/nvmem.yaml > index 1c75a059206c..b43c6c65294e 100644 > --- a/Documentation/devicetree/bindings/nvmem/nvmem.yaml > +++ b/Documentation/devicetree/bindings/nvmem/nvmem.yaml > @@ -34,6 +34,14 @@ properties: > description: > Mark the provider as read only. > > + wp-gpios: > + description: > + GPIO to which the write-protect pin of the chip is connected. > + The write-protect GPIO is asserted, when it's driven high > + (logical '1') to block the write operation. It's deasserted, > + when it's driven low (logical '0') to allow writing. > + maxItems: 1 > + > patternProperties: > "^.*@[0-9a-f]+$": > type: object > @@ -63,9 +71,12 @@ patternProperties: > > examples: > - | > + #include > + > qfprom: eeprom@700000 { > #address-cells = <1>; > #size-cells = <1>; > + wp-gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>; > > /* ... */ > > -- > 2.17.1 >