Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp32802ybl; Tue, 7 Jan 2020 01:32:36 -0800 (PST) X-Google-Smtp-Source: APXvYqxbbFWVsM2CcJM4+nzHAgBsXAdsQjISa/4loDRvcZgjeys1cqRa8EduMfS9sU0Uhl6EBtRC X-Received: by 2002:a9d:3e16:: with SMTP id a22mr126275039otd.259.1578389556855; Tue, 07 Jan 2020 01:32:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578389556; cv=none; d=google.com; s=arc-20160816; b=p19MznD5i8lXNahmPgBpm/fwTRGim5rwQFLKkDa+srUIIscZr5zlBHRp2vdGzn9w0F GjzQ+Y+7HogYrzdEmRNcX1qTHIX7UqyuElQr6DxrTQwxVxTtHkJqkLXGWL62erxnd14R vULK7uy0bleDwupThgvfAPCPnC07TuoHRhchC/7aNqGtyzkwEIog6JuS4Rdzkx6YzPBV xZ/dY/jCSMjGzL44RBibjielSbQrP3iMccmQ1ZuL0sps+ehUzi9XHn10KJ0uapeqV3X3 VdFCIZuRv5iRwernaNGGApn5jU/PSLi4YAb0D2Udv9cj66Vt8cXeI8MHWw3Z8280ukuM tTVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=ZhKekxLTP92RphP15HP22YKK/XHkNOZwqR3Bm0RWNn4=; b=UyH2ti9q3II5Nj0PJ1ZUfxxMP9xAjpdK2StWqFBvyhiynefzW5siXCRaZeNRuUWXE4 iXfRbu8bqG3bDYWi2AE56t/UEt+x+xIV/ttqrT+6JUZjB5FVCK/TZy7YhpsVSh3P9Iya 0hqyGj3FeLgtmKBpTaBMLnoH+tetmTq/Hql7wQF6cDlEMbACrjr0D9ULRA1bwtnQnSLl +NOcK01hPstpnxkjc6sM6+Fun9aEPdhj5tXc5tujzfGLCBmPsIIhj3winpS2Q21en7/9 1l8PXMu5kvjsHeezBLfI1eqv8ogXe/KtsICyO8SztEX41hO3YIhs5QzftZnOuAhaNyTE pllw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=ZJhcPv9V; 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 s68si36067900oih.275.2020.01.07.01.32.24; Tue, 07 Jan 2020 01:32:36 -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=ZJhcPv9V; 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 S1727772AbgAGJ36 (ORCPT + 99 others); Tue, 7 Jan 2020 04:29:58 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:34200 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727177AbgAGJ36 (ORCPT ); Tue, 7 Jan 2020 04:29:58 -0500 Received: by mail-wr1-f65.google.com with SMTP id t2so53079881wrr.1 for ; Tue, 07 Jan 2020 01:29:56 -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; bh=ZhKekxLTP92RphP15HP22YKK/XHkNOZwqR3Bm0RWNn4=; b=ZJhcPv9VdZ/7VIGypWEKwM5EncUxXp0fNe+4lYsmyU2Qk/MlORWzXDCDpxYwo/f8c5 nWI1WyE1jWYp1JRiQ5XcqZMB7lirXbLDe+NJQSrfFpLQgyqjU7wmB8o3qTDtJkUrdPoA 6Oc+IcB4gUH0jIpPkhx+4Ewbd5S0UfrpTA1iWpAsv058Buk1FKKxfIof+Fqf/zslP+yu u3mw0lfzhZdZkbBfw4Yf4PtDoCvBDckD5etJlXfebZIepenqHlVSy+W2OVFnKDKQFUCP y7HgQzbrwCmrTA5Om423DjuyBs6dRNz4JxViQtkE5o4qphLd0gwGlZbjfK6t5p9D8qe8 PYFA== 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; bh=ZhKekxLTP92RphP15HP22YKK/XHkNOZwqR3Bm0RWNn4=; b=sImF/xkQNVKaGw2s93pPKK1UTpshopvGDcvBeaP0Av5h9uiKaeqsuFxKekofdgBANM Qn4zShimEgl/R3JF0zp8oylAbbYZ71gYbV7/iGf2UnJTW4YBs97NF+MMGYg/l+4ZLMoO jBxGRrp0FIGcu6tdRqa7e74q2ay/aZCpzE0n9XB9YmPrd0EHIxkP9zdDrfroLQm5JYud 0BKZ5fuEm0UrWAHa/8lKOpBmgOE0/3csEBE5IyKaHfHhCmWmXZrOiObXPuZgnRds3tUv EaqWYHdFSAcxgnUgN6+kbDUblXSwKUy/sjbzawjucv2fnB0lMXqjFqqMegUTZIATU1Bv eC9Q== X-Gm-Message-State: APjAAAXSq2TmeFq55tSDZQUjAj+m03uWE/HN6e4Ru+yJzxBAb8noydA6 II3gD6wx7lwzbrTp18ztMYzYTQ== X-Received: by 2002:adf:a141:: with SMTP id r1mr109570212wrr.285.1578389396079; Tue, 07 Jan 2020 01:29:56 -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.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jan 2020 01:29:55 -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 0/5] at24: move write-protect pin handling to nvmem core Date: Tue, 7 Jan 2020 10:29:17 +0100 Message-Id: <20200107092922.18408-1-ktouil@baylibre.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The write-protect pin handling looks like a standard property that could benefit other users if available in the core nvmem framework. Instead of modifying all the 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. This patchset: - adds support for the write-protect pin split into two parts. The first patch modifies modifies the relevant binding document, while the second modifies the nvmem code to pull the write-protect GPIO low (if present) during write operations. - removes support for the write-protect pin split into two parts. The first patch modifies the relevant binding document to make the wp-gpio a reference to the property defined by nvmem , while the second removes the relevant code in the at24 driver. - adds reference in the at25 binding document for the wp-gpios property as it uses nvmem subsystem. Changes since v1: -Add an explenation on how the wp-gpios works -Keep reference to the wp-gpios in the at24 binding Changes since v2: -Use the flag GPIO_ACTIVE_HIGH instead of 0 Changes since v3: -Keep the example of the wp-gpios in the at25 bindings -Add reference for the wp-gpios property in the at25 binding Khouloud Touil (5): dt-bindings: nvmem: new optional property wp-gpios nvmem: add support for the write-protect pin dt-bindings: at24: make wp-gpios a reference to the property defined by nvmem dt-bindings: at25: add reference for the wp-gpios property eeprom: at24: remove the write-protect pin support .../devicetree/bindings/eeprom/at24.yaml | 5 +---- .../devicetree/bindings/eeprom/at25.txt | 2 ++ .../devicetree/bindings/nvmem/nvmem.yaml | 11 +++++++++++ drivers/misc/eeprom/at24.c | 9 --------- drivers/nvmem/core.c | 19 +++++++++++++++++-- drivers/nvmem/nvmem.h | 2 ++ include/linux/nvmem-provider.h | 3 +++ 7 files changed, 36 insertions(+), 15 deletions(-) -- 2.17.1