Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3853700pxv; Mon, 19 Jul 2021 10:17:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJypTWi6/prNN2kENgvkLjDBEHLSwY4sgcPL2o4wU2fP565pgunuSZRwX9xwoEhBs7PWXE+7 X-Received: by 2002:a92:dd02:: with SMTP id n2mr16803830ilm.259.1626715078434; Mon, 19 Jul 2021 10:17:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626715078; cv=none; d=google.com; s=arc-20160816; b=hAmrkWAjv2olDX1L7CIAI6vSzoYSztjxKBOnOySVqcmf4vu0mfupx2oJttejnmDdLP 0huFsPag/WgCf17zrx5DfAo7EN7CRTw0kDXxsLUxsMIgSYwObxXmbWldVcvN/iie6+Cz k+jEXD0fVaR/2wIjHvzEQ5WATD1sFBWX9hL1zfrXjpipx7s37qJcxRpi00ag8TN1mkdK NdAYjPlJUgyHLLYhGvV4ysE4RKfsPfGqtv6IN81mp4H/k1DWq5WU5waN1sJ7iatJKTyx IztKnMGl4O48WYiYpVg4ExLnFIazonkkfQpMJFugiWxdBYyZwQlrlv+ZvCs224UTe/jK pktg== 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=0/Nd7oHolCvVvnoScskkzK+8/tY8vakEBDvvRUObx/Y=; b=dHc2rt51OEVStjt6NcwF2ewAcl3ZTMNlegQwKWeZixoLQoPN9Cr5GxiR6JkXfB114f rMIB7R2A254PV1r40YraC0RLD6zaU8d2kq/rQY0+XdyIxLh+SchMRZc4if5qeGd5SSGd 8cJ41ysQmYgPFoBd21Fi7id9XNpOQeEvlstu4/PWIiLcUUUCeCMrc3tWH+orA5gTHy9w WjyMmb58kmlZcl6IeJB5ml1XtNGIXLtwAaYfIFNzEF3fHGJmYfGMGhofCvSIQZ8kVhoY Q46UnDmZocgPr9cbqGtt1WP+oZ+augo75k1AVyqSRZ63bTQxrVDhLiQA+tfreopA1ANr OpHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=S7iYaI43; 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 w132si10011625jab.61.2021.07.19.10.17.46; Mon, 19 Jul 2021 10:17:58 -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=S7iYaI43; 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 S1350005AbhGSQeA (ORCPT + 99 others); Mon, 19 Jul 2021 12:34:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:59754 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347236AbhGSPRs (ORCPT ); Mon, 19 Jul 2021 11:17:48 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 795FF613E3; Mon, 19 Jul 2021 15:58:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626710284; bh=v1Cde9pBawz3Tgf65lztJSscdZvIxb28sxAbf7ESwCA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S7iYaI43UOfGxecp9GPhSu7iEfnvZdx/mU6anKINm5JfSRY68I0z4XNFF6M/6nHwZ xH98Mu5hcASp94HvYvHWCtmv2NTlQcfrsCtTT/kWInXc3xIAM6I2QpZaIuyw/Ylrxx lS1QViKIwWom0O9uMwfuIjYvuBL8RL2Mfu63aKEQ= 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.10 153/243] power: supply: rt5033_battery: Fix device tree enumeration Date: Mon, 19 Jul 2021 16:53:02 +0200 Message-Id: <20210719144945.849034642@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210719144940.904087935@linuxfoundation.org> References: <20210719144940.904087935@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 1699b9269a78..0aa46b451017 100644 --- a/drivers/power/supply/Kconfig +++ b/drivers/power/supply/Kconfig @@ -692,7 +692,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