rtc-sun6i.c (d26a3a6ce7e02f9c056ad992bcd9624735022337) | rtc-sun6i.c (4d9890ac9d43d4dfd011110ab96633caa6fa829c) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-or-later 2/* 3 * An RTC driver for Allwinner A31/A23 4 * 5 * Copyright (c) 2014, Chen-Yu Tsai <wens@csie.org> 6 * 7 * based on rtc-sunxi.c 8 * --- 246 unchanged lines hidden (view full) --- 255 reg = SUN6I_LOSC_CTRL_KEY; 256 if (rtc->data->has_auto_swt) { 257 /* Bypass auto-switch to int osc, on ext losc failure */ 258 reg |= SUN6I_LOSC_CTRL_AUTO_SWT_BYPASS; 259 writel(reg, rtc->base + SUN6I_LOSC_CTRL); 260 } 261 262 /* Switch to the external, more precise, oscillator, if present */ | 1// SPDX-License-Identifier: GPL-2.0-or-later 2/* 3 * An RTC driver for Allwinner A31/A23 4 * 5 * Copyright (c) 2014, Chen-Yu Tsai <wens@csie.org> 6 * 7 * based on rtc-sunxi.c 8 * --- 246 unchanged lines hidden (view full) --- 255 reg = SUN6I_LOSC_CTRL_KEY; 256 if (rtc->data->has_auto_swt) { 257 /* Bypass auto-switch to int osc, on ext losc failure */ 258 reg |= SUN6I_LOSC_CTRL_AUTO_SWT_BYPASS; 259 writel(reg, rtc->base + SUN6I_LOSC_CTRL); 260 } 261 262 /* Switch to the external, more precise, oscillator, if present */ |
263 if (of_get_property(node, "clocks", NULL)) { | 263 if (of_property_present(node, "clocks")) { |
264 reg |= SUN6I_LOSC_CTRL_EXT_OSC; 265 if (rtc->data->has_losc_en) 266 reg |= SUN6I_LOSC_CTRL_EXT_LOSC_EN; 267 } 268 writel(reg, rtc->base + SUN6I_LOSC_CTRL); 269 270 /* Yes, I know, this is ugly. */ 271 sun6i_rtc = rtc; --- 613 unchanged lines hidden --- | 264 reg |= SUN6I_LOSC_CTRL_EXT_OSC; 265 if (rtc->data->has_losc_en) 266 reg |= SUN6I_LOSC_CTRL_EXT_LOSC_EN; 267 } 268 writel(reg, rtc->base + SUN6I_LOSC_CTRL); 269 270 /* Yes, I know, this is ugly. */ 271 sun6i_rtc = rtc; --- 613 unchanged lines hidden --- |