From patchwork Thu Jun 1 20:08:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ralph Sennhauser X-Patchwork-Id: 769930 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3wdz1d20YXz9sNJ for ; Fri, 2 Jun 2017 06:08:37 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="S8KH7gLc"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751129AbdFAUIg (ORCPT ); Thu, 1 Jun 2017 16:08:36 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:34356 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751120AbdFAUIe (ORCPT ); Thu, 1 Jun 2017 16:08:34 -0400 Received: by mail-wm0-f68.google.com with SMTP id d127so13961975wmf.1; Thu, 01 Jun 2017 13:08:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=LuKWbk+MEJyiAgQKOHoJAX4iGCDv6NTZviVgboursbQ=; b=S8KH7gLc4hujkplCF/desPa5weHudGKkNUATniz4l63ZRfnjebANsFBxDU2gfxcR7W +2QY+REcJje+/gfnhVCas5r/RLXbpUMPRuyPYwskY1kv6la4zn7Qrj5nu6ONeYN0AvNu zle4eKrq7TkdZe+KyUevScqmRM9rgD0AAjgxmjlOtYeQiVabta2z8njoUUosYp0ATu6B VTYAugw2zNnpaTPxGWLdf4JGmMnsDopGPsc/7p1VbTq4We+ajTpKw6GZYj10Wsh7mwva PIMLR20RjfPlh+XSmbvXUgmjSHTAvQfqnd+w2hO4/JDZ0r4eSywml9QATEE7xnN3WIrZ Vm/A== 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=LuKWbk+MEJyiAgQKOHoJAX4iGCDv6NTZviVgboursbQ=; b=ZSR8I3UvfBEJeq4GlWFwWn8HsnT2/UcObQwsC4pxpDtiXly+MxWIZLhorXEi9h8fph SSQh84+ivkSslu/KcfPMF5nlEqXuhyHzkYBVGW3cKALzacVTkQcpQZoxiZHyDDMjV8Uy RHCMhnzQFRuXvRZL0QFcYuCMwxRoluS4f8XT6BtRWBmMzYI7b+L81Z31puNirSNbxkEp LqkGKT3ZsDJLyiWplUE8nCZdE7Kr9JBoKEyHuvFxAzlE+p90+cEyocBlX0nLOiDhxugr 6IeDFI9QwIhxCd+8L2us0RFFLyO/Lvn89keKLk5UOx+GKoRO5qRsOsTBXm3jNHGozmaE O6sg== X-Gm-Message-State: AODbwcCvJYG3xOvivJMIx562jKo9BNGH1ugiGDwMTbDHlX4KoeZVYIOY y13BZt4YKovZLXHP X-Received: by 10.28.212.14 with SMTP id l14mr680808wmg.20.1496347712473; Thu, 01 Jun 2017 13:08:32 -0700 (PDT) Received: from localhost.lan ([37.209.189.139]) by smtp.googlemail.com with ESMTPSA id t8sm8499711wrc.28.2017.06.01.13.08.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Jun 2017 13:08:31 -0700 (PDT) From: Ralph Sennhauser To: linux-gpio@vger.kernel.org Cc: Linus Walleij , Thierry Reding , Alexandre Courbot , Rob Herring , Mark Rutland , Jason Cooper , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Russell King , Richard Genoud , linux-arm-kernel@lists.infradead.org, linux-pwm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Ralph Sennhauser Subject: [PATCH] gpio: mvebu: change compatible string for PWM support Date: Thu, 1 Jun 2017 22:08:20 +0200 Message-Id: <20170601200820.22396-1-ralph.sennhauser@gmail.com> X-Mailer: git-send-email 2.10.2 Sender: linux-pwm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pwm@vger.kernel.org As it turns out more than just Armada 370 and XP support using GPIO lines as PWM lines. For example the Armada 38x family has the same hardware support. As such "marvell,armada-370-xp-gpio" for the compatible string is a misnomer. Change the compatible string to "marvell,armada-370-gpio" before the driver makes it out of the -rc stage. This also follows the practice of using only the first device family supported as part of the name. Also update the documentation and comments in the code accordingly. Fixes: 757642f9a584 ("gpio: mvebu: Add limited PWM support") Signed-off-by: Ralph Sennhauser Acked-by: Gregory CLEMENT Acked-by: Rob Herring --- Hi everyone, The suggestion to change the compatible string last minute comes from Gregory CLEMENT after we realized the bad choice of name due to Richard Genoud reporting an issue when he used the driver with an Armada-388. Rob Herring just requested to use a separate compatible string but not what it should look like. So I assume he is fine with the new one as well. The rest of this patch is rather minor. Nothing in tree is using this driver so far, first consumers will be added with 4.13. Ralph --- Documentation/devicetree/bindings/gpio/gpio-mvebu.txt | 6 +++--- drivers/gpio/gpio-mvebu.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Documentation/devicetree/bindings/gpio/gpio-mvebu.txt b/Documentation/devicetree/bindings/gpio/gpio-mvebu.txt index 42c3bb2..01e331a 100644 --- a/Documentation/devicetree/bindings/gpio/gpio-mvebu.txt +++ b/Documentation/devicetree/bindings/gpio/gpio-mvebu.txt @@ -41,9 +41,9 @@ Required properties: Optional properties: In order to use the GPIO lines in PWM mode, some additional optional -properties are required. Only Armada 370 and XP support these properties. +properties are required. -- compatible: Must contain "marvell,armada-370-xp-gpio" +- compatible: Must contain "marvell,armada-370-gpio" - reg: an additional register set is needed, for the GPIO Blink Counter on/off registers. @@ -71,7 +71,7 @@ Example: }; gpio1: gpio@18140 { - compatible = "marvell,armada-370-xp-gpio"; + compatible = "marvell,armada-370-gpio"; reg = <0x18140 0x40>, <0x181c8 0x08>; reg-names = "gpio", "pwm"; ngpios = <17>; diff --git a/drivers/gpio/gpio-mvebu.c b/drivers/gpio/gpio-mvebu.c index 19a92ef..f94fd47 100644 --- a/drivers/gpio/gpio-mvebu.c +++ b/drivers/gpio/gpio-mvebu.c @@ -721,7 +721,7 @@ static int mvebu_pwm_probe(struct platform_device *pdev, u32 set; if (!of_device_is_compatible(mvchip->chip.of_node, - "marvell,armada-370-xp-gpio")) + "marvell,armada-370-gpio")) return 0; if (IS_ERR(mvchip->clk)) @@ -845,7 +845,7 @@ static const struct of_device_id mvebu_gpio_of_match[] = { .data = (void *) MVEBU_GPIO_SOC_VARIANT_ARMADAXP, }, { - .compatible = "marvell,armada-370-xp-gpio", + .compatible = "marvell,armada-370-gpio", .data = (void *) MVEBU_GPIO_SOC_VARIANT_ORION, }, { @@ -1121,7 +1121,7 @@ static int mvebu_gpio_probe(struct platform_device *pdev) mvchip); } - /* Armada 370/XP has simple PWM support for GPIO lines */ + /* Some MVEBU SoCs have simple PWM support for GPIO lines */ if (IS_ENABLED(CONFIG_PWM)) return mvebu_pwm_probe(pdev, mvchip, id);