Krzysztof Kozlowski | 84b2170 | 2017-12-25 20:54:32 +0100 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
| 2 | // |
| 3 | // Copyright (c) 2004-2005 Simtec Electronics |
| 4 | // http://armlinux.simtec.co.uk/ |
| 5 | // Ben Dooks <ben@simtec.co.uk> |
| 6 | // |
| 7 | // S3C2442 core and lock support |
Ben Dooks | 96ce238 | 2006-06-18 23:06:41 +0100 | [diff] [blame] | 8 | |
Ben Dooks | 96ce238 | 2006-06-18 23:06:41 +0100 | [diff] [blame] | 9 | #include <linux/init.h> |
Ben Dooks | 491547d | 2010-01-26 16:13:35 +0900 | [diff] [blame] | 10 | #include <linux/module.h> |
| 11 | #include <linux/kernel.h> |
| 12 | #include <linux/list.h> |
| 13 | #include <linux/errno.h> |
| 14 | #include <linux/err.h> |
| 15 | #include <linux/device.h> |
Rafael J. Wysocki | bb072c3 | 2011-04-22 22:03:21 +0200 | [diff] [blame] | 16 | #include <linux/syscore_ops.h> |
Ben Dooks | 491547d | 2010-01-26 16:13:35 +0900 | [diff] [blame] | 17 | #include <linux/interrupt.h> |
| 18 | #include <linux/ioport.h> |
| 19 | #include <linux/mutex.h> |
Vasily Khoruzhick | 812c4e4 | 2010-12-01 08:29:23 +0200 | [diff] [blame] | 20 | #include <linux/gpio.h> |
Ben Dooks | 491547d | 2010-01-26 16:13:35 +0900 | [diff] [blame] | 21 | #include <linux/clk.h> |
| 22 | #include <linux/io.h> |
Ben Dooks | 96ce238 | 2006-06-18 23:06:41 +0100 | [diff] [blame] | 23 | |
Arun Sharma | 60063497 | 2011-07-26 16:09:06 -0700 | [diff] [blame] | 24 | #include <linux/atomic.h> |
Ben Dooks | 491547d | 2010-01-26 16:13:35 +0900 | [diff] [blame] | 25 | #include <asm/irq.h> |
| 26 | |
Arnd Bergmann | c6ff132 | 2019-09-02 18:37:30 +0200 | [diff] [blame] | 27 | #include "regs-clock.h" |
Ben Dooks | 491547d | 2010-01-26 16:13:35 +0900 | [diff] [blame] | 28 | |
Arnd Bergmann | c6ff132 | 2019-09-02 18:37:30 +0200 | [diff] [blame] | 29 | #include "cpu.h" |
| 30 | #include "pm.h" |
Vasily Khoruzhick | 812c4e4 | 2010-12-01 08:29:23 +0200 | [diff] [blame] | 31 | |
Arnd Bergmann | c6ff132 | 2019-09-02 18:37:30 +0200 | [diff] [blame] | 32 | #include "gpio-core.h" |
| 33 | #include "gpio-cfg.h" |
| 34 | #include "gpio-cfg-helpers.h" |
| 35 | #include "gpio-samsung.h" |
Ben Dooks | 96ce238 | 2006-06-18 23:06:41 +0100 | [diff] [blame] | 36 | |
Arnd Bergmann | 71b9114 | 2019-09-02 17:47:55 +0200 | [diff] [blame] | 37 | #include "s3c24xx.h" |
Heiko Stuebner | d8fdec1 | 2013-01-29 10:25:22 -0800 | [diff] [blame] | 38 | |
Kay Sievers | 4a858cf | 2011-12-21 16:01:38 -0800 | [diff] [blame] | 39 | static struct device s3c2442_dev = { |
| 40 | .bus = &s3c2442_subsys, |
Ben Dooks | 96ce238 | 2006-06-18 23:06:41 +0100 | [diff] [blame] | 41 | }; |
| 42 | |
| 43 | int __init s3c2442_init(void) |
| 44 | { |
| 45 | printk("S3C2442: Initialising architecture\n"); |
| 46 | |
Arnd Bergmann | 4f506da | 2015-02-27 05:50:22 +0900 | [diff] [blame] | 47 | #ifdef CONFIG_PM_SLEEP |
Rafael J. Wysocki | bb072c3 | 2011-04-22 22:03:21 +0200 | [diff] [blame] | 48 | register_syscore_ops(&s3c2410_pm_syscore_ops); |
Heiko Stuebner | d8fdec1 | 2013-01-29 10:25:22 -0800 | [diff] [blame] | 49 | register_syscore_ops(&s3c24xx_irq_syscore_ops); |
Rafael J. Wysocki | bb072c3 | 2011-04-22 22:03:21 +0200 | [diff] [blame] | 50 | register_syscore_ops(&s3c244x_pm_syscore_ops); |
Arnd Bergmann | 4f506da | 2015-02-27 05:50:22 +0900 | [diff] [blame] | 51 | #endif |
Rafael J. Wysocki | bb072c3 | 2011-04-22 22:03:21 +0200 | [diff] [blame] | 52 | |
Kay Sievers | 4a858cf | 2011-12-21 16:01:38 -0800 | [diff] [blame] | 53 | return device_register(&s3c2442_dev); |
Ben Dooks | 96ce238 | 2006-06-18 23:06:41 +0100 | [diff] [blame] | 54 | } |
Vasily Khoruzhick | 812c4e4 | 2010-12-01 08:29:23 +0200 | [diff] [blame] | 55 | |
| 56 | void __init s3c2442_map_io(void) |
| 57 | { |
| 58 | s3c244x_map_io(); |
| 59 | |
Kukjin Kim | 782d8a3 | 2011-08-30 20:47:32 +0900 | [diff] [blame] | 60 | s3c24xx_gpiocfg_default.set_pull = s3c24xx_gpio_setpull_1down; |
| 61 | s3c24xx_gpiocfg_default.get_pull = s3c24xx_gpio_getpull_1down; |
Vasily Khoruzhick | 812c4e4 | 2010-12-01 08:29:23 +0200 | [diff] [blame] | 62 | } |