From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-pg0-x243.google.com ([2607:f8b0:400e:c05::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1db6Vp-0003RE-Lq for barebox@lists.infradead.org; Fri, 28 Jul 2017 14:45:18 +0000 Received: by mail-pg0-x243.google.com with SMTP id 125so10359361pgi.5 for ; Fri, 28 Jul 2017 07:44:52 -0700 (PDT) From: Andrey Smirnov Date: Fri, 28 Jul 2017 07:44:21 -0700 Message-Id: <20170728144427.14007-6-andrew.smirnov@gmail.com> In-Reply-To: <20170728144427.14007-1-andrew.smirnov@gmail.com> References: <20170728144427.14007-1-andrew.smirnov@gmail.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH v3 05/11] ARM: i.MX: Add mx7_setup_pad() To: barebox@lists.infradead.org Cc: Andrey Smirnov Add mx7_setup_pad() low-level convenience function for setting up pinmux in PBL code. Acked-by: Sam Ravnborg Signed-off-by: Andrey Smirnov --- arch/arm/mach-imx/include/mach/iomux-mx7.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/arch/arm/mach-imx/include/mach/iomux-mx7.h b/arch/arm/mach-imx/include/mach/iomux-mx7.h index 378e73a74..2667dc3eb 100644 --- a/arch/arm/mach-imx/include/mach/iomux-mx7.h +++ b/arch/arm/mach-imx/include/mach/iomux-mx7.h @@ -1306,4 +1306,23 @@ enum { MX7D_PAD_ENET1_COL__CSU_INT_DEB = IOMUX_PAD(0x04D8, 0x0268, 7, 0x0000, 0, 0), }; +static inline void mx7_setup_pad(void __iomem *iomux, iomux_v3_cfg_t pad) +{ + unsigned int flags = 0; + uint32_t mode = IOMUX_MODE(pad); + + if (mode & IOMUX_CONFIG_LPSR) { + mode &= ~IOMUX_CONFIG_LPSR; + flags = ZERO_OFFSET_VALID | IMX7_PINMUX_LPSR; + } + + iomux_v3_setup_pad(iomux, flags, + IOMUX_CTRL_OFS(pad), + IOMUX_PAD_CTRL_OFS(pad), + IOMUX_SEL_INPUT_OFS(pad), + mode, + IOMUX_PAD_CTRL(pad), + IOMUX_SEL_INPUT(pad)); +} + #endif -- 2.13.3 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox