mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00:00
ARM: global cleanups
Quite a bit of code gets removed, and some stuff moved around, mostly the old samsung s3c24xx stuff. There should be no functional changes in this series otherwise. Some cleanups have dependencies on other arm-soc branches and will be sent in the second round. Signed-off-by: Arnd Bergmann <arnd@arndb.de> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIVAwUAT2pCjGCrR//JCVInAQLd8RAAqCxhzSc4ewTUP/974gVhujj3TrpiEQcS FKvYWF76yP38Lbf3CJZBZaONRtrQNOhYpVQ0jb3WCV4F8mEH9PCes2q9RObeBYiY TNX8VdcuVjX2U9HaH0+RQtBUdujNLHpEOqtO57un7T5UDNssR5JOive1tNAooRv1 pL0Hgx3AVqUbNOPpqQqHzy/MDdd67S6dX80yysANjFGMX87Nvp/ztYAdNnIdta+Z pDJt+DPlmK8LvjoSL3SEUN0p3Thk75621cCuauGq88PLIB2w62tzF0NFFbvIAgJT 3aMlHM2flOiTJAWkUvA8zJiUzwv/0vYvH3xPoTo84abve3lVfZcY+fHNcfxE/Gge ri2MmkHyimVP3rNeyM0GbN1RTej1TN1MezeQW3nq2wP6nvS2k0/t32ObLLtWU7XA 6iA0hKVMSnhqj4ln6jPAmyaDkaWHyYz97urhgetHqGadvLTiGPXCSBPalSiFmyMo 11tvuqwUNz9tw4nsvGboFQwS2ZoVquC5inoHp5seqZETkGCB67JyeRGxtAM4gbP/ wIRa3OBLY99yo1on6QovWNnSOMC6X4cOvBI/qHIjSEY/T9JVkslY87gRg3LkxCBR XpXfZ6iuLHoSRUGcIjE8D6KHjMgWIDPRnLkIliK4H+3Jn08g0R1MxCplevFCRtis egswZ8C24Xw= =o5Xl -----END PGP SIGNATURE----- Merge tag 'cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc Pull "ARM: global cleanups" from Arnd Bergmann: "Quite a bit of code gets removed, and some stuff moved around, mostly the old samsung s3c24xx stuff. There should be no functional changes in this series otherwise. Some cleanups have dependencies on other arm-soc branches and will be sent in the second round. Signed-off-by: Arnd Bergmann <arnd@arndb.de>" Fixed up trivial conflicts mainly due to #include's being changes on both sides. * tag 'cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (121 commits) ep93xx: Remove unnecessary includes of ep93xx-regs.h ep93xx: Move EP93XX_SYSCON defines to SoC private header ep93xx: Move crunch code to mach-ep93xx directory ep93xx: Make syscon access functions private to SoC ep93xx: Configure GPIO ports in core code ep93xx: Move peripheral defines to local SoC header ep93xx: Convert the watchdog driver into a platform device. ep93xx: Use ioremap for backlight driver ep93xx: Move GPIO defines to gpio-ep93xx.h ep93xx: Don't use system controller defines in audio drivers ep93xx: Move PHYS_BASE defines to local SoC header file ARM: EXYNOS: Add clock register addresses for EXYNOS4X12 bus devfreq driver ARM: EXYNOS: add clock registers for exynos4x12-cpufreq PM / devfreq: update the name of EXYNOS clock registers that were omitted PM / devfreq: update the name of EXYNOS clock register ARM: EXYNOS: change the prefix S5P_ to EXYNOS4_ for clock ARM: EXYNOS: use static declaration on regarding clock ARM: EXYNOS: replace clock.c for other new EXYNOS SoCs ARM: OMAP2+: Fix build error after merge ARM: S3C24XX: remove call to s3c24xx_setup_clocks ...
This commit is contained in:
commit
d61b7a572b
379 changed files with 4796 additions and 7619 deletions
|
@ -42,67 +42,8 @@
|
|||
#define RTC_DEF_TRIM 0
|
||||
|
||||
static const unsigned long RTC_FREQ = 1024;
|
||||
static struct rtc_time rtc_alarm;
|
||||
static DEFINE_SPINLOCK(sa1100_rtc_lock);
|
||||
|
||||
static inline int rtc_periodic_alarm(struct rtc_time *tm)
|
||||
{
|
||||
return (tm->tm_year == -1) ||
|
||||
((unsigned)tm->tm_mon >= 12) ||
|
||||
((unsigned)(tm->tm_mday - 1) >= 31) ||
|
||||
((unsigned)tm->tm_hour > 23) ||
|
||||
((unsigned)tm->tm_min > 59) ||
|
||||
((unsigned)tm->tm_sec > 59);
|
||||
}
|
||||
|
||||
/*
|
||||
* Calculate the next alarm time given the requested alarm time mask
|
||||
* and the current time.
|
||||
*/
|
||||
static void rtc_next_alarm_time(struct rtc_time *next, struct rtc_time *now,
|
||||
struct rtc_time *alrm)
|
||||
{
|
||||
unsigned long next_time;
|
||||
unsigned long now_time;
|
||||
|
||||
next->tm_year = now->tm_year;
|
||||
next->tm_mon = now->tm_mon;
|
||||
next->tm_mday = now->tm_mday;
|
||||
next->tm_hour = alrm->tm_hour;
|
||||
next->tm_min = alrm->tm_min;
|
||||
next->tm_sec = alrm->tm_sec;
|
||||
|
||||
rtc_tm_to_time(now, &now_time);
|
||||
rtc_tm_to_time(next, &next_time);
|
||||
|
||||
if (next_time < now_time) {
|
||||
/* Advance one day */
|
||||
next_time += 60 * 60 * 24;
|
||||
rtc_time_to_tm(next_time, next);
|
||||
}
|
||||
}
|
||||
|
||||
static int rtc_update_alarm(struct rtc_time *alrm)
|
||||
{
|
||||
struct rtc_time alarm_tm, now_tm;
|
||||
unsigned long now, time;
|
||||
int ret;
|
||||
|
||||
do {
|
||||
now = RCNR;
|
||||
rtc_time_to_tm(now, &now_tm);
|
||||
rtc_next_alarm_time(&alarm_tm, &now_tm, alrm);
|
||||
ret = rtc_tm_to_time(&alarm_tm, &time);
|
||||
if (ret != 0)
|
||||
break;
|
||||
|
||||
RTSR = RTSR & (RTSR_HZE|RTSR_ALE|RTSR_AL);
|
||||
RTAR = time;
|
||||
} while (now != RCNR);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static irqreturn_t sa1100_rtc_interrupt(int irq, void *dev_id)
|
||||
{
|
||||
struct platform_device *pdev = to_platform_device(dev_id);
|
||||
|
@ -146,9 +87,6 @@ static irqreturn_t sa1100_rtc_interrupt(int irq, void *dev_id)
|
|||
|
||||
rtc_update_irq(rtc, 1, events);
|
||||
|
||||
if (rtsr & RTSR_AL && rtc_periodic_alarm(&rtc_alarm))
|
||||
rtc_update_alarm(&rtc_alarm);
|
||||
|
||||
spin_unlock(&sa1100_rtc_lock);
|
||||
|
||||
return IRQ_HANDLED;
|
||||
|
@ -224,7 +162,6 @@ static int sa1100_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
|
|||
{
|
||||
u32 rtsr;
|
||||
|
||||
memcpy(&alrm->time, &rtc_alarm, sizeof(struct rtc_time));
|
||||
rtsr = RTSR;
|
||||
alrm->enabled = (rtsr & RTSR_ALE) ? 1 : 0;
|
||||
alrm->pending = (rtsr & RTSR_AL) ? 1 : 0;
|
||||
|
@ -233,16 +170,20 @@ static int sa1100_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
|
|||
|
||||
static int sa1100_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
|
||||
{
|
||||
unsigned long time;
|
||||
int ret;
|
||||
|
||||
spin_lock_irq(&sa1100_rtc_lock);
|
||||
ret = rtc_update_alarm(&alrm->time);
|
||||
if (ret == 0) {
|
||||
if (alrm->enabled)
|
||||
RTSR |= RTSR_ALE;
|
||||
else
|
||||
RTSR &= ~RTSR_ALE;
|
||||
}
|
||||
ret = rtc_tm_to_time(&alrm->time, &time);
|
||||
if (ret != 0)
|
||||
goto out;
|
||||
RTSR = RTSR & (RTSR_HZE|RTSR_ALE|RTSR_AL);
|
||||
RTAR = time;
|
||||
if (alrm->enabled)
|
||||
RTSR |= RTSR_ALE;
|
||||
else
|
||||
RTSR &= ~RTSR_ALE;
|
||||
out:
|
||||
spin_unlock_irq(&sa1100_rtc_lock);
|
||||
|
||||
return ret;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue