All of lore.kernel.org
 help / color / mirror / Atom feed
From: axel.lin@ingics.com (Axel Lin)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH RFT 1/2] pinctrl: dove: Fix dove_audio1_ctrl_set when BIT(0|1|2|3) of config is clear
Date: Sun, 11 Nov 2012 21:44:55 +0800	[thread overview]
Message-ID: <1352641495.3113.1.camel@phoenix> (raw)

Current implementation in dove_audio1_ctrl_set() does not clear corresponding
register bit if BIT(0|1|2|3) of config is clear. Fix it.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
Hi,
I don't have this hardware.
I'd appreciate if someone can review and test this patch.

This resend also CC Sebastian Hesselbarth and linux-arm-kernel.
Thanks,
Axel
 drivers/pinctrl/mvebu/pinctrl-dove.c |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/pinctrl/mvebu/pinctrl-dove.c b/drivers/pinctrl/mvebu/pinctrl-dove.c
index ffe74b2..e5cc694 100644
--- a/drivers/pinctrl/mvebu/pinctrl-dove.c
+++ b/drivers/pinctrl/mvebu/pinctrl-dove.c
@@ -236,12 +236,23 @@ static int dove_audio1_ctrl_set(struct mvebu_mpp_ctrl *ctrl,
 
 	if (config & BIT(0))
 		gcfg2 |= DOVE_TWSI_OPTION3_GPIO;
+	else
+		gcfg2 &= ~DOVE_TWSI_OPTION3_GPIO;
+
 	if (config & BIT(1))
 		gmpp |= DOVE_AU1_SPDIFO_GPIO_EN;
+	else
+		gmpp &= ~DOVE_AU1_SPDIFO_GPIO_EN;
+
 	if (config & BIT(2))
 		sspc1 |= DOVE_SSP_ON_AU1;
+	else
+		sspc1 &= ~DOVE_SSP_ON_AU1;
+
 	if (config & BIT(3))
 		mpp4 |= DOVE_AU1_GPIO_SEL;
+	else
+		mpp4 &= ~DOVE_AU1_GPIO_SEL;
 
 	writel(mpp4, DOVE_MPP_CTRL4_VIRT_BASE);
 	writel(sspc1, DOVE_SSP_CTRL_STATUS_1);
-- 
1.7.9.5

WARNING: multiple messages have this Message-ID (diff)
From: Axel Lin <axel.lin@ingics.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
	Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH RFT 1/2] pinctrl: dove: Fix dove_audio1_ctrl_set when BIT(0|1|2|3) of config is clear
Date: Sun, 11 Nov 2012 21:44:55 +0800	[thread overview]
Message-ID: <1352641495.3113.1.camel@phoenix> (raw)

Current implementation in dove_audio1_ctrl_set() does not clear corresponding
register bit if BIT(0|1|2|3) of config is clear. Fix it.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
Hi,
I don't have this hardware.
I'd appreciate if someone can review and test this patch.

This resend also CC Sebastian Hesselbarth and linux-arm-kernel.
Thanks,
Axel
 drivers/pinctrl/mvebu/pinctrl-dove.c |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/pinctrl/mvebu/pinctrl-dove.c b/drivers/pinctrl/mvebu/pinctrl-dove.c
index ffe74b2..e5cc694 100644
--- a/drivers/pinctrl/mvebu/pinctrl-dove.c
+++ b/drivers/pinctrl/mvebu/pinctrl-dove.c
@@ -236,12 +236,23 @@ static int dove_audio1_ctrl_set(struct mvebu_mpp_ctrl *ctrl,
 
 	if (config & BIT(0))
 		gcfg2 |= DOVE_TWSI_OPTION3_GPIO;
+	else
+		gcfg2 &= ~DOVE_TWSI_OPTION3_GPIO;
+
 	if (config & BIT(1))
 		gmpp |= DOVE_AU1_SPDIFO_GPIO_EN;
+	else
+		gmpp &= ~DOVE_AU1_SPDIFO_GPIO_EN;
+
 	if (config & BIT(2))
 		sspc1 |= DOVE_SSP_ON_AU1;
+	else
+		sspc1 &= ~DOVE_SSP_ON_AU1;
+
 	if (config & BIT(3))
 		mpp4 |= DOVE_AU1_GPIO_SEL;
+	else
+		mpp4 &= ~DOVE_AU1_GPIO_SEL;
 
 	writel(mpp4, DOVE_MPP_CTRL4_VIRT_BASE);
 	writel(sspc1, DOVE_SSP_CTRL_STATUS_1);
-- 
1.7.9.5




             reply	other threads:[~2012-11-11 13:44 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-11 13:44 Axel Lin [this message]
2012-11-11 13:44 ` [PATCH RFT 1/2] pinctrl: dove: Fix dove_audio1_ctrl_set when BIT(0|1|2|3) of config is clear Axel Lin
2012-11-11 13:46 ` [PATCH RFT 2/2] pinctrl: dove: Checking valid config in dove_audio1_ctrl_set Axel Lin
2012-11-11 13:46   ` Axel Lin
2012-11-12  9:43   ` Sebastian Hesselbarth
2012-11-12  9:43     ` Sebastian Hesselbarth
2012-11-12  9:39 ` [PATCH RFT 1/2] pinctrl: dove: Fix dove_audio1_ctrl_set when BIT(0|1|2|3) of config is clear Sebastian Hesselbarth
2012-11-12  9:39   ` Sebastian Hesselbarth
2012-11-16  9:12   ` Axel Lin
2012-11-16  9:12     ` Axel Lin
2012-11-16 18:32     ` Sebastian Hesselbarth
2012-11-16 18:32       ` Sebastian Hesselbarth
2012-11-17  1:22       ` Axel Lin
2012-11-17  1:22         ` Axel Lin
  -- strict thread matches above, loose matches on Subject: below --
2012-11-10 23:28 Axel Lin
2012-11-11  8:58 ` Thomas Petazzoni

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=1352641495.3113.1.camel@phoenix \
    --to=axel.lin@ingics.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.