Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3890018pxv; Mon, 19 Jul 2021 11:13:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzX55z4L+2oEyWmrkSCvyvMMABkV7iIl7gtzn8xCkXon2q4kUUvea7J7m3p91lRPRJVHgJ2 X-Received: by 2002:a05:6602:164f:: with SMTP id y15mr6870385iow.200.1626718280693; Mon, 19 Jul 2021 11:11:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626718280; cv=none; d=google.com; s=arc-20160816; b=B8z9y+lUBYLeWCBD8e1ZWbs44k0vMBujfuk6O4UgWtp0QR5xPtCWHt1Y7T+4WWklSm WjN27wT6Hq8Lr4OumQYB/H5yAC7x6IQHepEoJtWkgp6w3Jyg+bd/pjYtw+nmcylJOooq EQyZWyUv5Od7wqXC94M+dLD4oUFppTwmikVrX4R7vpz+S8zVrY99J3q4/eycLZ/OVjzA QkZwE6V3C4o4Y0fiaWnPRcGlDNUYlhMnDaSUGXtctlIosh3p4SNAHe8Z+0FYq+bKI1lK 8NkAK40IdxBIpiHL5VdjP0Ai0KMLLzYotkOWmvky9T3Ame3B9SuSgbQrKU7Yw+OsheFW xt3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ezYDRGpfcCuximQJ0a1tBZZkYpUo2Yx9EUoVmBadTDA=; b=ZVesMevmHyKHf8eLdBzgm4JDBxBfyr38E7Olz4mvW4rHqlnZJe4zqJnK8zz84CYb6+ UunhqoR76WjfRL3rSVy1Y+eQWsMOPI7NScI6/1jvsWx2gwcBmTW6UP5w8ew1byHMz1W2 NBNWALbxjas5ieEX/9j0KEmIt7qf6nZpktUleAU/c2wbV1A6XqO0XQ1Ix74ENsooEP7L HAp+edvw7mpdsN4+UTpUAVImS4hsstPOSpuGGUzG7bZIeIu4kYK4DOSTaYuB6fIzczv9 lBDgPTXhjjr/noReRAZi614XLLFKeBRoXEWebHxIDXEna2eiBxLmXwukvnlLCnbrTqKW 0uEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mEIPCZCC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q4si19976467ils.118.2021.07.19.11.11.09; Mon, 19 Jul 2021 11:11:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mEIPCZCC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1380111AbhGSR1i (ORCPT + 99 others); Mon, 19 Jul 2021 13:27:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:42648 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349543AbhGSPpK (ORCPT ); Mon, 19 Jul 2021 11:45:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 78F5D61248; Mon, 19 Jul 2021 16:25:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626711923; bh=eTWbT2G9JV6gYb40IR5MUNDHMriNA7xMN65CQDbw0Vw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mEIPCZCC8wEt/b0yjMUqHWtSq4u0TItimPznHfMfNvLYPXOWq55ay1tAIaQhXhioz jy74BnUjZ+YAaXb9Op57TALL02V3j1X+0sY47BkP8H3zf++rDDgM79yd0Yy8PB3gaq mqY5Z9PhV8K1vtttUlLP+AVGXUj/aMzYE22ybu6Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Beomho Seo , Chanwoo Choi , Stephan Gerhold , Sebastian Reichel , Sasha Levin Subject: [PATCH 5.12 181/292] power: supply: rt5033_battery: Fix device tree enumeration Date: Mon, 19 Jul 2021 16:54:03 +0200 Message-Id: <20210719144948.445183258@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210719144942.514164272@linuxfoundation.org> References: <20210719144942.514164272@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Stephan Gerhold [ Upstream commit f3076cd8d1d5fa64b5e1fa5affc045c2fc123baa ] The fuel gauge in the RT5033 PMIC has its own I2C bus and interrupt line. Therefore, it is not actually part of the RT5033 MFD and needs its own of_match_table to probe properly. Also, given that it's independent of the MFD, there is actually no need to make the Kconfig depend on MFD_RT5033. Although the driver uses the shared header, there is no compile or runtime dependency on the RT5033 MFD driver. Cc: Beomho Seo Cc: Chanwoo Choi Fixes: b847dd96e659 ("power: rt5033_battery: Add RT5033 Fuel gauge device driver") Signed-off-by: Stephan Gerhold Signed-off-by: Sebastian Reichel Signed-off-by: Sasha Levin --- drivers/power/supply/Kconfig | 3 ++- drivers/power/supply/rt5033_battery.c | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/power/supply/Kconfig b/drivers/power/supply/Kconfig index 006b95eca673..5207beea9d23 100644 --- a/drivers/power/supply/Kconfig +++ b/drivers/power/supply/Kconfig @@ -712,7 +712,8 @@ config BATTERY_GOLDFISH config BATTERY_RT5033 tristate "RT5033 fuel gauge support" - depends on MFD_RT5033 + depends on I2C + select REGMAP_I2C help This adds support for battery fuel gauge in Richtek RT5033 PMIC. The fuelgauge calculates and determines the battery state of charge diff --git a/drivers/power/supply/rt5033_battery.c b/drivers/power/supply/rt5033_battery.c index f330452341f0..9ad0afe83d1b 100644 --- a/drivers/power/supply/rt5033_battery.c +++ b/drivers/power/supply/rt5033_battery.c @@ -164,9 +164,16 @@ static const struct i2c_device_id rt5033_battery_id[] = { }; MODULE_DEVICE_TABLE(i2c, rt5033_battery_id); +static const struct of_device_id rt5033_battery_of_match[] = { + { .compatible = "richtek,rt5033-battery", }, + { } +}; +MODULE_DEVICE_TABLE(of, rt5033_battery_of_match); + static struct i2c_driver rt5033_battery_driver = { .driver = { .name = "rt5033-battery", + .of_match_table = rt5033_battery_of_match, }, .probe = rt5033_battery_probe, .remove = rt5033_battery_remove, -- 2.30.2