Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1547789pxb; Thu, 16 Sep 2021 09:40:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMfXCwOkTFPCYhsNF7lLz/mr95Uuxl3C9L4HtHffBgigy78jFGHJzDMSRBn+HzIbRyavbQ X-Received: by 2002:a92:cda2:: with SMTP id g2mr4500432ild.135.1631810427744; Thu, 16 Sep 2021 09:40:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631810427; cv=none; d=google.com; s=arc-20160816; b=FOFyiPVNO69NkxxVAoq/Xw8nzGkTB9sb6U/4NrUeFkQBy4vdezLWJw7VjQgA7hrFzS 31bRCjRqhEGOurQyltZDhUPN4egWLfDexbWhDr4c+EpmpnxzbNlshei9sUIeLmqC4dZM eZowYGjFS3h132bPzBEo8Icy3cd+G97trQV6ypyqJfStzSzbcXWXg1WQkXAr1foJlEHc RKOqus2fLf/jjHDQlO3bhGSg3rgQ1jQ3azydyvJKvvKtHbmGdwPGbSMc/ySSnGEsstxB gAc+IYMjZUtgqCNUN5BNtbjBkK9noCFquaKJFTR0YnVXYLJ7SECPou1jxQRgLB35yjNd UudQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=5BEhruv40UbOb99+KNzkX1oxSEP8jAqAg42BxPGwUzg=; b=WzMj9e2YbP+d3ENMNlw++TuLwe393dYQXHPttIM129R4usoBCeBoVHkATKZiykyVpb C2zCSunjVXr5nSW39Qp7VFx46sK8LXtutbP3TEwhjZpdudMIdEtesgszzBGsIVNwEcGD uGx8eDQ+zZsZXVZn/6Zm8/GvUrDv9oGMRSB7xg1UT+GFrCqBi8ooZinPbKxMHoYKjpxp 3T5wkp1WspFs+jduGUOeOsxbShQSa1CFwZ+4KuB/+Nv3WmxkjEALCzWa8D8l1vbqyIuL aOquLt/LuTyGli4frMlBIDUbolLH9Q4OrrbPJHhmK2C6B2su+1vjNhNa+bTv1a4LrUw7 6BCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Hwhz1OUm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v4si3458041ilc.20.2021.09.16.09.40.16; Thu, 16 Sep 2021 09:40:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Hwhz1OUm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245177AbhIPQkK (ORCPT + 99 others); Thu, 16 Sep 2021 12:40:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:44898 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242254AbhIPQdp (ORCPT ); Thu, 16 Sep 2021 12:33:45 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0F05460698; Thu, 16 Sep 2021 16:20:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631809230; bh=t6xbDUtGupDzcGxTITp17lxS6T+CZ8laWc9Bu/yxFiA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Hwhz1OUmPwmigEQSCz18uCus6L2nqjPnhfACTt4lcLrpRFQl3oqvCnmc6yf24Fp+E tWvbAuuVJYoFhgIh+G0bInlPVYoIH5fl9biN046hPblZi+yGESHcPb6YUYCMxJC9n3 j7OPQoRTWwHp1nZSXi9chrReyh/i1lWsCAXpcAnY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Marek=20Beh=C3=BAn?= , Rob Herring , Linus Walleij , Sasha Levin Subject: [PATCH 5.13 071/380] pinctrl: armada-37xx: Correct PWM pins definitions Date: Thu, 16 Sep 2021 17:57:08 +0200 Message-Id: <20210916155806.416114730@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155803.966362085@linuxfoundation.org> References: <20210916155803.966362085@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marek BehĂșn [ Upstream commit baf8d6899b1e8906dc076ef26cc633e96a8bb0c3 ] The PWM pins on North Bridge on Armada 37xx can be configured into PWM or GPIO functions. When in PWM function, each pin can also be configured to drive low on 0 and tri-state on 1 (LED mode). The current definitions handle this by declaring two pin groups for each pin: - group "pwmN" with functions "pwm" and "gpio" - group "ledN_od" ("od" for open drain) with functions "led" and "gpio" This is semantically incorrect. The correct definition for each pin should be one group with three functions: "pwm", "led" and "gpio". Change the "pwmN" groups to support "led" function. Remove "ledN_od" groups. This cannot break backwards compatibility with older device trees: no device tree uses it since there is no PWM driver for this SOC yet. Also "ledN_od" groups are not even documented. Fixes: b835d6953009 ("pinctrl: armada-37xx: swap polarity on LED group") Signed-off-by: Marek BehĂșn Acked-by: Rob Herring Link: https://lore.kernel.org/r/20210719112938.27594-1-kabel@kernel.org Signed-off-by: Linus Walleij Signed-off-by: Sasha Levin --- .../pinctrl/marvell,armada-37xx-pinctrl.txt | 8 ++++---- drivers/pinctrl/mvebu/pinctrl-armada-37xx.c | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Documentation/devicetree/bindings/pinctrl/marvell,armada-37xx-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/marvell,armada-37xx-pinctrl.txt index 38dc56a57760..ecec514b3155 100644 --- a/Documentation/devicetree/bindings/pinctrl/marvell,armada-37xx-pinctrl.txt +++ b/Documentation/devicetree/bindings/pinctrl/marvell,armada-37xx-pinctrl.txt @@ -43,19 +43,19 @@ group emmc_nb group pwm0 - pin 11 (GPIO1-11) - - functions pwm, gpio + - functions pwm, led, gpio group pwm1 - pin 12 - - functions pwm, gpio + - functions pwm, led, gpio group pwm2 - pin 13 - - functions pwm, gpio + - functions pwm, led, gpio group pwm3 - pin 14 - - functions pwm, gpio + - functions pwm, led, gpio group pmic1 - pin 7 diff --git a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c index 5a68e242f6b3..5cb018f98800 100644 --- a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c +++ b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c @@ -167,10 +167,14 @@ static struct armada_37xx_pin_group armada_37xx_nb_groups[] = { PIN_GRP_GPIO("jtag", 20, 5, BIT(0), "jtag"), PIN_GRP_GPIO("sdio0", 8, 3, BIT(1), "sdio"), PIN_GRP_GPIO("emmc_nb", 27, 9, BIT(2), "emmc"), - PIN_GRP_GPIO("pwm0", 11, 1, BIT(3), "pwm"), - PIN_GRP_GPIO("pwm1", 12, 1, BIT(4), "pwm"), - PIN_GRP_GPIO("pwm2", 13, 1, BIT(5), "pwm"), - PIN_GRP_GPIO("pwm3", 14, 1, BIT(6), "pwm"), + PIN_GRP_GPIO_3("pwm0", 11, 1, BIT(3) | BIT(20), 0, BIT(20), BIT(3), + "pwm", "led"), + PIN_GRP_GPIO_3("pwm1", 12, 1, BIT(4) | BIT(21), 0, BIT(21), BIT(4), + "pwm", "led"), + PIN_GRP_GPIO_3("pwm2", 13, 1, BIT(5) | BIT(22), 0, BIT(22), BIT(5), + "pwm", "led"), + PIN_GRP_GPIO_3("pwm3", 14, 1, BIT(6) | BIT(23), 0, BIT(23), BIT(6), + "pwm", "led"), PIN_GRP_GPIO("pmic1", 7, 1, BIT(7), "pmic"), PIN_GRP_GPIO("pmic0", 6, 1, BIT(8), "pmic"), PIN_GRP_GPIO("i2c2", 2, 2, BIT(9), "i2c"), @@ -184,10 +188,6 @@ static struct armada_37xx_pin_group armada_37xx_nb_groups[] = { PIN_GRP_EXTRA("uart2", 9, 2, BIT(1) | BIT(13) | BIT(14) | BIT(19), BIT(1) | BIT(13) | BIT(14), BIT(1) | BIT(19), 18, 2, "gpio", "uart"), - PIN_GRP_GPIO_2("led0_od", 11, 1, BIT(20), BIT(20), 0, "led"), - PIN_GRP_GPIO_2("led1_od", 12, 1, BIT(21), BIT(21), 0, "led"), - PIN_GRP_GPIO_2("led2_od", 13, 1, BIT(22), BIT(22), 0, "led"), - PIN_GRP_GPIO_2("led3_od", 14, 1, BIT(23), BIT(23), 0, "led"), }; static struct armada_37xx_pin_group armada_37xx_sb_groups[] = { -- 2.30.2