[RFC 6/7] pwm: Add Tegra2 SoC support
Olof Johansson
olof at lixom.net
Wed Dec 21 09:29:20 EST 2011
Hi,
On Tue, Dec 20, 2011 at 2:32 AM, Thierry Reding
<thierry.reding at avionic-design.de> wrote:
> Signed-off-by: Thierry Reding <thierry.reding at avionic-design.de>
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
> 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).
> 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
More information about the devicetree-discuss
mailing list