Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp12101imm; Thu, 30 Aug 2018 13:00:54 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZplxQMHh59v9Kl331xHR6eANaUJzHY83U1HDOoFN3KZ+GuyF1N/F/vc8WCdTIqPT8NS8fc X-Received: by 2002:a62:d085:: with SMTP id p127-v6mr12018235pfg.119.1535659254389; Thu, 30 Aug 2018 13:00:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535659254; cv=none; d=google.com; s=arc-20160816; b=qWmX+yNUThWO8HP3pAioFEcYCaE2glbf+YUs32JO51mlrPcuc1b+XWICzKGRyHpyVy CV/TWE09cwNRVowUpCPmabxseE7SShblDD5wXih7Z617zqbI7dIIrSHiwxIcaICFejL0 wh7OO3EgicCAhuWhiHPXX7R0TpjCTXEh0cA/w+RXX4bR61qdG44sq0aAW7c6HVxAtSgA AaWu+VMpw1v2HjjSOCIrHZQpf5jiGJxMEgDG+g2flG4jpRaU+9V6bc61lFx4IPa4twXy YQqJ6JGcZHVMofeGkgd6HbJY8D5JI9FdB9/n7u1u03UzdmHiCPlHi74KvSwAQtnfXXSc dIHA== 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=tRSTjo3Z0N0KzT8Bds1HDUdwZ64/Qe7DWyKM4KTkWjE=; b=T7GMy0pMcWjcP/SPI2gd53p7rKTl1jTt2E1kET8+MMeYMMgLkYDbKbteGoRtK8ltbp QQLkI+/VKiAaRqx9jnOR9frzfa2HIOr92jjQ/3HfUSFdjxvfejb+TgKgUNXUn97O+1EE OiN39XFVd8CBaxmHJwR4PoYs8S3vVImnGv2oJXwhfohpVN0GPYbKa6O4X8UIVA84CdHH bqShyFes1epg17+O96osaOkXmse8vaHuzQuUmyori0EUHW0qzgmC/BHqgJl1+17wgPG5 hwgMmkg93c1TLF1eUUsHbLufRpv51blbSu5ak1mORrUoJKEVtT7LIH1PcxcB8PiQyx7w ucrw== 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 v132-v6si8264756pfc.193.2018.08.30.13.00.35; Thu, 30 Aug 2018 13:00:54 -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 S1727272AbeHaADK (ORCPT + 99 others); Thu, 30 Aug 2018 20:03:10 -0400 Received: from smtp06.smtpout.orange.fr ([80.12.242.128]:60934 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726878AbeHaADK (ORCPT ); Thu, 30 Aug 2018 20:03:10 -0400 Received: from belgarion.home ([90.89.234.36]) by mwinf5d82 with ME id VXzF1y0020nnJME03XzKQ9; Thu, 30 Aug 2018 21:59:19 +0200 X-ME-Helo: belgarion.home X-ME-Auth: amFyem1pay5yb2JlcnRAb3JhbmdlLmZy X-ME-Date: Thu, 30 Aug 2018 21:59:19 +0200 X-ME-IP: 90.89.234.36 From: Robert Jarzmik To: Daniel Mack , Haojian Zhuang , Robert Jarzmik , Rob Herring , Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] ARM: dts: pxa: add pincontrol helpers Date: Thu, 30 Aug 2018 21:59:12 +0200 Message-Id: <20180830195912.6025-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 a520b4c14ea9..81312a9813f6 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