Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp31599ybl; Tue, 7 Jan 2020 01:31:09 -0800 (PST) X-Google-Smtp-Source: APXvYqzyXBnPyysaNoC00lQYSdBq9rfkBn8XoqK+tRQBtUw5TrSOS1GyBY+NNXnS72Y8NHnPqqxU X-Received: by 2002:a05:6830:20cf:: with SMTP id z15mr120920161otq.277.1578389469149; Tue, 07 Jan 2020 01:31:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578389469; cv=none; d=google.com; s=arc-20160816; b=W2/MKknEWGJuwv5sScZq4Uxn+WYxSSRCFvG65j/PehnyDni7E0jgETvA8P87o0V2rm q7CAhKXmHa68EXPYi1AZFFzLWR+u4hAWRm0rYiEfBQky7alWPz3PK/kJhSK8FnLEi5zD 7LE7nAcs9CGKDK3xNaAXoGfcBYMEensVGX8AjuRaZ8p8QlI27A0a8XOSm0jIVIC80XZy 1J46bV+U6pu8SuRZkgtTdkazFoZUuY5xl850y9VyXm58scpkZd2ARSLu4WP4bywHncMd FqOomnFNPuF8T5ZlnvkFYkSQgeDhq9WkewUANP53lj6DLVjj+Tlx8iBQX9/Xw6+VV5lb 6hIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=tY1YFADtaZKXzMf5Ie7W6ruxIu2Bb0htwIWWuGbAKcM=; b=ai2GGQRSvFjWjyeu+RmQTgbwx8iC9+66gQaYwcsjzq7MxQckoVFzevAhVA7WkgXHQU FFDI1tg4PViOilDVlBcDI0xWEd+Kd8KuVB3e53BF1Mh5y7smgMm4p4qZG6+aaT+JzJc5 bPyTOrzJXv2XB+JKHKJIo1NXuFap8YmrF0JKp6Nvn+HYkRnTlSwCf8WarhTxwkyqvGvH CGDOOduqeT3V4qk8I4uUl+SUGXQ8ONnRGGikeeMe5tQEHKZMsw4TWP28+4ZD2UyLsOci TFIew54seBqZmZdM26yOtTPXB5eR3d5mDzHyEtlWclhwazLQ3d7lI71/dr8N0VdtyFVc J1sA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=BT+XiI7K; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l3si33497743oih.0.2020.01.07.01.30.56; Tue, 07 Jan 2020 01:31:09 -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=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=BT+XiI7K; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727806AbgAGJaD (ORCPT + 99 others); Tue, 7 Jan 2020 04:30:03 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:45461 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727589AbgAGJ37 (ORCPT ); Tue, 7 Jan 2020 04:29:59 -0500 Received: by mail-wr1-f65.google.com with SMTP id j42so53041496wrj.12 for ; Tue, 07 Jan 2020 01:29:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=tY1YFADtaZKXzMf5Ie7W6ruxIu2Bb0htwIWWuGbAKcM=; b=BT+XiI7KL8AbXEnRoUphi5RAur5dTOV2WYkSXxsNVg5uOoY16h3spUJNcw+WDN0eE8 Q5Kuu9cKqxAScKglzuKOu9ImlN2vUCvsl7yUQkB/+PQewkGeMlrzdbeof2gkRE4kl5zh OZkGw2QPofaOfrL2yT/LE33DZCsOLM9J01mUix2D/Mb8FCxKGdcHOrzi8LpHxe8qAmSJ aRUJu/umX8XmfRMveLIccd9z17jBvwTdrkyBYwrT5bSu7B3aRoNZLNMOBdfkQMBlrZlU WEsMzFveyXDtc4CMtzTcDQoIqKI659lvX2nsG90szJDM8GoXJFs8Rgx/PqZf/++kn8wo nywQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=tY1YFADtaZKXzMf5Ie7W6ruxIu2Bb0htwIWWuGbAKcM=; b=Mk4ESIB5DYdU/IE3v1jiexcuKtIdy78LiMObnlogKwV5haLs77kl/dZLBe3Y38VefZ LyYm2adbt6O8tip9Xm6W5piWrZIPxDKuqbVtDlRF3M6v2u+MrU0bZEo6zocnaYIe4SOe +rmkkDN9hYC22WZvTd3Pl9ZFp2ub/Jz8+6W6f+ZlKesv/cq2dthJmlVLgl6Zmz4+mRDL 8Fj2ZiaEjeOaqe8Lg/dFsj07+rmMHwphHW+hGHWUOtTiWLKf2QB4V98Re610u4QKRSr3 49Z7Y5VJc/MC1EMRsh7ZbBqS8Ht4X1gMjf5ZFjxds7xZf9m2ep1fk/Rb6Orn++OxD0ed ciTA== X-Gm-Message-State: APjAAAUrpvyns0LpoDIUz225Uh+qLmlryy7BvBd8HasgyQVFQ0x4x1WZ O2nHgJ7vrUC+tYecLm1uI7U6Ug== X-Received: by 2002:a5d:4e0a:: with SMTP id p10mr106677513wrt.229.1578389397032; Tue, 07 Jan 2020 01:29:57 -0800 (PST) Received: from localhost.localdomain (i16-les01-ntr-213-44-229-207.sfr.lns.abo.bbox.fr. [213.44.229.207]) by smtp.googlemail.com with ESMTPSA id x14sm25959969wmj.42.2020.01.07.01.29.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jan 2020 01:29:56 -0800 (PST) From: Khouloud Touil To: bgolaszewski@baylibre.com, robh+dt@kernel.org, mark.rutland@arm.com, srinivas.kandagatla@linaro.org, baylibre-upstreaming@groups.io Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-i2c@vger.kernel.org, linus.walleij@linaro.org, Khouloud Touil Subject: [PATCH v4 1/5] dt-bindings: nvmem: new optional property wp-gpios Date: Tue, 7 Jan 2020 10:29:18 +0100 Message-Id: <20200107092922.18408-2-ktouil@baylibre.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200107092922.18408-1-ktouil@baylibre.com> References: <20200107092922.18408-1-ktouil@baylibre.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Several memories have a write-protect pin, that when pulled high, it blocks the write operation. 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