Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1834459ybl; Thu, 19 Dec 2019 03:53:34 -0800 (PST) X-Google-Smtp-Source: APXvYqzHawMo8h09kw8lHFS5M81aR6X2M8Oito5R9GTz6MRnctZ/iHV3vI7ltkAfrl6lT8d1px9g X-Received: by 2002:a9d:7305:: with SMTP id e5mr8035139otk.64.1576756414062; Thu, 19 Dec 2019 03:53:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576756414; cv=none; d=google.com; s=arc-20160816; b=IoqZT+hHyQNSJ/12F+Gnl1fIImSfUgf3L5EbFcZFvKS8zFgKGKPhOVZaiOeceX+MNo y0/YfQZKBIcSXZdghwJLjmUB8x/17fjLxEdTvENpz+h8vb+kH+oSXxz6U+0hTYWSIX8r 9azsaj4uRmZcVdEAwFMcv4bEFKzVOSj3edkL8xMOcEMOb26m5HmXXP7SjS0HReSaR6oB fbcWxCR8Na47FUd6jxdLcU2azze2UScVlVPnYMTTWS1EqrRu0bsr/Jggu8SbrlMDTrcy cFJrrWyO19Eo5ku/YKfN0Lt4/s53BQcejfKQEZijwLXOSpLpBYOl84dSFdQDw2v77V/f CPlQ== 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=rRTyPtsjMjEAp3h6bIlespvbMkUfnuh3fM/nsltxauk=; b=awpZIeiiSJ4srUkIXjA8gJNWm3fVcd9ket+WG9kqyH0u47a37cSRgRkPP84+Zaj1gb YKraUVXCzO9SGfyUpliOxUSKIyY9wxI3i2FcISo15BueVI53GOcLxjqt1n/afcWCaSwx l+25fSDO1Zx3o0Wb+Li/yVnF4d2RtfWIPnQRFKxxyvGand2I1YQ6fzsLAJaZtDQu0cBN lRZ3bWOxcpaxU9Xi/wfbp1ydcMFt9DFf9GzwaokAeF+v+Tsu4K3zd15/fC+ZGVZg0TO0 VST5WsGH9tXgfd4kB6sJOrOleO2cB3zd4pRklNIzQ0P2brIj3T/9KFpeCIVn1AEQPTmV i1JQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=j4P8x9pA; 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 f190si3030381oig.229.2019.12.19.03.53.21; Thu, 19 Dec 2019 03:53:34 -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=j4P8x9pA; 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 S1726767AbfLSLwA (ORCPT + 99 others); Thu, 19 Dec 2019 06:52:00 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:50931 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726704AbfLSLwA (ORCPT ); Thu, 19 Dec 2019 06:52:00 -0500 Received: by mail-wm1-f66.google.com with SMTP id a5so5137939wmb.0 for ; Thu, 19 Dec 2019 03:51:58 -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=rRTyPtsjMjEAp3h6bIlespvbMkUfnuh3fM/nsltxauk=; b=j4P8x9pASoURu4wvSqYR573rGBqgZhFgTCNK3NR2oqpfo8w4XmlKWhhk4H2E03GOnc zm4jUaBMucQsNyybYjX4ocsJAkc1ocWjtoX9OzlPnPlBc7erHf07TzueZGNm9jT6wZXn 8J4azit5Sxu63FrG/JtGyFCLAFTsrO+FVE2D80F6PhmDjnt9pgxx986zP3VstkZVsd3w HYKpL5Wq9j5J6/X39WTu6HPoy0wDH2jXCFz7s8yXJRsS3qb+EH1Om8qRMUrQZAizlkoT lBqVy6mrqRxKuJXUN1a8XN4Ajx6sm4WpFblaxhBPQHsufABTPqgXAR2NtFsQa3ux89H2 +4Ww== 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=rRTyPtsjMjEAp3h6bIlespvbMkUfnuh3fM/nsltxauk=; b=MHdwI7+X3bnlp6ewYkttNufigSTLcUU9fjDtYXHWUNv3BksMJNXsgvZYbyKnf7Z0wi 5W64pxa02X8Kfi7CC74qchCuRUFbV8T5GhLGvX0GxCA5LkV9smXoXmmYBwjLlC+YcCXs S6+O/ZITznvVrEtDLOx7q00jV0TqD1W+LOKWpFA7KAWKCnTQV5bEfxDQGa981nybJX4O mx+EE1hQFAxqPrzSJ+WsDlGhGO4RchspHRkl0AM/K/s/d3wA8flPjjxxt1KbtBF+aKbd VVH43Rm8YhwVcOr2dEKPzymlT8n7jKXuJDeBpQrQOvAa9ZYjiO+03aKvq/zfR+c41jWK wNNQ== X-Gm-Message-State: APjAAAVA1x/vyet5xFkmBrSj/UGi4R6rrAcosQYDHIzWmzzrR57cV5DI Tufon5ZwO9E4352z/USa6PHuZw== X-Received: by 2002:a05:600c:2215:: with SMTP id z21mr9999932wml.55.1576756317614; Thu, 19 Dec 2019 03:51: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 k16sm6489660wru.0.2019.12.19.03.51.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 03:51:57 -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 v3 0/4] at24: move write-protect pin handling to nvmem core Date: Thu, 19 Dec 2019 12:51:37 +0100 Message-Id: <20191219115141.24653-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 remove the wp-gpio, while the second removes the relevant code in the at24 driver. 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 Khouloud Touil (4): dt-bindings: nvmem: new optional property write-protect-gpios nvmem: add support for the write-protect pin dt-bindings: at24: remove the optional property write-protect-gpios eeprom: at24: remove the write-protect pin support .../devicetree/bindings/eeprom/at24.yaml | 6 +----- .../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 +++ 6 files changed, 34 insertions(+), 16 deletions(-) -- 2.17.1