Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp301474ybf; Thu, 27 Feb 2020 21:39:04 -0800 (PST) X-Google-Smtp-Source: APXvYqzgevP7O8YzMhawfIzlrx+R9CAX6IclFIIXDritO0eH2uGpx5BhRUxjEU8ucsyuKqbv8XRL X-Received: by 2002:a05:6830:155a:: with SMTP id l26mr1965421otp.339.1582868344802; Thu, 27 Feb 2020 21:39:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582868344; cv=none; d=google.com; s=arc-20160816; b=Amy4aa0RL6kTAHWuDunSTLYnKlcYyEZkDCIpvGT3XZ8+ur6Txc4Ko84hMaNXcMwJ7V 8rp8ska6z+U7FSWg2Hx6RH+Tke/ABmFSAOGy2KShRsZMAVLQyKLeacmBTOO1bZ1VVX8h REFY6oSAzwLnGLvkq8hk20WvAd/zL/mk597cbgk2wqEF6UZjav+lKCjeFrNYdsdDUHs7 zwWsRoOE2/LnzWh/M7ijv7XUTrG/DyxWrc3+Q2uhJO+1hxUY/tj/8B7dKqPK2yWosWwl 9xOxdvW4JlHVwARTXm+kYDALTvR26a0XK3w8RmKPxmnYailbEAVNH8/AzGr6jcdxqFCE Xg7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=76wpTcV+LXA0Dyl54UG5BsW53npVN0WBYlbvd10TsrE=; b=RoCGq7OGR3c1RyBWkgPCYM6E2HkLaUFV+ngZBYij23rJgQDwR0lPq1pXMGArwQPbwB 6x34RIp018cmkoXr6FXmC1m3UEzeXdPV/ueJLsuzzBuehhCDQ+1CAkQ6q6BC01QfMo9j NmWg+299EWQ05QxD3yc1YGD6WtJIU8GUazFifAo7t1y1IuU7ogOo2MAW+mCyzeEEQw8d eBQTIyhdoA82HMTjoYZrBjC+5ChMn7reqtKxx0HW47/Mz7Xq/D024uDGzPuz/vKLfk8e w1lcJ3fv9jAjdZ+X2fLTTb8bBryOzUT8ljt2JmBoH+wbLIenBDkXpwXs+trbp86xmj+O /akQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=m56oWDYK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 194si1115476oii.2.2020.02.27.21.38.52; Thu, 27 Feb 2020 21:39:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=m56oWDYK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725943AbgB1Fhr (ORCPT + 99 others); Fri, 28 Feb 2020 00:37:47 -0500 Received: from mail-qt1-f196.google.com ([209.85.160.196]:34014 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725805AbgB1Fhr (ORCPT ); Fri, 28 Feb 2020 00:37:47 -0500 Received: by mail-qt1-f196.google.com with SMTP id l16so1240025qtq.1; Thu, 27 Feb 2020 21:37:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=76wpTcV+LXA0Dyl54UG5BsW53npVN0WBYlbvd10TsrE=; b=m56oWDYKo8U2gzUmdVaIuVwDYDH1S0NbqGtJxGC0Xrn3fn8ho6S2oL8qWWNALQetIM uqyo2M47TbrDiO+VFYm0ulOAWEtDn6vNNAQ/dHu/Pw9kmLOaLNwn5cG7/3/MtIbEWSpW fVOCJOfwASE1gDGQiNLoalDMAbVrBVP43vXFDA5HYIAGLGu8nOFC7hYBOFRBpFTrYxNI ASliIuBzEzmhrIlS2na9tmr3QySr4JHhi8FXJ0AZqXNaVvcV2pYGSOmL7FiUo4juyd7S Xy618Hsae7VRaQM6S7ic4uZ2OR6/GK64ON0zaxKjREicZeUC4vC798EXPyHMcLVnbmJJ KqQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=76wpTcV+LXA0Dyl54UG5BsW53npVN0WBYlbvd10TsrE=; b=tiSSsifFNhCPKQ+4K3u9cz9sD8b04Mw2dQVnmrtEUzOMvy+eSoXM8o/JMF6T8F+T6Y ZajEY2/wrtlqgOQpmyBdpHoNs+xr0OruB7Cj3EsUiYlQsKpdTUbysBqs0NmaFtAJJI3V +66uXbXjguUy/cXZGxzRg8ZplT7oare7oeDfYnt4/t7N3wQ7IeTqLCtGj+46279a6e+/ IUrqhLw6ShrJyEBg+XQClNr8CJKh2IkRXIvkto97bDVFfBtaZYBEoeD9O/I7q5P1d2S5 ZAkJYsSqKdznKFe1PvI1Qo9dT+OFkJV1xmsUGy9ChhbZgOR5YKYbqKXkpTAcI23fHzFV Qacw== X-Gm-Message-State: APjAAAW0WeMELilQxt5sUDtOQVHlbhK0+dOkcxwyGoq12kJYMiJLdC9X YXmbYUpr2XPzcRCD8YbWFIwlJc3iWWuGJYQLYFQ= X-Received: by 2002:aed:2202:: with SMTP id n2mr3003286qtc.4.1582868266510; Thu, 27 Feb 2020 21:37:46 -0800 (PST) MIME-Version: 1.0 References: <2d0854b00d7f85e988aff4f8186e8ac5d8a9aff2.1581410798.git.baolin.wang7@gmail.com> In-Reply-To: From: Baolin Wang Date: Fri, 28 Feb 2020 13:37:34 +0800 Message-ID: Subject: Re: [PATCH] power: supply: Allow charger manager can be built as a module To: Saravana Kannan Cc: Orson Zhai , sre@kernel.org, Linux PM , LKML , Lyra Zhang , Android Kernel Team Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 28, 2020 at 10:54 AM Saravana Kannan wrote: > > On Thu, Feb 27, 2020 at 8:06 AM Orson Zhai wrote: > > > > Hi Sebastian and other guys here, > > > > On Tue, Feb 11, 2020 at 4:51 PM Baolin Wang wrote: > > > > > > Allow charger manager can be built as a module like other charger > > > drivers. > > > > > What do you think about this patch? > > We want to set charger-manager as module in our project for new Android devices. > > > > -Orson > > > > > Signed-off-by: Baolin Wang > > > --- > > > drivers/power/supply/Kconfig | 2 +- > > > include/linux/power/charger-manager.h | 7 +------ > > > 2 files changed, 2 insertions(+), 7 deletions(-) > > > > > > diff --git a/drivers/power/supply/Kconfig b/drivers/power/supply/Kconfig > > > index 9a5591a..195bc04 100644 > > > --- a/drivers/power/supply/Kconfig > > > +++ b/drivers/power/supply/Kconfig > > > @@ -480,7 +480,7 @@ config CHARGER_GPIO > > > called gpio-charger. > > > > > > config CHARGER_MANAGER > > > - bool "Battery charger manager for multiple chargers" > > > + tristate "Battery charger manager for multiple chargers" > > > depends on REGULATOR > > > select EXTCON > > > help > > > diff --git a/include/linux/power/charger-manager.h b/include/linux/power/charger-manager.h > > > index ad19e68..40493b2 100644 > > > --- a/include/linux/power/charger-manager.h > > > +++ b/include/linux/power/charger-manager.h > > > @@ -248,11 +248,6 @@ struct charger_manager { > > > u64 charging_end_time; > > > }; > > > > > > -#ifdef CONFIG_CHARGER_MANAGER > > > extern void cm_notify_event(struct power_supply *psy, > > > - enum cm_event_types type, char *msg); > > > -#else > > > -static inline void cm_notify_event(struct power_supply *psy, > > > - enum cm_event_types type, char *msg) { } > > > -#endif > > > + enum cm_event_types type, char *msg); > > > #endif /* _CHARGER_MANAGER_H */ > > You are breaking the kernel if CONFIG_CHARGER_MANAGER is disabled. Why No, now no users in mainline have called cm_notify_event() function, and if some charger drivers want to use the charger manager, they should select CHARGER_MANAGER, like: config CHARGER_SC2731 tristate "Spreadtrum SC2731 charger driver" depends on MFD_SC27XX_PMIC || COMPILE_TEST select CHARGER_MANAGER > not simple change the #ifdef to > #if IS_ENABLED(CONFIG_CHARGER_MANAGER) > ? Yes, this also can work, and either way is okay for me. Sebastian, what do you prefer? Thanks.