rtc-sun6i.c (754451342fc5954061ede74b0a8485ec4a4c6eaa) rtc-sun6i.c (09018d4bd7994c2c9f775029bc24589bc85f76fa)
1/*
2 * An RTC driver for Allwinner A31/A23
3 *
4 * Copyright (c) 2014, Chen-Yu Tsai <wens@csie.org>
5 *
6 * based on rtc-sunxi.c
7 *
8 * An RTC driver for Allwinner A10/A20

--- 60 unchanged lines hidden (view full) ---

69#define SUN6I_ALRM1_IRQ_STA 0x004c
70#define SUN6I_ALRM1_IRQ_STA_WEEK_IRQ_PEND BIT(0)
71
72/* Alarm config */
73#define SUN6I_ALARM_CONFIG 0x0050
74#define SUN6I_ALARM_CONFIG_WAKEUP BIT(0)
75
76#define SUN6I_LOSC_OUT_GATING 0x0060
1/*
2 * An RTC driver for Allwinner A31/A23
3 *
4 * Copyright (c) 2014, Chen-Yu Tsai <wens@csie.org>
5 *
6 * based on rtc-sunxi.c
7 *
8 * An RTC driver for Allwinner A10/A20

--- 60 unchanged lines hidden (view full) ---

69#define SUN6I_ALRM1_IRQ_STA 0x004c
70#define SUN6I_ALRM1_IRQ_STA_WEEK_IRQ_PEND BIT(0)
71
72/* Alarm config */
73#define SUN6I_ALARM_CONFIG 0x0050
74#define SUN6I_ALARM_CONFIG_WAKEUP BIT(0)
75
76#define SUN6I_LOSC_OUT_GATING 0x0060
77#define SUN6I_LOSC_OUT_GATING_EN BIT(0)
77#define SUN6I_LOSC_OUT_GATING_EN_OFFSET 0
78
79/*
80 * Get date values
81 */
82#define SUN6I_DATE_GET_DAY_VALUE(x) ((x) & 0x0000001f)
83#define SUN6I_DATE_GET_MON_VALUE(x) (((x) & 0x00000f00) >> 8)
84#define SUN6I_DATE_GET_YEAR_VALUE(x) (((x) & 0x003f0000) >> 16)
85#define SUN6I_LEAP_GET_VALUE(x) (((x) & 0x00400000) >> 22)

--- 164 unchanged lines hidden (view full) ---

250 pr_crit("Couldn't register the LOSC clock\n");
251 return;
252 }
253
254 of_property_read_string_index(node, "clock-output-names", 1,
255 &clkout_name);
256 rtc->ext_losc = clk_register_gate(NULL, clkout_name, rtc->hw.init->name,
257 0, rtc->base + SUN6I_LOSC_OUT_GATING,
78
79/*
80 * Get date values
81 */
82#define SUN6I_DATE_GET_DAY_VALUE(x) ((x) & 0x0000001f)
83#define SUN6I_DATE_GET_MON_VALUE(x) (((x) & 0x00000f00) >> 8)
84#define SUN6I_DATE_GET_YEAR_VALUE(x) (((x) & 0x003f0000) >> 16)
85#define SUN6I_LEAP_GET_VALUE(x) (((x) & 0x00400000) >> 22)

--- 164 unchanged lines hidden (view full) ---

250 pr_crit("Couldn't register the LOSC clock\n");
251 return;
252 }
253
254 of_property_read_string_index(node, "clock-output-names", 1,
255 &clkout_name);
256 rtc->ext_losc = clk_register_gate(NULL, clkout_name, rtc->hw.init->name,
257 0, rtc->base + SUN6I_LOSC_OUT_GATING,
258 SUN6I_LOSC_OUT_GATING_EN, 0,
258 SUN6I_LOSC_OUT_GATING_EN_OFFSET, 0,
259 &rtc->lock);
260 if (IS_ERR(rtc->ext_losc)) {
261 pr_crit("Couldn't register the LOSC external gate\n");
262 return;
263 }
264
265 clk_data->num = 2;
266 clk_data->hws[0] = &rtc->hw;

--- 329 unchanged lines hidden ---
259 &rtc->lock);
260 if (IS_ERR(rtc->ext_losc)) {
261 pr_crit("Couldn't register the LOSC external gate\n");
262 return;
263 }
264
265 clk_data->num = 2;
266 clk_data->hws[0] = &rtc->hw;

--- 329 unchanged lines hidden ---