tree: https://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux.git rtc-next head: 2394261b480c677380df432a1c1a712eeb25f386 commit: 294e17d1a6ae28f1d11f93f92b76c37bb9083968 [1/3] rtc: cmos: allow using ACPI for RTC alarm instead of HPET config: x86_64-randconfig-x015-201815 (attached as .config) compiler: gcc-7 (Debian 7.3.0-16) 7.3.0 reproduce: git checkout 294e17d1a6ae28f1d11f93f92b76c37bb9083968 # save the attached .config to linux build tree make ARCH=x86_64
All errors (new ones prefixed by >>):
In file included from include/linux/platform_device.h:14:0,
from drivers//rtc/rtc-cmos.c:39:
drivers//rtc/rtc-cmos.c: In function 'cmos_do_probe':
>> drivers//rtc/rtc-cmos.c:863:4: error: implicit declaration of function
>> 'use_hpet_enabled'; did you mean 'is_hpet_enabled'?
>> [-Werror=implicit-function-declaration]
use_hpet_enabled() ? ", hpet irqs" : "");
^
include/linux/device.h:1382:58: note: in definition of macro 'dev_info'
#define dev_info(dev, fmt, arg...) _dev_info(dev, fmt, ##arg)
^~~
cc1: some warnings being treated as errors
vim +863 drivers//rtc/rtc-cmos.c
688
689 static int INITSECTION
690 cmos_do_probe(struct device *dev, struct resource *ports, int rtc_irq)
691 {
692 struct cmos_rtc_board_info *info = dev_get_platdata(dev);
693 int retval = 0;
694 unsigned char rtc_control;
695 unsigned address_space;
696 u32 flags = 0;
697 struct nvmem_config nvmem_cfg = {
698 .name = "cmos_nvram",
699 .word_size = 1,
700 .stride = 1,
701 .reg_read = cmos_nvram_read,
702 .reg_write = cmos_nvram_write,
703 .priv = &cmos_rtc,
704 };
705
706 /* there can be only one ... */
707 if (cmos_rtc.dev)
708 return -EBUSY;
709
710 if (!ports)
711 return -ENODEV;
712
713 /* Claim I/O ports ASAP, minimizing conflict with legacy driver.
714 *
715 * REVISIT non-x86 systems may instead use memory space
resources
716 * (needing ioremap etc), not i/o space resources like this ...
717 */
718 if (RTC_IOMAPPED)
719 ports = request_region(ports->start,
resource_size(ports),
720 driver_name);
721 else
722 ports = request_mem_region(ports->start,
resource_size(ports),
723 driver_name);
724 if (!ports) {
725 dev_dbg(dev, "i/o registers already in use\n");
726 return -EBUSY;
727 }
728
729 cmos_rtc.irq = rtc_irq;
730 cmos_rtc.iomem = ports;
731
732 /* Heuristic to deduce NVRAM size ... do what the legacy NVRAM
733 * driver did, but don't reject unknown configs. Old hardware
734 * won't address 128 bytes. Newer chips have multiple banks,
735 * though they may not be listed in one I/O resource.
736 */
737 #if defined(CONFIG_ATARI)
738 address_space = 64;
739 #elif defined(__i386__) || defined(__x86_64__) || defined(__arm__) \
740 || defined(__sparc__) || defined(__mips__) \
741 || defined(__powerpc__)
742 address_space = 128;
743 #else
744 #warning Assuming 128 bytes of RTC+NVRAM address space, not 64 bytes.
745 address_space = 128;
746 #endif
747 if (can_bank2 && ports->end > (ports->start + 1))
748 address_space = 256;
749
750 /* For ACPI systems extension info comes from the FADT. On
others,
751 * board specific setup provides it as appropriate. Systems
where
752 * the alarm IRQ isn't automatically a wakeup IRQ (like ACPI,
and
753 * some almost-clones) can provide hooks to make that behave.
754 *
755 * Note that ACPI doesn't preclude putting these registers into
756 * "extended" areas of the chip, including some that we won't
yet
757 * expect CMOS_READ and friends to handle.
758 */
759 if (info) {
760 if (info->flags)
761 flags = info->flags;
762 if (info->address_space)
763 address_space = info->address_space;
764
765 if (info->rtc_day_alarm && info->rtc_day_alarm < 128)
766 cmos_rtc.day_alrm = info->rtc_day_alarm;
767 if (info->rtc_mon_alarm && info->rtc_mon_alarm < 128)
768 cmos_rtc.mon_alrm = info->rtc_mon_alarm;
769 if (info->rtc_century && info->rtc_century < 128)
770 cmos_rtc.century = info->rtc_century;
771
772 if (info->wake_on && info->wake_off) {
773 cmos_rtc.wake_on = info->wake_on;
774 cmos_rtc.wake_off = info->wake_off;
775 }
776 }
777
778 cmos_rtc.dev = dev;
779 dev_set_drvdata(dev, &cmos_rtc);
780
781 cmos_rtc.rtc = devm_rtc_allocate_device(dev);
782 if (IS_ERR(cmos_rtc.rtc)) {
783 retval = PTR_ERR(cmos_rtc.rtc);
784 goto cleanup0;
785 }
786
787 rename_region(ports, dev_name(&cmos_rtc.rtc->dev));
788
789 spin_lock_irq(&rtc_lock);
790
791 if (!(flags & CMOS_RTC_FLAGS_NOFREQ)) {
792 /* force periodic irq to CMOS reset default of 1024Hz;
793 *
794 * REVISIT it's been reported that at least one x86_64
ALI
795 * mobo doesn't use 32KHz here ... for portability we
might
796 * need to do something about other clock frequencies.
797 */
798 cmos_rtc.rtc->irq_freq = 1024;
799 if (use_hpet_alarm())
800 hpet_set_periodic_freq(cmos_rtc.rtc->irq_freq);
801 CMOS_WRITE(RTC_REF_CLCK_32KHZ | 0x06, RTC_FREQ_SELECT);
802 }
803
804 /* disable irqs */
805 if (is_valid_irq(rtc_irq))
806 cmos_irq_disable(&cmos_rtc, RTC_PIE | RTC_AIE |
RTC_UIE);
807
808 rtc_control = CMOS_READ(RTC_CONTROL);
809
810 spin_unlock_irq(&rtc_lock);
811
812 if (is_valid_irq(rtc_irq) && !(rtc_control & RTC_24H)) {
813 dev_warn(dev, "only 24-hr supported\n");
814 retval = -ENXIO;
815 goto cleanup1;
816 }
817
818 if (use_hpet_alarm())
819 hpet_rtc_timer_init();
820
821 if (is_valid_irq(rtc_irq)) {
822 irq_handler_t rtc_cmos_int_handler;
823
824 if (use_hpet_alarm()) {
825 rtc_cmos_int_handler = hpet_rtc_interrupt;
826 retval =
hpet_register_irq_handler(cmos_interrupt);
827 if (retval) {
828 hpet_mask_rtc_irq_bit(RTC_IRQMASK);
829 dev_warn(dev,
"hpet_register_irq_handler "
830 " failed in
rtc_init().");
831 goto cleanup1;
832 }
833 } else
834 rtc_cmos_int_handler = cmos_interrupt;
835
836 retval = request_irq(rtc_irq, rtc_cmos_int_handler,
837 IRQF_SHARED,
dev_name(&cmos_rtc.rtc->dev),
838 cmos_rtc.rtc);
839 if (retval < 0) {
840 dev_dbg(dev, "IRQ %d is already in use\n",
rtc_irq);
841 goto cleanup1;
842 }
843 }
844
845 cmos_rtc.rtc->ops = &cmos_rtc_ops;
846 cmos_rtc.rtc->nvram_old_abi = true;
847 retval = rtc_register_device(cmos_rtc.rtc);
848 if (retval)
849 goto cleanup2;
850
851 /* export at least the first block of NVRAM */
852 nvmem_cfg.size = address_space - NVRAM_OFFSET;
853 if (rtc_nvmem_register(cmos_rtc.rtc, &nvmem_cfg))
854 dev_err(dev, "nvmem registration failed\n");
855
856 dev_info(dev, "%s%s, %d bytes nvram%s\n",
857 !is_valid_irq(rtc_irq) ? "no alarms" :
858 cmos_rtc.mon_alrm ? "alarms up to one year" :
859 cmos_rtc.day_alrm ? "alarms up to one month" :
860 "alarms up to one day",
861 cmos_rtc.century ? ", y3k" : "",
862 nvmem_cfg.size,
> 863 use_hpet_enabled() ? ", hpet irqs" : "");
864
865 return 0;
866
867 cleanup2:
868 if (is_valid_irq(rtc_irq))
869 free_irq(rtc_irq, cmos_rtc.rtc);
870 cleanup1:
871 cmos_rtc.dev = NULL;
872 cleanup0:
873 if (RTC_IOMAPPED)
874 release_region(ports->start, resource_size(ports));
875 else
876 release_mem_region(ports->start, resource_size(ports));
877 return retval;
878 }
879
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.
.config.gz
Description: application/gzip
