Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5336231ybi; Wed, 12 Jun 2019 00:27:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqzcsgzwSodBUBWpRq+q+zhqYfpSOEh8R9W//IRGq6tXHjb41HWFzj6SxsFXRaU7Dmx83ext X-Received: by 2002:a63:5f0d:: with SMTP id t13mr17575712pgb.358.1560324449841; Wed, 12 Jun 2019 00:27:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560324449; cv=none; d=google.com; s=arc-20160816; b=lFflFFGmehadh2EgFsRzOMkCQt75jPML+VCBc0xON5OVXtRQZeaF35h6iNDvwifkFj ytN9OhLak2BLDZy1KiTZ4Apcq/B3BQYj35NAMz0etmWD/44It3CoReQv9pNoebZPV6/k yyXYHloEBYkp9+ELyV0SWaBThmI3MQLVN+lckVFg+aTw9Ku8nnoyGHSr9chmmDqboxfh DScV7I7ODRoAIl/Xq4Sy88iXll+YXrygWzQVRTBT0AMhkr976ymCyAd0wGOR6Gj07gxR VfKLL2tPmxegcZ4eXvweoaPp++834rr8bplluIogf/JIHQTX2WtSQ6wxQ1EvmuBg6Iop qsBg== 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=KQq32cKsqkY3NhJq+BP0fPox4yAfuAv9Yt0Vd+TjtfI=; b=gQlq1dHQLe7FcvhOars0hjJDjw+Ae1m8xpe2cvjFY2LTBkKYPKyR46P3X2lGLYwW0A 9F4iIIUXG/Xfc6G3LvnFH61XB7tMww+2IRkUh1RsH8DBvxx6yzed4xMqRCk1pJjzGfSe 9B7S05InusipEpX3E1l3PmX3aJfrfRGJn8qsxohspJateSIUc5Cf1zkQ2T8mV8V4rB7C jm6k8MyVmbcegvKtX82QCa0/66ayyB5LoLBk2ovPNnT+7cUT2yKSS6z8OKX5k2/cSyXU 41CB3x0/CuQP8pSsb0JuTJhPGiSiKT1JbSY34/vjWUJaiR7RqaIxHloAHu2ghOi21kBc aWyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="tub0/eAy"; 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 f12si14319125pgs.37.2019.06.12.00.27.09; Wed, 12 Jun 2019 00:27:29 -0700 (PDT) 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="tub0/eAy"; 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 S2406504AbfFLCCU (ORCPT + 99 others); Tue, 11 Jun 2019 22:02:20 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:38034 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404880AbfFLCCU (ORCPT ); Tue, 11 Jun 2019 22:02:20 -0400 Received: by mail-io1-f67.google.com with SMTP id k13so11632601iop.5; Tue, 11 Jun 2019 19:02:20 -0700 (PDT) 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=KQq32cKsqkY3NhJq+BP0fPox4yAfuAv9Yt0Vd+TjtfI=; b=tub0/eAyDdq+sRrwDwUrU99nQ79e61+rN5hQoUhUhValhU2tmBJCOnvKq3fAolklIc emcxzOyraQ+OxeLfwG0bClVZRw87xiBpNoIWAhUglhWghg/R8abLDJ3UnQ3ZdzFTQ/NB JwERulhBzXtiBAcs42auD6oLqdlrc4xanWiuudqm22XEglv/OUwPOt5eTe0f/O14gQgE 8lg3NzHzFOwSdZtyjWHHzwDydciIiq9213CO448ZyjnXZzdveD3EgvLZLD4Eq1CXwRlz ljr8oxeGFt0muOa3z5/kAwPs5WYypsMYqcua3zhQZ4d9NErltJ+wGAnTVxDvg4tfzW3L bUAQ== 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=KQq32cKsqkY3NhJq+BP0fPox4yAfuAv9Yt0Vd+TjtfI=; b=OKmLkagcas3ch1swWc1ruuXLMeL/D/jkXcIPbHNhPSs/AB31oR9uY9GmI4eb4iq2vX KJCGDiQ38DrhuAFpZ3HGL2GAMjt1mxaqrBem16aen06JwiXLv9f/3TLV84imw0MaHaAW N0frrExPBvJvV6ZAJe8kqHI3bZTof7GyXT6pTCtO274ExffjR9PVjdd9egdDMauXbbV2 foPFi9vKIRQxBDiCRg4Na1xmhIA2kzihBh3DxvW6577YcSPAtSgNha6wL0EqDD+I0FnX ZWKVB/5gX7rU58UkgFntQ/dvKoEFcZ8YsekIn7Ff6YImbLW9/17NmlkbjFDAJtFjKqm3 jptw== X-Gm-Message-State: APjAAAWGzxINDYCptf17jy4kSsnmjIy5ORk5iZgv3L4HFoHajzNZbV8p G/0mk+4piySZDB4foV4z0ndpu0w1aoB1tIlBbQI= X-Received: by 2002:a6b:f607:: with SMTP id n7mr16284029ioh.263.1560304939465; Tue, 11 Jun 2019 19:02:19 -0700 (PDT) MIME-Version: 1.0 References: <20190605072323.21990-1-andrew.smirnov@gmail.com> <20190605072323.21990-3-andrew.smirnov@gmail.com> <20190605183945.GA2442@roeck-us.net> <20190611194651.rmyo4jhdy7xgrgpu@earth.universe> In-Reply-To: <20190611194651.rmyo4jhdy7xgrgpu@earth.universe> From: Andrey Smirnov Date: Tue, 11 Jun 2019 19:02:08 -0700 Message-ID: Subject: Re: [PATCH v3 2/2] power: supply: ucs1002: Add HWMON interface To: Sebastian Reichel Cc: Guenter Roeck , "Andrew F. Davis" , Linux PM list , Chris Healy , Cory Tusar , Lucas Stach , Fabio Estevam , linux-kernel 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 Tue, Jun 11, 2019 at 12:46 PM Sebastian Reichel wrote: > > Hi, > > On Wed, Jun 05, 2019 at 11:39:45AM -0700, Guenter Roeck wrote: > > On Wed, Jun 05, 2019 at 10:47:25AM -0700, Andrey Smirnov wrote: > > > On Wed, Jun 5, 2019 at 9:26 AM Andrew F. Davis wrote: > > > > > > > > On 6/5/19 3:23 AM, Andrey Smirnov wrote: > > > > > Expose current sensors found on UCS1002 via HWMON. > > > > > > > > > > Signed-off-by: Andrey Smirnov > > > > > Reviewed-by: Guenter Roeck > > > > > Cc: Chris Healy > > > > > Cc: Cory Tusar > > > > > Cc: Lucas Stach > > > > > Cc: Fabio Estevam > > > > > Cc: Guenter Roeck > > > > > Cc: Sebastian Reichel > > > > > Cc: linux-kernel@vger.kernel.org > > > > > Cc: linux-pm@vger.kernel.org > > > > > --- > > > > > drivers/power/supply/ucs1002_power.c | 6 ++++++ > > > > > 1 file changed, 6 insertions(+) > > > > > > > > > > diff --git a/drivers/power/supply/ucs1002_power.c b/drivers/power/supply/ucs1002_power.c > > > > > index 677f20a4d76f..a4b6b37549cf 100644 > > > > > --- a/drivers/power/supply/ucs1002_power.c > > > > > +++ b/drivers/power/supply/ucs1002_power.c > > > > > @@ -571,6 +571,12 @@ static int ucs1002_probe(struct i2c_client *client, > > > > > return ret; > > > > > } > > > > > > > > > > + ret = devm_power_supply_add_hwmon_sysfs(info->charger); > > > > > > > > Could this be added to the core power supply framework on registering so > > > > all devices get this, vs each driver having to add this line? > > > > > > > > > > I'd say it is up to Sebastian to decide if this should be opt-out > > > rather than opt-in. I have no objections to either approach. > > > > > > > Same here, and agreed. > > I think this should be registered in power_supply_register() and > free'd in power_supply_unregister(). It's not device specific at > all and the functionality can be configured via Kconfig. > Sure, will do in v4. Thanks, Andrey Smirnov