From patchwork Wed Apr 16 18:25:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 4003581 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7A5569F2CC for ; Wed, 16 Apr 2014 18:33:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9EB572035C for ; Wed, 16 Apr 2014 18:33:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D038620353 for ; Wed, 16 Apr 2014 18:33:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755654AbaDPSdq (ORCPT ); Wed, 16 Apr 2014 14:33:46 -0400 Received: from mail-yh0-f73.google.com ([209.85.213.73]:64233 "EHLO mail-yh0-f73.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753811AbaDPSdm (ORCPT ); Wed, 16 Apr 2014 14:33:42 -0400 Received: by mail-yh0-f73.google.com with SMTP id c41so1660863yho.2 for ; Wed, 16 Apr 2014 11:33:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=qypZkfUUhlXeOh2zsVGpBemTsAE3E1ZkGFCSgx0ZpOY=; b=bCdGfvuIoyPBWPEC5Bcrr3n31Y/9g7YIYwF5w6njZtpn2XEmxVM/d33MXAsY0m1xKZ 1/H8CO5FxM9oTDG5vH/ZicL/lAY1YSEXO5mHTqA0zDQsH0YTCU6yh2ZBNGWEbMpGJq2h 9x3bhJ4HVfhJKk32VzRrvNv2N23XD3RBQBmAEzz/iArp+T5kdat/3B2G0OgS6KD56efX /8JdczzmCk1Ru7pC1f3fNljeub5cfPnXcQcX/0Tw6eBZQ0onStGCKrJFIHBlPVc6hQ1t YuaBWmwRk6Chltnk5P06gSV9pJlLouwUbD8XrIxwihEJ6mNXAKDL35fWVY0oiVO7eY6C YB7w== X-Gm-Message-State: ALoCoQk6CvxHO/L+AkgF/7Iix4ED2Jyx0j/F5QjkOvfmtiXuItr5reVTvJV7+OAv1I4wfJqjLfL+kfP2G2eEwMfPiclMbd1RLUI+4XT+LCGXHliNJ3I6dXZiXU1a+mnsotR1yw2+yPcAVi8jL0oJgvTGnJCD83puoEyEzrBmRaHLrlEut9GfRwWWn6kk/fMO/iAAfpnIrVuxawonhC+e5RXQyLLaekPP5A== X-Received: by 10.58.43.170 with SMTP id x10mr4484887vel.36.1397672733526; Wed, 16 Apr 2014 11:25:33 -0700 (PDT) Received: from corp2gmr1-1.hot.corp.google.com (corp2gmr1-1.hot.corp.google.com [172.24.189.92]) by gmr-mx.google.com with ESMTPS id x22si3202135yhd.5.2014.04.16.11.25.33 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 16 Apr 2014 11:25:33 -0700 (PDT) Received: from tictac.mtv.corp.google.com (tictac.mtv.corp.google.com [172.22.72.141]) by corp2gmr1-1.hot.corp.google.com (Postfix) with ESMTP id 5C76B31C211; Wed, 16 Apr 2014 11:25:33 -0700 (PDT) Received: by tictac.mtv.corp.google.com (Postfix, from userid 121310) id E025D80556; Wed, 16 Apr 2014 11:25:32 -0700 (PDT) From: Doug Anderson To: Anton Vorontsov Cc: Olof Johansson , Sachin Kamat , ajaykumar.rs@samsung.com, linux-samsung-soc@vger.kernel.org, Doug Anderson , Samuel Ortiz , Lee Jones , linux-kernel@vger.kernel.org Subject: [PATCH v2 1/5] mfd: tps65090: Don't tell child devices we have an IRQ if we don't Date: Wed, 16 Apr 2014 11:25:20 -0700 Message-Id: <1397672724-9063-2-git-send-email-dianders@chromium.org> X-Mailer: git-send-email 1.9.1.423.g4596e3a In-Reply-To: <1397672724-9063-1-git-send-email-dianders@chromium.org> References: <1397592876-5741-1-git-send-email-dianders@chromium.org> <1397672724-9063-1-git-send-email-dianders@chromium.org> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If we weren't given an interrupt we shouldn't tell child devices (like the tps65090 charger) that they have an interrupt. This is needed so that we can support polling mode in the tps65090 charger driver. See also (charger: tps65090: Allow charger module to be used when no irq). Signed-off-by: Doug Anderson Acked-by: Lee Jones --- Changes in v2: - Split noirq (polling mode) changes into MFD and charger drivers/mfd/tps65090.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/mfd/tps65090.c b/drivers/mfd/tps65090.c index ba1a25d..c3cddb4 100644 --- a/drivers/mfd/tps65090.c +++ b/drivers/mfd/tps65090.c @@ -64,11 +64,16 @@ static struct resource charger_resources[] = { } }; -static const struct mfd_cell tps65090s[] = { - { +enum tps65090_cells { + PMIC = 0, + CHARGER = 1, +}; + +static struct mfd_cell tps65090s[] = { + [PMIC] = { .name = "tps65090-pmic", }, - { + [CHARGER] = { .name = "tps65090-charger", .num_resources = ARRAY_SIZE(charger_resources), .resources = &charger_resources[0], @@ -211,6 +216,9 @@ static int tps65090_i2c_probe(struct i2c_client *client, "IRQ init failed with err: %d\n", ret); return ret; } + } else { + /* Don't tell children they have an IRQ that'll never fire */ + tps65090s[CHARGER].num_resources = 0; } ret = mfd_add_devices(tps65090->dev, -1, tps65090s,