From: Andrew Morton <akpm@linux-foundation.org>
To: Amit Daniel Kachhap <amit.kachhap@linaro.org>
Cc: linux-samsung-soc@vger.kernel.org, linaro-dev@lists.linaro.org,
patches@linaro.org, linux-kernel@vger.kernel.org,
linux-acpi@vger.kernel.org, linux-pm@lists.linux-foundation.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v3 6/6] ARM: exynos: Add thermal sensor driver platform data support
Date: Tue, 8 May 2012 13:16:44 -0700 [thread overview]
Message-ID: <20120508131644.e2e92f3e.akpm@linux-foundation.org> (raw)
In-Reply-To: <1336493898-7039-7-git-send-email-amit.kachhap@linaro.org>
On Tue, 8 May 2012 21:48:18 +0530
Amit Daniel Kachhap <amit.kachhap@linaro.org> wrote:
> This patch adds necessary default platform data support needed for TMU driver.
> This dt/non-dt values are tested for origen exynos4210 and smdk exynos5250 platforms.
>
>
> ...
>
> --- a/drivers/thermal/exynos_thermal.c
> +++ b/drivers/thermal/exynos_thermal.c
> @@ -646,14 +646,117 @@ static irqreturn_t exynos_tmu_irq(int irq, void *id)
> static struct thermal_sensor_conf exynos_sensor_conf = {
> .name = "exynos-therm",
> .read_temperature = (int (*)(void *))exynos_tmu_read,
> +};
> +
> +#if defined(CONFIG_CPU_EXYNOS4210)
> +static struct exynos_tmu_platform_data exynos4_default_tmu_data = {
Again, make it const if possible.
> + .threshold = 80,
> + .trigger_levels[0] = 5,
> + .trigger_levels[1] = 20,
> + .trigger_levels[2] = 30,
> + .trigger_level0_en = 1,
> + .trigger_level1_en = 1,
> + .trigger_level2_en = 1,
> + .trigger_level3_en = 0,
> + .gain = 15,
> + .reference_voltage = 7,
> + .cal_type = TYPE_ONE_POINT_TRIMMING,
> + .freq_tab[0] = {
> + .freq_clip_max = 800 * 1000,
> + },
> + .freq_tab[1] = {
> + .freq_clip_max = 200 * 1000,
> + },
> + .freq_tab_count = 2,
> + .type = SOC_ARCH_EXYNOS4,
> +};
> +#define EXYNOS4_TMU_DRV_DATA ((kernel_ulong_t)&exynos4_default_tmu_data)
> +#else
> +#define EXYNOS4_TMU_DRV_DATA ((kernel_ulong_t)NULL)
> +#endif
See below.
> +#if defined(CONFIG_SOC_EXYNOS5250)
> +static struct exynos_tmu_platform_data exynos5_default_tmu_data = {
> + .trigger_levels[0] = 85,
> + .trigger_levels[1] = 103,
> + .trigger_levels[2] = 110,
> + .trigger_level0_en = 1,
> + .trigger_level1_en = 1,
> + .trigger_level2_en = 1,
> + .trigger_level3_en = 0,
> + .gain = 8,
> + .reference_voltage = 16,
> + .noise_cancel_mode = 4,
> + .cal_type = TYPE_ONE_POINT_TRIMMING,
> + .efuse_value = 55,
> + .freq_tab[0] = {
> + .freq_clip_max = 800 * 1000,
> + },
> + .freq_tab[1] = {
> + .freq_clip_max = 200 * 1000,
> + },
> + .freq_tab_count = 2,
> + .type = SOC_ARCH_EXYNOS5,
> +};
> +#define EXYNOS5_TMU_DRV_DATA ((kernel_ulong_t)&exynos5_default_tmu_data)
The use of kernel_ulong_t is unexpected.
I suspect you could remove this cast altogether. Or make it void*.
> +#else
> +#define EXYNOS5_TMU_DRV_DATA ((kernel_ulong_t)NULL)
And remove this cast too. Rely upon void* magic.
> +#endif
> +
> +#ifdef CONFIG_OF
> +static const struct of_device_id exynos_tmu_match[] = {
> + {
> + .compatible = "samsung,exynos4-tmu",
> + .data = (void *)EXYNOS4_TMU_DRV_DATA,
No cast is needed if EXYNOS4_TMU_DRV_DATA has a pointer type.
> + },
> + {
> + .compatible = "samsung,exynos5-tmu",
> + .data = (void *)EXYNOS5_TMU_DRV_DATA,
No cast is needed if EXYNOS4_TMU_DRV_DATA has a pointer type.
> + },
> + {},
> +};
> +MODULE_DEVICE_TABLE(of, exynos_tmu_match);
> +#else
> +#define exynos_tmu_match NULL
> +#endif
> +
>
> ...
>
next prev parent reply other threads:[~2012-05-08 20:16 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-08 16:18 [PATCH v3 0/6] thermal: exynos: Add kernel thermal support for exynos platform Amit Daniel Kachhap
2012-05-08 16:18 ` [PATCH v3 1/6] thermal: Add a new trip type to use cooling device instance number Amit Daniel Kachhap
[not found] ` <1336493898-7039-2-git-send-email-amit.kachhap-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2012-05-08 16:18 ` [PATCH v3 2/6] thermal: Add generic cpufreq cooling implementation Amit Daniel Kachhap
[not found] ` <1336493898-7039-3-git-send-email-amit.kachhap-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2012-05-08 16:18 ` [PATCH v3 3/6] hwmon: exynos4: Move thermal sensor driver to driver/thermal directory Amit Daniel Kachhap
[not found] ` <1336493898-7039-4-git-send-email-amit.kachhap-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2012-05-08 16:18 ` [PATCH v3 4/6] thermal: exynos5: Add exynos5 thermal sensor driver support Amit Daniel Kachhap
[not found] ` <1336493898-7039-5-git-send-email-amit.kachhap-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2012-05-08 16:18 ` [PATCH v3 5/6] thermal: exynos: Register the tmu sensor with the kernel thermal layer Amit Daniel Kachhap
[not found] ` <1336493898-7039-6-git-send-email-amit.kachhap-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2012-05-08 16:18 ` [PATCH v3 6/6] ARM: exynos: Add thermal sensor driver platform data support Amit Daniel Kachhap
2012-05-08 20:16 ` Andrew Morton [this message]
2012-05-08 20:16 ` [PATCH v3 5/6] thermal: exynos: Register the tmu sensor with the kernel thermal layer Andrew Morton
2012-05-09 9:26 ` Amit Kachhap
2012-05-08 20:16 ` [PATCH v3 3/6] hwmon: exynos4: Move thermal sensor driver to driver/thermal directory Andrew Morton
2012-05-08 20:16 ` [PATCH v3 2/6] thermal: Add generic cpufreq cooling implementation Andrew Morton
2012-05-09 8:27 ` Amit Kachhap
2012-05-08 20:06 ` [PATCH v3 0/6] thermal: exynos: Add kernel thermal support for exynos platform Zhang, Rui
2012-05-09 12:44 ` Amit Kachhap
2012-05-08 20:16 ` Andrew Morton
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=20120508131644.e2e92f3e.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=amit.kachhap@linaro.org \
--cc=linaro-dev@lists.linaro.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=linux-samsung-soc@vger.kernel.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 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).