devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: Sangbeom Kim <sbkim73@samsung.com>,
	Samuel Ortiz <sameo@linux.intel.com>,
	linux-kernel@vger.kernel.org, Kukjin Kim <kgene@kernel.org>,
	devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org,
	Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Subject: Re: [PATCH 1/2] mfd: sec: Fix RTC alarm interrupt number on S2MPS11
Date: Tue, 7 Apr 2015 08:37:28 +0100	[thread overview]
Message-ID: <20150407073728.GH3461@x1> (raw)
In-Reply-To: <1427985376-20420-2-git-send-email-k.kozlowski@samsung.com>

On Thu, 02 Apr 2015, Krzysztof Kozlowski wrote:

> The RTC on S2MPS11 is the same as S2MPS14. However interrupt numbers of
> RTC alarms 0 and 1 were inversed between these two devices. So when
> rtc-s5m driver requested S2MPS14_IRQ_RTCA0 interrupt, it matched to
> S2MPS11_IRQ_RTCA1, not RTCA0.
> 
> Fix this by using consistent RTC alarm interrupt numbers and adding a
> BUILD_BUG_ON for future generations.
> 
> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> ---
>  drivers/mfd/sec-irq.c           | 14 ++++++++++----
>  include/linux/mfd/samsung/irq.h |  2 +-
>  2 files changed, 11 insertions(+), 5 deletions(-)

Applied, thanks.

> diff --git a/drivers/mfd/sec-irq.c b/drivers/mfd/sec-irq.c
> index ba86a918c2da..806fa8dbb22d 100644
> --- a/drivers/mfd/sec-irq.c
> +++ b/drivers/mfd/sec-irq.c
> @@ -61,14 +61,14 @@ static const struct regmap_irq s2mps11_irqs[] = {
>  		.reg_offset = 1,
>  		.mask = S2MPS11_IRQ_RTC60S_MASK,
>  	},
> -	[S2MPS11_IRQ_RTCA0] = {
> -		.reg_offset = 1,
> -		.mask = S2MPS11_IRQ_RTCA0_MASK,
> -	},
>  	[S2MPS11_IRQ_RTCA1] = {
>  		.reg_offset = 1,
>  		.mask = S2MPS11_IRQ_RTCA1_MASK,
>  	},
> +	[S2MPS11_IRQ_RTCA0] = {
> +		.reg_offset = 1,
> +		.mask = S2MPS11_IRQ_RTCA0_MASK,
> +	},
>  	[S2MPS11_IRQ_SMPL] = {
>  		.reg_offset = 1,
>  		.mask = S2MPS11_IRQ_SMPL_MASK,
> @@ -484,6 +484,12 @@ int sec_irq_init(struct sec_pmic_dev *sec_pmic)
>  		return ret;
>  	}
>  
> +	/*
> +	 * The rtc-s5m driver requests S2MPS14_IRQ_RTCA0 also for S2MPS11
> +	 * so the interrupt number must be consistent.
> +	 */
> +	BUILD_BUG_ON(((enum s2mps14_irq)S2MPS11_IRQ_RTCA0) != S2MPS14_IRQ_RTCA0);
> +
>  	return 0;
>  }
>  
> diff --git a/include/linux/mfd/samsung/irq.h b/include/linux/mfd/samsung/irq.h
> index f35af7361b60..667aa40486dd 100644
> --- a/include/linux/mfd/samsung/irq.h
> +++ b/include/linux/mfd/samsung/irq.h
> @@ -74,8 +74,8 @@ enum s2mps11_irq {
>  	S2MPS11_IRQ_MRB,
>  
>  	S2MPS11_IRQ_RTC60S,
> -	S2MPS11_IRQ_RTCA0,
>  	S2MPS11_IRQ_RTCA1,
> +	S2MPS11_IRQ_RTCA0,
>  	S2MPS11_IRQ_SMPL,
>  	S2MPS11_IRQ_RTC1S,
>  	S2MPS11_IRQ_WTSR,

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

  reply	other threads:[~2015-04-07  7:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-02 14:36 [PATCH 0/2] Arndale Octa: Fix S2MPS11 RTC alarm IRQ Krzysztof Kozlowski
2015-04-02 14:36 ` [PATCH 1/2] mfd: sec: Fix RTC alarm interrupt number on S2MPS11 Krzysztof Kozlowski
2015-04-07  7:37   ` Lee Jones [this message]
2015-04-02 14:36 ` [PATCH 2/2] ARM: dts: Fix pinctrl settings for S2MPS11 RTC alarm IRQ on Arndale Octa Krzysztof Kozlowski
2015-04-17 13:30   ` Krzysztof Kozlowski
2015-04-27  0:59     ` Kukjin Kim
2015-04-30 15:58     ` Kevin Hilman
2015-05-01  8:04       ` Krzysztof Kozlowski

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=20150407073728.GH3461@x1 \
    --to=lee.jones@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=javier.martinez@collabora.co.uk \
    --cc=k.kozlowski@samsung.com \
    --cc=kgene@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=sameo@linux.intel.com \
    --cc=sbkim73@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).