Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp820183imm; Fri, 1 Jun 2018 10:04:31 -0700 (PDT) X-Google-Smtp-Source: ADUXVKITAEpkm/YYl0fbtigHS3zErLCObNvlcCy/Q9448hvnWvtULgw2XQSnCDZYBpQLogPImD49 X-Received: by 2002:a63:b646:: with SMTP id v6-v6mr3024760pgt.276.1527872671746; Fri, 01 Jun 2018 10:04:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527872671; cv=none; d=google.com; s=arc-20160816; b=AwhgQUeBsOJSNfNIg6yw3QGE4nzHYxLRR/aC9aiIgZ700T34C45R3pBHbhvV+InN7f whNuPjXTpUcGn7nBQ1RBPINJgbX3XJwTo2Y1qfmP1n4eJ2Yw+5/nvCRfJ2wz2L0A8Jbd GSugag4KKuCdGpHtI5kZX1px17Z7IimcDlG3+lII70go4iLrlUo29XwuR3NpEhQvLwRT 567mQqKr1aPftVUm++0iCSK5PFNOPoOlwy84E3bTfW7e8doSIV1wnDBUcQE2S0spDu/c 6kLph1kfYyH4IHy+8ZzVFrJbzsNUtcY4dBX6nJ1oiRWVKMW1YO+YsZvshLeXCBXZsCPS G67A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=jDzqBU1xf9kw1XZS4b37WITZRP2NfGMTiAOXG1u8YKg=; b=chO+rEEkhb983CWLPxGL+o9cooTXC4pqaDW0U3ldvpz2uaJSWgZHbobYN5Q3mGh4om bbeYx9vgZsUNsRvb7tU0J9NcGTOGKoFs4jNwYW4z9NjRgyBmX5d4Avsvr9O5U5Nlr5/0 kB+OHcfGj59IooC8QxRz2pin2B4qak3Okyu+wzp2Khdf5kSVyvmdQJoNpatL1neL6gqw HTpwOiSBcqlle3YejWfi+iV+O3jfEGX0d+Qa7E+qPrSn2XgGZXdYDpanH1j7a7D7gxsB YhQupXWJd50rwi2hwE7dSGqRd0nL/+wVMb2nCP31vOwLi9ufTMpOiwov2Bo5oc9tgcQf uccw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=V+LC9iLW; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c17-v6si4053727pfi.102.2018.06.01.10.04.17; Fri, 01 Jun 2018 10:04:31 -0700 (PDT) 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=@kernel.org header.s=default header.b=V+LC9iLW; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753283AbeFARDt (ORCPT + 99 others); Fri, 1 Jun 2018 13:03:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:42210 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752687AbeFARDo (ORCPT ); Fri, 1 Jun 2018 13:03:44 -0400 Received: from mail-qk0-f171.google.com (mail-qk0-f171.google.com [209.85.220.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E43762087D; Fri, 1 Jun 2018 17:03:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527872624; bh=hByYmXzo7AgmbuezejJDIMyDEiX3eZ3cjSkiR0rPeJw=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=V+LC9iLW7E1ONKWVZfFwbMhQieBcwQxPjaDLAoR30cKvl8R02/GCwmgp99lIrrfxP QmLakKyZzG6S0Wgb6YovrxT5Og1CqwGF3Cpe57fAEdyJuN7U5TFVanNU1+sWXVmTKd HmlQ9C7uHclYRh0I6kFJvWSElAYkWodYPA03HuDg= Received: by mail-qk0-f171.google.com with SMTP id h19-v6so20381499qkj.10; Fri, 01 Jun 2018 10:03:43 -0700 (PDT) X-Gm-Message-State: APt69E0lMVT0qbqYCeetwjhQJId0AUrjegGgzcjCMyAcQUMCHQK9H4kg O49ScyaI0sao2kIplXqyL/VEMBD2joQse0YZEg== X-Received: by 2002:a37:6188:: with SMTP id v130-v6mr11290413qkb.43.1527872623069; Fri, 01 Jun 2018 10:03:43 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a0c:9b02:0:0:0:0:0 with HTTP; Fri, 1 Jun 2018 10:03:22 -0700 (PDT) In-Reply-To: <0d08ba26-77f2-6c42-8fb1-214aaf6085e9@t-chip.com.cn> References: <1527737273-8387-1-git-send-email-djw@t-chip.com.cn> <1527737273-8387-3-git-send-email-djw@t-chip.com.cn> <0d08ba26-77f2-6c42-8fb1-214aaf6085e9@t-chip.com.cn> From: Rob Herring Date: Fri, 1 Jun 2018 12:03:22 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 2/5] gpio: syscon: rockchip: add GPIO_MUTE support for rk3328 To: Levin Cc: "open list:ARM/Rockchip SoC..." , Wayne Chou , Heiko Stuebner , devicetree@vger.kernel.org, Linus Walleij , "linux-kernel@vger.kernel.org" , "open list:GPIO SUBSYSTEM" , Mark Rutland , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 31, 2018 at 9:05 PM, Levin wrote: > Hi Rob, > > > On 2018-05-31 10:45 PM, Rob Herring wrote: >> >> On Wed, May 30, 2018 at 10:27 PM, wrote: >>> >>> From: Levin Du >>> >>> In Rockchip RK3328, the output only GPIO_MUTE pin, originally for codec >>> mute control, can also be used for general purpose. It is manipulated by >>> the GRF_SOC_CON10 register. >>> >>> Signed-off-by: Levin Du >>> >>> --- >>> >>> Changes in v3: >>> - Change from general gpio-syscon to specific rk3328-gpio-mute >>> >>> Changes in v2: >>> - Rename gpio_syscon10 to gpio_mute in doc >>> >>> Changes in v1: >>> - Refactured for general gpio-syscon usage for Rockchip SoCs. >>> - Add doc rockchip,gpio-syscon.txt >>> >>> .../bindings/gpio/rockchip,rk3328-gpio-mute.txt | 28 >>> +++++++++++++++++++ >>> drivers/gpio/gpio-syscon.c | 31 >>> ++++++++++++++++++++++ >>> 2 files changed, 59 insertions(+) >>> create mode 100644 >>> Documentation/devicetree/bindings/gpio/rockchip,rk3328-gpio-mute.txt >>> >>> diff --git >>> a/Documentation/devicetree/bindings/gpio/rockchip,rk3328-gpio-mute.txt >>> b/Documentation/devicetree/bindings/gpio/rockchip,rk3328-gpio-mute.txt >>> new file mode 100644 >>> index 0000000..10bc632 >>> --- /dev/null >>> +++ >>> b/Documentation/devicetree/bindings/gpio/rockchip,rk3328-gpio-mute.txt >>> @@ -0,0 +1,28 @@ >>> +Rockchip RK3328 GPIO controller dedicated for the GPIO_MUTE pin. >>> + >>> +In Rockchip RK3328, the output only GPIO_MUTE pin, originally for codec >>> mute >>> +control, can also be used for general purpose. It is manipulated by the >>> +GRF_SOC_CON10 register. >>> + >>> +Required properties: >>> +- compatible: Should contain "rockchip,rk3328-gpio-mute". >>> +- gpio-controller: Marks the device node as a gpio controller. >>> +- #gpio-cells: Should be 2. The first cell is the pin number and >>> + the second cell is used to specify the gpio polarity: >>> + 0 = Active high, >>> + 1 = Active low. >>> + >>> +Example: >>> + >>> + grf: syscon@ff100000 { >>> + compatible = "rockchip,rk3328-grf", "syscon", >>> "simple-mfd"; >>> + >>> + gpio_mute: gpio-mute { >> >> Node names should be generic: >> >> gpio { >> >> This also means you can't add another GPIO node in the future and >> you'll have to live with "rockchip,rk3328-gpio-mute" covering more >> than 1 GPIO if you do need to add more GPIOs. > > > As the first line describes, this GPIO controller is dedicated for the > GPIO_MUTE pin. > There's only one GPIO pin in the GRF_SOC_CON10 register. Therefore the > gpio_mute > name is proper IMHO. It's how many GPIOs in the GRF, not this register. What I'm saying is when you come along later to add another GPIO in the GRF, you had better just add it to this same node. I'm not going to accept another GPIO controller node within the GRF. You have the cells to support more than 1, so it would only be a driver change. The compatible string would then not be ideally named at that point. But compatible strings are just unique identifiers, so it doesn't really matter what the string is. I'm being told both "this is the only GPIO" and "the GRF has too many different functions for us to tell you what they all are". So which is it? Rob