Received: by 2002:a17:90a:88:0:0:0:0 with SMTP id a8csp181904pja; Fri, 22 Nov 2019 05:08:47 -0800 (PST) X-Google-Smtp-Source: APXvYqxcvKs1a8nN8fEc3u1Imzn5/JP7A24TEPHMdzRA0nk505YyHx4nV3hu9+Xkkr5Znd4iG5dO X-Received: by 2002:a05:6402:168b:: with SMTP id a11mr956214edv.107.1574428127207; Fri, 22 Nov 2019 05:08:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574428127; cv=none; d=google.com; s=arc-20160816; b=npj8zBA/ULRBMD0eTNJ7HYUoFq/RkcftcFKR+xfF8jHRMitD1vKzw3aEHukrvkm2SE yCrgNmZmnQ4cAl3OFNnWBE+sGwyk4m1JFmtJ8eTLOUYN/1bWAKbvyrJRoKxbUnOuKvaS ZBpyKANKbuRKKo9A1YBxpWYqMe7DdEyAPVGpk04YNHKYAHZPCJiK9IZHmlIr5sPy2iL2 5AQOuCE6thQzNNb2z6ZJVTX+aHR6tDy+8kLoz0tEP9Nj8J2J0T3pJy6/KMWhvk2yDu+3 mYWHyXKqwhZpZIfyoIsMbSuGKO2oS5NPrvppTvo1r44XfhrdL6UGyVp8hO7eMoqQvdE2 6pUQ== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=fzPqklm51f4d+04Hk2lQiF3YOc8XKDMT60XYkopdcUs=; b=xoJXDWZSrNuNWNf8HaSB0s/QOMOzI2+2Cpn1BM+j44mDcjy1HHLr5kaGenQC8bytq1 WM1mAk62qnddx5Jcuf/BMr6wEmWvCTNWbo8fyV7l60iBlGxpHBBy34qrPfuDNPESWlB6 rCZbJBBiKcNtyimNsrpad9CsbPYYiWm4pX/IeLdeTA5FGMuXZ1/TpyAXmM4W2MuGAHjG UETtfo6lwMemqV2qJeLBq1cEAvkWeBFaaYaMN9QQhRqsyX3IPMJ/zFThDr3z46NOW5iV nn4DGWk6TtqnAZnuMRQAkQCnNF0cmx6q5mlMd2/UKrE2+e0/gAeUDWmU2qfD8oJhILl9 DsoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b="Cznat/dV"; 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 q7si4213947ejn.26.2019.11.22.05.08.19; Fri, 22 Nov 2019 05:08:47 -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="Cznat/dV"; 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 S1727401AbfKVNEP (ORCPT + 99 others); Fri, 22 Nov 2019 08:04:15 -0500 Received: from mail-oi1-f194.google.com ([209.85.167.194]:39435 "EHLO mail-oi1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726526AbfKVNEP (ORCPT ); Fri, 22 Nov 2019 08:04:15 -0500 Received: by mail-oi1-f194.google.com with SMTP id v138so6399911oif.6 for ; Fri, 22 Nov 2019 05:04:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=fzPqklm51f4d+04Hk2lQiF3YOc8XKDMT60XYkopdcUs=; b=Cznat/dVZPw9vqZe2bd3oZfkQzZl0vWz5bWzsmdOpvJGNKn6qNI+C+eCevnHvOdQEw DiPcgzw6YvU/vJNRB2xRSWiu8zLiN0QZ1ZWNZ0Mva9iIRMOUFAbrgyq8Kgoglke8mih3 Q8o62l9vxugKLHAeIcsfUPPWNJlQgTAhy5Jbs6Rwpi+e71pn0yUePkWQYidiviCtLMFz pgSHbflxkymTl5MGW24kHzVVL6qtYC8t5j5/Q3MKfneH0geutsfd6SqpEtskcb7Rts0o JcoVwKa+z5jQEUk5ln3MY7xKHUbQAtRi+hQsU3DnsvplJtPOTC/6edITOayA5o7fWlba VqHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=fzPqklm51f4d+04Hk2lQiF3YOc8XKDMT60XYkopdcUs=; b=DB7zOuCqIW3QEy4CltOClppfUvh241UqU8EnktnpJDcn1QGYnOqENSdq5JepycySNC alfFyj9i0T29iIWooSTGDt7/GiyRybokvu8Ubd/rTQuFCMmuo1MSkrDt6FqmjVxudUn2 SZYwHPVRvzmH71ONHWBrVS5qJvHS0ISB1Jx9VYwsJUXVPZ90xyA7DgM4w6IjsDlVz3Sq EI58pJ61Rdi+5WogNtfdfq8s73gcv8llAYapYbN5lcJLrct0MlXC6jbFshHlrYdcAb86 QWU6oRKSok6ofJHKlnHv3UEjFC/rxPdSjHurFXnpdWJjNBb6vvo7lx1yM8gZBjxuVgtI EOow== X-Gm-Message-State: APjAAAX1imdfFGpCp2Er2HiGBtfXAGpfpuKnmjmisxRmcTcQ8QNzT/0g GC+DwC7P7TiB3+iyLvb4gNce8SgjnMppZeFzClNHmA== X-Received: by 2002:a05:6808:498:: with SMTP id z24mr12274927oid.114.1574427854113; Fri, 22 Nov 2019 05:04:14 -0800 (PST) MIME-Version: 1.0 References: <20191120142038.30746-1-ktouil@baylibre.com> <20191120142038.30746-2-ktouil@baylibre.com> In-Reply-To: From: Bartosz Golaszewski Date: Fri, 22 Nov 2019 14:04:03 +0100 Message-ID: Subject: Re: [PATCH 1/4] dt-bindings: nvmem: new optional property write-protect-gpios To: Linus Walleij Cc: Khouloud Touil , Rob Herring , Mark Rutland , Srinivas Kandagatla , baylibre-upstreaming@groups.io, "linux-kernel@vger.kernel.org" , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , linux-i2c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org pt., 22 lis 2019 o 13:53 Linus Walleij napisa=C5= =82(a): > > On Fri, Nov 22, 2019 at 1:47 PM Bartosz Golaszewski > wrote: > > > what about the existing bindings for at24 that don't mandate the > > active-low flag? I'm afraid this would break the support for this > > specific chip or lead to code duplication if we had this in both nvmem > > and at24 with different logic. > > Hm yeah I realized this when I read patches 3 & 4. > > I would to like this: > > 1. Add a new generic property > writeprotect-gpios that mandates to use GPIO_ACTIVE_LOW > and use this in the new example > > 2. Deprecate wp-gpios in the binding, keep it around but deprecated. This is a pretty standard property though - for instance it is documented in the main mmc binding and doesn't mandate GPIO_ACTIVE_LOW either. I think this is because nobody says that the write-protect line must always be driver low to be asserted - this is highly implementation-specific. Bartosz > > 3. Add a quirk to gpiolib-of in the manner of the other quirks there > (like for SPI) so that if we are dealing with some EEPROM node > like at24 and the flag is zero, tag on GPIO_ACTIVE_LOW on > the descriptor. > > The driver will now handle the semantic of both cases > with gpiolib-of providing a quirk for the old binding. > > This is how we solved this type of problem before. > > Yours, > Linus Walleij