From patchwork Mon Jun 22 17:29:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Drew Fustini X-Patchwork-Id: 11618521 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B844B90 for ; Mon, 22 Jun 2020 17:32:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A0DDA207BB for ; Mon, 22 Jun 2020 17:32:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=beagleboard-org.20150623.gappssmtp.com header.i=@beagleboard-org.20150623.gappssmtp.com header.b="S1nZPtuC" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730006AbgFVRcO (ORCPT ); Mon, 22 Jun 2020 13:32:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729922AbgFVRcO (ORCPT ); Mon, 22 Jun 2020 13:32:14 -0400 Received: from mail-ed1-x544.google.com (mail-ed1-x544.google.com [IPv6:2a00:1450:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8706C061573 for ; Mon, 22 Jun 2020 10:32:13 -0700 (PDT) Received: by mail-ed1-x544.google.com with SMTP id w7so14333300edt.1 for ; Mon, 22 Jun 2020 10:32:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beagleboard-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ovMidJWukcafnyUoSegnCUeUmM9YyWMYRmZkPwlZahM=; b=S1nZPtuCdm9ch5pQNWiGH0hwwTOBb4GAKeUf+HVXrp4fLD6NUbUuL94SbjOI/LSS72 SLNwG0UwdqqXjt2F0prL0dbz+CAh/m9BMSqbcY8gilzAsxJZPdXM0F/urV0hyXeybDkL RhONouhDGUBW1IMPo9Mh0nnQCnmVrs4ki9G9ZDrM0tzF9L0IgeqlFVeBl6hGOe89GYZC FPY3Hi8tOBAASdiHPFbx2ohJrv7c+1Y8WlJBxgF0WK4NF0ZE8tRaayrg3oCbaRKiz/Hi G8Z3m2Qj/LZjTZDHt92amMenX3Z4xHL3JGnDuOoBSIMDDbD/g3LDAXEid83jDqzzdEit 24ig== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=ovMidJWukcafnyUoSegnCUeUmM9YyWMYRmZkPwlZahM=; b=NJB8eR3A4i5JAYVOe8HrvYDkV2j5E0yoRZv47Z6Aa6dOsuKWYveZFRjy12RlGBQTGy GXeWJQOQVmo+ng4ToZmK/FMeuAf2eCArSfH3UQY+R54E0C/WzISb0X3QJxs5FOTmoAep ETRm+nVlxOil7Bj7so5RFrF7NlvXGKxa51q8Wso634uTYVGGwgZSP+Jzyrl6jILiqwkn UtsjJvSG8vVkVbY+nn693p5WWAz+RWIvcmONJdltRTGUKM9iRHwvWKVZn9tsVVH4pgMR YTy4R13rZx6YCCvKTLHt5/8sdtOFVSyD41GIf1rIGXyFT+2dZvM7eUUVWEfrZ5BrtCca lwfg== X-Gm-Message-State: AOAM533TZ/P9Gts4YM86szi7Jy9j9Iq6GJLuoXQNkzfZU3GaCZgKt5HB z0H37PSqkki7gK75Hwll/AiULw== X-Google-Smtp-Source: ABdhPJwe6Gd4k/+os6hh1s7VvLRlLAAlNwHWabRdlzNF1D1Cg3UJFff7cvs543eV0RNNYMW2oKsqUA== X-Received: by 2002:aa7:da8c:: with SMTP id q12mr18327099eds.385.1592847132701; Mon, 22 Jun 2020 10:32:12 -0700 (PDT) Received: from localhost.localdomain (i59F66838.versanet.de. [89.246.104.56]) by smtp.gmail.com with ESMTPSA id z1sm4747386ejb.41.2020.06.22.10.32.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 10:32:11 -0700 (PDT) From: Drew Fustini To: Tony Lindgren , Rob Herring , linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Linus Walleij , Haojian Zhuang , devicetree@vger.kernel.org, bcousson@baylibre.com, Jason Kridner , Robert Nelson Cc: Drew Fustini Subject: [PATCH v3 1/3] pinctrl: single: parse #pinctrl-cells = 2 Date: Mon, 22 Jun 2020 19:29:49 +0200 Message-Id: <20200622172951.524306-2-drew@beagleboard.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200622172951.524306-1-drew@beagleboard.org> References: <20200622172951.524306-1-drew@beagleboard.org> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org If "pinctrl-single,pins" has 3 arguments (offset, conf, mux) then pcs_parse_one_pinctrl_entry() does an OR operation on to get the value to store in the register. Signed-off-by: Drew Fustini --- drivers/pinctrl/pinctrl-single.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c index a9d511982780..17b32cafe5f0 100644 --- a/drivers/pinctrl/pinctrl-single.c +++ b/drivers/pinctrl/pinctrl-single.c @@ -1017,10 +1017,17 @@ static int pcs_parse_one_pinctrl_entry(struct pcs_device *pcs, break; } - /* Index plus one value cell */ offset = pinctrl_spec.args[0]; vals[found].reg = pcs->base + offset; - vals[found].val = pinctrl_spec.args[1]; + + switch (pinctrl_spec.args_count) { + case 2: + vals[found].val = pinctrl_spec.args[1]; + break; + case 3: + vals[found].val = (pinctrl_spec.args[1] | pinctrl_spec.args[2]); + break; + } dev_dbg(pcs->dev, "%pOFn index: 0x%x value: 0x%x\n", pinctrl_spec.np, offset, pinctrl_spec.args[1]); From patchwork Mon Jun 22 17:29:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Drew Fustini X-Patchwork-Id: 11618523 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F25FB90 for ; Mon, 22 Jun 2020 17:32:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DB16620776 for ; Mon, 22 Jun 2020 17:32:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=beagleboard-org.20150623.gappssmtp.com header.i=@beagleboard-org.20150623.gappssmtp.com header.b="IvuoGUIW" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730076AbgFVRcV (ORCPT ); Mon, 22 Jun 2020 13:32:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729811AbgFVRcU (ORCPT ); Mon, 22 Jun 2020 13:32:20 -0400 Received: from mail-ej1-x642.google.com (mail-ej1-x642.google.com [IPv6:2a00:1450:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C94EDC061573 for ; Mon, 22 Jun 2020 10:32:19 -0700 (PDT) Received: by mail-ej1-x642.google.com with SMTP id w6so7508270ejq.6 for ; Mon, 22 Jun 2020 10:32:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beagleboard-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Bp2iCF0V+pxEB1qX+I4xhpc7NppyeLuUVo+dt6mFcSk=; b=IvuoGUIWcCIQo6CK77cG7w8/8i6yMRGu3jqAVtDneEVMOskWKPt1H5oEvI8WqMhZNy q3SZWQbxGmZX1YAnVnJLK3IZb+MNj06WDzV3WIOWGXbePqjg6Gr32LVdAm+ea4xL1J1R 3uHLkLBW/4wYUdbOWNMEPxv0aCuTQsY3P2oXIKSxqAuZexLhJMJjaysulNWtJ9oTIJfK 72vrHtPOxvoSYRgMDiorDeWTFthyA+/CQfOVWG7szw4j5gleM7rbHk0lDC2nfCgr24FK SVj5JBtkX2fLH2Ifz7i/LUeoqZubDhCzule77jMfzb6forrMTIIRz/JN/qtFMGyKwyrj QMzw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=Bp2iCF0V+pxEB1qX+I4xhpc7NppyeLuUVo+dt6mFcSk=; b=od4d/gnC3rsiGDuqX/DFpMl4zKwlGQhJNZTOWYz8DtXFv3lqijZ/xIPRuVlbCpHwri 88YZoezV29i/XPvE1JRrYa+qNE9k/5VjnPjYE29Kb0IuxWvsxfa6OdiVDktLLUlC0i6t HpRa9aa3UcFCB+ycuS+ZMV0RagU405GaPVSoXevfofl8a75iALm79ipMR1/Gd9VM+eO6 qfxXuGRNBZg+yC9M8CevMiAXPuP2oqmY9xIkiCtLbYnCv5Ew6C1piVJnsmbMhfy69i64 O92XCIeDl1S8YzrGeyeJHh2GJRsO0IxtpkTup8GEQK3pIoZisd4RVL/9tgKgtWbHVO03 lHDA== X-Gm-Message-State: AOAM531u2hddb8RGNVfzbyNYH14wbqU67GLvl9unTQJLIa9GRdeuB2Co 3cJ2t8egy2JmXqI2o8TT/IBvlQ== X-Google-Smtp-Source: ABdhPJy021kLIGLXUWAQwFLlIxfxylwPiPKp9FWG0opDvmlw8+MPskGqjPkQP4pPHMC+fjUtjPUFfA== X-Received: by 2002:a17:906:454b:: with SMTP id s11mr17460979ejq.546.1592847138559; Mon, 22 Jun 2020 10:32:18 -0700 (PDT) Received: from localhost.localdomain (i59F66838.versanet.de. [89.246.104.56]) by smtp.gmail.com with ESMTPSA id z1sm4747386ejb.41.2020.06.22.10.32.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 10:32:17 -0700 (PDT) From: Drew Fustini To: Tony Lindgren , Rob Herring , linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Linus Walleij , Haojian Zhuang , devicetree@vger.kernel.org, bcousson@baylibre.com, Jason Kridner , Robert Nelson Cc: Drew Fustini Subject: [PATCH v3 2/3] ARM: dts: change AM33XX_PADCONF macro separate conf and mux Date: Mon, 22 Jun 2020 19:29:50 +0200 Message-Id: <20200622172951.524306-3-drew@beagleboard.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200622172951.524306-1-drew@beagleboard.org> References: <20200622172951.524306-1-drew@beagleboard.org> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org AM33XX_PADCONF macro is modified to keep pin conf and pin mux separate. This requires #pinctrl-cells = 2 in am33xx-l4.dtsi pinctrl-single.c but also be changed to support "pinctrl-single,pins" with 3 arguments (offset, conf, mux) Signed-off-by: Drew Fustini --- include/dt-bindings/pinctrl/omap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/dt-bindings/pinctrl/omap.h b/include/dt-bindings/pinctrl/omap.h index 625718042413..2d2a8c737822 100644 --- a/include/dt-bindings/pinctrl/omap.h +++ b/include/dt-bindings/pinctrl/omap.h @@ -65,7 +65,7 @@ #define DM814X_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x0800) (val) #define DM816X_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x0800) (val) #define AM33XX_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x0800) (val) -#define AM33XX_PADCONF(pa, dir, mux) OMAP_IOPAD_OFFSET((pa), 0x0800) ((dir) | (mux)) +#define AM33XX_PADCONF(pa, conf, mux) OMAP_IOPAD_OFFSET((pa), 0x0800) (conf) (mux) /* * Macros to allow using the offset from the padconf physical address From patchwork Mon Jun 22 17:29:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Drew Fustini X-Patchwork-Id: 11618525 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0879A90 for ; Mon, 22 Jun 2020 17:32:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E6A2C2076E for ; Mon, 22 Jun 2020 17:32:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=beagleboard-org.20150623.gappssmtp.com header.i=@beagleboard-org.20150623.gappssmtp.com header.b="LhbGWaTF" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730090AbgFVRc0 (ORCPT ); Mon, 22 Jun 2020 13:32:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730088AbgFVRcZ (ORCPT ); Mon, 22 Jun 2020 13:32:25 -0400 Received: from mail-ej1-x642.google.com (mail-ej1-x642.google.com [IPv6:2a00:1450:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8B33C061796 for ; Mon, 22 Jun 2020 10:32:24 -0700 (PDT) Received: by mail-ej1-x642.google.com with SMTP id i14so428321ejr.9 for ; Mon, 22 Jun 2020 10:32:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beagleboard-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=esraNk9vYcbt+aYhCal6Rv+dFZCSdTm7//1cm/DqNAg=; b=LhbGWaTFVPf141FJ+VrlM1gm9G0Yx9T8OzJsVp75vXKaqYFoXf5GmC8kpq2EpwwBbc WqOxWY+Tg9AsLYgOz1eO/LBiR+MVYTEfOkKxkgHAnxxI/56s2ggpsK/r/j/7SL1++AMP SDLZKqsstrA3w9vruCcX1oPVY8uC0Q6yXReSYG9DVhLmm+/Uqq6mmd+e1SYBBXOExrgd s9Qnj0Q1Hszp8W0gNV884tUzFLS+cHFswvbroJwNUn1qRoJIz/FwglnYHd4rTywkKgLw Q7b6HII+eeMzKJpkWXli3tFONXpY94d5smgvEkrme+nK5Rm88QCngPMJej+Qa3qer9do 8iyQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=esraNk9vYcbt+aYhCal6Rv+dFZCSdTm7//1cm/DqNAg=; b=rL6h2F7fhuLA3IWmKc9ZF39Wwd9/EZqEB4cET3prCpNOj5fJWgI3LapNn7CwmCOdeB JqDX1Jts3mMq8is7yJncjBftcfVk3Ex2FF0HxJn1dxAV1Kc4G2jeine2OdwXw9birKq4 Lof/7UdzSNLshUfR6GWq9usDI7spscHqO9ohxc2Am3oBTZFCyVhOtnNOXqNVEzycDKGN SoT+aYqiFpLgj3v1T0C4tW3M4PnM7bfAieomBWLwf2e37moO4Bu253IS29oVSAirDTM/ Ae5cJZyXKYacUa2qdtvTzZwqfYY3sQW+5VLrniynvy6d1jkjRkItyWl2J/FR45zzb13O S2DQ== X-Gm-Message-State: AOAM5307mlLh0/TGAwnmVN4asoeZ1+e1vh7o9V7JkX/0X2Yq26/17Mak dE+laX3ARxsFCb1WWqkXhpDZJA== X-Google-Smtp-Source: ABdhPJy+SFPlroEIO3VTMMRuyksrmrJdFlyJ5PCayo2U6g0j3Kq28XVgQDvES259MOoHErSiuzhQNA== X-Received: by 2002:a17:906:e05:: with SMTP id l5mr17849171eji.318.1592847143378; Mon, 22 Jun 2020 10:32:23 -0700 (PDT) Received: from localhost.localdomain (i59F66838.versanet.de. [89.246.104.56]) by smtp.gmail.com with ESMTPSA id z1sm4747386ejb.41.2020.06.22.10.32.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 10:32:22 -0700 (PDT) From: Drew Fustini To: Tony Lindgren , Rob Herring , linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Linus Walleij , Haojian Zhuang , devicetree@vger.kernel.org, bcousson@baylibre.com, Jason Kridner , Robert Nelson Cc: Drew Fustini Subject: [PATCH v3 3/3] ARM: dts: am33xx-l4: change #pinctrl-cells from 1 to 2 Date: Mon, 22 Jun 2020 19:29:51 +0200 Message-Id: <20200622172951.524306-4-drew@beagleboard.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200622172951.524306-1-drew@beagleboard.org> References: <20200622172951.524306-1-drew@beagleboard.org> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org This requires AM33XX_PADCONF macro in omap.h to be modified to keep pin conf and pin mux values separate. pinctrl-single.c must also be changed to support "pinctrl-single,pins" with 3 arguments (offset, conf, mux). Signed-off-by: Drew Fustini --- arch/arm/boot/dts/am33xx-l4.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/am33xx-l4.dtsi b/arch/arm/boot/dts/am33xx-l4.dtsi index 7ff11d6bf0f2..dafd6e8b42a1 100644 --- a/arch/arm/boot/dts/am33xx-l4.dtsi +++ b/arch/arm/boot/dts/am33xx-l4.dtsi @@ -278,7 +278,7 @@ scm: scm@0 { am33xx_pinmux: pinmux@800 { compatible = "pinctrl-single"; reg = <0x800 0x238>; - #pinctrl-cells = <1>; + #pinctrl-cells = <2>; pinctrl-single,register-width = <32>; pinctrl-single,function-mask = <0x7f>; };