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

Commit 06b45f2a authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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

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

Pull pwm changes from Thierry Reding:
 "Not much has been happening in PWM land lately, so this contains
  mostly minor fixes that didn't seem urgent enough for a late
  pull-request last cycle"

* tag 'pwm/for-4.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm:
  pwm: Remove __init initializer for pwm_add_table()
  pwm: samsung: Fix output race on disabling
  pwm: mxs: Fix period divider computation
  pwm: atmel-hlcdc: Add errata handling for sama5d4
  pwm: pca9685: Constify struct regmap_config
  pwm: imx-pwm: add explicit compatible strings and required clock properties
parents b3f4ef0b c264f111
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
Freescale i.MX PWM controller

Required properties:
- compatible: should be "fsl,<soc>-pwm"
- compatible : should be "fsl,<soc>-pwm" and one of the following
   compatible strings:
  - "fsl,imx1-pwm" for PWM compatible with the one integrated on i.MX1
  - "fsl,imx27-pwm" for PWM compatible with the one integrated on i.MX27
- reg: physical base address and length of the controller's registers
- #pwm-cells: should be 2. See pwm.txt in this directory for a description of
  the cells format.
- clocks : Clock specifiers for both ipg and per clocks.
- clock-names : Clock names should include both "ipg" and "per"
See the clock consumer binding,
	Documentation/devicetree/bindings/clock/clock-bindings.txt
- interrupts: The interrupt for the pwm controller

Example:
@@ -13,5 +20,8 @@ pwm1: pwm@53fb4000 {
	#pwm-cells = <2>;
	compatible = "fsl,imx53-pwm", "fsl,imx27-pwm";
	reg = <0x53fb4000 0x4000>;
	clocks = <&clks IMX5_CLK_PWM1_IPG_GATE>,
		 <&clks IMX5_CLK_PWM1_HF_GATE>;
	clock-names = "ipg", "per";
	interrupts = <61>;
};
+1 −1
Original line number Diff line number Diff line
@@ -573,7 +573,7 @@ EXPORT_SYMBOL_GPL(of_pwm_get);
 * @table: array of consumers to register
 * @num: number of consumers in table
 */
void __init pwm_add_table(struct pwm_lookup *table, size_t num)
void pwm_add_table(struct pwm_lookup *table, size_t num)
{
	mutex_lock(&pwm_lookup_lock);

+4 −0
Original line number Diff line number Diff line
@@ -225,6 +225,10 @@ static const struct of_device_id atmel_hlcdc_dt_ids[] = {
		.compatible = "atmel,sama5d3-hlcdc",
		.data = &atmel_hlcdc_pwm_sama5d3_errata,
	},
	{
		.compatible = "atmel,sama5d4-hlcdc",
		.data = &atmel_hlcdc_pwm_sama5d3_errata,
	},
	{ /* sentinel */ },
};

+6 −2
Original line number Diff line number Diff line
@@ -35,6 +35,10 @@
#define  PERIOD_CDIV(div)	(((div) & 0x7) << 20)
#define  PERIOD_CDIV_MAX	8

static const unsigned int cdiv[PERIOD_CDIV_MAX] = {
	1, 2, 4, 8, 16, 64, 256, 1024
};

struct mxs_pwm_chip {
	struct pwm_chip chip;
	struct clk *clk;
@@ -54,13 +58,13 @@ static int mxs_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,

	rate = clk_get_rate(mxs->clk);
	while (1) {
		c = rate / (1 << div);
		c = rate / cdiv[div];
		c = c * period_ns;
		do_div(c, 1000000000);
		if (c < PERIOD_PERIOD_MAX)
			break;
		div++;
		if (div > PERIOD_CDIV_MAX)
		if (div >= PERIOD_CDIV_MAX)
			return -EINVAL;
	}

+1 −1
Original line number Diff line number Diff line
@@ -202,7 +202,7 @@ static const struct pwm_ops pca9685_pwm_ops = {
	.owner = THIS_MODULE,
};

static struct regmap_config pca9685_regmap_i2c_config = {
static const struct regmap_config pca9685_regmap_i2c_config = {
	.reg_bits = 8,
	.val_bits = 8,
	.max_register = PCA9685_NUMREGS,
Loading