aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <k.kozlowski@samsung.com>2015-02-06 06:24:47 -0500
committerLee Jones <lee.jones@linaro.org>2015-03-03 11:41:22 -0500
commit2600abca149745deeb4cc9272bc3640a88815485 (patch)
treedd135dd8f403b7799984a80c59429c233780ff8e /drivers/rtc
parent0523b8f41473c3d869adebeb029b5dc045ab35d8 (diff)
rtc: s5m: Remove unused watchdog and sudden momentary power loss
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> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-s5m.c60
1 files changed, 0 insertions, 60 deletions
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 {
48 unsigned int alarm0; 48 unsigned int alarm0;
49 /* First register for alarm 1, seconds */ 49 /* First register for alarm 1, seconds */
50 unsigned int alarm1; 50 unsigned int alarm1;
51 /* SMPL/WTSR register */
52 unsigned int smpl_wtsr;
53 /* 51 /*
54 * Register for update flag (UDR). Typically setting UDR field to 1 52 * Register for update flag (UDR). Typically setting UDR field to 1
55 * will enable update of time or alarm register. Then it will be 53 * 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 = {
67 .ctrl = S5M_ALARM1_CONF, 65 .ctrl = S5M_ALARM1_CONF,
68 .alarm0 = S5M_ALARM0_SEC, 66 .alarm0 = S5M_ALARM0_SEC,
69 .alarm1 = S5M_ALARM1_SEC, 67 .alarm1 = S5M_ALARM1_SEC,
70 .smpl_wtsr = S5M_WTSR_SMPL_CNTL,
71 .rtc_udr_update = S5M_RTC_UDR_CON, 68 .rtc_udr_update = S5M_RTC_UDR_CON,
72 .rtc_udr_mask = S5M_RTC_UDR_MASK, 69 .rtc_udr_mask = S5M_RTC_UDR_MASK,
73}; 70};
@@ -82,7 +79,6 @@ static const struct s5m_rtc_reg_config s2mps_rtc_regs = {
82 .ctrl = S2MPS_RTC_CTRL, 79 .ctrl = S2MPS_RTC_CTRL,
83 .alarm0 = S2MPS_ALARM0_SEC, 80 .alarm0 = S2MPS_ALARM0_SEC,
84 .alarm1 = S2MPS_ALARM1_SEC, 81 .alarm1 = S2MPS_ALARM1_SEC,
85 .smpl_wtsr = S2MPS_WTSR_SMPL_CNTL,
86 .rtc_udr_update = S2MPS_RTC_UDR_CON, 82 .rtc_udr_update = S2MPS_RTC_UDR_CON,
87 .rtc_udr_mask = S2MPS_RTC_WUDR_MASK, 83 .rtc_udr_mask = S2MPS_RTC_WUDR_MASK,
88}; 84};
@@ -96,7 +92,6 @@ struct s5m_rtc_info {
96 int irq; 92 int irq;
97 int device_type; 93 int device_type;
98 int rtc_24hr_mode; 94 int rtc_24hr_mode;
99 bool wtsr_smpl;
100 const struct s5m_rtc_reg_config *regs; 95 const struct s5m_rtc_reg_config *regs;
101}; 96};
102 97
@@ -597,28 +592,6 @@ static const struct rtc_class_ops s5m_rtc_ops = {
597 .alarm_irq_enable = s5m_rtc_alarm_irq_enable, 592 .alarm_irq_enable = s5m_rtc_alarm_irq_enable,
598}; 593};
599 594
600static void s5m_rtc_enable_wtsr(struct s5m_rtc_info *info, bool enable)
601{
602 int ret;
603 ret = regmap_update_bits(info->regmap, info->regs->smpl_wtsr,
604 WTSR_ENABLE_MASK,
605 enable ? WTSR_ENABLE_MASK : 0);
606 if (ret < 0)
607 dev_err(info->dev, "%s: fail to update WTSR reg(%d)\n",
608 __func__, ret);
609}
610
611static void s5m_rtc_enable_smpl(struct s5m_rtc_info *info, bool enable)
612{
613 int ret;
614 ret = regmap_update_bits(info->regmap, info->regs->smpl_wtsr,
615 SMPL_ENABLE_MASK,
616 enable ? SMPL_ENABLE_MASK : 0);
617 if (ret < 0)
618 dev_err(info->dev, "%s: fail to update SMPL reg(%d)\n",
619 __func__, ret);
620}
621
622static int s5m8767_rtc_init_reg(struct s5m_rtc_info *info) 595static int s5m8767_rtc_init_reg(struct s5m_rtc_info *info)
623{ 596{
624 u8 data[2]; 597 u8 data[2];
@@ -715,7 +688,6 @@ static int s5m_rtc_probe(struct platform_device *pdev)
715 info->dev = &pdev->dev; 688 info->dev = &pdev->dev;
716 info->s5m87xx = s5m87xx; 689 info->s5m87xx = s5m87xx;
717 info->device_type = s5m87xx->device_type; 690 info->device_type = s5m87xx->device_type;
718 info->wtsr_smpl = s5m87xx->wtsr_smpl;
719 691
720 if (s5m87xx->irq_data) { 692 if (s5m87xx->irq_data) {
721 info->irq = regmap_irq_get_virq(s5m87xx->irq_data, alarm_irq); 693 info->irq = regmap_irq_get_virq(s5m87xx->irq_data, alarm_irq);
@@ -731,11 +703,6 @@ static int s5m_rtc_probe(struct platform_device *pdev)
731 703
732 ret = s5m8767_rtc_init_reg(info); 704 ret = s5m8767_rtc_init_reg(info);
733 705
734 if (info->wtsr_smpl) {
735 s5m_rtc_enable_wtsr(info, true);
736 s5m_rtc_enable_smpl(info, true);
737 }
738
739 device_init_wakeup(&pdev->dev, 1); 706 device_init_wakeup(&pdev->dev, 1);
740 707
741 info->rtc_dev = devm_rtc_device_register(&pdev->dev, "s5m-rtc", 708 info->rtc_dev = devm_rtc_device_register(&pdev->dev, "s5m-rtc",
@@ -768,36 +735,10 @@ err:
768 return ret; 735 return ret;
769} 736}
770 737
771static void s5m_rtc_shutdown(struct platform_device *pdev)
772{
773 struct s5m_rtc_info *info = platform_get_drvdata(pdev);
774 int i;
775 unsigned int val = 0;
776 if (info->wtsr_smpl) {
777 for (i = 0; i < 3; i++) {
778 s5m_rtc_enable_wtsr(info, false);
779 regmap_read(info->regmap, info->regs->smpl_wtsr, &val);
780 pr_debug("%s: WTSR_SMPL reg(0x%02x)\n", __func__, val);
781 if (val & WTSR_ENABLE_MASK)
782 pr_emerg("%s: fail to disable WTSR\n",
783 __func__);
784 else {
785 pr_info("%s: success to disable WTSR\n",
786 __func__);
787 break;
788 }
789 }
790 }
791 /* Disable SMPL when power off */
792 s5m_rtc_enable_smpl(info, false);
793}
794
795static int s5m_rtc_remove(struct platform_device *pdev) 738static int s5m_rtc_remove(struct platform_device *pdev)
796{ 739{
797 struct s5m_rtc_info *info = platform_get_drvdata(pdev); 740 struct s5m_rtc_info *info = platform_get_drvdata(pdev);
798 741
799 /* Perform also all shutdown steps when removing */
800 s5m_rtc_shutdown(pdev);
801 i2c_unregister_device(info->i2c); 742 i2c_unregister_device(info->i2c);
802 743
803 return 0; 744 return 0;
@@ -842,7 +783,6 @@ static struct platform_driver s5m_rtc_driver = {
842 }, 783 },
843 .probe = s5m_rtc_probe, 784 .probe = s5m_rtc_probe,
844 .remove = s5m_rtc_remove, 785 .remove = s5m_rtc_remove,
845 .shutdown = s5m_rtc_shutdown,
846 .id_table = s5m_rtc_id, 786 .id_table = s5m_rtc_id,
847}; 787};
848 788