Thread (1 message) 1 message, 1 author, 2011-12-20

Re: [RFC 6/7] pwm: Add Tegra2 SoC support

From: Olof Johansson <hidden>
Date: 2011-12-20 22:29:20
Also in: linux-tegra

Hi,

On Tue, Dec 20, 2011 at 2:32 AM, Thierry Reding
[off-list ref] wrote:
Signed-off-by: Thierry Reding <redacted>
If the code is copyright nvidia without a signed-off-by from them,
then they at least deserve mentioning of original authorship in the
change log.

It's also proving itself easier to do the driver and the device tree
and board-dt update separately since they tend to have different merge
paths.

Care to split up as two patches, one for drivers/ and one for arch/arm/?


Thanks!

-Olof

quoted hunk
diff --git a/arch/arm/mach-tegra/board-dt.c b/arch/arm/mach-tegra/board-dt.c
index 2fa599d..387146c 100644
--- a/arch/arm/mach-tegra/board-dt.c
+++ b/arch/arm/mach-tegra/board-dt.c
@@ -81,6 +81,7 @@ struct of_dev_auxdata tegra20_auxdata_lookup[] __initdata = {
                      &tegra_ehci2_device.dev.platform_data),
       OF_DEV_AUXDATA("nvidia,tegra20-ehci", TEGRA_USB3_BASE, "tegra-ehci.2",
                      &tegra_ehci3_device.dev.platform_data),
+       OF_DEV_AUXDATA("nvidia,tegra20-pwm", TEGRA_PWFM_BASE, "tegra-pwm", NULL),
       {}
 };
diff --git a/arch/arm/mach-tegra/devices.c b/arch/arm/mach-tegra/devices.c
index 7a2a02d..c67d85d 100644
--- a/arch/arm/mach-tegra/devices.c
+++ b/arch/arm/mach-tegra/devices.c
@@ -704,3 +704,18 @@ struct platform_device tegra_pcm_device = {
       .name = "tegra-pcm-audio",
       .id = -1,
 };
+
+static struct resource tegra_pwm_resources[] = {
+       [0] = {
+               .start = TEGRA_PWFM_BASE,
+               .end = TEGRA_PWFM_BASE + TEGRA_PWFM_SIZE - 1,
+               .flags = IORESOURCE_MEM,
+       },
+};
+
+struct platform_device tegra_pwm_device = {
+       .name = "tegra-pwm",
+       .id = -1,
+       .num_resources = ARRAY_SIZE(tegra_pwm_resources),
+       .resource = tegra_pwm_resources,
+};
diff --git a/arch/arm/mach-tegra/devices.h b/arch/arm/mach-tegra/devices.h
index 873ecb2..a8a5e25 100644
--- a/arch/arm/mach-tegra/devices.h
+++ b/arch/arm/mach-tegra/devices.h
@@ -48,5 +48,6 @@ extern struct platform_device tegra_i2s_device1;
 extern struct platform_device tegra_i2s_device2;
 extern struct platform_device tegra_das_device;
 extern struct platform_device tegra_pcm_device;
+extern struct platform_device tegra_pwm_device;

 #endif
I don't think you need the platform_device at all, since all platforms
should probe this device via DT (no legacy board file users in-tree).
quoted hunk
diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig
index 93c1052..7c6a137 100644
--- a/drivers/pwm/Kconfig
+++ b/drivers/pwm/Kconfig
@@ -9,4 +9,9 @@ menuconfig PWM
 if PWM

+config PWM_TEGRA
+       tristate "NVIDIA Tegra PWM support"
+       depends on ARCH_TEGRA
+       default n
No need to specify default n, since that's the default default. :)


-Olof
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help