public inbox for linux-kernel@vger.kernel.org
 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
Subject: Re: [PATCH v2 1/3] rtc: s5m: Remove unused watchdog and sudden momentary power loss
Date: Thu, 26 Feb 2015 10:47:15 +0000	[thread overview]
Message-ID: <20150226104715.GL6688@x1> (raw)
In-Reply-To: <1424942031-28370-1-git-send-email-k.kozlowski@samsung.com>

On Thu, 26 Feb 2015, Krzysztof Kozlowski wrote:

> The WTSR (Watchdog Timer Software Reset) and SMPL (Sudden Momentary
> Power Loss) are never enabled. These are left-overs from board files.
> After removing them the driver's shutdown callback is empty so get rid
> of it as well.
> 
> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> ---
> Changes since v1:
> 1. None. Patch applied by Andrew Morton. Resending for Lee Jones.
> ---
>  drivers/rtc/rtc-s5m.c | 60 ---------------------------------------------------
>  1 file changed, 60 deletions(-)

Due to dependencies with other patches I'll take this through MFD.

Applied, thanks.

> diff --git a/drivers/rtc/rtc-s5m.c b/drivers/rtc/rtc-s5m.c
> index 89ac1d5083c6..4008b84246ca 100644
> --- a/drivers/rtc/rtc-s5m.c
> +++ b/drivers/rtc/rtc-s5m.c
> @@ -48,8 +48,6 @@ struct s5m_rtc_reg_config {
>  	unsigned int alarm0;
>  	/* First register for alarm 1, seconds */
>  	unsigned int alarm1;
> -	/* SMPL/WTSR register */
> -	unsigned int smpl_wtsr;
>  	/*
>  	 * Register for update flag (UDR). Typically setting UDR field to 1
>  	 * will enable update of time or alarm register. Then it will be
> @@ -67,7 +65,6 @@ static const struct s5m_rtc_reg_config s5m_rtc_regs = {
>  	.ctrl			= S5M_ALARM1_CONF,
>  	.alarm0			= S5M_ALARM0_SEC,
>  	.alarm1			= S5M_ALARM1_SEC,
> -	.smpl_wtsr		= S5M_WTSR_SMPL_CNTL,
>  	.rtc_udr_update		= S5M_RTC_UDR_CON,
>  	.rtc_udr_mask		= S5M_RTC_UDR_MASK,
>  };
> @@ -82,7 +79,6 @@ static const struct s5m_rtc_reg_config s2mps_rtc_regs = {
>  	.ctrl			= S2MPS_RTC_CTRL,
>  	.alarm0			= S2MPS_ALARM0_SEC,
>  	.alarm1			= S2MPS_ALARM1_SEC,
> -	.smpl_wtsr		= S2MPS_WTSR_SMPL_CNTL,
>  	.rtc_udr_update		= S2MPS_RTC_UDR_CON,
>  	.rtc_udr_mask		= S2MPS_RTC_WUDR_MASK,
>  };
> @@ -96,7 +92,6 @@ struct s5m_rtc_info {
>  	int irq;
>  	int device_type;
>  	int rtc_24hr_mode;
> -	bool wtsr_smpl;
>  	const struct s5m_rtc_reg_config	*regs;
>  };
>  
> @@ -597,28 +592,6 @@ static const struct rtc_class_ops s5m_rtc_ops = {
>  	.alarm_irq_enable = s5m_rtc_alarm_irq_enable,
>  };
>  
> -static void s5m_rtc_enable_wtsr(struct s5m_rtc_info *info, bool enable)
> -{
> -	int ret;
> -	ret = regmap_update_bits(info->regmap, info->regs->smpl_wtsr,
> -				 WTSR_ENABLE_MASK,
> -				 enable ? WTSR_ENABLE_MASK : 0);
> -	if (ret < 0)
> -		dev_err(info->dev, "%s: fail to update WTSR reg(%d)\n",
> -			__func__, ret);
> -}
> -
> -static void s5m_rtc_enable_smpl(struct s5m_rtc_info *info, bool enable)
> -{
> -	int ret;
> -	ret = regmap_update_bits(info->regmap, info->regs->smpl_wtsr,
> -				 SMPL_ENABLE_MASK,
> -				 enable ? SMPL_ENABLE_MASK : 0);
> -	if (ret < 0)
> -		dev_err(info->dev, "%s: fail to update SMPL reg(%d)\n",
> -			__func__, ret);
> -}
> -
>  static int s5m8767_rtc_init_reg(struct s5m_rtc_info *info)
>  {
>  	u8 data[2];
> @@ -715,7 +688,6 @@ static int s5m_rtc_probe(struct platform_device *pdev)
>  	info->dev = &pdev->dev;
>  	info->s5m87xx = s5m87xx;
>  	info->device_type = s5m87xx->device_type;
> -	info->wtsr_smpl = s5m87xx->wtsr_smpl;
>  
>  	if (s5m87xx->irq_data) {
>  		info->irq = regmap_irq_get_virq(s5m87xx->irq_data, alarm_irq);
> @@ -731,11 +703,6 @@ static int s5m_rtc_probe(struct platform_device *pdev)
>  
>  	ret = s5m8767_rtc_init_reg(info);
>  
> -	if (info->wtsr_smpl) {
> -		s5m_rtc_enable_wtsr(info, true);
> -		s5m_rtc_enable_smpl(info, true);
> -	}
> -
>  	device_init_wakeup(&pdev->dev, 1);
>  
>  	info->rtc_dev = devm_rtc_device_register(&pdev->dev, "s5m-rtc",
> @@ -768,36 +735,10 @@ err:
>  	return ret;
>  }
>  
> -static void s5m_rtc_shutdown(struct platform_device *pdev)
> -{
> -	struct s5m_rtc_info *info = platform_get_drvdata(pdev);
> -	int i;
> -	unsigned int val = 0;
> -	if (info->wtsr_smpl) {
> -		for (i = 0; i < 3; i++) {
> -			s5m_rtc_enable_wtsr(info, false);
> -			regmap_read(info->regmap, info->regs->smpl_wtsr, &val);
> -			pr_debug("%s: WTSR_SMPL reg(0x%02x)\n", __func__, val);
> -			if (val & WTSR_ENABLE_MASK)
> -				pr_emerg("%s: fail to disable WTSR\n",
> -					 __func__);
> -			else {
> -				pr_info("%s: success to disable WTSR\n",
> -					__func__);
> -				break;
> -			}
> -		}
> -	}
> -	/* Disable SMPL when power off */
> -	s5m_rtc_enable_smpl(info, false);
> -}
> -
>  static int s5m_rtc_remove(struct platform_device *pdev)
>  {
>  	struct s5m_rtc_info *info = platform_get_drvdata(pdev);
>  
> -	/* Perform also all shutdown steps when removing */
> -	s5m_rtc_shutdown(pdev);
>  	i2c_unregister_device(info->i2c);
>  
>  	return 0;
> @@ -842,7 +783,6 @@ static struct platform_driver s5m_rtc_driver = {
>  	},
>  	.probe		= s5m_rtc_probe,
>  	.remove		= s5m_rtc_remove,
> -	.shutdown	= s5m_rtc_shutdown,
>  	.id_table	= s5m_rtc_id,
>  };
>  

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

      parent reply	other threads:[~2015-02-26 10:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-26  9:13 [PATCH v2 1/3] rtc: s5m: Remove unused watchdog and sudden momentary power loss Krzysztof Kozlowski
2015-02-26  9:13 ` [PATCH v2 2/3] mfd: sec: Cleanup unused RTC fields: ono, WTSR and SMPL Krzysztof Kozlowski
2015-02-26 11:01   ` Lee Jones
2015-02-26  9:13 ` [PATCH v2 3/3] mfd: sec: Remove unnecessary out of memory message Krzysztof Kozlowski
2015-02-26 11:01   ` Lee Jones
2015-02-26 10:47 ` Lee Jones [this message]

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=20150226104715.GL6688@x1 \
    --to=lee.jones@linaro.org \
    --cc=k.kozlowski@samsung.com \
    --cc=linux-kernel@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