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

Commit 9ec97169 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'for-3.6' of git://gitorious.org/linux-pwm/linux-pwm



Pull PWM subsystem from Thierry Reding:
 "The new PWM subsystem aims at collecting all implementations of the
  legacy PWM API and to eventually replace it completely.

  The subsystem has been in development for over half a year now and
  many drivers have already been converted.  It has been in linux-next
  for a couple of weeks and there have been no major issues so I think
  it is ready for inclusion in your tree."

Arnd Bergmann <arnd@arndb.de>:
 "Very much Ack on the new subsystem.  It uses the interface
  declarations as the previously separate pwm drivers, so nothing
  changes for now in the drivers using it, although it enables us to
  change those more easily in the future if we want to.

  This work is also one of the missing pieces that are required to
  eventually build ARM kernels for multiple platforms, which is
  currently prohibited (amongs other things) by the fact that you cannot
  have more than one driver exporting the pwm functions."

Tested-and-acked-by: default avatarAlexandre Courbot <acourbot@nvidia.com>
Acked-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Philip, Avinash <avinashphilip@ti.com> # TI's AM33xx platforms
Acked-By: Alexandre Pereira da Silva <aletes.xgr@gmail.com> # LPC32XX
Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
Acked-by: default avatarSachin Kamat <sachin.kamat@linaro.org>

Fix up trivial conflicts with other cleanups and DT updates.

* 'for-3.6' of git://gitorious.org/linux-pwm/linux-pwm: (36 commits)
  pwm: pwm-tiehrpwm: PWM driver support for EHRPWM
  pwm: pwm-tiecap: PWM driver support for ECAP APWM
  pwm: fix used-uninitialized warning in pwm_get()
  pwm: add lpc32xx PWM support
  pwm_backlight: pass correct brightness to callback
  pwm: Use pr_* functions in pwm-samsung.c file
  pwm: Convert pwm-samsung to use devm_* APIs
  pwm: Convert pwm-tegra to use devm_clk_get()
  pwm: pwm-mxs: Return proper error if pwmchip_remove() fails
  pwm: pwm-bfin: Return proper error if pwmchip_remove() fails
  pwm: pxa: Propagate pwmchip_remove() error
  pwm: Convert pwm-pxa to use devm_* APIs
  pwm: Convert pwm-vt8500 to use devm_* APIs
  pwm: Convert pwm-imx to use devm_* APIs
  pwm: Conflict with legacy PWM API
  pwm: pwm-mxs: add pinctrl support
  pwm: pwm-mxs: use devm_* managed functions
  pwm: pwm-mxs: use global reset function stmp_reset_block
  pwm: pwm-mxs: encode soc name in compatible string
  pwm: Take over maintainership of the PWM subsystem
  ...
parents a410963b 19891b20
Loading
Loading
Loading
Loading
+12 −0
Original line number Original line Diff line number Diff line
LPC32XX PWM controller

Required properties:
- compatible: should be "nxp,lpc3220-pwm"
- reg: physical base address and length of the controller's registers

Examples:

pwm@0x4005C000 {
	compatible = "nxp,lpc3220-pwm";
	reg = <0x4005C000 0x8>;
};
+17 −0
Original line number Original line Diff line number Diff line
Freescale MXS PWM controller

Required properties:
- compatible: should be "fsl,imx23-pwm"
- reg: physical base address and length of the controller's registers
- #pwm-cells: should be 2.  The first cell specifies the per-chip index
  of the PWM to use and the second cell is the duty cycle in nanoseconds.
- fsl,pwm-number: the number of PWM devices

Example:

pwm: pwm@80064000 {
	compatible = "fsl,imx28-pwm", "fsl,imx23-pwm";
	reg = <0x80064000 2000>;
	#pwm-cells = <2>;
	fsl,pwm-number = <8>;
};
+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>;
	};
+57 −0
Original line number Original line Diff line number Diff line
Specifying PWM information for devices
======================================

1) PWM user nodes
-----------------

PWM users should specify a list of PWM devices that they want to use
with a property containing a 'pwm-list':

	pwm-list ::= <single-pwm> [pwm-list]
	single-pwm ::= <pwm-phandle> <pwm-specifier>
	pwm-phandle : phandle to PWM controller node
	pwm-specifier : array of #pwm-cells specifying the given PWM
			(controller specific)

PWM properties should be named "pwms". The exact meaning of each pwms
property must be documented in the device tree binding for each device.
An optional property "pwm-names" may contain a list of strings to label
each of the PWM devices listed in the "pwms" property. If no "pwm-names"
property is given, the name of the user node will be used as fallback.

Drivers for devices that use more than a single PWM device can use the
"pwm-names" property to map the name of the PWM device requested by the
pwm_get() call to an index into the list given by the "pwms" property.

The following example could be used to describe a PWM-based backlight
device:

	pwm: pwm {
		#pwm-cells = <2>;
	};

	[...]

	bl: backlight {
		pwms = <&pwm 0 5000000>;
		pwm-names = "backlight";
	};

pwm-specifier typically encodes the chip-relative PWM number and the PWM
period in nanoseconds. Note that in the example above, specifying the
"pwm-names" is redundant because the name "backlight" would be used as
fallback anyway.

2) PWM controller nodes
-----------------------

PWM controller nodes must specify the number of cells used for the
specifier using the '#pwm-cells' property.

An example PWM controller might look like this:

	pwm: pwm@7000a000 {
		compatible = "nvidia,tegra20-pwm";
		reg = <0x7000a000 0x100>;
		#pwm-cells = <2>;
	};
+28 −0
Original line number Original line Diff line number Diff line
pwm-backlight bindings

Required properties:
  - compatible: "pwm-backlight"
  - pwms: OF device-tree PWM specification (see PWM binding[0])
  - brightness-levels: Array of distinct brightness levels. Typically these
      are in the range from 0 to 255, but any range starting at 0 will do.
      The actual brightness level (PWM duty cycle) will be interpolated
      from these values. 0 means a 0% duty cycle (darkest/off), while the
      last value in the array represents a 100% duty cycle (brightest).
  - default-brightness-level: the default brightness level (index into the
      array defined by the "brightness-levels" property)

Optional properties:
  - pwm-names: a list of names for the PWM devices specified in the
               "pwms" property (see PWM binding[0])

[0]: Documentation/devicetree/bindings/pwm/pwm.txt

Example:

	backlight {
		compatible = "pwm-backlight";
		pwms = <&pwm 0 5000000>;

		brightness-levels = <0 4 8 16 32 64 128 255>;
		default-brightness-level = <6>;
	};
Loading