From patchwork Wed Feb 6 14:15:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Jackson X-Patchwork-Id: 2104381 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 9237EDF2A1 for ; Wed, 6 Feb 2013 14:15:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754211Ab3BFOPg (ORCPT ); Wed, 6 Feb 2013 09:15:36 -0500 Received: from mercuryimc.plus.com ([80.229.200.144]:42829 "EHLO centos1.newflow.co.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753869Ab3BFOPg (ORCPT ); Wed, 6 Feb 2013 09:15:36 -0500 Received: from [10.0.0.102] (unknown [10.0.0.102]) by centos1.newflow.co.uk (Postfix) with ESMTP id 916BE26B8035 for ; Wed, 6 Feb 2013 14:15:34 +0000 (GMT) Message-ID: <51126586.9030308@mimc.co.uk> Date: Wed, 06 Feb 2013 14:15:34 +0000 From: Mark Jackson User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 MIME-Version: 1.0 To: "linux-omap@vger.kernel.org" Subject: [PATCH] ARM: OMAP: Clear GPMC bits when applying new setting Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org When setting the GPMC device type, make sure any previous bits are cleared down, before applying the new setting. Signed-off-by: Mark Jackson Acked-by: Jon Hunter --- arch/arm/mach-omap2/gpmc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c index 1adb2d4..026e786 100644 --- a/arch/arm/mach-omap2/gpmc.c +++ b/arch/arm/mach-omap2/gpmc.c @@ -613,6 +613,10 @@ int gpmc_cs_configure(int cs, int cmd, int wval) case GPMC_CONFIG_DEV_TYPE: regval = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1); + /* clear 3 target bits */ + regval &= ~(GPMC_CONFIG1_DEVICETYPE(3) | + GPMC_CONFIG1_MUXADDDATA); + /* set the proper value */ regval |= GPMC_CONFIG1_DEVICETYPE(wval); if (wval == GPMC_DEVICETYPE_NOR) regval |= GPMC_CONFIG1_MUXADDDATA;