From: Donggeun Kim <dg77.kim@samsung.com>
To: Amit Kachhap <amit.kachhap@linaro.org>
Cc: guenter.roeck@ericsson.com,
"linux-pm@lists.linux-foundation.org"
<linux-pm@lists.linux-foundation.org>,
"linux-samsung-soc@vger.kernel.org"
<linux-samsung-soc@vger.kernel.org>,
"linaro-dev@lists.linaro.org" <linaro-dev@lists.linaro.org>,
"patches@linaro.org" <patches@linaro.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"lm-sensors@lm-sensors.org" <lm-sensors@lm-sensors.org>,
"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
"lenb@kernel.org" <lenb@kernel.org>
Subject: Re: [lm-sensors] [RFC PATCH 2/3] thermal: exynos4: Register the tmu sensor with the thermal interface layer
Date: Thu, 05 Jan 2012 14:57:35 +0900 [thread overview]
Message-ID: <4F053BCF.7030600@samsung.com> (raw)
In-Reply-To: <CAK44p20XeLVkJyox2SsDqyy=RYgEQNpyGGypwTMPXpueQT1T3g@mail.gmail.com>
Actually, the TMU driver is closely related to thermal layer.
I think it's okay to move it to the thermal.
Thanks.
-Donggeun
On 2012년 01월 04일 19:14, Amit Kachhap wrote:
> Hi Guenter,
>
> The main idea of this work is to leave the current userspace based
> notification scheme and add the kernel based cooling scheme on top of
> it. Anyway, It is a good idea to move the file hwmon/exynos4_tmu.c as
> this creates 2 hwmon entries.
> Adding CC: Donggeun Kim to know his opinion.
>
> Thanks,
> Amit Daniel
>
> On 4 January 2012 03:55, Guenter Roeck <guenter.roeck@ericsson.com> wrote:
>> On Wed, 2011-12-21 at 06:59 -0500, Amit Daniel Kachhap wrote:
>>> Export and register information from the hwmon tmu sensor to the samsung
>>> exynos kernel thermal framework where different cooling devices and thermal
>>> zone are binded. The exported information is based according to the data
>>> structure thermal_sensor_conf present in exynos_thermal.h. HWMON sysfs
>>> functions are currently left although all of them are present in generic
>>> linux thermal layer.
>>> Also the platform data structure is modified to pass frequency cooling
>>> in percentages for each thermal level.
>>>
>> Hi Amit,
>>
>> wouldn't it make more sense to merge the code as necessary from
>> hwmon/exynos4_tmu.c into the new thermal/exynos_thermal.c, and drop
>> hwmon/exynos4_tmu.c entirely ?
>>
>> With that, you should get the hwmon entries for free, and we would not
>> have to maintain two drivers with overlapping functionality.
>>
>> Thanks,
>> Guenter
>>
>>> Signed-off-by: Amit Daniel Kachhap <amit.kachhap@linaro.org>
>>> ---
>>> drivers/hwmon/exynos4_tmu.c | 34 ++++++++++++++++++++++++++--
>>> include/linux/platform_data/exynos4_tmu.h | 7 ++++++
>>> 2 files changed, 38 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/drivers/hwmon/exynos4_tmu.c b/drivers/hwmon/exynos4_tmu.c
>>> index f2359a0..6912a7f 100644
>>> --- a/drivers/hwmon/exynos4_tmu.c
>>> +++ b/drivers/hwmon/exynos4_tmu.c
>>> @@ -37,6 +37,9 @@
>>> #include <linux/hwmon-sysfs.h>
>>>
>>> #include <linux/platform_data/exynos4_tmu.h>
>>> +#ifdef CONFIG_SAMSUNG_THERMAL_INTERFACE
>>> +#include <linux/exynos_thermal.h>
>>> +#endif
>>>
>>> #define EXYNOS4_TMU_REG_TRIMINFO 0x0
>>> #define EXYNOS4_TMU_REG_CONTROL 0x20
>>> @@ -248,10 +251,13 @@ static void exynos4_tmu_work(struct work_struct *work)
>>>
>>> kobject_uevent(&data->hwmon_dev->kobj, KOBJ_CHANGE);
>>>
>>> - enable_irq(data->irq);
>>>
>>> clk_disable(data->clk);
>>> mutex_unlock(&data->lock);
>>> +#ifdef CONFIG_SAMSUNG_THERMAL_INTERFACE
>>> + exynos4_report_trigger();
>>> +#endif
>>> + enable_irq(data->irq);
>>> }
>>>
>>> static irqreturn_t exynos4_tmu_irq(int irq, void *id)
>>> @@ -345,6 +351,14 @@ static const struct attribute_group exynos4_tmu_attr_group = {
>>> .attrs = exynos4_tmu_attributes,
>>> };
>>>
>>> +#ifdef CONFIG_SAMSUNG_THERMAL_INTERFACE
>>> +static struct thermal_sensor_conf exynos4_sensor_conf = {
>>> + .name = "exynos4-therm",
>>> + .read_temperature = (int (*)(void *))exynos4_tmu_read,
>>> +};
>>> +#endif
>>> +/*CONFIG_SAMSUNG_THERMAL_INTERFACE*/
>>> +
>>> static int __devinit exynos4_tmu_probe(struct platform_device *pdev)
>>> {
>>> struct exynos4_tmu_data *data;
>>> @@ -432,9 +446,20 @@ static int __devinit exynos4_tmu_probe(struct platform_device *pdev)
>>> }
>>>
>>> exynos4_tmu_control(pdev, true);
>>> -
>>> +#ifdef CONFIG_SAMSUNG_THERMAL_INTERFACE
>>> + (&exynos4_sensor_conf)->private_data = data;
>>> + (&exynos4_sensor_conf)->sensor_data = pdata;
>>> + ret = exynos4_register_thermal(&exynos4_sensor_conf);
>>> + if (ret) {
>>> + dev_err(&pdev->dev, "Failed to register thermal interface\n");
>>> + goto err_hwmon_device;
>>> + }
>>> +#endif
>>> return 0;
>>> -
>>> +#ifdef CONFIG_SAMSUNG_THERMAL_INTERFACE
>>> +err_hwmon_device:
>>> + hwmon_device_unregister(data->hwmon_dev);
>>> +#endif
>>> err_create_group:
>>> sysfs_remove_group(&pdev->dev.kobj, &exynos4_tmu_attr_group);
>>> err_clk:
>>> @@ -458,6 +483,9 @@ static int __devexit exynos4_tmu_remove(struct platform_device *pdev)
>>>
>>> exynos4_tmu_control(pdev, false);
>>>
>>> +#ifdef CONFIG_SAMSUNG_THERMAL_INTERFACE
>>> + exynos4_unregister_thermal();
>>> +#endif
>>> hwmon_device_unregister(data->hwmon_dev);
>>> sysfs_remove_group(&pdev->dev.kobj, &exynos4_tmu_attr_group);
>>>
>>> diff --git a/include/linux/platform_data/exynos4_tmu.h b/include/linux/platform_data/exynos4_tmu.h
>>> index 39e038c..642c508 100644
>>> --- a/include/linux/platform_data/exynos4_tmu.h
>>> +++ b/include/linux/platform_data/exynos4_tmu.h
>>> @@ -21,6 +21,7 @@
>>>
>>> #ifndef _LINUX_EXYNOS4_TMU_H
>>> #define _LINUX_EXYNOS4_TMU_H
>>> +#include <linux/cpu_cooling.h>
>>>
>>> enum calibration_type {
>>> TYPE_ONE_POINT_TRIMMING,
>>> @@ -64,6 +65,9 @@ enum calibration_type {
>>> * in the positive-TC generator block
>>> * 0 <= reference_voltage <= 31
>>> * @cal_type: calibration type for temperature
>>> + * @freq_pctg_table: Table representing frequency reduction percentage.
>>> + * @freq_tab_count: Count of the above table as frequency reduction may
>>> + * applicable to only some of the trigger levels.
>>> *
>>> * This structure is required for configuration of exynos4_tmu driver.
>>> */
>>> @@ -79,5 +83,8 @@ struct exynos4_tmu_platform_data {
>>> u8 reference_voltage;
>>>
>>> enum calibration_type cal_type;
>>> +
>>> + struct freq_pctg_table freq_tab[4];
>>> + unsigned int freq_tab_count;
>>> };
>>> #endif /* _LINUX_EXYNOS4_TMU_H */
>>
>>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: Donggeun Kim <dg77.kim@samsung.com>
To: Amit Kachhap <amit.kachhap@linaro.org>
Cc: guenter.roeck@ericsson.com,
"linux-pm@lists.linux-foundation.org"
<linux-pm@lists.linux-foundation.org>,
"linux-samsung-soc@vger.kernel.org"
<linux-samsung-soc@vger.kernel.org>,
"linaro-dev@lists.linaro.org" <linaro-dev@lists.linaro.org>,
"patches@linaro.org" <patches@linaro.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"lm-sensors@lm-sensors.org" <lm-sensors@lm-sensors.org>,
"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
"lenb@kernel.org" <lenb@kernel.org>
Subject: Re: [lm-sensors] [RFC PATCH 2/3] thermal: exynos4: Register the tmu
Date: Thu, 05 Jan 2012 05:57:35 +0000 [thread overview]
Message-ID: <4F053BCF.7030600@samsung.com> (raw)
In-Reply-To: <CAK44p20XeLVkJyox2SsDqyy=RYgEQNpyGGypwTMPXpueQT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czRfdG11X3BsYXRmb3JtX2RhdGEgewo+Pj4gICAgICAgdTggcmVmZXJlbmNl
X3ZvbHRhZ2U7Cj4+Pgo+Pj4gICAgICAgZW51bSBjYWxpYnJhdGlvbl90eXBlIGNhbF90eXBlOwo+
Pj4gKwo+Pj4gKyAgICAgc3RydWN0IGZyZXFfcGN0Z190YWJsZSBmcmVxX3RhYls0XTsKPj4+ICsg
ICAgIHVuc2lnbmVkIGludCBmcmVxX3RhYl9jb3VudDsKPj4+ICB9Owo+Pj4gICNlbmRpZiAvKiBf
TElOVVhfRVhZTk9TNF9UTVVfSCAqLwo+Pgo+Pgo+IAoKCgpfX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fXwpsbS1zZW5zb3JzIG1haWxpbmcgbGlzdApsbS1zZW5z
b3JzQGxtLXNlbnNvcnMub3JnCmh0dHA6Ly9saXN0cy5sbS1zZW5zb3JzLm9yZy9tYWlsbWFuL2xp
c3RpbmZvL2xtLXNlbnNvcnM
WARNING: multiple messages have this Message-ID (diff)
From: Donggeun Kim <dg77.kim@samsung.com>
To: Amit Kachhap <amit.kachhap@linaro.org>
Cc: guenter.roeck@ericsson.com,
"linux-pm@lists.linux-foundation.org"
<linux-pm@lists.linux-foundation.org>,
"linux-samsung-soc@vger.kernel.org"
<linux-samsung-soc@vger.kernel.org>,
"linaro-dev@lists.linaro.org" <linaro-dev@lists.linaro.org>,
"patches@linaro.org" <patches@linaro.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"lm-sensors@lm-sensors.org" <lm-sensors@lm-sensors.org>,
"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
"lenb@kernel.org" <lenb@kernel.org>
Subject: Re: [lm-sensors] [RFC PATCH 2/3] thermal: exynos4: Register the tmu sensor with the thermal interface layer
Date: Thu, 05 Jan 2012 14:57:35 +0900 [thread overview]
Message-ID: <4F053BCF.7030600@samsung.com> (raw)
In-Reply-To: <CAK44p20XeLVkJyox2SsDqyy=RYgEQNpyGGypwTMPXpueQT1T3g@mail.gmail.com>
Actually, the TMU driver is closely related to thermal layer.
I think it's okay to move it to the thermal.
Thanks.
-Donggeun
On 2012년 01월 04일 19:14, Amit Kachhap wrote:
> Hi Guenter,
>
> The main idea of this work is to leave the current userspace based
> notification scheme and add the kernel based cooling scheme on top of
> it. Anyway, It is a good idea to move the file hwmon/exynos4_tmu.c as
> this creates 2 hwmon entries.
> Adding CC: Donggeun Kim to know his opinion.
>
> Thanks,
> Amit Daniel
>
> On 4 January 2012 03:55, Guenter Roeck <guenter.roeck@ericsson.com> wrote:
>> On Wed, 2011-12-21 at 06:59 -0500, Amit Daniel Kachhap wrote:
>>> Export and register information from the hwmon tmu sensor to the samsung
>>> exynos kernel thermal framework where different cooling devices and thermal
>>> zone are binded. The exported information is based according to the data
>>> structure thermal_sensor_conf present in exynos_thermal.h. HWMON sysfs
>>> functions are currently left although all of them are present in generic
>>> linux thermal layer.
>>> Also the platform data structure is modified to pass frequency cooling
>>> in percentages for each thermal level.
>>>
>> Hi Amit,
>>
>> wouldn't it make more sense to merge the code as necessary from
>> hwmon/exynos4_tmu.c into the new thermal/exynos_thermal.c, and drop
>> hwmon/exynos4_tmu.c entirely ?
>>
>> With that, you should get the hwmon entries for free, and we would not
>> have to maintain two drivers with overlapping functionality.
>>
>> Thanks,
>> Guenter
>>
>>> Signed-off-by: Amit Daniel Kachhap <amit.kachhap@linaro.org>
>>> ---
>>> drivers/hwmon/exynos4_tmu.c | 34 ++++++++++++++++++++++++++--
>>> include/linux/platform_data/exynos4_tmu.h | 7 ++++++
>>> 2 files changed, 38 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/drivers/hwmon/exynos4_tmu.c b/drivers/hwmon/exynos4_tmu.c
>>> index f2359a0..6912a7f 100644
>>> --- a/drivers/hwmon/exynos4_tmu.c
>>> +++ b/drivers/hwmon/exynos4_tmu.c
>>> @@ -37,6 +37,9 @@
>>> #include <linux/hwmon-sysfs.h>
>>>
>>> #include <linux/platform_data/exynos4_tmu.h>
>>> +#ifdef CONFIG_SAMSUNG_THERMAL_INTERFACE
>>> +#include <linux/exynos_thermal.h>
>>> +#endif
>>>
>>> #define EXYNOS4_TMU_REG_TRIMINFO 0x0
>>> #define EXYNOS4_TMU_REG_CONTROL 0x20
>>> @@ -248,10 +251,13 @@ static void exynos4_tmu_work(struct work_struct *work)
>>>
>>> kobject_uevent(&data->hwmon_dev->kobj, KOBJ_CHANGE);
>>>
>>> - enable_irq(data->irq);
>>>
>>> clk_disable(data->clk);
>>> mutex_unlock(&data->lock);
>>> +#ifdef CONFIG_SAMSUNG_THERMAL_INTERFACE
>>> + exynos4_report_trigger();
>>> +#endif
>>> + enable_irq(data->irq);
>>> }
>>>
>>> static irqreturn_t exynos4_tmu_irq(int irq, void *id)
>>> @@ -345,6 +351,14 @@ static const struct attribute_group exynos4_tmu_attr_group = {
>>> .attrs = exynos4_tmu_attributes,
>>> };
>>>
>>> +#ifdef CONFIG_SAMSUNG_THERMAL_INTERFACE
>>> +static struct thermal_sensor_conf exynos4_sensor_conf = {
>>> + .name = "exynos4-therm",
>>> + .read_temperature = (int (*)(void *))exynos4_tmu_read,
>>> +};
>>> +#endif
>>> +/*CONFIG_SAMSUNG_THERMAL_INTERFACE*/
>>> +
>>> static int __devinit exynos4_tmu_probe(struct platform_device *pdev)
>>> {
>>> struct exynos4_tmu_data *data;
>>> @@ -432,9 +446,20 @@ static int __devinit exynos4_tmu_probe(struct platform_device *pdev)
>>> }
>>>
>>> exynos4_tmu_control(pdev, true);
>>> -
>>> +#ifdef CONFIG_SAMSUNG_THERMAL_INTERFACE
>>> + (&exynos4_sensor_conf)->private_data = data;
>>> + (&exynos4_sensor_conf)->sensor_data = pdata;
>>> + ret = exynos4_register_thermal(&exynos4_sensor_conf);
>>> + if (ret) {
>>> + dev_err(&pdev->dev, "Failed to register thermal interface\n");
>>> + goto err_hwmon_device;
>>> + }
>>> +#endif
>>> return 0;
>>> -
>>> +#ifdef CONFIG_SAMSUNG_THERMAL_INTERFACE
>>> +err_hwmon_device:
>>> + hwmon_device_unregister(data->hwmon_dev);
>>> +#endif
>>> err_create_group:
>>> sysfs_remove_group(&pdev->dev.kobj, &exynos4_tmu_attr_group);
>>> err_clk:
>>> @@ -458,6 +483,9 @@ static int __devexit exynos4_tmu_remove(struct platform_device *pdev)
>>>
>>> exynos4_tmu_control(pdev, false);
>>>
>>> +#ifdef CONFIG_SAMSUNG_THERMAL_INTERFACE
>>> + exynos4_unregister_thermal();
>>> +#endif
>>> hwmon_device_unregister(data->hwmon_dev);
>>> sysfs_remove_group(&pdev->dev.kobj, &exynos4_tmu_attr_group);
>>>
>>> diff --git a/include/linux/platform_data/exynos4_tmu.h b/include/linux/platform_data/exynos4_tmu.h
>>> index 39e038c..642c508 100644
>>> --- a/include/linux/platform_data/exynos4_tmu.h
>>> +++ b/include/linux/platform_data/exynos4_tmu.h
>>> @@ -21,6 +21,7 @@
>>>
>>> #ifndef _LINUX_EXYNOS4_TMU_H
>>> #define _LINUX_EXYNOS4_TMU_H
>>> +#include <linux/cpu_cooling.h>
>>>
>>> enum calibration_type {
>>> TYPE_ONE_POINT_TRIMMING,
>>> @@ -64,6 +65,9 @@ enum calibration_type {
>>> * in the positive-TC generator block
>>> * 0 <= reference_voltage <= 31
>>> * @cal_type: calibration type for temperature
>>> + * @freq_pctg_table: Table representing frequency reduction percentage.
>>> + * @freq_tab_count: Count of the above table as frequency reduction may
>>> + * applicable to only some of the trigger levels.
>>> *
>>> * This structure is required for configuration of exynos4_tmu driver.
>>> */
>>> @@ -79,5 +83,8 @@ struct exynos4_tmu_platform_data {
>>> u8 reference_voltage;
>>>
>>> enum calibration_type cal_type;
>>> +
>>> + struct freq_pctg_table freq_tab[4];
>>> + unsigned int freq_tab_count;
>>> };
>>> #endif /* _LINUX_EXYNOS4_TMU_H */
>>
>>
>
next prev parent reply other threads:[~2012-01-05 5:57 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-21 11:59 [RFC PATCH 0/3] thermal: exynos: Add kernel thermal support for exynos platform Amit Daniel Kachhap
2011-12-21 12:11 ` [lm-sensors] [RFC PATCH 0/3] thermal: exynos: Add kernel thermal Amit Daniel Kachhap
2011-12-21 11:59 ` [RFC PATCH 1/3] thermal: exynos: Add thermal interface support for linux thermal layer Amit Daniel Kachhap
2011-12-21 12:11 ` [lm-sensors] [RFC PATCH 1/3] thermal: exynos: Add thermal interface Amit Daniel Kachhap
2011-12-21 11:59 ` [RFC PATCH 1/3] thermal: exynos: Add thermal interface support for linux thermal layer Amit Daniel Kachhap
2011-12-21 11:59 ` [RFC PATCH 2/3] thermal: exynos4: Register the tmu sensor with the thermal interface layer Amit Daniel Kachhap
2011-12-21 12:11 ` [lm-sensors] [RFC PATCH 2/3] thermal: exynos4: Register the tmu Amit Daniel Kachhap
2011-12-21 11:59 ` [RFC PATCH 2/3] thermal: exynos4: Register the tmu sensor with the thermal interface layer Amit Daniel Kachhap
2012-01-03 22:25 ` [lm-sensors] " Guenter Roeck
2012-01-03 22:25 ` [lm-sensors] [RFC PATCH 2/3] thermal: exynos4: Register the tmu Guenter Roeck
2012-01-04 10:14 ` [lm-sensors] [RFC PATCH 2/3] thermal: exynos4: Register the tmu sensor with the thermal interface layer Amit Kachhap
2012-01-04 10:26 ` [lm-sensors] [RFC PATCH 2/3] thermal: exynos4: Register the tmu Amit Kachhap
2012-01-04 10:23 ` [lm-sensors] [RFC PATCH 2/3] thermal: exynos4: Register the tmu sensor with the thermal interface layer R, Durgadoss
2012-01-04 10:23 ` [linux-pm] " R, Durgadoss
2012-01-04 10:23 ` [lm-sensors] [linux-pm] [RFC PATCH 2/3] thermal: exynos4: R, Durgadoss
2012-01-04 16:20 ` [linux-pm] [lm-sensors] [RFC PATCH 2/3] thermal: exynos4: Register the tmu sensor with the thermal interface layer Guenter Roeck
2012-01-04 16:20 ` [lm-sensors] [linux-pm] [RFC PATCH 2/3] thermal: exynos4: Guenter Roeck
2012-01-05 5:57 ` Donggeun Kim [this message]
2012-01-05 5:57 ` [lm-sensors] [RFC PATCH 2/3] thermal: exynos4: Register the tmu sensor with the thermal interface layer Donggeun Kim
2012-01-05 5:57 ` [lm-sensors] [RFC PATCH 2/3] thermal: exynos4: Register the tmu Donggeun Kim
2012-01-05 5:57 ` [lm-sensors] [RFC PATCH 2/3] thermal: exynos4: Register the tmu sensor with the thermal interface layer Donggeun Kim
2012-01-04 10:14 ` Amit Kachhap
2011-12-21 11:59 ` [RFC PATCH 3/3] ARM: exynos4: Add thermal sensor driver platform device support Amit Daniel Kachhap
2011-12-21 12:11 ` [lm-sensors] [RFC PATCH 3/3] ARM: exynos4: Add thermal sensor Amit Daniel Kachhap
2011-12-21 11:59 ` [RFC PATCH 3/3] ARM: exynos4: Add thermal sensor driver platform device support Amit Daniel Kachhap
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=4F053BCF.7030600@samsung.com \
--to=dg77.kim@samsung.com \
--cc=amit.kachhap@linaro.org \
--cc=guenter.roeck@ericsson.com \
--cc=lenb@kernel.org \
--cc=linaro-dev@lists.linaro.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=lm-sensors@lm-sensors.org \
--cc=patches@linaro.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.