Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1299290
| From | Alim Akhtar <alim.akhtar@samsung.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2 2/3] rtc: s5m: Add separate field for storing auto-cleared mask in register config |
| Date | 2015-12-30 11:10 +0100 |
| Message-ID | <qLlRE-5fz-15@gated-at.bofh.it> (permalink) |
| References | <qLgRX-1Iu-7@gated-at.bofh.it> <qLgRX-1Iu-13@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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");
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v2 1/3] rtc: s5m: Cleanup by removing useless 'rtc' prefix from fields Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2015-12-30 05:50 +0100
[PATCH v2 3/3] rtc: s5m: Make register configuration per S2MPS device to remove exceptions Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2015-12-30 05:50 +0100
Re: [PATCH v2 3/3] rtc: s5m: Make register configuration per S2MPS device to remove exceptions Alim Akhtar <alim.akhtar@samsung.com> - 2015-12-30 11:20 +0100
Re: [rtc-linux] Re: [PATCH v2 3/3] rtc: s5m: Make register configuration per S2MPS device to remove exceptions Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2015-12-30 13:30 +0100
[PATCH v2 2/3] rtc: s5m: Add separate field for storing auto-cleared mask in register config Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2015-12-30 05:50 +0100
Re: [PATCH v2 2/3] rtc: s5m: Add separate field for storing auto-cleared mask in register config Alim Akhtar <alim.akhtar@samsung.com> - 2015-12-30 11:10 +0100
Re: [PATCH v2 1/3] rtc: s5m: Cleanup by removing useless 'rtc' prefix from fields Alim Akhtar <alim.akhtar@samsung.com> - 2015-12-30 11:10 +0100
csiph-web