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

Commit 7f33e724 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'pwm/for-3.16-rc1' of...

Merge tag 'pwm/for-3.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm

Pull pwm changes from Thierry Reding:
 "The majority of these changes are cleanups and fixes across all
  drivers.  Redundant error messages are removed and more PWM
  controllers set the .can_sleep flag to signal that they can't be used
  in atomic context.

  Support is added for the Broadcom Kona family of SoCs and the Intel
  LPSS driver can now probe PCI devices in addition to ACPI devices.
  Upon shutdown, the pwm-backlight driver will now power off the
  backlight.  It also uses the new descriptor-based GPIO API for more
  concise GPIO handling.

  A large chunk of these changes also converts platforms to use the
  lookup mechanism rather than relying on the global number space to
  reference PWM devices.  This is largely in preparation for more
  unification and cleanups in future patches.  Eventually it will allow
  the legacy PWM API to be removed"

* tag 'pwm/for-3.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm: (38 commits)
  pwm: fsl-ftm: set pwm_chip can_sleep flag
  pwm: ab8500: Fix wrong value shift for disable/enable PWM
  pwm: samsung: do not set manual update bit in pwm_samsung_config
  pwm: lp3943: Set pwm_chip can_sleep flag
  pwm: atmel: set pwm_chip can_sleep flag
  pwm: mxs: set pwm_chip can_sleep flag
  pwm: tiehrpwm: inline accessor functions
  pwm: tiehrpwm: don't build PM related functions when not needed
  pwm-backlight: retrieve configured PWM period
  leds: leds-pwm: retrieve configured PWM period
  ARM: pxa: hx4700: use PWM_LOOKUP to initialize struct pwm_lookup
  ARM: shmobile: armadillo: use PWM_LOOKUP to initialize struct pwm_lookup
  ARM: OMAP3: Beagle: use PWM_LOOKUP to initialize struct pwm_lookup
  pwm: modify PWM_LOOKUP to initialize all struct pwm_lookup members
  ARM: pxa: hx4700: initialize all the struct pwm_lookup members
  ARM: OMAP3: Beagle: initialize all the struct pwm_lookup members
  pwm: renesas-tpu: remove unused struct tpu_pwm_platform_data
  ARM: shmobile: armadillo: initialize all struct pwm_lookup members
  pwm: add period and polarity to struct pwm_lookup
  pwm: twl: Really disable twl6030 PWMs
  ...
parents 2dc24b0d 39fd3f99
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
Broadcom Kona PWM controller device tree bindings

This controller has 6 channels.

Required Properties :
- compatible: should contain "brcm,kona-pwm"
- reg: physical base address and length of the controller's registers
- clocks: phandle + clock specifier pair for the external clock
- #pwm-cells: Should be 3. See pwm.txt in this directory for a
  description of the cells format.

Refer to clocks/clock-bindings.txt for generic clock consumer properties.

Example:

pwm: pwm@3e01a000 {
	compatible = "brcm,bcm11351-pwm", "brcm,kona-pwm";
	reg = <0x3e01a000 0xc4>;
	clocks = <&pwm_clk>;
	#pwm-cells = <3>;
};
+9 −1
Original line number Diff line number Diff line
@@ -19,7 +19,8 @@ should instead register a static mapping that can be used to match PWM
consumers to providers, as given in the following example:

	static struct pwm_lookup board_pwm_lookup[] = {
		PWM_LOOKUP("tegra-pwm", 0, "pwm-backlight", NULL),
		PWM_LOOKUP("tegra-pwm", 0, "pwm-backlight", NULL,
			   50000, PWM_POLARITY_NORMAL),
	};

	static void __init board_init(void)
@@ -97,6 +98,13 @@ pwm_chip as argument which provides a description of the PWM chip, the
number of PWM devices provided by the chip and the chip-specific
implementation of the supported PWM operations to the framework.

When implementing polarity support in a PWM driver, make sure to respect the
signal conventions in the PWM framework. By definition, normal polarity
characterizes a signal starts high for the duration of the duty cycle and
goes low for the remainder of the period. Conversely, a signal with inversed
polarity starts low for the duration of the duty cycle and goes high for the
remainder of the period.

Locking
-------

+2 −1
Original line number Diff line number Diff line
@@ -60,7 +60,8 @@

static struct pwm_lookup pwm_lookup[] = {
	/* LEDB -> PMU_STAT */
	PWM_LOOKUP("twl-pwmled", 1, "leds_pwm", "beagleboard::pmu_stat"),
	PWM_LOOKUP("twl-pwmled", 1, "leds_pwm", "beagleboard::pmu_stat",
		   7812500, PWM_POLARITY_NORMAL),
};

static struct led_pwm pwm_leds[] = {
+2 −1
Original line number Diff line number Diff line
@@ -574,7 +574,8 @@ static struct platform_device backlight = {
};

static struct pwm_lookup hx4700_pwm_lookup[] = {
	PWM_LOOKUP("pxa27x-pwm.1", 0, "pwm-backlight", NULL),
	PWM_LOOKUP("pxa27x-pwm.1", 0, "pwm-backlight", NULL,
		   30923, PWM_POLARITY_NORMAL),
};

/*
+3 −11
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@
#include <linux/gpio_keys.h>
#include <linux/regulator/driver.h>
#include <linux/pinctrl/machine.h>
#include <linux/platform_data/pwm-renesas-tpu.h>
#include <linux/pwm.h>
#include <linux/pwm_backlight.h>
#include <linux/regulator/fixed.h>
#include <linux/regulator/gpio-regulator.h>
@@ -399,24 +399,16 @@ static struct resource pwm_resources[] = {
	},
};

static struct tpu_pwm_platform_data pwm_device_data = {
	.channels[2] = {
		.polarity = PWM_POLARITY_INVERSED,
	}
};

static struct platform_device pwm_device = {
	.name = "renesas-tpu-pwm",
	.id = -1,
	.dev = {
		.platform_data = &pwm_device_data,
	},
	.num_resources = ARRAY_SIZE(pwm_resources),
	.resource = pwm_resources,
};

static struct pwm_lookup pwm_lookup[] = {
	PWM_LOOKUP("renesas-tpu-pwm", 2, "pwm-backlight.0", NULL),
	PWM_LOOKUP("renesas-tpu-pwm", 2, "pwm-backlight.0", NULL,
		   33333, PWM_POLARITY_INVERSED),
};

/* LCDC and backlight */
Loading