From patchwork Wed Apr 16 23:12:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 4004441 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 A91699F2BA for ; Wed, 16 Apr 2014 23:13:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C3E79200E6 for ; Wed, 16 Apr 2014 23:13:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F19ED20149 for ; Wed, 16 Apr 2014 23:13:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756062AbaDPXMz (ORCPT ); Wed, 16 Apr 2014 19:12:55 -0400 Received: from mail-oa0-f73.google.com ([209.85.219.73]:52233 "EHLO mail-oa0-f73.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757027AbaDPXMu (ORCPT ); Wed, 16 Apr 2014 19:12:50 -0400 Received: by mail-oa0-f73.google.com with SMTP id n16so2454761oag.0 for ; Wed, 16 Apr 2014 16:12:50 -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=nsaKbpQNgCJ29IoXUdhxeA2H9LK1rO19xi6vyky0I78=; b=cJU8EHHaU4Z1bTSXLeqaEcC2MjzVolhtq+vbRUndm+8lkIGWjHvp9k42cB5JoqMhUA AXliGT4iF4D8wX0dCZH2nFtrgkcXkyjWui/oxDAtijOhSwT5r2zd0xdYZ4gsJv9VuyAx o8U6PDglrALN1suR5Qc0HL0hHY1Llyfk2HHGL0GxskvhRH+Jk+dOhoowwvMkvCyg4mYv QCTEYyzG4F6CPlzQqLe5NQDSKsDuntnxpmALQFUep7+R/SelceOv/0YdQLb9tRl8udbU kaN1d01jCdFcdhBFyUegwB3/9YTGWrw7EQfTH3cO8mhrHVtLwTlm4BCu4SmIITHO4Dou jq6g== X-Gm-Message-State: ALoCoQnE/rtohAU9EE6jPfF5x87hHx1nqlk5jdvsMeA3nLpErIDUXUbmsVqV5jla+0GWzwyS43ZIwudnEqPsS3FOkcT7kr0L+S8mhy3/yifyPqRKjB9FXIHcytLprUS7GuqP+Tdrby/A9WBzuf/6BoTkMkj/+J8uFLOXA45NDJ3L0RWLkTJFGBn3LxQ0F2FY6TZyBsnq+VNdVcUt9oUjduzJYMamlTGyVA== X-Received: by 10.182.104.200 with SMTP id gg8mr5605911obb.45.1397689970043; Wed, 16 Apr 2014 16:12:50 -0700 (PDT) Received: from corp2gmr1-2.hot.corp.google.com (corp2gmr1-2.hot.corp.google.com [172.24.189.93]) by gmr-mx.google.com with ESMTPS id x22si3302931yhd.5.2014.04.16.16.12.50 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 16 Apr 2014 16:12:50 -0700 (PDT) Received: from tictac.mtv.corp.google.com (tictac.mtv.corp.google.com [172.22.72.141]) by corp2gmr1-2.hot.corp.google.com (Postfix) with ESMTP id DA07B5A42C3; Wed, 16 Apr 2014 16:12:49 -0700 (PDT) Received: by tictac.mtv.corp.google.com (Postfix, from userid 121310) id 8977180736; Wed, 16 Apr 2014 16:12:49 -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 v3 1/5] mfd: tps65090: Don't tell child devices we have an IRQ if we don't Date: Wed, 16 Apr 2014 16:12:25 -0700 Message-Id: <1397689950-1568-2-git-send-email-dianders@chromium.org> X-Mailer: git-send-email 1.9.1.423.g4596e3a In-Reply-To: <1397689950-1568-1-git-send-email-dianders@chromium.org> References: <1397689950-1568-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 v3: None 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,