Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1782837ybl; Thu, 19 Dec 2019 02:59:20 -0800 (PST) X-Google-Smtp-Source: APXvYqwZ/itcKCCvX+WqRSud7BrEmDQmCeePSPNESvtnHxVx6gmMcJOxogtu6H5eSogW3dDA/PQH X-Received: by 2002:a9d:7590:: with SMTP id s16mr7651406otk.89.1576753160539; Thu, 19 Dec 2019 02:59:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576753160; cv=none; d=google.com; s=arc-20160816; b=ro1FI56CaH0CjDPG9J5eDGDqkHhMfEj/6BcbqyB43Ejz1S8ibgSVAWoV2H+e6+QT1z SmDAKuyR8Nda6t4IN34WReHrMlU7BjjzQDESg/WYOraRhOu2Fw92UrTAr0Xm4lToCl+B o2Mq6kxgQnklm+62gWXv0UlW2YRKBFVTq3ehdyz56MhXth9SJDgA0qTTAP8zCT8YzGyl zczfaZ2G0EEXTr3Zbit3+v1GknJvh8DcJU0EP1uo5rLxeuqEihj65ZsfGwURsMvbYWZ+ 0p2IPjMGiNmrAgN7ggjtm+ndFGaYUlOQYvTASogDDyR+Gu5CymWoU9/lFxQP+LhC0bTB r3cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=5Q6JHWk739xDDCKW+bRI8JXmRfOhV3reXhjb+RjWQi4=; b=n6DglVa0Tv1iJxovacgSq7g45jhCVisIWywb4mZlM8YBfQjfHjQk4evdoKXRKgRM/P Asvo0eSmFWZPxxixs9Nh2PNHdxn5SiuewqVUZfkp32n4T0BrZhqdezUaqokj3Mg6mABu lhwA5TEQKgN9eAjh7v/U1Q9Kc5QEsZyxVo+kLRUySbxufxTyr0LPJiby7HoCOLirZode P+CbeMJOJb77APBqGPUMpW1CNUhIJnuZJ1rM1/kslOslU0wAnudva1fKcs27Sjc2bzJV BrHJSOb3Bu89MkN7AuOwVsOhw7HlldESv2KQJukVeU06RdGmjLkJrY2oxijALVj2jPwQ uQsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yxbUaQR0; 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 v23si1581210ote.118.2019.12.19.02.59.07; Thu, 19 Dec 2019 02:59:20 -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=yxbUaQR0; 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 S1726725AbfLSK6V (ORCPT + 99 others); Thu, 19 Dec 2019 05:58:21 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:36090 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726702AbfLSK6V (ORCPT ); Thu, 19 Dec 2019 05:58:21 -0500 Received: by mail-wr1-f65.google.com with SMTP id z3so5528915wru.3 for ; Thu, 19 Dec 2019 02:58:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=5Q6JHWk739xDDCKW+bRI8JXmRfOhV3reXhjb+RjWQi4=; b=yxbUaQR0OaOY62E64p7ZtrGmCe3a9ltKn0UeAY1I8kENAnPRlhPjxRXUsfCjcW7Prc 9GjsfCnqHewNZusceEgkk+HgioCdLhU5oqa0++U5yWLBlgoL0qfjJPUH+wKyVIMB4DF6 PELUo7owpd/K6wlCOnXsvk+7KR0922E+nPCYiXWiyIvzF9O6LSeAQm+8j0RSekETk+Pa VcRIoh51OO4rMEl6Gp7jV/iNdUX7sBEt/+eq+SxQEvU1NyevVmgTgdZ6YL7iWyTVAfCh zd0Y2L6e8R+Xx9ZGhoMwrakR18R1S1gNLiDuvO6HfjYEhhg347fkOgaXxiL5PRQrmhII vUVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=5Q6JHWk739xDDCKW+bRI8JXmRfOhV3reXhjb+RjWQi4=; b=JuI869PxcTlDfTqoD+wAeDZvuER4lxs9iyAuWjJGtUtu32nzxnavbGB+HJrCZCdlUS XUl7G/+5UHJiBR/oaAKKQxAOyl7EXppUC8vQvqYA8dqD5mfoXEltWZDZE7AZBoFFk6fT KDLQqKWa5vgk38cqHftdJGZr6L7lo7x38C2xf94Sucnabb/tai3id4czITwJhBAGUROO o8/wFpTgOTii8SmyRayE690i2ekueODAjc6Bi54jR+Zmmwnnn8Yx8alJrXOC+p5AwbE7 DU/3RN8Hp2Qb07Xh33FAD33GboMqZjCPFa3MP8Ez6O+QEn/vdVNj7C8Qz7JvPKavhTAm KyXQ== X-Gm-Message-State: APjAAAVi3lT5+f8iPGolT+aVpcYJDIS847L30i4iDAdO4NHWJwKe5Th1 5zNA9xSMSDCgXDd9ks6+TtHUsQ== X-Received: by 2002:adf:dd51:: with SMTP id u17mr8413151wrm.290.1576753099094; Thu, 19 Dec 2019 02:58:19 -0800 (PST) Received: from [192.168.86.34] (cpc89974-aztw32-2-0-cust43.18-1.cable.virginm.net. [86.30.250.44]) by smtp.googlemail.com with ESMTPSA id x10sm5918379wrv.60.2019.12.19.02.58.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Dec 2019 02:58:18 -0800 (PST) Subject: Re: [PATCH v2 2/4] nvmem: add support for the write-protect pin To: Khouloud Touil , bgolaszewski@baylibre.com, robh+dt@kernel.org, mark.rutland@arm.com, baylibre-upstreaming@groups.io Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-i2c@vger.kernel.org, linus.walleij@linaro.org References: <20191210154157.21930-1-ktouil@baylibre.com> <20191210154157.21930-3-ktouil@baylibre.com> From: Srinivas Kandagatla Message-ID: Date: Thu, 19 Dec 2019 10:58:17 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20191210154157.21930-3-ktouil@baylibre.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/12/2019 15:41, Khouloud Touil wrote: > 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 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. > > There was a suggestion for introducing the gpiodesc from pdata, but > as pdata is already removed it could be replaced by adding it to > nvmem_config. > > Reference: https://lists.96boards.org/pipermail/dev/2018-August/001056.html > > Signed-off-by: Khouloud Touil > --- > drivers/nvmem/core.c | 19 +++++++++++++++++-- > drivers/nvmem/nvmem.h | 2 ++ > include/linux/nvmem-provider.h | 3 +++ > 3 files changed, 22 insertions(+), 2 deletions(-) > > diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c Acked-by: Srinivas Kandagatla