Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6993423ybi; Wed, 5 Jun 2019 09:28:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqzSF7NtVpJkJvHyh/PV7UiH4pgOkkb/Z86VPvqVsxNWxtbTTPiXOAlFbaYs/ZRz4zhxJp8E X-Received: by 2002:a62:b40a:: with SMTP id h10mr47912466pfn.216.1559752096432; Wed, 05 Jun 2019 09:28:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559752096; cv=none; d=google.com; s=arc-20160816; b=THFPMELY7tQxH0LzQKNJw/LGlwDWffqcDMkWATd1lOx0Q4G4LDext8I2QsQ1jdfmkO DvZxBCKt0e5+WykT62o6XIQDBBBSSLNIzb5TIAoTOgKu9TgXIC9aiuVkgxrYvpkmOvni GSsnEawWl8UlWQ+nkC5JYE7YUjLYnWzIG2Lli9nArnqzPQaxHC3ccm8tyAsSHmThIxVx vQN3F2fvVfr3BDoA0wYeJnqO/ghBTYSfcg8UITR6VvqgrE1IJBjtQfKSgNcdeoDmwH8F C+fWboGSxlSacflBWKL1Ino+qm8b05AIMoHej73Zx9ryk21h730Lr2vkoAJ0h0iLjtu8 upeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=EMqHxFFz2e3EAXX4FcyZTIL/l3V900zRWLYvMEpJ64w=; b=asnxVq98H8HWZ6WqF3MNlLbklunY/q9ibyqoOy80RPDWx6oDG6C5LaIfIXBSIiMIi2 YXWLw0rOVijn4DMa09SDFWk5SQkQfTHV3uo5w24cbp3UNM1vfWEdbyXLlsIwoxcZrgti Crgyf65Au1stgo8H9Xm/3CvxjToojCUEk9r1mVhFi4Co32Kb+2rb6Fnt9WHEbALqQDWf vWbccRwZRyUOBmnQuUhn87KgB06wohkttszMRpToaA9up4pySCTF6R0TvVsm6NjsPpZy ENQpycUWsfp4c/DoO3gYj7Rm/2ORl4cByKcJSQtLNShhuWM7Y63gScjedoofe3Gc1P14 zitA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=F8yhHcp0; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c11si9038947pjs.44.2019.06.05.09.27.58; Wed, 05 Jun 2019 09:28:16 -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=@ti.com header.s=ti-com-17Q1 header.b=F8yhHcp0; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728732AbfFEQ0i (ORCPT + 99 others); Wed, 5 Jun 2019 12:26:38 -0400 Received: from lelv0143.ext.ti.com ([198.47.23.248]:43488 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728595AbfFEQ0g (ORCPT ); Wed, 5 Jun 2019 12:26:36 -0400 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x55GQ3FR089735; Wed, 5 Jun 2019 11:26:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1559751963; bh=EMqHxFFz2e3EAXX4FcyZTIL/l3V900zRWLYvMEpJ64w=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=F8yhHcp0oL89eOxepuEfzj7a55hSXsRPHIpMlTCG4AI4XqxC1tOZ/T9JmmWdtV6ez FEUnTxsEb9QFC2g9eQPbNg4AaPNz9F/D1NVYkVarhLMxTDzIfHCZOyoDswsCTBjxcl dKkuz8ITQ1qdOr8IINCZ87Sw5s/LcDJqJ1q1UJdI= Received: from DLEE103.ent.ti.com (dlee103.ent.ti.com [157.170.170.33]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x55GQ3n1070809 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 5 Jun 2019 11:26:03 -0500 Received: from DLEE105.ent.ti.com (157.170.170.35) by DLEE103.ent.ti.com (157.170.170.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Wed, 5 Jun 2019 11:26:03 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE105.ent.ti.com (157.170.170.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Wed, 5 Jun 2019 11:26:02 -0500 Received: from [10.250.67.116] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id x55GQ2Xx012525; Wed, 5 Jun 2019 11:26:02 -0500 Subject: Re: [PATCH v3 2/2] power: supply: ucs1002: Add HWMON interface To: Andrey Smirnov , CC: Guenter Roeck , Chris Healy , Cory Tusar , Lucas Stach , Fabio Estevam , Sebastian Reichel , References: <20190605072323.21990-1-andrew.smirnov@gmail.com> <20190605072323.21990-3-andrew.smirnov@gmail.com> From: "Andrew F. Davis" Message-ID: Date: Wed, 5 Jun 2019 12:26:02 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20190605072323.21990-3-andrew.smirnov@gmail.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? Andrew > + if (ret) { > + dev_err(dev, "Failed to add hmwon attributes: %d\n", ret); > + return ret; > + } > + > ret = regmap_read(info->regmap, UCS1002_REG_PIN_STATUS, ®val); > if (ret) { > dev_err(dev, "Failed to read pin status: %d\n", ret); >