From patchwork Tue Apr 17 07:30:57 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 7887 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id AC08F23E4C for ; Tue, 17 Apr 2012 07:31:10 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 72009A18774 for ; Tue, 17 Apr 2012 07:31:10 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id e36so11751811iag.11 for ; Tue, 17 Apr 2012 00:31:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:mime-version:content-type :x-gm-message-state; bh=gkHRXMhXbK05LXg6lpcMbgWObpWMWJghaWJeM1zE4Z4=; b=U8SgOQ16vei9x2/rb8TVIpTVLg5aPDQ+AonZo4zmc/csjO6Ul6Wugin00Y9pxuhtJT cC18wzVPT+WAyb30vjbqvdQOASoDDzkpNVX+2XHUmg1NkwcTLoxi3ePHPzr8WdqoOJxK 1Mfkz7+4XbLlwLSKmypOWbL9wgbnZYDKuQA4kwj/1BljDV/yyPhQkLsT3LqQaqkLMEUf McH1Ib1XKAg7ShxFxFSrGXduc4cNohZMsDqP0Z+mYYK9GjU1J2PJBv/fLnLuUhWhMKB2 eyTfgS1VgUI+p18V3caGT2bgg4WVUNIw9jqghg/Yyrc/mMleEbmAgZlw90DXvKY52FG3 Q+MA== Received: by 10.50.135.36 with SMTP id pp4mr8345448igb.19.1334647870210; Tue, 17 Apr 2012 00:31:10 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.137.198 with SMTP id x6csp130033ibt; Tue, 17 Apr 2012 00:31:09 -0700 (PDT) Received: by 10.14.28.65 with SMTP id f41mr2036254eea.23.1334647869067; Tue, 17 Apr 2012 00:31:09 -0700 (PDT) Received: from eu1sys200aog102.obsmtp.com (eu1sys200aog102.obsmtp.com. [207.126.144.113]) by mx.google.com with SMTP id m1si5733614eeh.8.2012.04.17.00.31.04 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 17 Apr 2012 00:31:09 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.113 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.113; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.113 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) smtp.mail=linus.walleij@stericsson.com Received: from beta.dmz-us.st.com ([167.4.1.35]) (using TLSv1) by eu1sys200aob102.postini.com ([207.126.147.11]) with SMTP ID DSNKT40cOBVejH5G5p43KCICa+IsHi907gpe@postini.com; Tue, 17 Apr 2012 07:31:08 UTC Received: from zeta.dmz-us.st.com (ns4.st.com [167.4.16.71]) by beta.dmz-us.st.com (STMicroelectronics) with ESMTP id D869066; Tue, 17 Apr 2012 07:30:45 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-us.st.com (STMicroelectronics) with ESMTP id E27D471; Tue, 17 Apr 2012 05:26:23 +0000 (GMT) Received: from exdcvycastm004.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm004", Issuer "exdcvycastm004" (not verified)) by relay1.stm.gmessaging.net (Postfix) with ESMTPS id 3DA3924C07D; Tue, 17 Apr 2012 09:30:57 +0200 (CEST) Received: from steludxu4075.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.2) with Microsoft SMTP Server (TLS) id 8.3.83.0; Tue, 17 Apr 2012 09:31:01 +0200 From: Linus Walleij To: Samuel Ortiz , Cc: Rickard Andersson , Linus Walleij Subject: [PATCH 6/6] mfd/ab8500: add parameter to disable battery management Date: Tue, 17 Apr 2012 09:30:57 +0200 Message-ID: <1334647857-1810-1-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.7.9.2 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQlelfPVzawi+wpifpIgyVGGeW1TwqCyPNIVLyyt9fX8pNmbB2+79iLumxpmn/7izCmKPVGx From: Rickard Andersson This patch makes it possible to disable battery management via a module boot parameter. When 'ab8500-core.no_bm=1' then ab8500_btemp, ab8500_chargalg, ab8500_charger and ab8500_fg will not be probed. This boot parameter is used for scripted testing of the system. Signed-off-by: Rickard Andersson Reviewed-by: Jonas Aberg Signed-off-by: Linus Walleij --- drivers/mfd/ab8500-core.c | 55 ++++++++++++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 20 deletions(-) diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c index 8e56fd1..239d928 100644 --- a/drivers/mfd/ab8500-core.c +++ b/drivers/mfd/ab8500-core.c @@ -106,6 +106,9 @@ #define AB8500_TURN_ON_STATUS 0x00 +static bool no_bm; /* No battery management */ +module_param(no_bm, bool, S_IRUGO); + #define AB9540_MODEM_CTRL2_REG 0x23 #define AB9540_MODEM_CTRL2_SWDBBRSTN_BIT BIT(2) @@ -904,26 +907,6 @@ static struct mfd_cell __devinitdata abx500_common_devs[] = { .resources = ab8500_rtc_resources, }, { - .name = "ab8500-charger", - .num_resources = ARRAY_SIZE(ab8500_charger_resources), - .resources = ab8500_charger_resources, - }, - { - .name = "ab8500-btemp", - .num_resources = ARRAY_SIZE(ab8500_btemp_resources), - .resources = ab8500_btemp_resources, - }, - { - .name = "ab8500-fg", - .num_resources = ARRAY_SIZE(ab8500_fg_resources), - .resources = ab8500_fg_resources, - }, - { - .name = "ab8500-chargalg", - .num_resources = ARRAY_SIZE(ab8500_chargalg_resources), - .resources = ab8500_chargalg_resources, - }, - { .name = "ab8500-acc-det", .num_resources = ARRAY_SIZE(ab8500_av_acc_detect_resources), .resources = ab8500_av_acc_detect_resources, @@ -956,6 +939,29 @@ static struct mfd_cell __devinitdata abx500_common_devs[] = { }, }; +static struct mfd_cell __devinitdata ab8500_bm_devs[] = { + { + .name = "ab8500-charger", + .num_resources = ARRAY_SIZE(ab8500_charger_resources), + .resources = ab8500_charger_resources, + }, + { + .name = "ab8500-btemp", + .num_resources = ARRAY_SIZE(ab8500_btemp_resources), + .resources = ab8500_btemp_resources, + }, + { + .name = "ab8500-fg", + .num_resources = ARRAY_SIZE(ab8500_fg_resources), + .resources = ab8500_fg_resources, + }, + { + .name = "ab8500-chargalg", + .num_resources = ARRAY_SIZE(ab8500_chargalg_resources), + .resources = ab8500_chargalg_resources, + }, +}; + static struct mfd_cell __devinitdata ab8500_devs[] = { { .name = "ab8500-gpio", @@ -1306,6 +1312,15 @@ int __devinit ab8500_init(struct ab8500 *ab8500, enum ab8500_version version) if (ret) goto out_freeirq; + if (!no_bm) { + /* Add battery management devices */ + ret = mfd_add_devices(ab8500->dev, 0, ab8500_bm_devs, + ARRAY_SIZE(ab8500_bm_devs), NULL, + ab8500->irq_base); + if (ret) + dev_err(ab8500->dev, "error adding bm devices\n"); + } + if (is_ab9540(ab8500)) ret = sysfs_create_group(&ab8500->dev->kobj, &ab9540_attr_group);