devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Adrian Alonso <aalonso@freescale.com>
To: linux-arm-kernel@lists.infradead.org, shawn.guo@linaro.org,
	shawnguo@kernel.org, linus.walleij@linaro.org, lznuaa@gmail.com
Cc: linux-gpio@vger.kernel.org, devicetree@vger.kernel.org,
	kernel@pengutronix.de, robh+dt@kernel.org,
	Anson.Huang@freescale.com, Frank.Li@freescale.com,
	yibin.gong@freescale.com, nitin.garg@freescale.com
Subject: [PATCH v5 4/7] pinctrl: freescale: imx: allow mux_reg offset zero
Date: Thu, 24 Sep 2015 15:54:00 -0500	[thread overview]
Message-ID: <1443128043-21063-4-git-send-email-aalonso@freescale.com> (raw)
In-Reply-To: <1443128043-21063-1-git-send-email-aalonso@freescale.com>

Allow mux_reg offset zero to be a valid pin_id, on imx7d
mux_conf reg offset is zero for iomuxc-lspr controller

Signed-off-by: Adrian Alonso <aalonso@freescale.com>
---
Changes for V2: Resend
Changes for V3: Resend
Changes for V4: Simplify pin_id assigment when ZERO_OFFSET_VALID is set
Changes for V5:
- Drop patch pinctrl: freescale: imx: add ZERO_OFFSET_VALID flag
- Allow mux_reg ZERO OFFSET as pin_id

 drivers/pinctrl/freescale/pinctrl-imx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c
index b9c6deb..23348d8 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx.c
@@ -550,7 +550,7 @@ static int imx_pinctrl_parse_groups(struct device_node *np,
 				conf_reg = -1;
 		}
 
-		pin_id = mux_reg ? mux_reg / 4 : conf_reg / 4;
+		pin_id = (mux_reg != -1) ? mux_reg / 4 : conf_reg / 4;
 		pin_reg = &info->pin_regs[pin_id];
 		pin->pin = pin_id;
 		grp->pin_ids[i] = pin_id;
-- 
2.1.4


  parent reply	other threads:[~2015-09-24 20:54 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-24 20:53 [PATCH v5 1/7] pinctrl: freescale: imx: fix system crash if enable two pinctl instances Adrian Alonso
2015-09-24 20:53 ` [PATCH v5 2/7] ARM: dts: imx: imx7d add iomuxc lpsr device node Adrian Alonso
2015-09-24 20:53 ` [PATCH v5 3/7] ARM: dts: imx: imx7d-sbd add iomuxc-lpsr hoggrp-2 pads Adrian Alonso
2015-09-25 10:49   ` Markus Pargmann
2015-09-25 17:17     ` Shawn Guo
2015-09-24 20:54 ` Adrian Alonso [this message]
2015-09-25 10:47   ` [PATCH v5 4/7] pinctrl: freescale: imx: allow mux_reg offset zero Markus Pargmann
2015-09-25 19:07     ` Shawn Guo
2015-09-25 19:16       ` Alonso Adrian
2015-09-25 20:59         ` Shawn Guo
2015-09-24 20:54 ` [PATCH v5 5/7] pinctrl: freescale: imx: add shared input select reg support Adrian Alonso
2015-09-24 20:54 ` [PATCH v5 6/7] pinctrl: freescale: imx7d: support iomux lpsr controller Adrian Alonso
2015-09-24 20:54 ` [PATCH v5 7/7] pinctrl: freescale: imx: imx7d iomuxc-lpsr devicetree bindings Adrian Alonso
2015-09-25 16:50 ` [PATCH v5 1/7] pinctrl: freescale: imx: fix system crash if enable two pinctl instances Linus Walleij
     [not found] ` <1443128043-21063-1-git-send-email-aalonso-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2015-09-25 19:09   ` Shawn Guo
2015-10-02 12:19   ` Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1443128043-21063-4-git-send-email-aalonso@freescale.com \
    --to=aalonso@freescale.com \
    --cc=Anson.Huang@freescale.com \
    --cc=Frank.Li@freescale.com \
    --cc=devicetree@vger.kernel.org \
    --cc=kernel@pengutronix.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=lznuaa@gmail.com \
    --cc=nitin.garg@freescale.com \
    --cc=robh+dt@kernel.org \
    --cc=shawn.guo@linaro.org \
    --cc=shawnguo@kernel.org \
    --cc=yibin.gong@freescale.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).