From patchwork Wed Apr 16 14:44:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 28490 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f71.google.com (mail-pa0-f71.google.com [209.85.220.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5A3EB206A6 for ; Wed, 16 Apr 2014 14:45:27 +0000 (UTC) Received: by mail-pa0-f71.google.com with SMTP id kq14sf42185438pab.6 for ; Wed, 16 Apr 2014 07:45:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=wkEmF+AWm2UXFmFID4pSDTcN439akcIYMu1GlxbbPTA=; b=gBrTgEXgfzdoi6+oMqyj2A8Rpk1xa4j2Ru+mB77btDbnQJWwY9GNL0oxqAK9WgqCm/ yNiXy+1LcBcGGBPeD6s3zDnEhHarEp4LrCgKqGptP3hzj9AiQ96ejk+f4u0owIzjvA6z GGg5yKghfKAVyY005VYR+z9ASu8fRgmoipQVavtTNtJ21HzDNEhGOMAVrGfNbWdwVouW gyPDVPrGsPpy3pi5YNMpYuwOp84Jj//5Cc4K7tCuR51tyNgX9H1Ol3Y8U8UE4rKpwi8P D8+SufiqSfbno8/BfAsTtjbIVr92K1rIyynDXi+vqMcj12OcQ2QImUL0SLBN2EajPk7W XMHg== X-Gm-Message-State: ALoCoQlDDNYdTycOV/1kS+gPhd2KriRpZDKFbqi5EsdgV7NZFEp0sGEiqBs+ss5k6SFb7Nx2GwGZ X-Received: by 10.66.240.4 with SMTP id vw4mr3984921pac.10.1397659526609; Wed, 16 Apr 2014 07:45:26 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.48.198 with SMTP id o64ls647252qga.66.gmail; Wed, 16 Apr 2014 07:45:26 -0700 (PDT) X-Received: by 10.221.58.144 with SMTP id wk16mr2413840vcb.23.1397659526467; Wed, 16 Apr 2014 07:45:26 -0700 (PDT) Received: from mail-ve0-f170.google.com (mail-ve0-f170.google.com [209.85.128.170]) by mx.google.com with ESMTPS id be7si3906278vcb.143.2014.04.16.07.45.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 16 Apr 2014 07:45:26 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.170; Received: by mail-ve0-f170.google.com with SMTP id pa12so11244542veb.1 for ; Wed, 16 Apr 2014 07:45:26 -0700 (PDT) X-Received: by 10.220.147.16 with SMTP id j16mr3339380vcv.14.1397659526343; Wed, 16 Apr 2014 07:45:26 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp317905vcb; Wed, 16 Apr 2014 07:45:25 -0700 (PDT) X-Received: by 10.69.2.2 with SMTP id bk2mr8867643pbd.75.1397659525096; Wed, 16 Apr 2014 07:45:25 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ai4si8264948pbd.254.2014.04.16.07.45.24; Wed, 16 Apr 2014 07:45:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161674AbaDPOou (ORCPT + 26 others); Wed, 16 Apr 2014 10:44:50 -0400 Received: from mail-we0-f175.google.com ([74.125.82.175]:49274 "EHLO mail-we0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161145AbaDPOos (ORCPT ); Wed, 16 Apr 2014 10:44:48 -0400 Received: by mail-we0-f175.google.com with SMTP id q58so10849797wes.20 for ; Wed, 16 Apr 2014 07:44:47 -0700 (PDT) X-Received: by 10.180.39.175 with SMTP id q15mr19794460wik.4.1397659487388; Wed, 16 Apr 2014 07:44:47 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id eu7sm5398968wib.18.2014.04.16.07.44.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Apr 2014 07:44:46 -0700 (PDT) From: Linus Walleij To: Samuel Ortiz , Lee Jones , linux-kernel@vger.kernel.org Cc: Silvio F , Philipp Zabel , Sascha Hauer , Shawn Guo , Viresh Kumar , Shiraz Hashim , spear-devel@list.st.com, Linus Walleij Subject: [PATCH 4/6] mfd: stmpe: mask off unused blocks properly Date: Wed, 16 Apr 2014 16:44:13 +0200 Message-Id: <1397659455-13638-5-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1397659455-13638-1-git-send-email-linus.walleij@linaro.org> References: <1397659455-13638-1-git-send-email-linus.walleij@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linus.walleij@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The STMPE driver would just read/modify/write the system control register on the STMPE1601, meaning it would not properly mask off the PWM block, which remained active if it was on at boot time. This makes sure the blocks are always masked off if they were active on boot, saving some power. Also rename the inconsistenty named STMPE1601 define for the PWM block activation. Signed-off-by: Linus Walleij Acked-by: Lee Jones --- drivers/mfd/stmpe.c | 9 +++++++++ drivers/mfd/stmpe.h | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c index 692452442ead..065c923cb2a9 100644 --- a/drivers/mfd/stmpe.c +++ b/drivers/mfd/stmpe.c @@ -606,9 +606,18 @@ static int stmpe1601_enable(struct stmpe *stmpe, unsigned int blocks, if (blocks & STMPE_BLOCK_GPIO) mask |= STMPE1601_SYS_CTRL_ENABLE_GPIO; + else + mask &= ~STMPE1601_SYS_CTRL_ENABLE_GPIO; if (blocks & STMPE_BLOCK_KEYPAD) mask |= STMPE1601_SYS_CTRL_ENABLE_KPC; + else + mask &= ~STMPE1601_SYS_CTRL_ENABLE_KPC; + + if (blocks & STMPE_BLOCK_PWM) + mask |= STMPE1601_SYS_CTRL_ENABLE_SPWM; + else + mask &= ~STMPE1601_SYS_CTRL_ENABLE_SPWM; return __stmpe_set_bits(stmpe, STMPE1601_REG_SYS_CTRL, mask, enable ? mask : 0); diff --git a/drivers/mfd/stmpe.h b/drivers/mfd/stmpe.h index 6639f1b0fef5..9e4d21d37a11 100644 --- a/drivers/mfd/stmpe.h +++ b/drivers/mfd/stmpe.h @@ -192,7 +192,7 @@ int stmpe_remove(struct stmpe *stmpe); #define STMPE1601_SYS_CTRL_ENABLE_GPIO (1 << 3) #define STMPE1601_SYS_CTRL_ENABLE_KPC (1 << 1) -#define STMPE1601_SYSCON_ENABLE_SPWM (1 << 0) +#define STMPE1601_SYS_CTRL_ENABLE_SPWM (1 << 0) /* The 1601/2403 share the same masks */ #define STMPE1601_AUTOSLEEP_TIMEOUT_MASK (0x7)