linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: "hongbo.zhang" <hongbo.zhang@linaro.org>
Cc: linaro-dev@lists.linaro.org, linux-kernel@vger.kernel.org,
	linux-pm@vger.kernel.org, rui.zhang@intel.com,
	amit.kachhap@linaro.org, STEricsson_nomadik_linux@list.st.com,
	kernel@igloocommunity.org, linaro-kernel@lists.linaro.org,
	"hongbo.zhang" <hongbo.zhang@linaro.com>,
	patches@linaro.org
Subject: Re: [PATCH V3 4/5] Thermal: Add ST-Ericsson DB8500 thermal driver.
Date: Wed, 31 Oct 2012 08:03:54 +0530	[thread overview]
Message-ID: <CAKohpondoFppsj38pWAzA4O=bcU81qzCP6vLBSYZ1f=oopykGA@mail.gmail.com> (raw)
In-Reply-To: <1351615741-24134-5-git-send-email-hongbo.zhang@linaro.com>

Sorry for late comments :(

On 30 October 2012 22:19, hongbo.zhang <hongbo.zhang@linaro.org> wrote:
> From: "hongbo.zhang" <hongbo.zhang@linaro.com>
>
> This diver is based on the thermal management framework in thermal_sys.c. A

s/diver/driver

> thermal zone device is created with the trip points to which cooling devices
> can be bound, the current cooling device is cpufreq, e.g. CPU frequency is
> clipped down to cool the CPU, and other cooling devices can be added and bound
> to the trip points dynamically.  The platform specific PRCMU interrupts are
> used to active thermal update when trip points are reached.
>
> Signed-off-by: hongbo.zhang <hongbo.zhang@linaro.com>
> ---
>  .../devicetree/bindings/thermal/db8500-thermal.txt |  40 ++
>  drivers/thermal/Kconfig                            |  20 +
>  drivers/thermal/Makefile                           |   2 +
>  drivers/thermal/db8500_cpufreq_cooling.c           | 108 +++++
>  drivers/thermal/db8500_thermal.c                   | 531 +++++++++++++++++++++
>  include/linux/platform_data/db8500_thermal.h       |  38 ++
>  6 files changed, 739 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/thermal/db8500-thermal.txt
>  create mode 100644 drivers/thermal/db8500_cpufreq_cooling.c
>  create mode 100644 drivers/thermal/db8500_thermal.c
>  create mode 100644 include/linux/platform_data/db8500_thermal.h
>
> diff --git a/Documentation/devicetree/bindings/thermal/db8500-thermal.txt b/Documentation/devicetree/bindings/thermal/db8500-thermal.txt
> new file mode 100644
> index 0000000..cab6916
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/thermal/db8500-thermal.txt
> @@ -0,0 +1,40 @@
> +* ST-Ericsson DB8500 Thermal
> +
> +** Thermal node properties:
> +
> +- compatible : "stericsson,db8500-thermal";
> +- reg : address range of the thermal sensor registers;
> +- interrupts : interrupts generated from PRCMU;
> +- interrupt-names : "IRQ_HOTMON_LOW" and "IRQ_HOTMON_HIGH";

Just mention here that below properties are optional or required.

> +- num-trips : number of total trip points;
> +- tripN-temp : temperature of trip point N, should be in ascending order;
> +- tripN-type : type of trip point N, should be one of "active" "passive" "hot" "critical";
> +- tripN-cdev-num : number of the cooling devices which can be bound to trip point N;
> +- tripN-cdev-nameM : name of the No. M cooling device of trip point N;

> diff --git a/drivers/thermal/db8500_thermal.c b/drivers/thermal/db8500_thermal.c

> +static int db8500_thermal_match_cdev(struct thermal_cooling_device *cdev,
> +               struct db8500_trip_point *trip_points)
> +{
> +       int i;
> +       char *cdev_name;
> +
> +       if (!strlen(cdev->type))
> +               return -EINVAL;
> +
> +       for (i = 0; i < COOLING_DEV_MAX; i++) {
> +               cdev_name = trip_points->cdev_name[i];
> +               if (!strcmp(cdev_name, cdev->type))

You can actually remove cdev_name variable. and use
if (!strcmp(trip_points->cdev_name[i], cdev->type))

> +                       return 0;
> +       }
> +
> +       return -ENODEV;
> +}

> +#ifdef CONFIG_OF
> +static struct db8500_thsens_platform_data*
> +               db8500_thermal_parse_dt(struct platform_device *pdev)
> +{

> +               for (j = 0; j < tmp_data; j++) {
> +                       sprintf(prop_name, "trip%d-cdev-name%d", i, j);
> +                       if (of_property_read_string(np, prop_name, &tmp_str))
> +                               goto err_parse_dt;
> +
> +                       if (strlen(tmp_str) > THERMAL_NAME_LENGTH)
> +                               goto err_parse_dt;
> +
> +                       strcpy(ptrips->trip_points[i].cdev_name[j], tmp_str);

want to check if it is copied or not??

> +               }
> +       }
> +       return ptrips;
> +
> +err_parse_dt:
> +       dev_err(&pdev->dev, "Parsing device tree data error.\n");
> +       return NULL;
> +}

After these please add my:

Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>

  reply	other threads:[~2012-10-31  2:33 UTC|newest]

Thread overview: 76+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-16 11:44 [PATCH 0/5] Fix thermal bugs and Upstream ST-Ericsson thermal driver hongbo.zhang
2012-10-16 11:44 ` [PATCH 1/5] Thermal: do bind operation after thermal zone or cooling device register returns hongbo.zhang
2012-10-21 10:05   ` Francesco Lavra
2012-10-23  8:23     ` Hongbo Zhang
2012-10-23 22:13       ` Francesco Lavra
2012-10-24  2:37         ` Hongbo Zhang
2012-10-16 11:44 ` [PATCH 2/5] Thermal: add indent for code alignment hongbo.zhang
2012-10-17 14:21   ` Viresh Kumar
2012-10-16 11:44 ` [PATCH 3/5] Thermal: fix empty list checking method hongbo.zhang
2012-10-17 14:24   ` Viresh Kumar
2012-10-16 11:44 ` [PATCH 4/5] Thermal: make sure cpufreq cooling register after cpufreq driver hongbo.zhang
2012-10-17 14:36   ` Viresh Kumar
2012-10-16 11:44 ` [PATCH 5/5] Thermal: Add ST-Ericsson db8500 thermal dirver hongbo.zhang
2012-10-17 15:23   ` Viresh Kumar
2012-10-17 16:58     ` Joe Perches
2012-10-17 17:02       ` Viresh Kumar
2012-10-18  7:35     ` Hongbo Zhang
2012-10-18  8:07       ` Viresh Kumar
2012-10-18 10:45         ` Hongbo Zhang
2012-10-18 18:08     ` viresh kumar
2012-10-21 15:01   ` Francesco Lavra
2012-10-22 12:02     ` Hongbo Zhang
2012-10-22 18:51       ` Francesco Lavra
2012-10-24  4:40         ` Hongbo Zhang
2012-10-24 11:58 ` [PATCH V2 0/6] Fix thermal bugs and Upstream ST-Ericsson thermal driver hongbo.zhang
2012-10-24 11:58   ` [PATCH V2 1/6] Thermal: add indent for code alignment hongbo.zhang
2012-10-24 11:58   ` [PATCH V2 2/6] Thermal: make sure cpufreq cooling register after cpufreq driver hongbo.zhang
2012-10-29 11:42     ` Amit Kachhap
2012-10-30  8:59       ` Hongbo Zhang
2012-10-24 11:58   ` [PATCH V2 3/6] Thermal: fix bug of counting cpu frequencies hongbo.zhang
2012-10-24 13:34     ` Viresh Kumar
2012-10-29 11:54       ` Amit Kachhap
2012-10-24 11:58   ` [PATCH V2 4/6] Thermal: Remove the cooling_cpufreq_list hongbo.zhang
2012-10-25 19:14     ` Francesco Lavra
2012-10-26  2:59       ` Hongbo Zhang
2012-10-26  7:09       ` hongbo.zhang
2012-10-27  6:39         ` Francesco Lavra
2012-10-30  8:03         ` Amit Kachhap
2012-10-30  8:53           ` Hongbo Zhang
2012-10-24 11:58   ` [PATCH V2 5/6] Thermal: Add ST-Ericsson DB8500 thermal dirver hongbo.zhang
2012-10-24 14:38     ` Viresh Kumar
2012-10-25  8:26       ` Hongbo Zhang
2012-10-25  8:41         ` Viresh Kumar
2012-10-25  9:33           ` Hongbo Zhang
2012-10-25  9:42             ` Viresh Kumar
2012-10-25 10:43               ` Hongbo Zhang
2012-10-25  9:56             ` Hongbo Zhang
2012-10-25 10:04               ` Viresh Kumar
2012-10-25 10:11                 ` Viresh Kumar
2012-10-25 10:45                   ` Hongbo Zhang
2012-10-25 11:13     ` [PATCH V2 5/6] Thermal: Add ST-Ericsson DB8500 thermal driver hongbo.zhang
2012-10-27 10:53       ` Francesco Lavra
2012-10-24 11:58   ` [PATCH V2 6/6] Thermal: Add ST-Ericsson DB8500 thermal properties and platform data hongbo.zhang
2012-10-24 14:32     ` Joe Perches
2012-10-25  3:45       ` Hongbo Zhang
2012-10-24 14:47     ` Viresh Kumar
2012-10-25  3:49       ` Hongbo Zhang
2012-10-25 11:15     ` hongbo.zhang
2012-10-25 11:39       ` hongbo.zhang
2012-10-30 16:48   ` [PATCH V3 0/5] Fix thermal bugs and Upstream ST-Ericsson thermal driver hongbo.zhang
2012-10-30 16:48     ` [PATCH V3 1/5] Thermal: add indent for code alignment hongbo.zhang
2012-11-07  6:54       ` Zhang Rui
2012-10-30 16:48     ` [PATCH V3 2/5] Thermal: fix bug of counting cpu frequencies hongbo.zhang
2012-11-07  6:54       ` Zhang Rui
2012-10-30 16:48     ` [PATCH V3 3/5] Thermal: Remove the cooling_cpufreq_list hongbo.zhang
2012-11-07  6:54       ` Zhang Rui
2012-11-09 11:54         ` Hongbo Zhang
2012-10-30 16:49     ` [PATCH V3 4/5] Thermal: Add ST-Ericsson DB8500 thermal driver hongbo.zhang
2012-10-31  2:33       ` Viresh Kumar [this message]
2012-11-01 14:48       ` Francesco Lavra
     [not found]       ` <744357E9AAD1214791ACBA4B0B90926324F81A@SHSMSX101.ccr.corp.intel.com>
2012-11-06 10:17         ` Hongbo Zhang
2012-11-06 10:30           ` Hongbo Zhang
2012-10-30 16:49     ` [PATCH V3 5/5] Thermal: Add ST-Ericsson DB8500 thermal properties and platform data hongbo.zhang
2012-10-31  2:18       ` viresh kumar
2012-11-06  7:25         ` Hongbo Zhang
2012-10-31  2:08     ` [PATCH V3 0/5] Fix thermal bugs and Upstream ST-Ericsson thermal driver viresh kumar

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='CAKohpondoFppsj38pWAzA4O=bcU81qzCP6vLBSYZ1f=oopykGA@mail.gmail.com' \
    --to=viresh.kumar@linaro.org \
    --cc=STEricsson_nomadik_linux@list.st.com \
    --cc=amit.kachhap@linaro.org \
    --cc=hongbo.zhang@linaro.com \
    --cc=hongbo.zhang@linaro.org \
    --cc=kernel@igloocommunity.org \
    --cc=linaro-dev@lists.linaro.org \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=patches@linaro.org \
    --cc=rui.zhang@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).