From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755315AbbG0AeX (ORCPT ); Sun, 26 Jul 2015 20:34:23 -0400 Received: from mailout4.w1.samsung.com ([210.118.77.14]:24958 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755232AbbG0AeV (ORCPT ); Sun, 26 Jul 2015 20:34:21 -0400 X-AuditID: cbfec7f5-f794b6d000001495-19-55b57c8a1277 Message-id: <55B57C85.4070309@samsung.com> Date: Mon, 27 Jul 2015 09:34:13 +0900 From: Krzysztof Kozlowski User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-version: 1.0 To: "Pallala, Ramakrishna" , Sebastian Reichel Cc: "linux-kernel@vger.kernel.org" , "linux-pm@vger.kernel.org" , MyungJoo Ham Subject: Re: [PATCH v2] power: max17042_battery: add HEALTH and TEMP_* properties support References: <1432438918-31002-1-git-send-email-ramakrishna.pallala@intel.com> <20150724144651.GE27569@earth> In-reply-to: Content-type: text/plain; charset=windows-1252 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrPLMWRmVeSWpSXmKPExsVy+t/xq7pdNVtDDS68UrR4/cLQ4vKuOWwW n3uPMFrcblzBZrHwzU0mi9O7SxzYPBbvecnksWlVJ5tH35ZVjB6fN8kFsERx2aSk5mSWpRbp 2yVwZSz4cp6p4IlAxePft5gbGN/wdjFycEgImEi87ozoYuQEMsUkLtxbz9bFyMUhJLCUUeJu zxEo5wujxLb//5lAqngFtCR6f31hAbFZBFQl/r5czw5iswkYS2xevoQNxBYViJBYvvokI0S9 oMSPyffA6kUEEiR2TWsFG8oMsuHP2W6wBmGBaInJT0+xQGw7xiTx/GsLWIJTIEzi/e9VrCCn MgvoSdy/qAUSZhaQl9i85i3zBEaBWUh2zEKomoWkagEj8ypG0dTS5ILipPRcI73ixNzi0rx0 veT83E2MkGD+uoNx6TGrQ4wCHIxKPLwXVLaGCrEmlhVX5h5ilOBgVhLhfRwFFOJNSaysSi3K jy8qzUktPsQozcGiJM47c9f7ECGB9MSS1OzU1ILUIpgsEwenVAMjV0zn1G0hvUJzBF9cfrpo auTX04bXOJJLohbrOZezsFs9kEm4qhapc9TlyX2VrWmLthfP91O9vSx9XYz14/3/u/QNv1i8 1PyrxKR/4L2Vhd5K6U8tVXMq0m3E1tSHmC1MSXr6nW3pw2ON/lPTWFe27e/Qryg1u/z525Mb 9xYeqWuwVM254j1ViaU4I9FQi7moOBEAod7HZmICAAA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 25.07.2015 22:23, Pallala, Ramakrishna wrote: > Hi Krzysztof Kozlowski, > >> On Tue, Jun 23, 2015 at 09:58:41AM +0900, Krzysztof Kozlowski wrote: >>> 2015-06-08 10:22 GMT+09:00 Krzysztof Kozlowski : >>>> 2015-05-24 12:41 GMT+09:00 Ramakrishna Pallala : >>>>> This patch adds the support for following battery properties to >>>> max17042 fuel gauge driver. >>>>> >>>>> POWER_SUPPLY_PROP_TEMP_ALERT_MIN >>>> POWER_SUPPLY_PROP_TEMP_ALERT_MAX >>>>> POWER_SUPPLY_PROP_TEMP_MIN >>>>> POWER_SUPPLY_PROP_TEMP_MAX >>>>> POWER_SUPPLY_PROP_HEALTH >>>> >>>> I wonder, have you tested the patch? After booting on Trats2 device >>>> (max77693 which identifies itself as 17047-like) the values are: >>>> POWER_SUPPLY_TEMP_ALERT_MIN=1280 >>>> POWER_SUPPLY_TEMP_ALERT_MAX=1270 >>>> POWER_SUPPLY_TEMP=257 >>>> This is okay, datasheet says that register after booting will have >>>> value of 0x7f80. >>>> >>>> However setting them to some value which should trigger interrupts >>>> (like 300 for MIN or 200 for MAX) does not trigger the interrupt. I >>>> added a printk in max17042_thread_handler(). >>>> >>>> Is the temperature alert feature working? >>> >>> Can you reply to my question above? >>> If this feature is not working, then it should be removed. > >> What's the status of this? I cannot test the feature, since I don't have the hardware. I agree, that this should be removed, if it's not working. > > I missed this email (may be overlooked it). To have the interrupts enabled we need the config registers(0x1Dh) bit's BIT(9), BIT(4) and BIT92) should be 1 and BIT(8) should be 0. > > Can you dump the status(00h), Talrt(02H) Temp(08h) and config(1Dh) registers values and share? Thanks for responding. The issue was in BIT(8) which was set to default value of 0x1. This would mean to use external sensor but the board does not have it. This is a DT platform and there is no initial config data so all registers are set to default values. Anyway everything seems to work as expected, thanks for explanation. Best regards, Krzysztof