From: tomasz.figa@gmail.com (Tomasz Figa)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 02/15] ARM: SAMSUNG: Add new PWM platform device
Date: Wed, 5 Jun 2013 23:18:07 +0200 [thread overview]
Message-ID: <1370467100-10820-3-git-send-email-tomasz.figa@gmail.com> (raw)
In-Reply-To: <1370467100-10820-1-git-send-email-tomasz.figa@gmail.com>
This patch adds new samsung_device_pwm platform device that represents
the whole PWM/timer block and includes memory and IRQ resources.
Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
---
arch/arm/plat-samsung/devs.c | 17 +++++++++++++++++
arch/arm/plat-samsung/include/plat/devs.h | 1 +
arch/arm/plat-samsung/include/plat/pwm-core.h | 24 ++++++++++++++++++++++++
3 files changed, 42 insertions(+)
create mode 100644 arch/arm/plat-samsung/include/plat/pwm-core.h
diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c
index 0f9c3f4..bba6d78 100644
--- a/arch/arm/plat-samsung/devs.c
+++ b/arch/arm/plat-samsung/devs.c
@@ -58,6 +58,7 @@
#include <plat/keypad.h>
#include <linux/platform_data/mmc-s3cmci.h>
#include <linux/platform_data/mtd-nand-s3c2410.h>
+#include <plat/pwm-core.h>
#include <plat/sdhci.h>
#include <linux/platform_data/touchscreen-s3c2410.h>
#include <linux/platform_data/usb-s3c2410_udc.h>
@@ -1127,6 +1128,22 @@ struct platform_device s3c_device_timer[] = {
[3] = { DEFINE_S3C_TIMER(3, IRQ_TIMER3) },
[4] = { DEFINE_S3C_TIMER(4, IRQ_TIMER4) },
};
+
+static struct resource samsung_pwm_resource[] = {
+ DEFINE_RES_MEM(SAMSUNG_PA_TIMER, SZ_4K),
+};
+
+struct platform_device samsung_device_pwm = {
+ .name = "samsung-pwm",
+ .id = -1,
+ .num_resources = ARRAY_SIZE(samsung_pwm_resource),
+ .resource = samsung_pwm_resource,
+};
+
+void __init samsung_pwm_set_platdata(struct samsung_pwm_variant *pd)
+{
+ samsung_device_pwm.dev.platform_data = pd;
+}
#endif /* CONFIG_SAMSUNG_DEV_PWM */
/* RTC */
diff --git a/arch/arm/plat-samsung/include/plat/devs.h b/arch/arm/plat-samsung/include/plat/devs.h
index 87d501f..0dc4ac4 100644
--- a/arch/arm/plat-samsung/include/plat/devs.h
+++ b/arch/arm/plat-samsung/include/plat/devs.h
@@ -134,6 +134,7 @@ extern struct platform_device exynos4_device_spdif;
extern struct platform_device samsung_asoc_idma;
extern struct platform_device samsung_device_keypad;
+extern struct platform_device samsung_device_pwm;
/* s3c2440 specific devices */
diff --git a/arch/arm/plat-samsung/include/plat/pwm-core.h b/arch/arm/plat-samsung/include/plat/pwm-core.h
new file mode 100644
index 0000000..df50f5c
--- /dev/null
+++ b/arch/arm/plat-samsung/include/plat/pwm-core.h
@@ -0,0 +1,24 @@
+/*
+ * linux/arch/arm/plat-samsung/onenand-core.h
+ *
+ * Copyright (c) 2013 Tomasz Figa <tomasz.figa@gmail.com>
+ *
+ * Samsung PWM Controller core functions
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#ifndef __ASM_ARCH_PWM_CORE_H
+#define __ASM_ARCH_PWM_CORE_H __FILE__
+
+#include <clocksource/samsung_pwm.h>
+
+#ifdef CONFIG_SAMSUNG_DEV_PWM
+extern void samsung_pwm_set_platdata(struct samsung_pwm_variant *pd);
+#else
+static inline void samsung_pwm_set_platdata(struct samsung_pwm_variant *pd) { }
+#endif
+
+#endif /* __ASM_ARCH_PWM_CORE_H */
--
1.8.2.1
next prev parent reply other threads:[~2013-06-05 21:18 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-05 21:18 [PATCH 00/15] Final Samsung PWM support cleanup Tomasz Figa
2013-06-05 21:18 ` [PATCH 01/15] ARM: SAMSUNG: Unify base address definitions of timer block Tomasz Figa
2013-06-05 21:18 ` Tomasz Figa [this message]
2013-06-05 21:18 ` [PATCH 03/15] ARM: SAMSUNG: Set PWM platform data Tomasz Figa
2013-06-05 21:18 ` [PATCH 04/15] ARM: SAMSUNG: Move all platforms to new clocksource driver Tomasz Figa
2013-06-05 21:18 ` [PATCH 05/15] ARM: SAMSUNG: Remove old samsung-time driver Tomasz Figa
2013-06-05 21:18 ` [PATCH 06/15] ARM: SAMSUNG: Remove unused PWM timer IRQ chip code Tomasz Figa
2013-06-05 21:18 ` [PATCH 07/15] pwm: samsung: Rename to pwm-samsung-legacy Tomasz Figa
2013-06-05 21:18 ` [PATCH 08/15] pwm: Add new pwm-samsung driver Tomasz Figa
2013-06-13 20:14 ` Heiko Stübner
2013-06-13 20:18 ` Tomasz Figa
2013-06-16 17:19 ` Tomasz Figa
2013-06-16 20:45 ` Kukjin Kim
2013-06-17 20:29 ` Thierry Reding
2013-06-17 20:50 ` Tomasz Figa
2013-06-18 22:17 ` Thierry Reding
2013-06-18 22:45 ` Tomasz Figa
2013-06-19 9:43 ` Thierry Reding
2013-06-19 10:23 ` Tomasz Figa
2013-06-24 17:52 ` Tomasz Figa
2013-06-24 19:50 ` Thierry Reding
2013-06-24 20:03 ` Tomasz Figa
2013-06-24 20:28 ` Thierry Reding
2013-06-24 20:55 ` Arnd Bergmann
2013-06-18 17:59 ` Tomasz Figa
2013-06-18 18:06 ` Kukjin Kim
2013-06-18 18:13 ` Tomasz Figa
2013-06-18 21:33 ` Thierry Reding
2013-06-18 21:35 ` Tomasz Figa
2013-06-18 19:41 ` Tomasz Figa
2013-06-18 21:40 ` Thierry Reding
2013-06-18 21:42 ` Tomasz Figa
2013-06-18 22:20 ` Thierry Reding
2013-06-05 21:18 ` [PATCH 09/15] ARM: SAMSUNG: Rework private data handling in dev-backlight Tomasz Figa
2013-06-05 21:18 ` [PATCH 10/15] ARM: SAMSUNG: Modify board files to use new PWM platform device Tomasz Figa
2013-06-05 21:18 ` [PATCH 11/15] pwm: Remove superseded pwm-samsung-legacy driver Tomasz Figa
2013-06-05 21:18 ` [PATCH 12/15] ARM: SAMSUNG: Remove old PWM timer platform devices Tomasz Figa
2013-06-05 21:18 ` [PATCH 13/15] ARM: SAMSUNG: Remove pwm-clock infrastructure Tomasz Figa
2013-06-05 21:18 ` [PATCH 14/15] ARM: SAMSUNG: Remove remaining uses of plat/regs-timer.h header Tomasz Figa
2013-06-13 20:24 ` Heiko Stübner
2013-06-13 20:38 ` Tomasz Figa
2013-06-05 21:18 ` [PATCH 15/15] ARM: SAMSUNG: Remove " Tomasz Figa
2013-06-12 21:48 ` [PATCH 00/15] Final Samsung PWM support cleanup Tomasz Figa
2013-06-12 23:00 ` Olof Johansson
2013-06-12 23:13 ` Tomasz Figa
2013-06-12 23:38 ` Heiko Stübner
2013-06-12 23:52 ` Sylwester Nawrocki
2013-06-13 9:07 ` Tomasz Figa
2013-06-13 20:17 ` Heiko Stübner
2013-06-13 22:27 ` Heiko Stübner
2013-06-13 0:25 ` Kukjin Kim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1370467100-10820-3-git-send-email-tomasz.figa@gmail.com \
--to=tomasz.figa@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).