From patchwork Sun Nov 11 13:44:55 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 1725571 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id DF4483FCAE for ; Sun, 11 Nov 2012 13:47:47 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TXXqZ-0002VM-ES; Sun, 11 Nov 2012 13:45:11 +0000 Received: from mail-pb0-f49.google.com ([209.85.160.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TXXqW-0002V5-Jn for linux-arm-kernel@lists.infradead.org; Sun, 11 Nov 2012 13:45:09 +0000 Received: by mail-pb0-f49.google.com with SMTP id un15so539195pbc.36 for ; Sun, 11 Nov 2012 05:45:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:subject:from:to:cc:date:content-type:x-mailer :content-transfer-encoding:mime-version:x-gm-message-state; bh=4a6B7HXYTMVOCBCsUCdPVAoNWlByHdE1Ol2N8nxXIRo=; b=JJOrCqEvV4vUF9wdsVCPbFOXmTxSeiJc5yfBqlcfiFjvjvHgXkmt7pppC48kzsgQO2 jTi12c6dlQ5dE7pWTGz2bj/W87XgatpnQaNjsa53aJBvi1s7AQUlqWR4+T4E/zKZTIF1 fb0/OdqZHuhNm+uvDG1eSUoQA74mlzDtOZFMpGmjBQ3D50mkdefmz8m1gUD6KZgSDj5x anKWV67rlGvlWrQUsJReviO4mArrLqph1v6wnRMS9rOWqMAWSItbpbF42wNfJSFx2ZTo JGRBGeXajW7S7nq6pIBAjG8K66QSGt17g6tsljbfw56A1R4ElND1kkI6OGDQBtuxA+qk ltyA== Received: by 10.68.230.234 with SMTP id tb10mr49316444pbc.71.1352641505835; Sun, 11 Nov 2012 05:45:05 -0800 (PST) Received: from [192.168.0.100] (114-39-110-57.dynamic.hinet.net. [114.39.110.57]) by mx.google.com with ESMTPS id j9sm2621474paw.2.2012.11.11.05.45.02 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 11 Nov 2012 05:45:05 -0800 (PST) Message-ID: <1352641495.3113.1.camel@phoenix> Subject: [PATCH RFT 1/2] pinctrl: dove: Fix dove_audio1_ctrl_set when BIT(0|1|2|3) of config is clear From: Axel Lin To: Linus Walleij Date: Sun, 11 Nov 2012 21:44:55 +0800 X-Mailer: Evolution 3.2.3-0ubuntu6 Mime-Version: 1.0 X-Gm-Message-State: ALoCoQmKLHWxE12D6/QUueV9kgm54da6RshOyuzlJGYIv+gNeb78HdgaND8k4XJTraCLGyNhJmPU X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121111_084508_786637_B2352F3D X-CRM114-Status: UNSURE ( 9.62 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.160.49 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Thomas Petazzoni , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sebastian Hesselbarth X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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 --- 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);