Linux RTC
 help / color / mirror / Atom feed
From: Alim Akhtar <alim.akhtar@samsung.com>
To: Krzysztof Kozlowski <k.kozlowski@samsung.com>,
	Sangbeom Kim <sbkim73@samsung.com>,
	Alessandro Zummo <a.zummo@towertech.it>,
	Alexandre Belloni <alexandre.belloni@free-electrons.com>,
	Lee Jones <lee.jones@linaro.org>,
	linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
	rtc-linux@googlegroups.com
Cc: Yadwinder Singh Brar <yadi.brar01@gmail.com>
Subject: [rtc-linux] Re: [PATCH v2 2/3] rtc: s5m: Add separate field for storing auto-cleared mask in register config
Date: Wed, 30 Dec 2015 15:39:04 +0530	[thread overview]
Message-ID: <5683AD40.2010609@samsung.com> (raw)
In-Reply-To: <1451450847-928-2-git-send-email-k.kozlowski@samsung.com>

Hi Krzysztof,


On 12/30/2015 10:17 AM, Krzysztof Kozlowski wrote:
> Some devices from S2M/S5M family use different register update masks for
> different operations (alarm and register update). Now the driver uses
> common register configuration and a lot of exceptions per device in code.
>
> Before eliminating the exceptions and using specific register
> configuration for given device, make the auto-cleared mask a separate
> field. This is merely a refactoring.
>
> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
>

Tested for s2mps15 pmic on exynos7-espresso board. Works well.
Fill free to add
Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>
Tested-by: Alim Akhtar <alim.akhtar@samsung.com>
> ---
>
> Changes since v1:
> 1. None.
> ---
>   drivers/rtc/rtc-s5m.c | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/rtc/rtc-s5m.c b/drivers/rtc/rtc-s5m.c
> index 85649861a6b0..559db8f72117 100644
> --- a/drivers/rtc/rtc-s5m.c
> +++ b/drivers/rtc/rtc-s5m.c
> @@ -56,6 +56,8 @@ struct s5m_rtc_reg_config {
>   	 * auto-cleared after successful update.
>   	 */
>   	unsigned int udr_update;
> +	/* Auto-cleared mask in UDR field for writing time and alarm */
> +	unsigned int autoclear_udr_mask;
>   	/* Mask for UDR field in 'udr_update' register */
>   	unsigned int udr_mask;
>   };
> @@ -68,6 +70,7 @@ static const struct s5m_rtc_reg_config s5m_rtc_regs = {
>   	.alarm0			= S5M_ALARM0_SEC,
>   	.alarm1			= S5M_ALARM1_SEC,
>   	.udr_update		= S5M_RTC_UDR_CON,
> +	.autoclear_udr_mask	= S5M_RTC_UDR_MASK,
>   	.udr_mask		= S5M_RTC_UDR_MASK,
>   };
>
> @@ -82,6 +85,7 @@ static const struct s5m_rtc_reg_config s2mps_rtc_regs = {
>   	.alarm0			= S2MPS_ALARM0_SEC,
>   	.alarm1			= S2MPS_ALARM1_SEC,
>   	.udr_update		= S2MPS_RTC_UDR_CON,
> +	.autoclear_udr_mask	= S2MPS_RTC_WUDR_MASK,
>   	.udr_mask		= S2MPS_RTC_WUDR_MASK,
>   };
>
> @@ -167,7 +171,7 @@ static inline int s5m8767_wait_for_udr_update(struct s5m_rtc_info *info)
>
>   	do {
>   		ret = regmap_read(info->regmap, info->regs->udr_update, &data);
> -	} while (--retry && (data & info->regs->udr_mask) && !ret);
> +	} while (--retry && (data & info->regs->autoclear_udr_mask) && !ret);
>
>   	if (!retry)
>   		dev_err(info->dev, "waiting for UDR update, reached max number of retries\n");
>

-- 
-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

  reply	other threads:[~2015-12-30 10:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-30  4:47 [rtc-linux] [PATCH v2 1/3] rtc: s5m: Cleanup by removing useless 'rtc' prefix from fields Krzysztof Kozlowski
2015-12-30  4:47 ` [rtc-linux] [PATCH v2 2/3] rtc: s5m: Add separate field for storing auto-cleared mask in register config Krzysztof Kozlowski
2015-12-30 10:09   ` Alim Akhtar [this message]
2015-12-30  4:47 ` [rtc-linux] [PATCH v2 3/3] rtc: s5m: Make register configuration per S2MPS device to remove exceptions Krzysztof Kozlowski
2015-12-30 10:14   ` [rtc-linux] " Alim Akhtar
2015-12-30 12:26     ` Krzysztof Kozlowski
2016-01-11  9:42   ` Lee Jones
2015-12-30 10:06 ` [rtc-linux] Re: [PATCH v2 1/3] rtc: s5m: Cleanup by removing useless 'rtc' prefix from fields Alim Akhtar
2016-01-04 17:08 ` Alexandre Belloni
2016-01-04 23:53   ` Krzysztof Kozlowski
2016-01-05  0:04     ` Krzysztof Kozlowski
2016-01-05  0:07       ` Alexandre Belloni
2016-01-11 19:25       ` Alexandre Belloni

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=5683AD40.2010609@samsung.com \
    --to=alim.akhtar@samsung.com \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@free-electrons.com \
    --cc=k.kozlowski@samsung.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=rtc-linux@googlegroups.com \
    --cc=sbkim73@samsung.com \
    --cc=yadi.brar01@gmail.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