From: Chanwoo Choi <cw00.choi-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
To: Pavel Machek <pavel-+ZI9xUNit7I@public.gmane.org>
Cc: anton-9xeibp6oKSgdnm+yROfE0A@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org,
grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org,
myungjoo.ham-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org,
kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org
Subject: Re: [PATCH 2/4] charger-manager: Use IIO subsystem to read battery temperature instead of legacy method
Date: Mon, 28 Oct 2013 08:51:12 +0900 [thread overview]
Message-ID: <526DA6F0.6060005@samsung.com> (raw)
In-Reply-To: <20131027111739.GC2437-5NIqAleC692hcjWhqY66xCZi+YwRKgec@public.gmane.org>
Hi Pavel,
On 10/27/2013 08:17 PM, Pavel Machek wrote:
> Hi!
>
>> diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig
>> index e6f92b4..6700191 100644
>> --- a/drivers/power/Kconfig
>> +++ b/drivers/power/Kconfig
>> @@ -309,6 +309,7 @@ config CHARGER_MANAGER
>> bool "Battery charger manager for multiple chargers"
>> depends on REGULATOR && RTC_CLASS
>> select EXTCON
>> + select IIO
>> help
>> Say Y to enable charger-manager support, which allows multiple
>> chargers attached to a battery and multiple batteries attached to a
>
> Umm. Are there charger-manager users that don't have temperature sensor on IIO?
I'll remove tightly coupled dependency between IIO and Charger-manager.
>
>> + if (desc->channel) {
>> + temp = iio_read_channel_raw(desc->channel, last_temp_mC);
>> +
>> + /*
>> + * The charger-manager use IIO subsystem to read ADC raw data
>> + * from IIO ADC device drvier. The each device driver has
>> + * own non-standard ADC table. If user of charger-manager
>> + * would like to get correct temperature value, have to convert
>> + * 'last_temp_mC' variable according to proper calculation
>> + * method and own ADC table.
>> + */
>> +
>> + if (*last_temp_mC >= desc->iio_adc_overheat)
>> + temp = CM_TEMP_NORMAL; /* Overheat */
>> + else if (*last_temp_mC <= desc->iio_adc_cold)
>> + temp = CM_TEMP_COLD; /* Cold */
>> + else
>> + temp = CM_TEMP_NORMAL; /* Normal */
>
> Something is definitely wrong here.
I'll fix it as below:
temp = CM_TEMP_NORMAL; /* Overheat */
-> temp = CM_TEMP_OVERHEAT; /* Overheat */
Also, as you mentioned, this patch haven't included the converting sequence
from ADC value to correct temperature because currently iio driver haven't
support this feature. So, I'm going to discuss this issue on following mailing thread:
- https://lkml.org/lkml/2013/10/26/42
If I find proper method to get temperature on IIO driver, I'll modify it.
Thanks for your comment.
Best Regards,
Chanwoo Choi
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: Chanwoo Choi <cw00.choi@samsung.com>
To: Pavel Machek <pavel@ucw.cz>
Cc: anton@enomsg.org, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org, dwmw2@infradead.org,
grant.likely@linaro.org, rob.herring@calxeda.com,
myungjoo.ham@samsung.com, kyungmin.park@samsung.com
Subject: Re: [PATCH 2/4] charger-manager: Use IIO subsystem to read battery temperature instead of legacy method
Date: Mon, 28 Oct 2013 08:51:12 +0900 [thread overview]
Message-ID: <526DA6F0.6060005@samsung.com> (raw)
In-Reply-To: <20131027111739.GC2437@xo-6d-61-c0.localdomain>
Hi Pavel,
On 10/27/2013 08:17 PM, Pavel Machek wrote:
> Hi!
>
>> diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig
>> index e6f92b4..6700191 100644
>> --- a/drivers/power/Kconfig
>> +++ b/drivers/power/Kconfig
>> @@ -309,6 +309,7 @@ config CHARGER_MANAGER
>> bool "Battery charger manager for multiple chargers"
>> depends on REGULATOR && RTC_CLASS
>> select EXTCON
>> + select IIO
>> help
>> Say Y to enable charger-manager support, which allows multiple
>> chargers attached to a battery and multiple batteries attached to a
>
> Umm. Are there charger-manager users that don't have temperature sensor on IIO?
I'll remove tightly coupled dependency between IIO and Charger-manager.
>
>> + if (desc->channel) {
>> + temp = iio_read_channel_raw(desc->channel, last_temp_mC);
>> +
>> + /*
>> + * The charger-manager use IIO subsystem to read ADC raw data
>> + * from IIO ADC device drvier. The each device driver has
>> + * own non-standard ADC table. If user of charger-manager
>> + * would like to get correct temperature value, have to convert
>> + * 'last_temp_mC' variable according to proper calculation
>> + * method and own ADC table.
>> + */
>> +
>> + if (*last_temp_mC >= desc->iio_adc_overheat)
>> + temp = CM_TEMP_NORMAL; /* Overheat */
>> + else if (*last_temp_mC <= desc->iio_adc_cold)
>> + temp = CM_TEMP_COLD; /* Cold */
>> + else
>> + temp = CM_TEMP_NORMAL; /* Normal */
>
> Something is definitely wrong here.
I'll fix it as below:
temp = CM_TEMP_NORMAL; /* Overheat */
-> temp = CM_TEMP_OVERHEAT; /* Overheat */
Also, as you mentioned, this patch haven't included the converting sequence
from ADC value to correct temperature because currently iio driver haven't
support this feature. So, I'm going to discuss this issue on following mailing thread:
- https://lkml.org/lkml/2013/10/26/42
If I find proper method to get temperature on IIO driver, I'll modify it.
Thanks for your comment.
Best Regards,
Chanwoo Choi
next prev parent reply other threads:[~2013-10-27 23:51 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-22 12:51 [PATCH 0/4] charger-manager: Support Devicetree and use IIO susbystem Chanwoo Choi
2013-10-22 12:51 ` Chanwoo Choi
2013-10-22 12:51 ` [PATCH 1/4] charger-manager: Support DT to get platform data for charger_desc Chanwoo Choi
2013-10-22 12:51 ` [PATCH 2/4] charger-manager: Use IIO subsystem to read battery temperature instead of legacy method Chanwoo Choi
2013-10-26 11:20 ` Lars-Peter Clausen
2013-10-27 23:41 ` Chanwoo Choi
2013-10-27 23:41 ` Chanwoo Choi
2013-10-27 11:17 ` Pavel Machek
[not found] ` <20131027111739.GC2437-5NIqAleC692hcjWhqY66xCZi+YwRKgec@public.gmane.org>
2013-10-27 23:51 ` Chanwoo Choi [this message]
2013-10-27 23:51 ` Chanwoo Choi
2013-10-22 12:51 ` [PATCH 3/4] charger-manager: Add device tree binding for charger-manager Chanwoo Choi
[not found] ` <1382446317-32613-4-git-send-email-cw00.choi-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2013-10-25 20:03 ` Grant Likely
2013-10-25 20:03 ` Grant Likely
[not found] ` <20131025200344.85AA5C40566-WNowdnHR2B42iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2013-10-26 3:00 ` Chanwoo Choi
2013-10-26 3:00 ` Chanwoo Choi
2013-10-22 12:51 ` [PATCH 4/4] charger-manager: Remove build warning fo unused variable Chanwoo Choi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=526DA6F0.6060005@samsung.com \
--to=cw00.choi-sze3o3uu22jbdgjk7y7tuq@public.gmane.org \
--cc=anton-9xeibp6oKSgdnm+yROfE0A@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
--cc=grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=myungjoo.ham-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=pavel-+ZI9xUNit7I@public.gmane.org \
--cc=rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.