aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
authorJavier Martinez Canillas <javier.martinez@collabora.co.uk>2014-10-13 18:52:57 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-10-13 20:18:18 -0400
commit6b50fac5ddb9748487aab3c5f8d323da01a6648f (patch)
treec213f1c799b028267703dc33b24e13c38e1be823 /drivers/rtc
parente7f7fc73693e0a9de693f261d63aa681f7979c33 (diff)
rtc: max77686: remove dead code for SMPL and WTSR
The MAX77686 RTC chip has two features called SMPL (Sudden Momentary Power Loss) and WTSR (Watchdog Timeout and Software Resets). Support for these features seems to be implemented in the driver but compilation is disabled using a C pre-processor conditional. This code has been disabled since the driver was original merged in commit fca1dd031a28 ("rtc: max77686: add Maxim 77686 driver"). So, since this code has never been built, let's just remove it. Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Cc: Doug Anderson <dianders@chromium.org> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Olof Johansson <olof@lixom.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-max77686.c101
1 files changed, 0 insertions, 101 deletions
diff --git a/drivers/rtc/rtc-max77686.c b/drivers/rtc/rtc-max77686.c
index c1c6055ccb71..7bb543344369 100644
--- a/drivers/rtc/rtc-max77686.c
+++ b/drivers/rtc/rtc-max77686.c
@@ -32,15 +32,6 @@
32#define RTC_UDR_MASK (1 << RTC_UDR_SHIFT) 32#define RTC_UDR_MASK (1 << RTC_UDR_SHIFT)
33#define RTC_RBUDR_SHIFT 4 33#define RTC_RBUDR_SHIFT 4
34#define RTC_RBUDR_MASK (1 << RTC_RBUDR_SHIFT) 34#define RTC_RBUDR_MASK (1 << RTC_RBUDR_SHIFT)
35/* WTSR and SMPL Register */
36#define WTSRT_SHIFT 0
37#define SMPLT_SHIFT 2
38#define WTSR_EN_SHIFT 6
39#define SMPL_EN_SHIFT 7
40#define WTSRT_MASK (3 << WTSRT_SHIFT)
41#define SMPLT_MASK (3 << SMPLT_SHIFT)
42#define WTSR_EN_MASK (1 << WTSR_EN_SHIFT)
43#define SMPL_EN_MASK (1 << SMPL_EN_SHIFT)
44/* RTC Hour register */ 35/* RTC Hour register */
45#define HOUR_PM_SHIFT 6 36#define HOUR_PM_SHIFT 6
46#define HOUR_PM_MASK (1 << HOUR_PM_SHIFT) 37#define HOUR_PM_MASK (1 << HOUR_PM_SHIFT)
@@ -49,7 +40,6 @@
49#define ALARM_ENABLE_MASK (1 << ALARM_ENABLE_SHIFT) 40#define ALARM_ENABLE_MASK (1 << ALARM_ENABLE_SHIFT)
50 41
51#define MAX77686_RTC_UPDATE_DELAY 16 42#define MAX77686_RTC_UPDATE_DELAY 16
52#undef MAX77686_RTC_WTSR_SMPL
53 43
54enum { 44enum {
55 RTC_SEC = 0, 45 RTC_SEC = 0,
@@ -412,64 +402,6 @@ static const struct rtc_class_ops max77686_rtc_ops = {
412 .alarm_irq_enable = max77686_rtc_alarm_irq_enable, 402 .alarm_irq_enable = max77686_rtc_alarm_irq_enable,
413}; 403};
414 404
415#ifdef MAX77686_RTC_WTSR_SMPL
416static void max77686_rtc_enable_wtsr(struct max77686_rtc_info *info, bool enable)
417{
418 int ret;
419 unsigned int val, mask;
420
421 if (enable)
422 val = (1 << WTSR_EN_SHIFT) | (3 << WTSRT_SHIFT);
423 else
424 val = 0;
425
426 mask = WTSR_EN_MASK | WTSRT_MASK;
427
428 dev_info(info->dev, "%s: %s WTSR\n", __func__,
429 enable ? "enable" : "disable");
430
431 ret = regmap_update_bits(info->max77686->rtc_regmap,
432 MAX77686_WTSR_SMPL_CNTL, mask, val);
433 if (ret < 0) {
434 dev_err(info->dev, "%s: fail to update WTSR reg(%d)\n",
435 __func__, ret);
436 return;
437 }
438
439 max77686_rtc_update(info, MAX77686_RTC_WRITE);
440}
441
442static void max77686_rtc_enable_smpl(struct max77686_rtc_info *info, bool enable)
443{
444 int ret;
445 unsigned int val, mask;
446
447 if (enable)
448 val = (1 << SMPL_EN_SHIFT) | (0 << SMPLT_SHIFT);
449 else
450 val = 0;
451
452 mask = SMPL_EN_MASK | SMPLT_MASK;
453
454 dev_info(info->dev, "%s: %s SMPL\n", __func__,
455 enable ? "enable" : "disable");
456
457 ret = regmap_update_bits(info->max77686->rtc_regmap,
458 MAX77686_WTSR_SMPL_CNTL, mask, val);
459 if (ret < 0) {
460 dev_err(info->dev, "%s: fail to update SMPL reg(%d)\n",
461 __func__, ret);
462 return;
463 }
464
465 max77686_rtc_update(info, MAX77686_RTC_WRITE);
466
467 val = 0;
468 regmap_read(info->max77686->rtc_regmap, MAX77686_WTSR_SMPL_CNTL, &val);
469 dev_info(info->dev, "%s: WTSR_SMPL(0x%02x)\n", __func__, val);
470}
471#endif /* MAX77686_RTC_WTSR_SMPL */
472
473static int max77686_rtc_init_reg(struct max77686_rtc_info *info) 405static int max77686_rtc_init_reg(struct max77686_rtc_info *info)
474{ 406{
475 u8 data[2]; 407 u8 data[2];
@@ -519,11 +451,6 @@ static int max77686_rtc_probe(struct platform_device *pdev)
519 goto err_rtc; 451 goto err_rtc;
520 } 452 }
521 453
522#ifdef MAX77686_RTC_WTSR_SMPL
523 max77686_rtc_enable_wtsr(info, true);
524 max77686_rtc_enable_smpl(info, true);
525#endif
526
527 device_init_wakeup(&pdev->dev, 1); 454 device_init_wakeup(&pdev->dev, 1);
528 455
529 info->rtc_dev = devm_rtc_device_register(&pdev->dev, "max77686-rtc", 456 info->rtc_dev = devm_rtc_device_register(&pdev->dev, "max77686-rtc",
@@ -556,33 +483,6 @@ err_rtc:
556 return ret; 483 return ret;
557} 484}
558 485
559static void max77686_rtc_shutdown(struct platform_device *pdev)
560{
561#ifdef MAX77686_RTC_WTSR_SMPL
562 struct max77686_rtc_info *info = platform_get_drvdata(pdev);
563 int i;
564 u8 val = 0;
565
566 for (i = 0; i < 3; i++) {
567 max77686_rtc_enable_wtsr(info, false);
568 regmap_read(info->max77686->rtc_regmap, MAX77686_WTSR_SMPL_CNTL, &val);
569 dev_info(info->dev, "%s: WTSR_SMPL reg(0x%02x)\n", __func__,
570 val);
571 if (val & WTSR_EN_MASK) {
572 dev_emerg(info->dev, "%s: fail to disable WTSR\n",
573 __func__);
574 } else {
575 dev_info(info->dev, "%s: success to disable WTSR\n",
576 __func__);
577 break;
578 }
579 }
580
581 /* Disable SMPL when power off */
582 max77686_rtc_enable_smpl(info, false);
583#endif /* MAX77686_RTC_WTSR_SMPL */
584}
585
586#ifdef CONFIG_PM_SLEEP 486#ifdef CONFIG_PM_SLEEP
587static int max77686_rtc_suspend(struct device *dev) 487static int max77686_rtc_suspend(struct device *dev)
588{ 488{
@@ -622,7 +522,6 @@ static struct platform_driver max77686_rtc_driver = {
622 .pm = &max77686_rtc_pm_ops, 522 .pm = &max77686_rtc_pm_ops,
623 }, 523 },
624 .probe = max77686_rtc_probe, 524 .probe = max77686_rtc_probe,
625 .shutdown = max77686_rtc_shutdown,
626 .id_table = rtc_id, 525 .id_table = rtc_id,
627}; 526};
628 527