From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE472C432C0 for ; Fri, 22 Nov 2019 13:04:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9D5CA20715 for ; Fri, 22 Nov 2019 13:04:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="Cznat/dV" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727209AbfKVNEP (ORCPT ); Fri, 22 Nov 2019 08:04:15 -0500 Received: from mail-oi1-f195.google.com ([209.85.167.195]:37347 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726836AbfKVNEP (ORCPT ); Fri, 22 Nov 2019 08:04:15 -0500 Received: by mail-oi1-f195.google.com with SMTP id y194so6418349oie.4 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=IJec5MFCxZBZ1LUzrFmlP3LHX6V9OCjqO94yvyQJ7n6K2uP3GYE5DZSfjHHOWDdLgR 9NHYo9H1ucmLjvISnpvIIH9vpTFXcIUVMXGcDfQpGwuvbUEIdIoWnjrXfVIvFp8TFp60 nFp8Q1bnqrQkLF0g5y9Bmazto9Bw4pb85ljqGW4b9uo8uLkZVZIb3W4eGMwzsf06KTo9 TlshO/9Up8V+SN/yohqINm7M3wvhUQl40jEEch0KtDumZxt8cmKGQk4YgUtU8PJVSrOG vuJ1OAMwqSZIw4dFarLsTT7cBMo0vc+eaKtIPWl2hzlJiJOVsRUcK3D9oGmGb5SxAEoN AW/A== X-Gm-Message-State: APjAAAUh5kNlgTFG3CSITiTeJ+UULGQhBMRwpxwrBUHKu1dOGRbA4hu4 hGau6vt1zdUYIGfDhItCZiJj5N35E9ZU5j9lblMNuQ== X-Google-Smtp-Source: APXvYqy2JE5Ni1hucVa+uC4X3b7zH+41DjbxZJ2O7HjBDpIvPEzKv2S1eu0QvaHdn8sa03AeYVlSy23xr8VmtmUiRPM= 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: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@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