rtc: Fix naming of RTC symbols

These symbols have the same name as the symbols from lib QMSI, which
causes a compilation failure, when lib QMSI is used.

This replaces the offending symbols with names which are more consistent
with the rest of the file (rtc_ prefix).

Change-Id: I288a1a229bf0b40f3b6fc8ffb35c502f998054b8
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
This commit is contained in:
Vinicius Costa Gomes 2015-12-18 18:47:17 -02:00 committed by Anas Nashif
commit 45dcfe1478
2 changed files with 20 additions and 23 deletions

View file

@ -24,7 +24,7 @@
#include "rtc_dw.h"
#define CLK_RTC_DIV_DEF_MASK (0xFFFFFF83)
#define RTC_CLK_DIV_DEF_MASK (0xFFFFFF83)
#define CCU_RTC_CLK_DIV_EN (2)
#ifdef RTC_DW_INT_MASK
@ -76,7 +76,7 @@ static void rtc_dw_set_div(const enum clk_rtc_div div)
{
/* set default division mask */
uint32_t reg =
sys_read32(CLOCK_SYSTEM_CLOCK_CONTROL) & CLK_RTC_DIV_DEF_MASK;
sys_read32(CLOCK_SYSTEM_CLOCK_CONTROL) & RTC_CLK_DIV_DEF_MASK;
reg |= (div << CCU_RTC_CLK_DIV_OFFSET);
sys_write32(reg, CLOCK_SYSTEM_CLOCK_CONTROL);
/* CLK Div en bit must be written from 0 -> 1 to apply new value */

View file

@ -21,31 +21,28 @@
#include <misc/util.h>
enum clk_rtc_div {
CLK_RTC_DIV_1,
CLK_RTC_DIV_2,
CLK_RTC_DIV_4,
CLK_RTC_DIV_8,
CLK_RTC_DIV_16,
CLK_RTC_DIV_32,
CLK_RTC_DIV_64,
CLK_RTC_DIV_128,
CLK_RTC_DIV_256,
CLK_RTC_DIV_512,
CLK_RTC_DIV_1024,
CLK_RTC_DIV_2048,
CLK_RTC_DIV_4096,
CLK_RTC_DIV_8192,
CLK_RTC_DIV_16384,
CLK_RTC_DIV_32768
RTC_CLK_DIV_1,
RTC_CLK_DIV_2,
RTC_CLK_DIV_4,
RTC_CLK_DIV_8,
RTC_CLK_DIV_16,
RTC_CLK_DIV_32,
RTC_CLK_DIV_64,
RTC_CLK_DIV_128,
RTC_CLK_DIV_256,
RTC_CLK_DIV_512,
RTC_CLK_DIV_1024,
RTC_CLK_DIV_2048,
RTC_CLK_DIV_4096,
RTC_CLK_DIV_8192,
RTC_CLK_DIV_16384,
RTC_CLK_DIV_32768
};
#ifndef BIT
#define BIT(n) (1UL << (n))
#endif
#define RTC_DIVIDER CLK_RTC_DIV_1
#define RTC_DIVIDER RTC_CLK_DIV_1
/** Number of RTC ticks in a second */
#define RTC_ALARM_SECOND (32768 / BIT(RTC_DIVIDER))
#define RTC_ALARM_SECOND (32768 / (1UL << RTC_DIVIDER))
/** Number of RTC ticks in a minute */
#define RTC_ALARM_MINUTE (RTC_ALARM_SECOND * 60)