Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 140fd977 authored by Thierry Reding's avatar Thierry Reding
Browse files

pwm: tegra: Add device tree support



Add auxdata to instantiate the PWFM controller from a device tree,
include the corresponding nodes in the dtsi files for Tegra 20 and
Tegra 30 and add binding documentation.

Acked-by: default avatarStephen Warren <swarren@wwwdotorg.org>
Signed-off-by: default avatarThierry Reding <thierry.reding@avionic-design.de>
parent 0134b932
Loading
Loading
Loading
Loading
+18 −0
Original line number Original line Diff line number Diff line
Tegra SoC PWFM controller

Required properties:
- compatible: should be one of:
  - "nvidia,tegra20-pwm"
  - "nvidia,tegra30-pwm"
- reg: physical base address and length of the controller's registers
- #pwm-cells: On Tegra the number of cells used to specify a PWM is 2. The
  first cell specifies the per-chip index of the PWM to use and the second
  cell is the duty cycle in nanoseconds.

Example:

	pwm: pwm@7000a000 {
		compatible = "nvidia,tegra20-pwm";
		reg = <0x7000a000 0x100>;
		#pwm-cells = <2>;
	};
+6 −0
Original line number Original line Diff line number Diff line
@@ -123,6 +123,12 @@
		status = "disable";
		status = "disable";
	};
	};


	pwm {
		compatible = "nvidia,tegra20-pwm";
		reg = <0x7000a000 0x100>;
		#pwm-cells = <2>;
	};

	i2c@7000c000 {
	i2c@7000c000 {
		compatible = "nvidia,tegra20-i2c";
		compatible = "nvidia,tegra20-i2c";
		reg = <0x7000c000 0x100>;
		reg = <0x7000c000 0x100>;
+6 −0
Original line number Original line Diff line number Diff line
@@ -117,6 +117,12 @@
		status = "disable";
		status = "disable";
	};
	};


	pwm {
		compatible = "nvidia,tegra30-pwm", "nvidia,tegra20-pwm";
		reg = <0x7000a000 0x100>;
		#pwm-cells = <2>;
	};

	i2c@7000c000 {
	i2c@7000c000 {
		compatible =  "nvidia,tegra30-i2c", "nvidia,tegra20-i2c";
		compatible =  "nvidia,tegra30-i2c", "nvidia,tegra20-i2c";
		reg = <0x7000c000 0x100>;
		reg = <0x7000c000 0x100>;
+1 −0
Original line number Original line Diff line number Diff line
@@ -64,6 +64,7 @@ struct of_dev_auxdata tegra20_auxdata_lookup[] __initdata = {
		       &tegra_ehci2_pdata),
		       &tegra_ehci2_pdata),
	OF_DEV_AUXDATA("nvidia,tegra20-ehci", TEGRA_USB3_BASE, "tegra-ehci.2",
	OF_DEV_AUXDATA("nvidia,tegra20-ehci", TEGRA_USB3_BASE, "tegra-ehci.2",
		       &tegra_ehci3_pdata),
		       &tegra_ehci3_pdata),
	OF_DEV_AUXDATA("nvidia,tegra20-pwm", TEGRA_PWFM_BASE, "tegra-pwm", NULL),
	{}
	{}
};
};


+3 −0
Original line number Original line Diff line number Diff line
@@ -33,6 +33,8 @@
#include <asm/mach/arch.h>
#include <asm/mach/arch.h>
#include <asm/hardware/gic.h>
#include <asm/hardware/gic.h>


#include <mach/iomap.h>

#include "board.h"
#include "board.h"
#include "clock.h"
#include "clock.h"


@@ -52,6 +54,7 @@ struct of_dev_auxdata tegra30_auxdata_lookup[] __initdata = {
	OF_DEV_AUXDATA("nvidia,tegra20-i2c", 0x7000C700, "tegra-i2c.3", NULL),
	OF_DEV_AUXDATA("nvidia,tegra20-i2c", 0x7000C700, "tegra-i2c.3", NULL),
	OF_DEV_AUXDATA("nvidia,tegra20-i2c", 0x7000D000, "tegra-i2c.4", NULL),
	OF_DEV_AUXDATA("nvidia,tegra20-i2c", 0x7000D000, "tegra-i2c.4", NULL),
	OF_DEV_AUXDATA("nvidia,tegra30-ahub", 0x70080000, "tegra30-ahub", NULL),
	OF_DEV_AUXDATA("nvidia,tegra30-ahub", 0x70080000, "tegra30-ahub", NULL),
	OF_DEV_AUXDATA("nvidia,tegra30-pwm", TEGRA_PWFM_BASE, "tegra-pwm", NULL),
	{}
	{}
};
};


Loading