diff mbox

[RFT,1/2] pinctrl: dove: Fix dove_audio1_ctrl_set when BIT(0|1|2|3) of config is clear

Message ID 1352641495.3113.1.camel@phoenix (mailing list archive)
State New, archived
Headers show

Commit Message

Axel Lin Nov. 11, 2012, 1:44 p.m. UTC
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(+)

Comments

Sebastian Hesselbarth Nov. 12, 2012, 9:39 a.m. UTC | #1
On 11/11/2012 02:44 PM, Axel Lin wrote:
> 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>

Axel,

thanks for the hint on not clearing the audio1 bits before setting them.
I will test this tonight and guess you should prepare a real patch for
this one.

Sebastian
Axel Lin Nov. 16, 2012, 9:12 a.m. UTC | #2
2012/11/12 Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>:
> On 11/11/2012 02:44 PM, Axel Lin wrote:
>>
>> 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>
>
>
> Axel,
>
> thanks for the hint on not clearing the audio1 bits before setting them.
> I will test this tonight and guess you should prepare a real patch for
> this one.

Hi Sebastian,
Does this patch work for you?
May I have your Acked-and-Tested-by if you think this patch is ok.

Thanks,
Axel
Sebastian Hesselbarth Nov. 16, 2012, 6:32 p.m. UTC | #3
On 11/16/2012 10:12 AM, Axel Lin wrote:
> 2012/11/12 Sebastian Hesselbarth<sebastian.hesselbarth@gmail.com>:
>> On 11/11/2012 02:44 PM, Axel Lin wrote:
>>>
>>> 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>
>>
>>
>> Axel,
>>
>> thanks for the hint on not clearing the audio1 bits before setting them.
>> I will test this tonight and guess you should prepare a real patch for
>> this one.
>
> Hi Sebastian,
> Does this patch work for you?
> May I have your Acked-and-Tested-by if you think this patch is ok.

Axel,

pinctrl for Dove will not be enabled before DT clock support for Dove,
which will hopefully make it into 3.8. If you agree, I will test and push it
with the related patches for enabling pinctrl.

Sebastian
Axel Lin Nov. 17, 2012, 1:22 a.m. UTC | #4
> pinctrl for Dove will not be enabled before DT clock support for Dove,
> which will hopefully make it into 3.8. If you agree, I will test and push it
> with the related patches for enabling pinctrl.
Ok. Thanks.

Axel
diff mbox

Patch

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);