From patchwork Sun Jul 9 02:17:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liam Breck X-Patchwork-Id: 9831597 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 89CEC603B5 for ; Sun, 9 Jul 2017 02:17:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 72DEA251F4 for ; Sun, 9 Jul 2017 02:17:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 67BAC2656B; Sun, 9 Jul 2017 02:17:46 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_SPAM,T_DKIM_INVALID,UPPERCASE_50_75 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 E30702522B for ; Sun, 9 Jul 2017 02:17:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751858AbdGICRp (ORCPT ); Sat, 8 Jul 2017 22:17:45 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:36283 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751654AbdGICRo (ORCPT ); Sat, 8 Jul 2017 22:17:44 -0400 Received: by mail-pf0-f193.google.com with SMTP id z6so9736898pfk.3 for ; Sat, 08 Jul 2017 19:17:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=kJxr4O1+JV6rL1oARtELWmA0OA++tyd92GOS1OfaP74=; b=JB0EuL4bL5XUdhfQn1HVgwnfhetc3izY7wm/1yCbT7r8Fi8I9BXNtkh3y6LeRJzd/r n2aHuls/dT1lCvcCPR3ItNf6MAjcehpWDEDzaOrbTVr26Z6fjqNkAc2mbtrsXNkwtTMP DD+ImT8l52smpRech+1puaHCQ/mDB2D3dx8nuIsB8sug9krxF89KR2mKVV0mppHI++GE nOQmaBMyXkPIUCOqitHTkid+o5SXJrtLURSCp5ExqnTbOE8MU2iEmqlcQpLe/le7u850 qHlRnl338/w9uR/zYH+cZnynIHtkDeXPyf70UhBJQxtpYu6BmOsF9P0JxV+zrA2mTOFG tFXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=kJxr4O1+JV6rL1oARtELWmA0OA++tyd92GOS1OfaP74=; b=YE/U2NLHFks39HA3Hj7+5nEBn839dkKOyEwq5aImKt3Ik4XcBR6+8V8StI7xDZ8Eez EVYea1OnFgXIZq5bDQCOGaS9QLM1T6ynGWhwsJqDF+kC3ARBlMe1WsXmTHgz62jwALNn QBuprNo5EoZtnSnXrKdrBW8nCtkmokxQ6LoTG55A8XAINc84543Wyun9vb+VXc57+8a6 Z9Jh3ZR7UWi869HoTwnRM3rKwPSWRA8vj0rrLnHW4ExEe0Bwg6kEK1XvY2sMBU6B5eet Tqf0uPM7t8JszbnOHSSvewFj7TBFuM5rV4eifvUgzjWzdO2KVXup3io5zH/V5T6/VaFx PQ/A== X-Gm-Message-State: AIVw112WIdH4GI8/c+roz0agO7Rnp9t10J3mcQStCFSVAzjMRQ+a031e hAnDP5C1ltRZpQ== X-Received: by 10.99.97.5 with SMTP id v5mr8323636pgb.77.1499566663436; Sat, 08 Jul 2017 19:17:43 -0700 (PDT) Received: from localhost.localdomain (c-73-223-93-234.hsd1.ca.comcast.net. [73.223.93.234]) by smtp.gmail.com with ESMTPSA id h184sm14994026pge.66.2017.07.08.19.17.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 08 Jul 2017 19:17:42 -0700 (PDT) From: Liam Breck To: Sebastian Reichel , =?UTF-8?q?Pali=20Roh=C3=A1r?= , linux-pm@vger.kernel.org Cc: Paul Kocialkowski , Liam Breck Subject: [RFC v1 6/6] power: supply: bq27xxx: Remove duplicate chip data arrays Date: Sat, 8 Jul 2017 19:17:00 -0700 Message-Id: <20170709021700.14354-7-liam@networkimprov.net> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20170709021700.14354-1-liam@networkimprov.net> References: <20170709021700.14354-1-liam@networkimprov.net> 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 From: Liam Breck BQ2751X & BQ27510G3 have identical regs & props. BQ27500 & BQ27510G1 & BQ27510G2 have identical regs & props. Remove the duplicate arrays. No functional changes to the driver. Signed-off-by: Liam Breck --- drivers/power/supply/bq27xxx_battery.c | 129 ++------------------------------- 1 file changed, 8 insertions(+), 121 deletions(-) diff --git a/drivers/power/supply/bq27xxx_battery.c b/drivers/power/supply/bq27xxx_battery.c index 54755c88..3632784e 100644 --- a/drivers/power/supply/bq27xxx_battery.c +++ b/drivers/power/supply/bq27xxx_battery.c @@ -201,27 +201,8 @@ static u8 [BQ27XXX_REG_AP] = INVALID_REG_ADDR, BQ27XXX_DM_REG_ROWS, }, - bq2751x_regs[BQ27XXX_REG_MAX] = { - [BQ27XXX_REG_CTRL] = 0x00, - [BQ27XXX_REG_TEMP] = 0x06, - [BQ27XXX_REG_INT_TEMP] = 0x28, - [BQ27XXX_REG_VOLT] = 0x08, - [BQ27XXX_REG_AI] = 0x14, - [BQ27XXX_REG_FLAGS] = 0x0a, - [BQ27XXX_REG_TTE] = 0x16, - [BQ27XXX_REG_TTF] = INVALID_REG_ADDR, - [BQ27XXX_REG_TTES] = 0x1a, - [BQ27XXX_REG_TTECP] = INVALID_REG_ADDR, - [BQ27XXX_REG_NAC] = 0x0c, - [BQ27XXX_REG_FCC] = 0x12, - [BQ27XXX_REG_CYCT] = 0x1e, - [BQ27XXX_REG_AE] = INVALID_REG_ADDR, - [BQ27XXX_REG_SOC] = 0x20, - [BQ27XXX_REG_DCAP] = 0x2e, - [BQ27XXX_REG_AP] = INVALID_REG_ADDR, - BQ27XXX_DM_REG_ROWS, - }, -#define bq2752x_regs bq2751x_regs +#define bq2751x_regs bq27510g3_regs +#define bq2752x_regs bq27510g3_regs bq27500_regs[BQ27XXX_REG_MAX] = { [BQ27XXX_REG_CTRL] = 0x00, [BQ27XXX_REG_TEMP] = 0x06, @@ -242,46 +223,8 @@ static u8 [BQ27XXX_REG_AP] = 0x24, BQ27XXX_DM_REG_ROWS, }, - bq27510g1_regs[BQ27XXX_REG_MAX] = { - [BQ27XXX_REG_CTRL] = 0x00, - [BQ27XXX_REG_TEMP] = 0x06, - [BQ27XXX_REG_INT_TEMP] = INVALID_REG_ADDR, - [BQ27XXX_REG_VOLT] = 0x08, - [BQ27XXX_REG_AI] = 0x14, - [BQ27XXX_REG_FLAGS] = 0x0a, - [BQ27XXX_REG_TTE] = 0x16, - [BQ27XXX_REG_TTF] = 0x18, - [BQ27XXX_REG_TTES] = 0x1c, - [BQ27XXX_REG_TTECP] = 0x26, - [BQ27XXX_REG_NAC] = 0x0c, - [BQ27XXX_REG_FCC] = 0x12, - [BQ27XXX_REG_CYCT] = 0x2a, - [BQ27XXX_REG_AE] = 0x22, - [BQ27XXX_REG_SOC] = 0x2c, - [BQ27XXX_REG_DCAP] = 0x3c, - [BQ27XXX_REG_AP] = 0x24, - BQ27XXX_DM_REG_ROWS, - }, - bq27510g2_regs[BQ27XXX_REG_MAX] = { - [BQ27XXX_REG_CTRL] = 0x00, - [BQ27XXX_REG_TEMP] = 0x06, - [BQ27XXX_REG_INT_TEMP] = INVALID_REG_ADDR, - [BQ27XXX_REG_VOLT] = 0x08, - [BQ27XXX_REG_AI] = 0x14, - [BQ27XXX_REG_FLAGS] = 0x0a, - [BQ27XXX_REG_TTE] = 0x16, - [BQ27XXX_REG_TTF] = 0x18, - [BQ27XXX_REG_TTES] = 0x1c, - [BQ27XXX_REG_TTECP] = 0x26, - [BQ27XXX_REG_NAC] = 0x0c, - [BQ27XXX_REG_FCC] = 0x12, - [BQ27XXX_REG_CYCT] = 0x2a, - [BQ27XXX_REG_AE] = 0x22, - [BQ27XXX_REG_SOC] = 0x2c, - [BQ27XXX_REG_DCAP] = 0x3c, - [BQ27XXX_REG_AP] = 0x24, - BQ27XXX_DM_REG_ROWS, - }, +#define bq27510g1_regs bq27500_regs +#define bq27510g2_regs bq27500_regs bq27510g3_regs[BQ27XXX_REG_MAX] = { [BQ27XXX_REG_CTRL] = 0x00, [BQ27XXX_REG_TEMP] = 0x06, @@ -530,24 +473,8 @@ static enum power_supply_property bq2750x_props[] = { POWER_SUPPLY_PROP_MANUFACTURER, }; -static enum power_supply_property bq2751x_props[] = { - POWER_SUPPLY_PROP_STATUS, - POWER_SUPPLY_PROP_PRESENT, - POWER_SUPPLY_PROP_VOLTAGE_NOW, - POWER_SUPPLY_PROP_CURRENT_NOW, - POWER_SUPPLY_PROP_CAPACITY, - POWER_SUPPLY_PROP_CAPACITY_LEVEL, - POWER_SUPPLY_PROP_TEMP, - POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW, - POWER_SUPPLY_PROP_TECHNOLOGY, - POWER_SUPPLY_PROP_CHARGE_FULL, - POWER_SUPPLY_PROP_CHARGE_NOW, - POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN, - POWER_SUPPLY_PROP_CYCLE_COUNT, - POWER_SUPPLY_PROP_HEALTH, - POWER_SUPPLY_PROP_MANUFACTURER, -}; -#define bq2752x_props bq2751x_props +#define bq2751x_props bq27510g3_props +#define bq2752x_props bq27510g3_props static enum power_supply_property bq27500_props[] = { POWER_SUPPLY_PROP_STATUS, @@ -569,48 +496,8 @@ static enum power_supply_property bq27500_props[] = { POWER_SUPPLY_PROP_HEALTH, POWER_SUPPLY_PROP_MANUFACTURER, }; - -static enum power_supply_property bq27510g1_props[] = { - POWER_SUPPLY_PROP_STATUS, - POWER_SUPPLY_PROP_PRESENT, - POWER_SUPPLY_PROP_VOLTAGE_NOW, - POWER_SUPPLY_PROP_CURRENT_NOW, - POWER_SUPPLY_PROP_CAPACITY, - POWER_SUPPLY_PROP_CAPACITY_LEVEL, - POWER_SUPPLY_PROP_TEMP, - POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW, - POWER_SUPPLY_PROP_TIME_TO_FULL_NOW, - POWER_SUPPLY_PROP_TECHNOLOGY, - POWER_SUPPLY_PROP_CHARGE_FULL, - POWER_SUPPLY_PROP_CHARGE_NOW, - POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN, - POWER_SUPPLY_PROP_CYCLE_COUNT, - POWER_SUPPLY_PROP_ENERGY_NOW, - POWER_SUPPLY_PROP_POWER_AVG, - POWER_SUPPLY_PROP_HEALTH, - POWER_SUPPLY_PROP_MANUFACTURER, -}; - -static enum power_supply_property bq27510g2_props[] = { - POWER_SUPPLY_PROP_STATUS, - POWER_SUPPLY_PROP_PRESENT, - POWER_SUPPLY_PROP_VOLTAGE_NOW, - POWER_SUPPLY_PROP_CURRENT_NOW, - POWER_SUPPLY_PROP_CAPACITY, - POWER_SUPPLY_PROP_CAPACITY_LEVEL, - POWER_SUPPLY_PROP_TEMP, - POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW, - POWER_SUPPLY_PROP_TIME_TO_FULL_NOW, - POWER_SUPPLY_PROP_TECHNOLOGY, - POWER_SUPPLY_PROP_CHARGE_FULL, - POWER_SUPPLY_PROP_CHARGE_NOW, - POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN, - POWER_SUPPLY_PROP_CYCLE_COUNT, - POWER_SUPPLY_PROP_ENERGY_NOW, - POWER_SUPPLY_PROP_POWER_AVG, - POWER_SUPPLY_PROP_HEALTH, - POWER_SUPPLY_PROP_MANUFACTURER, -}; +#define bq27510g1_props bq27500_props +#define bq27510g2_props bq27500_props static enum power_supply_property bq27510g3_props[] = { POWER_SUPPLY_PROP_STATUS,