From patchwork Thu Jun 20 22:12:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 2758981 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8EABD9F472 for ; Thu, 20 Jun 2013 22:14:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A5EFE201E2 for ; Thu, 20 Jun 2013 22:14:44 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9F7E3201C9 for ; Thu, 20 Jun 2013 22:14:43 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Upn7k-0004Mf-U2; Thu, 20 Jun 2013 22:14:38 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Upn7c-0002ph-H7; Thu, 20 Jun 2013 22:14:28 +0000 Received: from mail-bk0-x22d.google.com ([2a00:1450:4008:c01::22d]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Upn7Y-0002oP-0A for linux-arm-kernel@lists.infradead.org; Thu, 20 Jun 2013 22:14:25 +0000 Received: by mail-bk0-f45.google.com with SMTP id je9so3124434bkc.32 for ; Thu, 20 Jun 2013 15:14:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=3q6VocfCcrKPUoAempYs1AZI7//U9cDxH+9lQct77WI=; b=OK4ZPYeuuS0fsYOU1StU4uU5IikGTXRZluVesPN+xEtBBtspjKMZSO6eNnTT7Qn8nO Qp1ah9DsuBrDxnM0pqENHda60MhYRmCAlzGOKg8ZoVReyJC2ykaxhok6tn/xwC2afR9E kHw/Y60pRezWQqYbaodxfbKd7HBtQgCHpYvtvpYx49vRJQqRXMwWDa5Z3AFv6WlG0wX2 YZVbqqkHfiDrQ6Wo0fdhba8EU2aLj5q3z7uBQBpdSKM35CHlxDo5b/YkHGMK6NjFwE/n kklvpuX1g9NYzpoAt2wS9CGN0XY9qRrSsdXuPttANlS0o4DQJ80Ry3IsKkcM3R5TNtFU 6AoA== X-Received: by 10.204.190.136 with SMTP id di8mr1457458bkb.36.1371766442652; Thu, 20 Jun 2013 15:14:02 -0700 (PDT) Received: from flatron.tomeq (87-207-52-162.dynamic.chello.pl. [87.207.52.162]) by mx.google.com with ESMTPSA id fc7sm864232bkc.3.2013.06.20.15.14.00 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Jun 2013 15:14:01 -0700 (PDT) From: Tomasz Figa To: linux-samsung-soc@vger.kernel.org Subject: [PATCH v2 02/18] ARM: SAMSUNG: Add new PWM platform device Date: Fri, 21 Jun 2013 00:12:47 +0200 Message-Id: <1371766383-29077-3-git-send-email-tomasz.figa@gmail.com> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1371766383-29077-1-git-send-email-tomasz.figa@gmail.com> References: <1371766383-29077-1-git-send-email-tomasz.figa@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130620_181424_208132_29891666 X-CRM114-Status: GOOD ( 16.93 ) X-Spam-Score: -2.0 (--) Cc: linux-pwm@vger.kernel.org, Kukjin Kim , =?UTF-8?q?Heiko=20St=C3=BCbner?= , Arnd Bergmann , Tomasz Figa , Mark Brown , Thomas Abraham , Olof Johansson , Thierry Reding , Sylwester Nawrocki , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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 #include #include +#include #include #include #include @@ -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 + * + * 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 + +#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 */