From patchwork Tue Dec 20 11:33:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Rosin X-Patchwork-Id: 9481479 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 DF98D60820 for ; Tue, 20 Dec 2016 12:05:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CB7E328343 for ; Tue, 20 Dec 2016 12:05:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C0518284B0; Tue, 20 Dec 2016 12:05:29 +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 2FBC828343 for ; Tue, 20 Dec 2016 12:05:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757592AbcLTMF1 (ORCPT ); Tue, 20 Dec 2016 07:05:27 -0500 Received: from mail-db5eur01on0133.outbound.protection.outlook.com ([104.47.2.133]:47488 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1757531AbcLTMFZ (ORCPT ); Tue, 20 Dec 2016 07:05:25 -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=O21mOTyW0M00VN3Ug+sgmd3Cv7TYM1VbvSouVoDxvJw=; b=V5coI2Qg0RV446cwzTqSTkxAZxNIxaewCP6ofKVoLenqQ7hiXKjt/KF7uXOoQptbYr12WJph25L91D0cb2m8uVwM81FYMO9tUSPTrbOJ0FH6cSpnpRikBr84yzAIcdQyI27MXEZXefFhSpoSGTrgdaMGJW7H0GypO/th6K+Ndo8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peda@axentia.se; Received: from localhost.localdomain (217.210.101.82) by DB6PR0201MB2312.eurprd02.prod.outlook.com (10.169.222.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.771.8; Tue, 20 Dec 2016 11:33:20 +0000 From: Peter Rosin To: linux-kernel@vger.kernel.org Cc: Peter Rosin , Sebastian Reichel , linux-pm@vger.kernel.org Subject: [PATCH 1/3] power: supply: bq24735: move down bq24735_{en, dis}able_charging Date: Tue, 20 Dec 2016 12:33:00 +0100 Message-Id: <1482233582-29770-2-git-send-email-peda@axentia.se> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1482233582-29770-1-git-send-email-peda@axentia.se> References: <1482233582-29770-1-git-send-email-peda@axentia.se> MIME-Version: 1.0 X-Originating-IP: [217.210.101.82] X-ClientProxiedBy: DB5PR0101CA0002.eurprd01.prod.exchangelabs.com (10.165.200.140) To DB6PR0201MB2312.eurprd02.prod.outlook.com (10.169.222.151) X-MS-Office365-Filtering-Correlation-Id: 379cafa5-dae4-4fc4-6da6-08d428cc0024 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:DB6PR0201MB2312; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0201MB2312; 3:oCcRVRPVi8J6GQMCrhntqpHhUTs1R0RPQ2JC9dNCcawK0ReBCx7kJQJBlkOBjru1L4WInyCrPWHyGi9QemfQQ34GVfKGVlaocEt0gdpfAMV8FmVF/aKFdz6p6lQhREmUWXTt6EysUURHFW7XjquAPV3xSRLVJ1QqpOOPTsFmr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7gTmQTEzbUdxFP95rflZCodbHQRSeF+NtKgCtnYocBnRUfq6uUHSbEOBjFTDA6Km1BmDx9UZ4GsQji0YQ0gfeFkbR5whroFkrtoNzNdVrgt9rHwDWbBE03OowtoZAgEwHq73wLN9RwP01+7f6Kd2VOGO13E; 4:VP7EfxdJTqkJRK015NuwHu+av0MsAdcxtU9bnTHgrG2hNZgy57i8sBXc+rbSwbwieqUrWD5oCU/fHZErpfYgTf0hfvIEGIAEuyUo5Equ/5tLorpKJQPq6YSaZcu2JFpWveUNn0D2h8P+tzV0pcXbmJurC3DW8vezV1WNisvBstOvZqA4k2IHrHdbUYEppJh2kpr6s3NISRj9lbpRIvkeiNNG8R/XuzA1wOoVSabhwc3EBviWaZAgrOxfX46N1nsOBWKSuzIA648tZ9xoIl5HkPdozkqVXueVN+46zMujIKdietZYb5kp7Aar9hl8Mjwt3xq6h4beY5JfPyEgyVFuddSv5/M91afSaKi+s8JIgrHJn8e91xC089Ki0IndbmCqhVO2V/ODxhZBKFgY+uZYwwT4oaTQGm7vQivptYrP3/KHrUgEgoY4EWSL6Eo1IAOwI7FHuOYKtYatLNRN9kxFm83VIQX8YHvkczE1fmsabGfsxAXOtqd5mRdKy39XbCR9C65kJ5oarxCjJDPUDGIi/7tmGXqG0s5dTFrrGSu2+j9kRe+HAo7ZR7t3LUCLrZSZ2ctfUx8Xkl27O6iG4e8lRq/A36cqyJMLZkZH9lii4Vv6u1LliRJgK48TrlcVjrxN 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)(20161123562025)(20161123564025)(2016111802025)(20161123560025)(20161123555025)(6072148)(6043046); SRVR:DB6PR0201MB2312; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0201MB2312; X-Forefront-PRVS: 0162ACCC24 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6069001)(6009001)(7916002)(39830400002)(39450400003)(39410400002)(189002)(199003)(6916009)(86362001)(2351001)(97736004)(6486002)(2906002)(6506006)(101416001)(6512006)(2361001)(92566002)(7736002)(25786008)(305945005)(50226002)(68736007)(38730400001)(106356001)(8676002)(42186005)(81166006)(48376002)(50466002)(74482002)(36756003)(5660300001)(76176999)(4326007)(33646002)(81156014)(50986999)(66066001)(3846002)(189998001)(6666003)(110136003)(5003940100001)(6116002)(2950100002)(47776003)(105586002)(142933001)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:DB6PR0201MB2312; 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; DB6PR0201MB2312; 23:JCk1CvN+SdFMfLy4+dAyFaJe0V7cZcjhJ8EZCqD?= =?us-ascii?Q?WMw6BHYWbAeqkROGklKjHbfmUM1GVv1gpG5CUUfFCoVpdM6fUNNijO5cS/QL?= =?us-ascii?Q?AWAetRLchSKETkZjRl8zkMDon4OCzRjWrJjZHDsggB3Xfb6mgqKVfn2FfQmi?= =?us-ascii?Q?MTTe79hhezipeJAcS68FSxry91+OwfmHyTraS5nFTKdMRJPu3JT+pwDv2mh9?= =?us-ascii?Q?Y17o8yO3uRBOCgdbix4EtIsZlv2PZ+xdnzSA74zOHBlcHEJmsDXkuee3dnpA?= =?us-ascii?Q?jx2DavbWp7vk4PNL+ukJ3KVEfbdDFnrjm8B1rlYU8SZ7W0i+oBBbvaYqs9O8?= =?us-ascii?Q?YAxMyYp1YH9kyK7Ch+5QUWrJysk5i0JJHfuCd41QU570oI1SZ4bl6NLbxuAM?= =?us-ascii?Q?siaJlIArRo7cAHscjYP9CvDzC4rlDkwcPIPxCaBeG/xXt738m4/ccx0KvJqc?= =?us-ascii?Q?z1GyTw5T/yG1rRAUp1UZwGNjuEZRF7rygZr82XvbhiZErj6ijOjWkYUSMHwH?= =?us-ascii?Q?XzyRK+sVY/mIQnndU7ZKyveMKj96tKnapE3t6eI1RzeoLEvkc7WIWs4801FN?= =?us-ascii?Q?c6F80ZQDeJd+GDObEhFeMSX8ojw6gQ1Jqk75rKVq8ciecHN5L7y439/EJ8O+?= =?us-ascii?Q?d0tM+UMkPUC39MYoEbQQFirYraUo2YgH2J95sH6fBAQPManSQKR/Y0UpNOf3?= =?us-ascii?Q?NBpKISXcWJbWOJ/A+UOgetWpZdFibenYixu5jZaWplI/YTE5/i3oNeka1NFj?= =?us-ascii?Q?vfI73YBcqzgosSTSWa0boZ1C821pNg/HwjhkggSbFp62oORjWjUy6IwjrUQw?= =?us-ascii?Q?+YUejP9iXlxVVJghlGdqL72QO9+PbGxQjJOkaIxi08zMSNKT60jk8xjuv8NN?= =?us-ascii?Q?EO1Mr54+itINuTDf3U6u+qWSzw/d9SzMdTTCvCqrNt3lc8a4+20V5KetPNiz?= =?us-ascii?Q?/0hF4psZFJGhFcgv6ooYhL2ujXuhIZ32Byk9chSNNMQHundoV1Im09wWDkA/?= =?us-ascii?Q?k7A10beHdDksNCqXrHjgNipme7wC5n35zNZXwnF+GEHXjPuu7JRVhXRXjpRM?= =?us-ascii?Q?5cvK+zCjZBu1Mpwsvm0jd4PsaT8SMeXcAyUaavhM2mb9J729Ys/BSUna/NEf?= =?us-ascii?Q?qxK+bc8sqWiNDjpi0axn3qgxy/tTq+TgbOdOqyfsswcAx2kZV9LNIr0YQ5ei?= =?us-ascii?Q?LWqt/NCXGNn6ZzefKf2SeHh54aifw7MTmaRMqwHrI0OBGqwjvRAC/8hxoiId?= =?us-ascii?Q?zJPUTYYUkTqQzOrGwefg=3D?= X-Microsoft-Exchange-Diagnostics: 1; DB6PR0201MB2312; 6:QFMnEX5/ZVaeNu1HXK6HnyJ4SpBpF1meQQihdeSyidrTLY5iYZ10Q7Swmz24BStR+qWMZU3b/WwhmwHzFHHr39TEFU1uXX73UrmAd0DeUP0FZ4R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TUBc3cvofwPRTYbH3gLSbR3/tfTMei6yQII433MNvS/KUcQZz8OBp3pcbLJb5/B6kWrlbSQPjMWWJg== X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Dec 2016 11:33:20.0343 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0201MB2312 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 bq24735_enable_charging() needs to call bq24735_config_charging(), which is something to change later, this is just a preparatory patch. Signed-off-by: Peter Rosin --- drivers/power/supply/bq24735-charger.c | 38 +++++++++++++++++----------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/power/supply/bq24735-charger.c b/drivers/power/supply/bq24735-charger.c index 8a0242c13b7e..2787c19d6696 100644 --- a/drivers/power/supply/bq24735-charger.c +++ b/drivers/power/supply/bq24735-charger.c @@ -107,25 +107,6 @@ static int bq24735_update_word(struct i2c_client *client, u8 reg, return bq24735_write_word(client, reg, tmp); } -static inline int bq24735_enable_charging(struct bq24735 *charger) -{ - if (charger->pdata->ext_control) - return 0; - - return bq24735_update_word(charger->client, BQ24735_CHG_OPT, - BQ24735_CHG_OPT_CHARGE_DISABLE, 0); -} - -static inline int bq24735_disable_charging(struct bq24735 *charger) -{ - if (charger->pdata->ext_control) - return 0; - - return bq24735_update_word(charger->client, BQ24735_CHG_OPT, - BQ24735_CHG_OPT_CHARGE_DISABLE, - BQ24735_CHG_OPT_CHARGE_DISABLE); -} - static int bq24735_config_charger(struct bq24735 *charger) { struct bq24735_platform *pdata = charger->pdata; @@ -177,6 +158,25 @@ static int bq24735_config_charger(struct bq24735 *charger) return 0; } +static inline int bq24735_enable_charging(struct bq24735 *charger) +{ + if (charger->pdata->ext_control) + return 0; + + return bq24735_update_word(charger->client, BQ24735_CHG_OPT, + BQ24735_CHG_OPT_CHARGE_DISABLE, 0); +} + +static inline int bq24735_disable_charging(struct bq24735 *charger) +{ + if (charger->pdata->ext_control) + return 0; + + return bq24735_update_word(charger->client, BQ24735_CHG_OPT, + BQ24735_CHG_OPT_CHARGE_DISABLE, + BQ24735_CHG_OPT_CHARGE_DISABLE); +} + static bool bq24735_charger_is_present(struct bq24735 *charger) { if (charger->status_gpio) {