From patchwork Thu Nov 1 00:11:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Masney X-Patchwork-Id: 10663409 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 47F7017DB for ; Thu, 1 Nov 2018 00:12:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 35F372BB21 for ; Thu, 1 Nov 2018 00:12:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 291092BB84; Thu, 1 Nov 2018 00:12:57 +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=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable 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 D33F92BB21 for ; Thu, 1 Nov 2018 00:12:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727616AbeKAJNU (ORCPT ); Thu, 1 Nov 2018 05:13:20 -0400 Received: from onstation.org ([52.200.56.107]:44736 "EHLO onstation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725823AbeKAJMl (ORCPT ); Thu, 1 Nov 2018 05:12:41 -0400 Received: from localhost.localdomain (c-98-239-145-235.hsd1.wv.comcast.net [98.239.145.235]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: masneyb) by onstation.org (Postfix) with ESMTPSA id 802CAB0C; Thu, 1 Nov 2018 00:12:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=onstation.org; s=default; t=1541031131; bh=iezGjImedq/LkxrzjpD62LOtq1MXGldLnWtale4QFC8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NipsQLyXdupZtXv21zSjgnBJGQO2a8x7yt+mm9dFaDTPJwk4aJhZ0Anvm/Btd/mS+ KjdgRR/hJEhgDKixHY7akj+/feQXhtwmREvvfy2R3ZF1g/2Ev5ejeAuwCx3PRmdB+U 01DhWGdu5R/ieQcy5wBOl5b8N1TGNlvR3vL+RpQ0= From: Brian Masney To: sre@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com, andy.gross@linaro.org, david.brown@linaro.org, bjorn.andersson@linaro.org, linus.walleij@linaro.org Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, linux-gpio@vger.kernel.org, jonathan@marek.ca, masneyb@onstation.org Subject: [PATCH v2 2/7] power: supply: bq24190_charger: add support for bq24192 variant Date: Wed, 31 Oct 2018 20:11:44 -0400 Message-Id: <20181101001149.13453-3-masneyb@onstation.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181101001149.13453-1-masneyb@onstation.org> References: <20181101001149.13453-1-masneyb@onstation.org> 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: Jonathan Marek This patch adds support for the bq24192 variant to bq24190_charger. Signed-off-by: Jonathan Marek [masneyb@onstation.org: Changed if statement to a switch based on feedback from Sebastian Reichel.] Signed-off-by: Brian Masney --- drivers/power/supply/bq24190_charger.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/power/supply/bq24190_charger.c b/drivers/power/supply/bq24190_charger.c index b58df04d03b3..44d3aff32885 100644 --- a/drivers/power/supply/bq24190_charger.c +++ b/drivers/power/supply/bq24190_charger.c @@ -1637,8 +1637,12 @@ static int bq24190_hw_init(struct bq24190_dev_info *bdi) if (ret < 0) return ret; - if (v != BQ24190_REG_VPRS_PN_24190 && - v != BQ24190_REG_VPRS_PN_24192I) { + switch (v) { + case BQ24190_REG_VPRS_PN_24190: + case BQ24190_REG_VPRS_PN_24192: + case BQ24190_REG_VPRS_PN_24192I: + break; + default: dev_err(bdi->dev, "Error unknown model: 0x%02x\n", v); return -ENODEV; } @@ -1931,6 +1935,7 @@ static const struct dev_pm_ops bq24190_pm_ops = { static const struct i2c_device_id bq24190_i2c_ids[] = { { "bq24190" }, + { "bq24192" }, { "bq24192i" }, { }, }; @@ -1939,6 +1944,7 @@ MODULE_DEVICE_TABLE(i2c, bq24190_i2c_ids); #ifdef CONFIG_OF static const struct of_device_id bq24190_of_match[] = { { .compatible = "ti,bq24190", }, + { .compatible = "ti,bq24192", }, { .compatible = "ti,bq24192i", }, { }, };