From patchwork Wed Dec 21 21:29:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Rosin X-Patchwork-Id: 9483951 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8CFB2601D5 for ; Thu, 22 Dec 2016 00:04:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7EB2528429 for ; Thu, 22 Dec 2016 00:04:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 72B54284AA; Thu, 22 Dec 2016 00:04:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 50BA828429 for ; Thu, 22 Dec 2016 00:04:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757976AbcLVAER (ORCPT ); Wed, 21 Dec 2016 19:04:17 -0500 Received: from mail-db5eur01on0118.outbound.protection.outlook.com ([104.47.2.118]:51776 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754345AbcLVAEP (ORCPT ); Wed, 21 Dec 2016 19:04:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axentiatech.onmicrosoft.com; s=selector1-axentia-se; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=75hlx6+Qq2Mx9caFzQDB5ksO6S37uT7ufzstcIiNnI4=; b=faxLNf6jdgJAE+4d0KeRIEmo2bolFo2UDtqH0PZej2t1W8g9Rnv++zmVyweSQSmhhMXGnSJG5eaTGeXxSUkOzLVSrOPKghppDF6T3rg/FSt8JSbmUCIWB7bQQhpypt4ifBf6YHLMl2cMiWb2faNjriXbqBg93NNLx1po6ug6ytw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peda@axentia.se; Received: from localhost.localdomain (217.210.101.82) by DB6PR0201MB2309.eurprd02.prod.outlook.com (10.169.222.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.803.11; Wed, 21 Dec 2016 21:30:08 +0000 From: Peter Rosin To: linux-kernel@vger.kernel.org Cc: Peter Rosin , Sebastian Reichel , Rob Herring , Mark Rutland , linux-pm@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH 1/2] power: supply: bq24735: allow polling even if there is no ac-detect gpio Date: Wed, 21 Dec 2016 22:29:52 +0100 Message-Id: <1482355793-16190-2-git-send-email-peda@axentia.se> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1482355793-16190-1-git-send-email-peda@axentia.se> References: <1482355793-16190-1-git-send-email-peda@axentia.se> MIME-Version: 1.0 X-Originating-IP: [217.210.101.82] X-ClientProxiedBy: VI1PR0701CA0050.eurprd07.prod.outlook.com (10.168.131.140) To DB6PR0201MB2309.eurprd02.prod.outlook.com (10.169.222.148) X-MS-Office365-Filtering-Correlation-Id: 46e53ce3-f361-41c6-0bfa-08d429e88a44 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:DB6PR0201MB2309; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0201MB2309; 3:klckTo+HUV0cdlkWEBDfluTJ3Vz1jj82yXQoVHtkCsupyUjWjIDhtABAzspVWQxHwqP0k0oyOkcST/M//cB9FgJ4ceL+PkDvD4+Y4tjHShLvfJsQvcX9AGUVFBRgor+Hlc83gUvO1hxv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W6NEr1HzQYrICChAMWA6/PNi1VaqeFiXGwFB6LyyXSs30/p8Ighgs4rJ8ZdA9/8eC7plr2TdZ3zgRm6PcdF8BJwpR5tpRK7I9Q5+WY5zbIoo186z25mbe4fh45WBNg4iJUxbyasTHX3zDZyVjJ8rIZeINJfSOWJuHtBkQ0v/XNAYFDp+PPlCwfsDFAULzluwIG8wDNfJPMy6faM2VDQxzCuKWmLyt+US917GvAld8MeL82gAA16LXk2EQqpw==; 4:nX1avCyeFzFOGQLUgl8PYPMqUxS+ib2GVPu0s0BlMyrJBZH2W+4h/RFgrUtgXvpstxx+ZbAw6Gt+uwrFv9Offe5N9/8aAG5nv8vqB5JnNLM5Fv9h8UQDFroc8w3m6HoGRpF451yGdaHlQm9Emds4qCiRXpunNluxrHZiJSwM9OxHr6d0DuR9Z7KAhADpV83xS5DIP+0fV2zUp94IeVA8VSFmqjKjGWUPiFmaaNywm9cDmrTgBjipaYXJncVwAueNFREpylpPGVsyUvfEyJFgzTuvYiquzO3ZBSxnoxy0rQHu+4kPodzmGLxMHaQlLGJzLOcdD0hfu37NsOiS+eJ8U88juyF6D294vYGL9+q0HDCKUwJszRV8bqjpPn5UhkDmLGYhe0rTH+5olNB9IBJXK03CJ3Bi/C1dMoTNGME8Pnp/5uBHWIg4s/mb4/G50v4t9oV4pf9wphDBtu5RFyiD25d3ZyVE/jAN5qg1GA2cJ9DM0tq1R6U+yVwOSTdlHTtFEZfFu39VJSwHODK//EWJeAfeq58X847N0wErjLqWqsfbSkGCF5g46E1BGZwUamNrXXuXM6uIoRKplThiZhJe5HPgt5FOjz8QYCaU90v7HrHuZMPgxJgukzuXRuS01b59 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6041248)(2016111802025)(20161123562025)(20161123564025)(20161123560025)(20161123555025)(6072148)(6043046); SRVR:DB6PR0201MB2309; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0201MB2309; X-Forefront-PRVS: 01630974C0 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6069001)(6009001)(7916002)(39410400002)(39450400003)(39830400002)(189002)(199003)(74482002)(36756003)(47776003)(6486002)(7736002)(2950100002)(33646002)(2351001)(6916009)(101416001)(110136003)(105586002)(189998001)(86362001)(50986999)(76176999)(48376002)(50466002)(97736004)(68736007)(6666003)(106356001)(38730400001)(4326007)(2906002)(5003940100001)(81166006)(3846002)(6116002)(42186005)(92566002)(25786008)(2361001)(50226002)(305945005)(66066001)(5660300001)(6506006)(6512006)(81156014)(8676002)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:DB6PR0201MB2309; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: axentia.se does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB6PR0201MB2309; 23:PQVLwDVsuDZQd6hoqUYAvfA0zworC+SgvNN92Py?= =?us-ascii?Q?ODJWXp+7Yq1UbLSgDhnq9ZBrsm32T8KBuh2yod6SWM5nBCzeD9Qc5uDv3V0C?= =?us-ascii?Q?MTLqcAzpAkyRT6SvY5f77ZBVCm1+Tkta1aOs1sGS5OMEHDycK43DYB5AML/R?= =?us-ascii?Q?JLqWe7ovXPkbsNLruHLIdWiruP3XcNawvj2ktEqKDWls/tZ7PLEqPBf9H/tZ?= =?us-ascii?Q?G2VHg6RGm0hvWU/ZWYK8bjV10b2mgUZqxGBfAL60hL8mWIFW3lQiwtrI5UZM?= =?us-ascii?Q?IqZvTj9PPscv6C5sQ1rV2WPhNHjld8Hdd1fxLbnBXbyp8IdqXiX2WVpPJ9Tf?= =?us-ascii?Q?7/fO5k6WeyPoZI1dwm8RzHPKpRkuLMYF5NwDn1CB7gb7Gha2KukJ0Nc16IkB?= =?us-ascii?Q?r7sHzc5QjnMRH7rmh2aBNi3kY6wei6eNxsHRMExC8SzQkUwnX+TBCpaamTy9?= =?us-ascii?Q?z4OX5+sqXeLwUsD/6RyDx13jYp8rrZpf6buRiR+CmaM+ZXRP17Lgo3V8bqS1?= =?us-ascii?Q?YmzdkN6rGHAoIo2O70CRQ1/CaDWLwtbiYs9KPXXKby5huCle+R9eHbtbzaok?= =?us-ascii?Q?9syQNAZ64NpLIcQK6QvlcMefnA1gQ+mbjc/f2H/2T4qAcmnzhvQXrJ8SAfPK?= =?us-ascii?Q?YNFg+txeif03bl2QOsvw6+dAyx9YQNcbwj/G4YWCL1Utg8iCyVEyDDKps4lr?= =?us-ascii?Q?qEKk+k16QxYrndP5iztyEOWMlF7TjloLT86smIfC44eVjLKxpnJlgCVseUJu?= =?us-ascii?Q?ZCelSRs6qXm1TdRlKKpUvjjMd4zTLfYXAy7BPEMeBnzkzbeJyyD+xNyhgEe/?= =?us-ascii?Q?KragbyL1J9p0rbYqnfdN3Uw7KiiwYnMR8PP3fQlpASzUVhj85bYOjeEsdCdD?= =?us-ascii?Q?7M2vNNphWBrVeRZ4MfhYA1ztlGNIX/45PnjVfHfhUMZGa6jwbS9srqQ/IAyh?= =?us-ascii?Q?Yd+cTDDaHOqugA8DgFE6mOkg+HP3NzVJ/5r3a6du/DQirqwcMGv1+lxtu+UI?= =?us-ascii?Q?bJjNa2mT572862KvHVgTFUdlwtol2Q0Jfn2EYNINKI1H7IvmdsqByFf2D+TN?= =?us-ascii?Q?fErwAg//u3YZSz2wz/09pAlpZnrK2EUrheKu44djivGQUK083yL63uU6bIqV?= =?us-ascii?Q?GQjQ+SvCCpoIxWy8z82UWmpXq/HrDXpmPZlZWflqCSPtyzAxUC7cBZAMfOdd?= =?us-ascii?Q?uxmTMA9Nwnw/olftehM5QeGusvafJxXbP1R+3JgujvsQCci/tt/2H9BHUqA?= =?us-ascii?Q?=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; DB6PR0201MB2309; 6:ujUiRa0Pq3sNL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X1pUS3TmivhYU3WVCydkuDrNtlfQArgBUPJIYhxxUuQEnqL67DT1RPy88iQVcr/AC696FYn0AblaxNnB/CaBE6qI+o3K/caQ5G4UG6lgaBh8LwSb/ZjlwzQBfaMNWTHeNmUSF7FJbetsiF+8J80cZ0MUprc4ZccWtX70PwTRD2w== X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Dec 2016 21:30:08.3079 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0201MB2309 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It is possible to verify AC adapter presence via a register read, without any physical connection to the ACOK pin on the charger. Allow this. Signed-off-by: Peter Rosin Acked-by: Rob Herring --- Documentation/devicetree/bindings/power/supply/ti,bq24735.txt | 4 ++-- drivers/power/supply/bq24735-charger.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/power/supply/ti,bq24735.txt b/Documentation/devicetree/bindings/power/supply/ti,bq24735.txt index efc2c6a78661..de45e1a2a4d9 100644 --- a/Documentation/devicetree/bindings/power/supply/ti,bq24735.txt +++ b/Documentation/devicetree/bindings/power/supply/ti,bq24735.txt @@ -27,8 +27,8 @@ Optional properties : - ti,external-control : Indicates that the charger is configured externally and that the host should not attempt to enable/disable charging or set the charge voltage/current. - - poll-interval : In case 'interrupts' is not specified, poll AC presence - on the ti,ac-detect-gpios GPIO with this interval (milliseconds). + - poll-interval : In case 'interrupts' is not specified, poll AC adapter + presence with this interval (milliseconds). Example: diff --git a/drivers/power/supply/bq24735-charger.c b/drivers/power/supply/bq24735-charger.c index 4f6275e5cf1c..d8be81203837 100644 --- a/drivers/power/supply/bq24735-charger.c +++ b/drivers/power/supply/bq24735-charger.c @@ -468,7 +468,7 @@ static int bq24735_charger_probe(struct i2c_client *client, client->irq, ret); return ret; } - } else if (charger->status_gpio) { + } else { ret = device_property_read_u32(&client->dev, "poll-interval", &charger->poll_interval); if (ret)