linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zhang Rui <rui.zhang@intel.com>
To: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
Cc: linux-pm@vger.kernel.org, naveenkrishna.ch@gmail.com,
	eduardo.valentin@ti.com, linux-samsung-soc@vger.kernel.org,
	linux-kernel@vger.kernel.org, amit.daniel@samsung.com,
	kgene.kim@samsung.com, devicetree@vger.kernel.org,
	b.zolnierkie@samsung.com, cpgs@samsung.com, t.figa@samsung.com
Subject: Re: [PATCH v12 1/4] thermal: samsung: replace inten_ bit fields with intclr_
Date: Thu, 02 Jan 2014 10:33:14 +0800	[thread overview]
Message-ID: <1388629994.3739.70.camel@rzhang1-mobl4> (raw)
In-Reply-To: <1387433139-7801-1-git-send-email-ch.naveen@samsung.com>

On Thu, 2013-12-19 at 11:35 +0530, Naveen Krishna Chatradhi wrote:
> This patch replaces the inten_rise_shift/mask and inten_fall_shift/mask
> with intclr_rise_shift/mask and intclr_fall_shift/mask respectively.
> Currently, inten_rise_shift/mask and inten_fall_shift/mask bits are only used
> to configure intclr related registers.
> 
> Description of H/W:
> The offset for the bits in the CLEAR register are not consistent across TMU
> modules in Exynso5250, 5420 and 5440.
> 
> On Exynos5250, the FALL interrupt related en, status and clear bits are
> available at an offset of
> 16 in INTEN, INTSTAT registers and at an offset of
> 12 in INTCLEAR register.
> 
> On Exynos5420, the FALL interrupt related en, status and clear bits are
> available at an offset of
> 16 in INTEN, INTSTAT and INTCLEAR registers.
> 
> On Exynos5440,
> the FALL_IRQEN bits are at an offset of 4
> and the RISE_IRQEN bits are at an offset of 0
> 
> Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
> Acked-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
> Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> Reviewed-by: Tomasz Figa <t.figa@samsung.com>

Eduardo,

what do you think of this patch set?

thanks,
rui
> ---
> Changes since v11:
> Added Reviewed by Tomasz
> 
> Changes since v10:
> None
> 
>  drivers/thermal/samsung/exynos_tmu.c      |    6 +++---
>  drivers/thermal/samsung/exynos_tmu.h      |   16 ++++++++--------
>  drivers/thermal/samsung/exynos_tmu_data.c |   18 +++++++++---------
>  drivers/thermal/samsung/exynos_tmu_data.h |    4 ++--
>  4 files changed, 22 insertions(+), 22 deletions(-)
> 
> diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
> index 32f38b9..c493245 100644
> --- a/drivers/thermal/samsung/exynos_tmu.c
> +++ b/drivers/thermal/samsung/exynos_tmu.c
> @@ -237,7 +237,7 @@ skip_calib_data:
>  			writeb(pdata->trigger_levels[i], data->base +
>  			reg->threshold_th0 + i * sizeof(reg->threshold_th0));
>  
> -		writel(reg->inten_rise_mask, data->base + reg->tmu_intclear);
> +		writel(reg->intclr_rise_mask, data->base + reg->tmu_intclear);
>  	} else {
>  		/* Write temperature code for rising and falling threshold */
>  		for (i = 0;
> @@ -264,8 +264,8 @@ skip_calib_data:
>  		writel(falling_threshold,
>  				data->base + reg->threshold_th1);
>  
> -		writel((reg->inten_rise_mask << reg->inten_rise_shift) |
> -			(reg->inten_fall_mask << reg->inten_fall_shift),
> +		writel((reg->intclr_rise_mask << reg->intclr_rise_shift) |
> +			(reg->intclr_fall_mask << reg->intclr_fall_shift),
>  				data->base + reg->tmu_intclear);
>  
>  		/* if last threshold limit is also present */
> diff --git a/drivers/thermal/samsung/exynos_tmu.h b/drivers/thermal/samsung/exynos_tmu.h
> index 3fb6554..980859a 100644
> --- a/drivers/thermal/samsung/exynos_tmu.h
> +++ b/drivers/thermal/samsung/exynos_tmu.h
> @@ -122,10 +122,6 @@ enum soc_type {
>   * @threshold_th3_l0_shift: shift bits of level0 threshold temperature.
>   * @tmu_inten: register containing the different threshold interrupt
>  	enable bits.
> - * @inten_rise_shift: shift bits of all rising interrupt bits.
> - * @inten_rise_mask: mask bits of all rising interrupt bits.
> - * @inten_fall_shift: shift bits of all rising interrupt bits.
> - * @inten_fall_mask: mask bits of all rising interrupt bits.
>   * @inten_rise0_shift: shift bits of rising 0 interrupt bits.
>   * @inten_rise1_shift: shift bits of rising 1 interrupt bits.
>   * @inten_rise2_shift: shift bits of rising 2 interrupt bits.
> @@ -136,6 +132,10 @@ enum soc_type {
>   * @inten_fall3_shift: shift bits of falling 3 interrupt bits.
>   * @tmu_intstat: Register containing the interrupt status values.
>   * @tmu_intclear: Register for clearing the raised interrupt status.
> + * @intclr_fall_shift: shift bits for interrupt clear fall 0
> + * @intclr_rise_shift: shift bits of all rising interrupt bits.
> + * @intclr_rise_mask: mask bits of all rising interrupt bits.
> + * @intclr_fall_mask: mask bits of all rising interrupt bits.
>   * @emul_con: TMU emulation controller register.
>   * @emul_temp_shift: shift bits of emulation temperature.
>   * @emul_time_shift: shift bits of emulation time.
> @@ -191,10 +191,6 @@ struct exynos_tmu_registers {
>  	u32	threshold_th3_l0_shift;
>  
>  	u32	tmu_inten;
> -	u32	inten_rise_shift;
> -	u32	inten_rise_mask;
> -	u32	inten_fall_shift;
> -	u32	inten_fall_mask;
>  	u32	inten_rise0_shift;
>  	u32	inten_rise1_shift;
>  	u32	inten_rise2_shift;
> @@ -207,6 +203,10 @@ struct exynos_tmu_registers {
>  	u32	tmu_intstat;
>  
>  	u32	tmu_intclear;
> +	u32	intclr_fall_shift;
> +	u32	intclr_rise_shift;
> +	u32	intclr_fall_mask;
> +	u32	intclr_rise_mask;
>  
>  	u32	emul_con;
>  	u32	emul_temp_shift;
> diff --git a/drivers/thermal/samsung/exynos_tmu_data.c b/drivers/thermal/samsung/exynos_tmu_data.c
> index 073c292..7cdb04e 100644
> --- a/drivers/thermal/samsung/exynos_tmu_data.c
> +++ b/drivers/thermal/samsung/exynos_tmu_data.c
> @@ -40,13 +40,13 @@ static const struct exynos_tmu_registers exynos4210_tmu_registers = {
>  	.threshold_temp = EXYNOS4210_TMU_REG_THRESHOLD_TEMP,
>  	.threshold_th0 = EXYNOS4210_TMU_REG_TRIG_LEVEL0,
>  	.tmu_inten = EXYNOS_TMU_REG_INTEN,
> -	.inten_rise_mask = EXYNOS4210_TMU_TRIG_LEVEL_MASK,
>  	.inten_rise0_shift = EXYNOS_TMU_INTEN_RISE0_SHIFT,
>  	.inten_rise1_shift = EXYNOS_TMU_INTEN_RISE1_SHIFT,
>  	.inten_rise2_shift = EXYNOS_TMU_INTEN_RISE2_SHIFT,
>  	.inten_rise3_shift = EXYNOS_TMU_INTEN_RISE3_SHIFT,
>  	.tmu_intstat = EXYNOS_TMU_REG_INTSTAT,
>  	.tmu_intclear = EXYNOS_TMU_REG_INTCLEAR,
> +	.intclr_rise_mask = EXYNOS4210_TMU_TRIG_LEVEL_MASK,
>  };
>  
>  struct exynos_tmu_init_data const exynos4210_default_tmu_data = {
> @@ -112,10 +112,6 @@ static const struct exynos_tmu_registers exynos4412_tmu_registers = {
>  	.threshold_th0 = EXYNOS_THD_TEMP_RISE,
>  	.threshold_th1 = EXYNOS_THD_TEMP_FALL,
>  	.tmu_inten = EXYNOS_TMU_REG_INTEN,
> -	.inten_rise_mask = EXYNOS_TMU_RISE_INT_MASK,
> -	.inten_rise_shift = EXYNOS_TMU_RISE_INT_SHIFT,
> -	.inten_fall_mask = EXYNOS_TMU_FALL_INT_MASK,
> -	.inten_fall_shift = EXYNOS_TMU_FALL_INT_SHIFT,
>  	.inten_rise0_shift = EXYNOS_TMU_INTEN_RISE0_SHIFT,
>  	.inten_rise1_shift = EXYNOS_TMU_INTEN_RISE1_SHIFT,
>  	.inten_rise2_shift = EXYNOS_TMU_INTEN_RISE2_SHIFT,
> @@ -123,6 +119,10 @@ static const struct exynos_tmu_registers exynos4412_tmu_registers = {
>  	.inten_fall0_shift = EXYNOS_TMU_INTEN_FALL0_SHIFT,
>  	.tmu_intstat = EXYNOS_TMU_REG_INTSTAT,
>  	.tmu_intclear = EXYNOS_TMU_REG_INTCLEAR,
> +	.intclr_fall_shift = EXYNOS_TMU_CLEAR_FALL_INT_SHIFT,
> +	.intclr_rise_shift = EXYNOS_TMU_RISE_INT_SHIFT,
> +	.intclr_rise_mask = EXYNOS_TMU_RISE_INT_MASK,
> +	.intclr_fall_mask = EXYNOS_TMU_FALL_INT_MASK,
>  	.emul_con = EXYNOS_EMUL_CON,
>  	.emul_temp_shift = EXYNOS_EMUL_DATA_SHIFT,
>  	.emul_time_shift = EXYNOS_EMUL_TIME_SHIFT,
> @@ -217,10 +217,6 @@ static const struct exynos_tmu_registers exynos5440_tmu_registers = {
>  	.threshold_th2 = EXYNOS5440_TMU_S0_7_TH2,
>  	.threshold_th3_l0_shift = EXYNOS5440_TMU_TH_RISE4_SHIFT,
>  	.tmu_inten = EXYNOS5440_TMU_S0_7_IRQEN,
> -	.inten_rise_mask = EXYNOS5440_TMU_RISE_INT_MASK,
> -	.inten_rise_shift = EXYNOS5440_TMU_RISE_INT_SHIFT,
> -	.inten_fall_mask = EXYNOS5440_TMU_FALL_INT_MASK,
> -	.inten_fall_shift = EXYNOS5440_TMU_FALL_INT_SHIFT,
>  	.inten_rise0_shift = EXYNOS5440_TMU_INTEN_RISE0_SHIFT,
>  	.inten_rise1_shift = EXYNOS5440_TMU_INTEN_RISE1_SHIFT,
>  	.inten_rise2_shift = EXYNOS5440_TMU_INTEN_RISE2_SHIFT,
> @@ -228,6 +224,10 @@ static const struct exynos_tmu_registers exynos5440_tmu_registers = {
>  	.inten_fall0_shift = EXYNOS5440_TMU_INTEN_FALL0_SHIFT,
>  	.tmu_intstat = EXYNOS5440_TMU_S0_7_IRQ,
>  	.tmu_intclear = EXYNOS5440_TMU_S0_7_IRQ,
> +	.intclr_fall_shift = EXYNOS5440_TMU_CLEAR_FALL_INT_SHIFT,
> +	.intclr_rise_shift = EXYNOS5440_TMU_RISE_INT_SHIFT,
> +	.intclr_rise_mask = EXYNOS5440_TMU_RISE_INT_MASK,
> +	.intclr_fall_mask = EXYNOS5440_TMU_FALL_INT_MASK,
>  	.tmu_irqstatus = EXYNOS5440_TMU_IRQ_STATUS,
>  	.emul_con = EXYNOS5440_TMU_S0_7_DEBUG,
>  	.emul_temp_shift = EXYNOS_EMUL_DATA_SHIFT,
> diff --git a/drivers/thermal/samsung/exynos_tmu_data.h b/drivers/thermal/samsung/exynos_tmu_data.h
> index a1ea19d..d9495a4 100644
> --- a/drivers/thermal/samsung/exynos_tmu_data.h
> +++ b/drivers/thermal/samsung/exynos_tmu_data.h
> @@ -69,9 +69,10 @@
>  #define EXYNOS_TMU_RISE_INT_MASK	0x111
>  #define EXYNOS_TMU_RISE_INT_SHIFT	0
>  #define EXYNOS_TMU_FALL_INT_MASK	0x111
> -#define EXYNOS_TMU_FALL_INT_SHIFT	12
>  #define EXYNOS_TMU_CLEAR_RISE_INT	0x111
>  #define EXYNOS_TMU_CLEAR_FALL_INT	(0x111 << 12)
> +#define EXYNOS_TMU_CLEAR_FALL_INT_SHIFT	12
> +#define EXYNOS5440_TMU_CLEAR_FALL_INT_SHIFT	4
>  #define EXYNOS_TMU_TRIP_MODE_SHIFT	13
>  #define EXYNOS_TMU_TRIP_MODE_MASK	0x7
>  #define EXYNOS_TMU_THERM_TRIP_EN_SHIFT	12
> @@ -119,7 +120,6 @@
>  #define EXYNOS5440_TMU_RISE_INT_MASK		0xf
>  #define EXYNOS5440_TMU_RISE_INT_SHIFT		0
>  #define EXYNOS5440_TMU_FALL_INT_MASK		0xf
> -#define EXYNOS5440_TMU_FALL_INT_SHIFT		4
>  #define EXYNOS5440_TMU_INTEN_RISE0_SHIFT	0
>  #define EXYNOS5440_TMU_INTEN_RISE1_SHIFT	1
>  #define EXYNOS5440_TMU_INTEN_RISE2_SHIFT	2



  reply	other threads:[~2014-01-02  2:33 UTC|newest]

Thread overview: 98+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-01  6:02 [PATCH] thermal: exynos: Handle the misplaced TRIMINFO register Naveen Krishna Chatradhi
2013-08-01  8:32 ` amit daniel kachhap
2013-08-01  8:48   ` Naveen Krishna Ch
2013-08-01 10:36 ` [PATCH v2] " Naveen Krishna Chatradhi
2013-08-07  6:36   ` amit daniel kachhap
2013-08-07  6:43     ` Naveen Krishna Ch
2013-08-28  5:45 ` [PATCH 0/3] thermal: samsung: Add TMU for Exynos5420 Naveen Krishna Chatradhi
2013-08-28  5:45   ` [PATCH 1/3] thermal: samsung: correct the fall interrupt en, status bit fields Naveen Krishna Chatradhi
2013-08-28  5:57     ` amit daniel kachhap
2013-09-04  4:23     ` Naveen Krishna Chatradhi
2013-09-04  4:23       ` [PATCH 2/3] thermal: samsung: change base_common to more meaningful base_second Naveen Krishna Chatradhi
2013-09-06  4:38         ` amit daniel kachhap
2013-10-17  3:12         ` [PATCH 2/3 v6] " Naveen Krishna Chatradhi
2013-11-06 13:28         ` [PATCH 2/3 v7] " Naveen Krishna Chatradhi
2013-11-07  5:53         ` [PATCH 2/3 v8] " Naveen Krishna Chatradhi
2013-11-12  6:36         ` [PATCH 2/4 v9] " Naveen Krishna Chatradhi
2013-11-18  3:24           ` Naveen Krishna Ch
2013-11-19 13:04         ` [PATCH 2/4 v10] " Naveen Krishna Chatradhi
2013-11-22  8:56           ` Naveen Krishna Ch
2013-12-09 12:48           ` Tomasz Figa
2013-12-10  6:41         ` [PATCH v11 2/4] " Naveen Krishna Chatradhi
2013-12-18 15:51           ` Tomasz Figa
2013-12-19  6:06         ` [PATCH v12 " Naveen Krishna Chatradhi
2014-02-07  9:35           ` Naveen Krishna Ch
2013-09-04  4:23       ` [PATCH 3/3] thermal: samsung: Add TMU support for Exynos5420 SoCs Naveen Krishna Chatradhi
2013-10-03 12:01         ` Naveen Krishna Ch
2013-10-03 12:42           ` Bartlomiej Zolnierkiewicz
2013-10-09 11:45             ` Naveen Krishna Ch
2013-10-09 12:08         ` [PATCH 1/3 v4] thermal: samsung: correct the fall interrupt en, status bit fields Naveen Krishna Chatradhi
2013-10-09 12:08           ` [PATCH 2/3 v4] thermal: samsung: change base_common to more meaningful base_second Naveen Krishna Chatradhi
2013-10-14 13:47             ` Eduardo Valentin
2013-10-09 12:08           ` [PATCH 3/3 v4] thermal: samsung: Add TMU support for Exynos5420 SoCs Naveen Krishna Chatradhi
2013-10-09 14:03           ` [PATCH 1/3 v4] thermal: samsung: correct the fall interrupt en, status bit fields Bartlomiej Zolnierkiewicz
2013-10-11 15:10             ` Eduardo Valentin
2013-10-11 15:57               ` Bartlomiej Zolnierkiewicz
2013-10-14 14:18                 ` Eduardo Valentin
2013-10-14 16:01                   ` Bartlomiej Zolnierkiewicz
2013-10-15 11:39                     ` Naveen Krishna Ch
2013-10-14 13:56             ` Eduardo Valentin
2013-11-06 13:28         ` [PATCH 3/3 v7] thermal: samsung: Add TMU support for Exynos5420 SoCs Naveen Krishna Chatradhi
2013-11-06 13:44           ` Bartlomiej Zolnierkiewicz
2013-11-07  5:53         ` [PATCH 3/3 v8] " Naveen Krishna Chatradhi
2013-11-07 15:09           ` Tomasz Figa
2013-11-12  6:19             ` Naveen Krishna Ch
2013-11-12  6:37         ` [PATCH 3/4 v9] " Naveen Krishna Chatradhi
2013-11-18  3:22           ` Naveen Krishna Ch
2013-11-18 11:27             ` Mark Rutland
2013-12-09 12:43           ` Tomasz Figa
2013-11-19 13:05         ` [PATCH 3/4 v10] " Naveen Krishna Chatradhi
2013-11-22  8:55           ` Naveen Krishna Ch
2013-12-09 12:46           ` Tomasz Figa
2013-12-10  6:42         ` [PATCH v11 3/4] " Naveen Krishna Chatradhi
2013-12-18 15:50           ` Tomasz Figa
2013-12-19  4:44             ` Naveen Krishna Ch
2013-12-19  6:06         ` [PATCH v12 " Naveen Krishna Chatradhi
2013-12-19 11:34           ` Tomasz Figa
2014-02-07  9:34             ` Naveen Krishna Ch
2013-10-17  3:11     ` [PATCH 1/3 v6] thermal: samsung: add intclr_fall_shift bit in exynos_tmu_register Naveen Krishna Chatradhi
2013-10-17 10:03       ` Bartlomiej Zolnierkiewicz
2013-11-06 13:17         ` Naveen Krishna Ch
2013-11-06 13:36           ` Bartlomiej Zolnierkiewicz
2013-11-06 13:27       ` [PATCH 1/3 v7] " Naveen Krishna Chatradhi
2013-11-07  5:52       ` [PATCH 1/3 v8] thermal: samsung: add intclr_fall_shift bit in exynos_tmu_register struct Naveen Krishna Chatradhi
2013-11-07 10:48         ` Bartlomiej Zolnierkiewicz
2013-11-07 10:58           ` Naveen Krishna Ch
2013-11-07 14:47         ` Tomasz Figa
2013-11-12  6:36         ` [PATCH 1/4 v9] thermal: samsung: replace inten_ bit fields with intclr_ Naveen Krishna Chatradhi
2013-11-18  3:25           ` Naveen Krishna Ch
2013-11-19 13:04           ` [PATCH 1/4 v10] " Naveen Krishna Chatradhi
2013-12-09 12:51             ` Tomasz Figa
2013-12-10  6:41           ` [PATCH v11 1/4] " Naveen Krishna Chatradhi
2013-12-18 15:51             ` Tomasz Figa
2013-12-19  6:05           ` [PATCH v12 " Naveen Krishna Chatradhi
2014-01-02  2:33             ` Zhang Rui [this message]
2014-02-07  9:33               ` Naveen Krishna Ch
2014-04-10 12:43                 ` Bartlomiej Zolnierkiewicz
2013-08-28  5:45   ` [PATCH 2/3] thermal: samsung: Add TMU support for Exynos5420 SoCs Naveen Krishna Chatradhi
2013-08-28  5:58     ` amit daniel kachhap
2013-08-28  9:28     ` amit daniel kachhap
2013-10-17  3:12     ` [PATCH 3/3 v6] " Naveen Krishna Chatradhi
2013-08-28  5:45   ` [PATCH 3/3] thermal: exynos: Handle the misplaced TRIMINFO register Naveen Krishna Chatradhi
2013-08-28  6:03     ` amit daniel kachhap
2013-08-28  6:19       ` Naveen Krishna Ch
2013-08-28  8:43         ` amit daniel kachhap
2013-08-28  8:57           ` Naveen Krishna Ch
2013-08-28  9:04             ` amit daniel kachhap
2013-08-28 10:06     ` Bartlomiej Zolnierkiewicz
2013-11-12  6:35   ` [PATCH 0/3] thermal: samsung: Clean up and add support for Exynos5420 Naveen Krishna Chatradhi
2013-11-18  3:25     ` Naveen Krishna Ch
2013-12-10  6:40     ` [PATCH v11 0/4] " Naveen Krishna Chatradhi
2014-03-19 11:19       ` Leela Krishna Amudala
2014-03-19 15:58         ` Tomasz Figa
2014-03-20  2:45           ` Naveen Krishna Ch
2014-04-08  9:33             ` Javi Merino
2013-08-28  9:16 ` [PATCH 1/3 v2] thermal: samsung: correct the fall interrupt en, status bit fields Naveen Krishna Chatradhi
2013-08-28  9:16   ` [PATCH 2/3] thermal: samsung: change base_common to more meaningful base_second Naveen Krishna Chatradhi
2013-08-28  9:16   ` [PATCH v2: 3/3] thermal: samsung: Add TMU support for Exynos5420 SoCs Naveen Krishna Chatradhi
2013-08-28 10:38     ` Bartlomiej Zolnierkiewicz

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=1388629994.3739.70.camel@rzhang1-mobl4 \
    --to=rui.zhang@intel.com \
    --cc=amit.daniel@samsung.com \
    --cc=b.zolnierkie@samsung.com \
    --cc=ch.naveen@samsung.com \
    --cc=cpgs@samsung.com \
    --cc=devicetree@vger.kernel.org \
    --cc=eduardo.valentin@ti.com \
    --cc=kgene.kim@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=naveenkrishna.ch@gmail.com \
    --cc=t.figa@samsung.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).