From patchwork Thu May 8 21:16:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 29864 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f197.google.com (mail-ob0-f197.google.com [209.85.214.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 707D920534 for ; Thu, 8 May 2014 21:17:46 +0000 (UTC) Received: by mail-ob0-f197.google.com with SMTP id vb8sf15232432obc.8 for ; Thu, 08 May 2014 14:17:46 -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=TGpIAnLOqTMu57wGQ2whHDmvJOUWK+PSpFfnT5InTppFFJu2fYw+d2i76SIeoFJ6WA Nzz1stHAzWRiFfdYjsEwxCE6A7Y5xZD+7zuDYtAzFsOE8GTSUuKcTnUr6myE0w9Z22Yk JHjaIgMsxLz8xu/NMhkvz1QwJDZcbAg6XMoKnkP6qCKlXxkIY2/SliVLRhvMaubk0iD9 Nezm99VFkFSYobRyeXnxtoOXW9a6LaomdHLergNw/Wu3g1vjQoAtwlBHST8nkzfdX8q/ nYcJ1TFYjUuIRF3DyIxK69DbbGK6vRBopKjrxki2r2ARIjf4qRGOchl1iKDJxDgYTRX1 1sBQ== X-Gm-Message-State: ALoCoQl+0A/2eIWwx+TE1IiR8Ek5gIIFmGKZVEwBYCVinT2mXW4yWq3rwKl0s53egDAmxcTZ9doY X-Received: by 10.182.130.200 with SMTP id og8mr3124491obb.18.1399583866021; Thu, 08 May 2014 14:17:46 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.97.200 with SMTP id m66ls25190qge.83.gmail; Thu, 08 May 2014 14:17:45 -0700 (PDT) X-Received: by 10.58.178.130 with SMTP id cy2mr2441713vec.55.1399583865896; Thu, 08 May 2014 14:17:45 -0700 (PDT) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id si3si382559vcb.28.2014.05.08.14.17.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 08 May 2014 14:17:45 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.220.179; Received: by mail-vc0-f179.google.com with SMTP id im17so4088230vcb.38 for ; Thu, 08 May 2014 14:17:45 -0700 (PDT) X-Received: by 10.52.173.165 with SMTP id bl5mr3902324vdc.13.1399583865818; Thu, 08 May 2014 14:17:45 -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 ib8csp25898vcb; Thu, 8 May 2014 14:17:45 -0700 (PDT) X-Received: by 10.66.148.197 with SMTP id tu5mr12114768pab.108.1399583864843; Thu, 08 May 2014 14:17:44 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id xf3si1070134pab.384.2014.05.08.14.17.44; Thu, 08 May 2014 14:17:44 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755901AbaEHVRh (ORCPT + 27 others); Thu, 8 May 2014 17:17:37 -0400 Received: from mail-wi0-f182.google.com ([209.85.212.182]:34724 "EHLO mail-wi0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755876AbaEHVRf (ORCPT ); Thu, 8 May 2014 17:17:35 -0400 Received: by mail-wi0-f182.google.com with SMTP id r20so378125wiv.3 for ; Thu, 08 May 2014 14:17:34 -0700 (PDT) X-Received: by 10.180.212.107 with SMTP id nj11mr105580wic.40.1399583854429; Thu, 08 May 2014 14:17:34 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id gd5sm2726629wjb.40.2014.05.08.14.17.03 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 May 2014 14:17:03 -0700 (PDT) From: Linus Walleij To: Samuel Ortiz , Lee Jones , linux-kernel@vger.kernel.org Cc: Linus Walleij Subject: [RESEND PATCH 4/6] mfd: stmpe: mask off unused blocks properly Date: Thu, 8 May 2014 23:16:37 +0200 Message-Id: <1399583799-23517-4-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1399583799-23517-1-git-send-email-linus.walleij@linaro.org> References: <1399583799-23517-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: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) 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 --- 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)