From patchwork Sun Feb 21 11:28:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 8369131 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4A3D59F314 for ; Sun, 21 Feb 2016 18:37:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 701D620411 for ; Sun, 21 Feb 2016 18:37:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7F84C203EC for ; Sun, 21 Feb 2016 18:37:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751105AbcBUShM (ORCPT ); Sun, 21 Feb 2016 13:37:12 -0500 Received: from mail-wm0-f44.google.com ([74.125.82.44]:38106 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750805AbcBUShK (ORCPT ); Sun, 21 Feb 2016 13:37:10 -0500 Received: by mail-wm0-f44.google.com with SMTP id a4so134784824wme.1; Sun, 21 Feb 2016 10:37:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=4/gMf7uAPF71QoUhX3GoJo5GJZ3OrMqsDxF96jik5KY=; b=rg8KpH/l0KotW3BPYiQ+jLoI1LHPylc+HWvVuq7sdTnRqWywdKyrqc0ia1xo1XbVJy V+ePIfX9JcQbQxnSGfzlwDsTO1Mmx9gM/iz/JMPqk+EAk8HX9q/g8gbRd2tnKFw5A+K+ xLVrS+fVx+Qt6sA1i8Ff06tmIjzN4Nlc9bJR74J1LnZLcNqittlnLzad96FCVeLpbIIH zcP477W8F3FRnJ7n/2xox5W22lpq4wiPacthgqZrjmV+97fdDhoHK9MQbeJ3pG0VhWMX K4APuyIuD2+7f0OsBPI99w/IgNtaQ3D0t1CL0IZDM1WrH6wd9JmP0J+qARnscaE0EJr5 5O/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=4/gMf7uAPF71QoUhX3GoJo5GJZ3OrMqsDxF96jik5KY=; b=mLSPice1XzVZXd66PwtB/MbgqyvhW4MegOA/aZmPgFER3NZKRcjRl5+UCaE6KY6MqA KO+3HUBuZxo7EoGDTEdYkiDQFheHBgAR0HEqu49H9K96xm+DC+Z4EHEJSUoJT2APcKoz eT0t3fZxcPfpt+ncTJotIJHuEAjgyOp28kwfpM7yYz7KDRq3G0SAw4pG6PYPsGc+buXW Y++cE90g0alUsRMT7T7ncSsYzbsP/jjnPvpOeNvqIizSIP1ZXKDCWUVaA8wySTb/Dij3 BwC/s0GqH7QTJMEUUcln6kLyWvJHdzhGbHp6ZlDcL1hwsb2V5niIiZPDcxGBT1Pn/Lj1 YqPA== X-Gm-Message-State: AG10YORgrqGX4qZt3gj6PeGMXDAeN3XgOR9hVom8MhOqM0433zclw4sdV1078NMrK+zT2g== X-Received: by 10.194.242.202 with SMTP id ws10mr4546278wjc.3.1456054144199; Sun, 21 Feb 2016 03:29:04 -0800 (PST) Received: from localhost.localdomain (pali.kolej.mff.cuni.cz. [78.128.193.202]) by smtp.gmail.com with ESMTPSA id jc7sm19670939wjb.33.2016.02.21.03.29.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 21 Feb 2016 03:29:03 -0800 (PST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: =?UTF-8?q?Beno=C3=AEt=20Cousson?= , Tony Lindgren , Sebastian Reichel , Dmitry Eremin-Solenikov , David Woodhouse , Pavel Machel , Aaro Koskinen , Ivaylo Dimitrov , Nishanth Menon Cc: linux-pm@vger.kernel.org, linux-omap@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Pali=20Roh=C3=A1r?= Subject: [PATCH 5/6] power_supply: bq27xxx_battery: Add of modalias and match table when CONFIG_OF is enabled Date: Sun, 21 Feb 2016 12:28:22 +0100 Message-Id: <1456054103-19551-6-git-send-email-pali.rohar@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1456054103-19551-1-git-send-email-pali.rohar@gmail.com> References: <1456054103-19551-1-git-send-email-pali.rohar@gmail.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Pali Rohár --- drivers/power/bq27xxx_battery.c | 12 ++++++++++++ drivers/power/bq27xxx_battery_i2c.c | 24 ++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/drivers/power/bq27xxx_battery.c b/drivers/power/bq27xxx_battery.c index 6b027a4..45f6ebf 100644 --- a/drivers/power/bq27xxx_battery.c +++ b/drivers/power/bq27xxx_battery.c @@ -46,6 +46,7 @@ #include #include #include +#include #include @@ -1090,16 +1091,27 @@ static const struct platform_device_id bq27xxx_battery_platform_id_table[] = { }; MODULE_DEVICE_TABLE(platform, bq27xxx_battery_platform_id_table); +#ifdef CONFIG_OF +static const struct of_device_id bq27xxx_battery_platform_of_match_table[] = { + { .compatible = "ti,bq27000" }, + {}, +}; +MODULE_DEVICE_TABLE(of, bq27xxx_battery_platform_of_match_table); +#endif + static struct platform_driver bq27xxx_battery_platform_driver = { .probe = bq27xxx_battery_platform_probe, .remove = bq27xxx_battery_platform_remove, .driver = { .name = "bq27000-battery", + .of_match_table = of_match_ptr(bq27xxx_battery_platform_of_match_table), }, .id_table = bq27xxx_battery_platform_id_table, }; module_platform_driver(bq27xxx_battery_platform_driver); +MODULE_ALIAS("platform:bq27000-battery"); + MODULE_AUTHOR("Rodolfo Giometti "); MODULE_DESCRIPTION("BQ27xxx battery monitor driver"); MODULE_LICENSE("GPL"); diff --git a/drivers/power/bq27xxx_battery_i2c.c b/drivers/power/bq27xxx_battery_i2c.c index 9429e66..b810e08 100644 --- a/drivers/power/bq27xxx_battery_i2c.c +++ b/drivers/power/bq27xxx_battery_i2c.c @@ -135,9 +135,33 @@ static const struct i2c_device_id bq27xxx_i2c_id_table[] = { }; MODULE_DEVICE_TABLE(i2c, bq27xxx_i2c_id_table); +#ifdef CONFIG_OF +static const struct of_device_id bq27xxx_battery_i2c_of_match_table[] = { + { .compatible = "ti,bq27200" }, + { .compatible = "ti,bq27210" }, + { .compatible = "ti,bq27500" }, + { .compatible = "ti,bq27510" }, + { .compatible = "ti,bq27520" }, + { .compatible = "ti,bq27530" }, + { .compatible = "ti,bq27531" }, + { .compatible = "ti,bq27541" }, + { .compatible = "ti,bq27542" }, + { .compatible = "ti,bq27546" }, + { .compatible = "ti,bq27742" }, + { .compatible = "ti,bq27545" }, + { .compatible = "ti,bq27421" }, + { .compatible = "ti,bq27425" }, + { .compatible = "ti,bq27441" }, + { .compatible = "ti,bq27621" }, + {}, +}; +MODULE_DEVICE_TABLE(of, bq27xxx_battery_i2c_of_match_table); +#endif + static struct i2c_driver bq27xxx_battery_i2c_driver = { .driver = { .name = "bq27xxx-battery", + .of_match_table = of_match_ptr(bq27xxx_battery_i2c_of_match_table), }, .probe = bq27xxx_battery_i2c_probe, .remove = bq27xxx_battery_i2c_remove,