Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3474818imm; Sun, 1 Jul 2018 22:59:15 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdFiV8SzIbZiIzGs5nn7Nck/BJDpUBMZYfeLqhF9e4QJ9C0V4SMMDtpbGxZql236bF4F1QX X-Received: by 2002:a62:190d:: with SMTP id 13-v6mr11812340pfz.103.1530511155526; Sun, 01 Jul 2018 22:59:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530511155; cv=none; d=google.com; s=arc-20160816; b=SpXiI8luV1uB/tSzJFrifsy7uMHHa1N+4WuFHrPb50jhnqJrs/5TUu1gt/I//63gTB gj2NQZXD3dGfDo9xtaN7tV2NctcoYluRUjuazFASDoNwfq9pf2rShPmjxoHxwjo5n+Eu PgxzEQFQ4e64l6NymySi+BWrw7ACLpv9LRKvAzAqzHpeTXPxxfS4UCA4oLIfuSp1baVz cNcXguSOUF32wnhc+KA8OmV7bevSf6vmIES3s902+IHjjT7kT3vsg+ucM8K+H4DDNzhV QlgavcRwHPxYST/5ne4hlrirbgTX/GEg4Dsin6FtzyqH3+IeqBksJntUffkso4reWS55 cwlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=Vp/7Im/hSO37wSqLfFX+Z8oE8ru9DHTmbtz9uTIbObk=; b=IJZ3jkyIGKIkMg1Us+W9E4Yv+tqOKAIj7xFgFUHDFDmnsrp57nfnOMnndmxzncuyeI mYd4GJdCriV2WUPmzRw7wE2/UXYfKmC/MeKQ3w1s6bv2ck86jGi8+hboJDBEGwNv/l2U 8GKo7gzfqWgXKJWTY3DTG7eipZn3oUOK33tWiMeJFf3QRpC6+NqQG52+HuaFMujJ18UF JwnEdf1IixvmQJPMMTWudW15CgC+JF7Ybs/+tjQA3QapVpibhTEsnm9bWSAFcu2zUbZ6 UfYxUIH6LW5QtydqP9KcoPfTTMhdCSFAWPg1qPKGm2nFPd5XsCuPsjm3fkVFO0uHeNRP VkNA== ARC-Authentication-Results: i=1; mx.google.com; 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 p2-v6si12407112pgd.532.2018.07.01.22.59.01; Sun, 01 Jul 2018 22:59:15 -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; 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 S1753060AbeGBF6M (ORCPT + 99 others); Mon, 2 Jul 2018 01:58:12 -0400 Received: from smtp05.smtpout.orange.fr ([80.12.242.127]:24622 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751883AbeGBF6J (ORCPT ); Mon, 2 Jul 2018 01:58:09 -0400 Received: from belgarion.home ([90.55.203.186]) by mwinf5d28 with ME id 5hxo1y00H41oiFu03hxulR; Mon, 02 Jul 2018 07:58:06 +0200 X-ME-Helo: belgarion.home X-ME-Auth: amFyem1pay5yb2JlcnRAb3JhbmdlLmZy X-ME-Date: Mon, 02 Jul 2018 07:58:06 +0200 X-ME-IP: 90.55.203.186 From: Robert Jarzmik To: Rob Herring , Mark Rutland , Daniel Mack , Haojian Zhuang , Robert Jarzmik , Kees Cook , Anton Vorontsov , Colin Cross , Tony Luck Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/2] ARM: dts: pxa: add pincontrol helpers Date: Mon, 2 Jul 2018 07:57:32 +0200 Message-Id: <20180702055733.18578-1-robert.jarzmik@free.fr> X-Mailer: git-send-email 2.11.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add 3 helpers so that pincontrol definitions for pxa25x and pxa27x are easier, and can be easily converted from old mfp mach-pxa code to devicetree. An example of such conversion would be : static unsigned long mioa701_pin_config[] = { GPIO32_MMC_CLK, GPIO92_MMC_DAT_0, GPIO109_MMC_DAT_1, GPIO110_MMC_DAT_2, GPIO111_MMC_DAT_3, GPIO112_MMC_CMD, MIO_CFG_IN(GPIO78_SDIO_RO, AF0), MIO_CFG_IN(GPIO15_SDIO_INSERT, AF0), MIO_CFG_OUT(GPIO91_SDIO_EN, AF0, DRIVE_LOW), }; into: pinctrl_mmc_default: mmc-default { PMMUX(sd-insert, 15, gpio_in); PMMUX(mmclk, 32, MMCLK); PMMUX(sd-ro, 78, gpio_in); PMMUX_LPM_LOW(sd-enable, 91, gpio_out); PMMUX(mmdat0, 92, MMDAT<0>); PMMUX(mmdat1, 109, MMDAT<1>); PMMUX(mmdat2, 110, MMDAT<2>); PMMUX(mmdat3, 111, MMDAT<3>); PMMUX(mmcmd, 112, MMCMD); }; The third column of PMMUX*() helpers can be found in pincontrol muxing functions, either in pinctrl-pxa27x.c (or pinctrl-pxa25x.c), or by inspecting the pincontrol once booted in debugfs. Signed-off-by: Robert Jarzmik --- arch/arm/boot/dts/pxa2xx.dtsi | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/arch/arm/boot/dts/pxa2xx.dtsi b/arch/arm/boot/dts/pxa2xx.dtsi index e4ebcde17837..f609dbb86abf 100644 --- a/arch/arm/boot/dts/pxa2xx.dtsi +++ b/arch/arm/boot/dts/pxa2xx.dtsi @@ -9,6 +9,25 @@ #include "skeleton.dtsi" #include "dt-bindings/clock/pxa-clock.h" +#define PMGROUP(pin) #pin +#define PMMUX(func, pin, af) \ + mux- ## func { \ + groups = PMGROUP(P ## pin); \ + function = #af; \ + } +#define PMMUX_LPM_LOW(func, pin, af) \ + mux- ## func { \ + groups = PMGROUP(P ## pin); \ + function = #af; \ + low-power-disable; \ + } +#define PMMUX_LPM_HIGH(func, pin, af) \ + mux- ## func { \ + groups = PMGROUP(P ## pin); \ + function = #af; \ + low-power-enable; \ + } + / { model = "Marvell PXA2xx family SoC"; compatible = "marvell,pxa2xx"; -- 2.11.0