summaryrefslogtreecommitdiff
path: root/target/linux/s3c24xx/patches-2.6.24/1142-s3c24xx-pwm-platform-driver.patch.patch
diff options
context:
space:
mode:
authorMirko Vogt <mirko@openwrt.org>2008-12-12 11:58:53 +0000
committerMirko Vogt <mirko@openwrt.org>2008-12-12 11:58:53 +0000
commit614683faf8029100802db06a825648d0b6490285 (patch)
tree7401b135dc7ce24ff0175e67e0f2ce7f96296ff0 /target/linux/s3c24xx/patches-2.6.24/1142-s3c24xx-pwm-platform-driver.patch.patch
parent4a018d2445c5f249179ff82c8fffb0e3b717f738 (diff)
downloadmtk-20170518-614683faf8029100802db06a825648d0b6490285.zip
mtk-20170518-614683faf8029100802db06a825648d0b6490285.tar.gz
mtk-20170518-614683faf8029100802db06a825648d0b6490285.tar.bz2
changed Makefile and profiles, added patches for kernel 2.6.24 (stable-branch of Openmoko)
SVN-Revision: 13613
Diffstat (limited to 'target/linux/s3c24xx/patches-2.6.24/1142-s3c24xx-pwm-platform-driver.patch.patch')
-rw-r--r--target/linux/s3c24xx/patches-2.6.24/1142-s3c24xx-pwm-platform-driver.patch.patch127
1 files changed, 127 insertions, 0 deletions
diff --git a/target/linux/s3c24xx/patches-2.6.24/1142-s3c24xx-pwm-platform-driver.patch.patch b/target/linux/s3c24xx/patches-2.6.24/1142-s3c24xx-pwm-platform-driver.patch.patch
new file mode 100644
index 0000000..4e23331
--- /dev/null
+++ b/target/linux/s3c24xx/patches-2.6.24/1142-s3c24xx-pwm-platform-driver.patch.patch
@@ -0,0 +1,127 @@
+From 966a29020932751ba6a1a137b0e1e25ac0708be7 Mon Sep 17 00:00:00 2001
+From: matt_hsu <matt_hsu@openmoko.org>
+Date: Thu, 8 May 2008 10:23:07 +0100
+Subject: [PATCH] s3c24xx-pwm-platform-driver.patch
+
+This patch is to register pwm as platform driver to keep the PWM-related
+config when system is in suspend/resume. This could fix the following
+issue after resume:
+
+- HDQ read timeout
+- LEDs blinked abnormally(if LEDs is driven by PWM)
+
+Signed-off-by: Matt Hsu <matt_hsu@openmoko.org>
+---
+ arch/arm/mach-s3c2410/pwm.c | 63 ++++++++++++++++++++++++++++++++++++
+ arch/arm/mach-s3c2440/mach-gta02.c | 6 +++
+ 2 files changed, 69 insertions(+), 0 deletions(-)
+
+diff --git a/arch/arm/mach-s3c2410/pwm.c b/arch/arm/mach-s3c2410/pwm.c
+index 23738c1..86a4faa 100644
+--- a/arch/arm/mach-s3c2410/pwm.c
++++ b/arch/arm/mach-s3c2410/pwm.c
+@@ -20,10 +20,17 @@
+ #include <linux/kernel.h>
+ #include <linux/init.h>
+ #include <linux/clk.h>
++#include <linux/device.h>
+ #include <asm/hardware.h>
+ #include <asm/plat-s3c/regs-timer.h>
+ #include <asm/arch/pwm.h>
+
++#ifdef CONFIG_PM
++ static unsigned long standby_reg_tcon;
++ static unsigned long standby_reg_tcfg0;
++ static unsigned long standby_reg_tcfg1;
++#endif
++
+ int s3c2410_pwm_disable(struct s3c2410_pwm *pwm)
+ {
+ unsigned long tcon;
+@@ -212,3 +219,59 @@ int s3c2410_pwm_dumpregs(void)
+ return 0;
+ }
+ EXPORT_SYMBOL_GPL(s3c2410_pwm_dumpregs);
++
++static int __init s3c24xx_pwm_probe(struct platform_device *pdev)
++{
++ dev_info(&pdev->dev, "s3c24xx_pwm is registered \n");
++
++ return 0;
++}
++
++#ifdef CONFIG_PM
++static int s3c24xx_pwm_suspend(struct platform_device *pdev, pm_message_t state)
++{
++ /* PWM config should be kept in suspending */
++ standby_reg_tcon = __raw_readl(S3C2410_TCON);
++ standby_reg_tcfg0 = __raw_readl(S3C2410_TCFG0);
++ standby_reg_tcfg1 = __raw_readl(S3C2410_TCFG1);
++
++ return 0;
++}
++
++static int s3c24xx_pwm_resume(struct platform_device *pdev)
++{
++ __raw_writel(standby_reg_tcon, S3C2410_TCON);
++ __raw_writel(standby_reg_tcfg0, S3C2410_TCFG0);
++ __raw_writel(standby_reg_tcfg1, S3C2410_TCFG1);
++
++ return 0;
++}
++#else
++#define sc32440_pwm_suspend NULL
++#define sc32440_pwm_resume NULL
++#endif
++
++static struct platform_driver s3c24xx_pwm_driver = {
++ .driver = {
++ .name = "s3c24xx_pwm",
++ .owner = THIS_MODULE,
++ },
++ .probe = s3c24xx_pwm_probe,
++ .suspend = s3c24xx_pwm_suspend,
++ .resume = s3c24xx_pwm_resume,
++};
++
++static int __init s3c24xx_pwm_init(void)
++{
++ return platform_driver_register(&s3c24xx_pwm_driver);
++}
++
++static void __exit s3c24xx_pwm_exit(void)
++{
++}
++
++MODULE_AUTHOR("Javi Roman <javiroman@kernel-labs.org>");
++MODULE_LICENSE("GPL");
++
++module_init(s3c24xx_pwm_init);
++module_exit(s3c24xx_pwm_exit);
+diff --git a/arch/arm/mach-s3c2440/mach-gta02.c b/arch/arm/mach-s3c2440/mach-gta02.c
+index 27babc9..1954121 100644
+--- a/arch/arm/mach-s3c2440/mach-gta02.c
++++ b/arch/arm/mach-s3c2440/mach-gta02.c
+@@ -719,6 +719,11 @@ static struct platform_device gta02_sdio_dev = {
+ .num_resources = ARRAY_SIZE(gta02_sdio_resources),
+ };
+
++struct platform_device s3c24xx_pwm_device = {
++ .name = "s3c24xx_pwm",
++ .num_resources = 0,
++};
++
+ static struct platform_device *gta02_devices[] __initdata = {
+ &s3c_device_usb,
+ &s3c_device_wdt,
+@@ -731,6 +736,7 @@ static struct platform_device *gta02_devices[] __initdata = {
+ &gta02_nor_flash,
+ &sc32440_fiq_device,
+ &gta02_version_device,
++ &s3c24xx_pwm_device,
+ };
+
+ static struct s3c2410_nand_set gta02_nand_sets[] = {
+--
+1.5.6.5
+