16 Jan, 2015

4 commits

  • The .config() hook imx_pwm_config() calls clk APIs like clk_prepare()
    and clk_get_rate(), which might sleep, so we need to set can_sleep flag
    on pwm_chip.

    Signed-off-by: Shawn Guo
    Acked-by: Uwe Kleine-König
    Signed-off-by: Thierry Reding
    (cherry picked from commit 31c4fa3442570d001f58303dea36d81693bc199c)

    Shawn Guo
     
  • The i.MX PWM version2 is embedded in several i.MX SoCs, such as i.MX27,
    i.MX51 and i.MX6SL. There is a 4-word (16 bit) sample FIFO in this IP.
    Each FIFO slot determines the duty period of a PWM waveform in one full
    cycle. The IP spec mentions that we should not write a fourth sample
    because the FIFO will become full and triggers a FIFO write error (FWE)
    which will prevent the PWM from starting once it is enabled. In order
    to avoid any sample FIFO overflow issue, this patch clears all sample
    FIFO by doing software reset in the configuration hook when the
    controller is disabled or waits for a full PWM cycle to get a
    relinquished FIFO slot when the controller is enabled and the FIFO is
    fully loaded.

    The FIFO overflow issue can be reproduced by the following commands on
    the i.MX6SL EVK platform, assuming we use PWM2 for the debug LED which
    is driven by the pin HSIC_STROBE and the maximal brightness is 255.

    echo 0 > /sys/class/leds/user/brightness
    echo 0 > /sys/class/leds/user/brightness
    echo 0 > /sys/class/leds/user/brightness
    echo 0 > /sys/class/leds/user/brightness
    echo 255 > /sys/class/leds/user/brightness

    Here, FWE happens (PWMSR register reads 0x58) and the LED can not be
    lighten.

    Another way to reproduce the FIFO overflow issue is to run this script:

    while true;
    do echo 255 > /sys/class/leds/user/brightness;
    done

    Cc: Thierry Reding
    Cc: Sascha Hauer
    Cc: Shawn Guo
    Cc: Lothar Waßmann
    Cc: linux-pwm@vger.kernel.org
    Cc: linux-arm-kernel@lists.infradead.org
    Signed-off-by: Liu Ying
    Acked-by: Shawn Guo
    Signed-off-by: Thierry Reding
    (cherry picked from commit 137fd45ffec15db14034990ceac890975cae7a32)

    Liu Ying
     
  • This patch contains no logic change to cleanup indentation for register
    definitions only.

    Cc: Thierry Reding
    Cc: Sascha Hauer
    Cc: Shawn Guo
    Cc: Lothar Waßmann
    Cc: linux-pwm@vger.kernel.org
    Cc: linux-arm-kernel@lists.infradead.org
    Signed-off-by: Liu Ying
    Acked-by: Shawn Guo
    Signed-off-by: Thierry Reding
    (cherry picked from commit 40f260c2cebb464dda6916055112963f1421a111)

    Liu Ying
     
  • This patch adds missing parentheses around the argument of the macro
    MX3_PWMCR_PRESCALER(x) to avoid any potential macro expansion issue.

    Reported-by: Lothar Waßmann
    Cc: Thierry Reding
    Cc: Sascha Hauer
    Cc: Shawn Guo
    Cc: Lothar Waßmann
    Cc: linux-pwm@vger.kernel.org
    Cc: linux-arm-kernel@lists.infradead.org
    Signed-off-by: Liu Ying
    Acked-by: Shawn Guo
    Signed-off-by: Thierry Reding
    (cherry picked from commit bd59bdc898623e6c948a9f900250ce7343cf9012)

    Liu Ying
     

26 Feb, 2014

1 commit


28 Jan, 2014

1 commit

  • …ierry.reding/linux-pwm

    Pull pwm changes from Thierry Reding:
    "The patches for this release cycle include various enhancements
    (device tree support, better compile coverage, ...) for existing
    drivers. There is a new driver for Atmel SoCs.

    Various drivers as well as the sysfs support received minor fixes and
    cleanups"

    * tag 'pwm/for-3.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm:
    pwm: tiecap: Remove duplicate put_sync call
    pwm: tiehrpwm: use dev_err() instead of pr_err()
    pwm: pxa: remove unnecessary space before tabs
    pwm: ep93xx: split module author names
    pwm: use seq_puts() instead of seq_printf()
    pwm: atmel-pwm: Do not unprepare clock after successful registration
    of: Add Atmel PWM controller device tree binding
    pwm: atmel-pwm: Add Atmel PWM controller driver
    backlight: pwm_bl: Remove error message upon devm_kzalloc() failure
    pwm: pca9685: depends on I2C rather than REGMAP_I2C
    pwm: renesas-tpu: Enable driver compilation with COMPILE_TEST
    pwm: jz4740: Use devm_clk_get()
    pwm: jz4740: Pass device to clk_get()
    pwm: sysfs: Convert to use ATTRIBUTE_GROUPS macro
    pwm: pxa: Add device tree support

    Linus Torvalds
     

23 Jan, 2014

1 commit


21 Jan, 2014

1 commit

  • This is the other of the LP3943 MFD driver.
    LP3943 can be used as a PWM generator, up to 2 channels.

    * Two PWM generators supported

    * Supported PWM operations
    request, free, config, enable and disable

    * Pin assignment
    A driver data, 'pin_used' is checked when a PWM is requested.
    If the output pin is already assigned, then returns as failure.
    If the pin is available, 'pin_used' is set.
    When the PWM is not used anymore, then it is cleared.
    It is defined as unsigned long type for atomic bit operation APIs,
    but only LSB 16bits are used because LP3943 has 16 outputs.

    Signed-off-by: Milo Kim
    Acked-by: Thierry Reding
    Signed-off-by: Lee Jones

    Milo Kim
     

20 Dec, 2013

5 commits


17 Dec, 2013

2 commits


12 Dec, 2013

3 commits


04 Dec, 2013

2 commits

  • Use new ATTRIBUTE_GROUPS macro to reduce the number of lines of code.

    Signed-off-by: Axel Lin
    Signed-off-by: Thierry Reding

    Axel Lin
     
  • This patch adds device tree support to the PXA's PWM driver. Nothing
    needs to be extracted from the device tree node by the PWM device.
    Client devices need only specify the period; the per-chip index is
    implicitly zero because one device node must be present for each PWM
    output in use. This approach is more convenient due to the wide
    variability in the number of PWM channels present across the various PXA
    variants, and is made possible by the fact that the register sets for
    each PWM channel are segregated from each other. An of_xlate() method
    is added to parse this single-cell node. The existing ID table is
    reused for the match table data.

    Tested on a Palm Treo 680 (both platform data and DT cases).

    Signed-off-by: Mike Dunn
    Signed-off-by: Thierry Reding

    Mike Dunn
     

01 Nov, 2013

1 commit

  • PWM channel data was set to NULL before freeing it. This caused the
    following kernel warning while unexporting the channel. Set the channel
    data to NULL after freeing it.

    [ 70.495000] WARNING: CPU: 0 PID: 1 at drivers/base/devres.c:805 pwm_put+0x48/0x80()
    [ 70.505000] Modules linked in:
    [ 70.505000] CPU: 0 PID: 1 Comm: sh Not tainted 3.12.0-rc6-next-20131024-00012-gd4aec04-dirty #58
    [ 70.515000] [] (unwind_backtrace+0x0/0xf4) from [] (show_stack+0x10/0x14)
    [ 70.525000] [] (show_stack+0x10/0x14) from [] (dump_stack+0x7c/0xb0)
    [ 70.530000] [] (dump_stack+0x7c/0xb0) from [] (warn_slowpath_common+0x6c/0x88)
    [ 70.540000] [] (warn_slowpath_common+0x6c/0x88) from [] (warn_slowpath_null+0x1c/0x24)
    [ 70.550000] [] (warn_slowpath_null+0x1c/0x24) from [] (pwm_put+0x48/0x80)
    [ 70.560000] [] (pwm_put+0x48/0x80) from [] (pwm_unexport_store+0x94/0xac)
    [ 70.565000] [] (pwm_unexport_store+0x94/0xac) from [] (sysfs_write_file+0x148/0x1d8)
    [ 70.575000] [] (sysfs_write_file+0x148/0x1d8) from [] (vfs_write+0xb4/0x1a0)
    [ 70.585000] [] (vfs_write+0xb4/0x1a0) from [] (SyS_write+0x3c/0x78)
    [ 70.595000] [] (SyS_write+0x3c/0x78) from [] (ret_fast_syscall+0x0/0x30)

    Signed-off-by: Sachin Kamat
    Reviewed-by: Jingoo Han
    Signed-off-by: Thierry Reding

    Sachin Kamat
     

17 Oct, 2013

1 commit

  • Remove the non-standard EP93xx PWM driver in drivers/misc and add
    a new driver for the PWM controllers on the EP93xx platform based
    on the PWM framework.

    These PWM controllers each support 1 PWM channel with programmable
    duty cycle, frequency, and polarity inversion.

    Signed-off-by: H Hartley Sweeten
    Cc: Ryan Mallon
    Acked-by: Arnd Bergmann
    Acked-by: Greg Kroah-Hartman
    Signed-off-by: Thierry Reding

    H Hartley Sweeten
     

15 Oct, 2013

1 commit


08 Oct, 2013

7 commits


19 Sep, 2013

2 commits


07 Sep, 2013

1 commit

  • Pull ARM SoC cleanups from Olof Johansson:
    "This branch contains code cleanups, moves and removals for 3.12.

    There's a large number of various cleanups, and a nice net removal of
    13500 lines of code.

    Highlights worth mentioning are:

    - A series of patches from Stephen Boyd removing the ARM local timer
    API.
    - Move of Qualcomm MSM IOMMU code to drivers/iommu.
    - Samsung PWM driver cleanups from Tomasz Figa, removing legacy PWM
    driver and switching over to the drivers/pwm one.
    - Removal of some unusued auto-generated headers for OMAP2+ (PRM/CM).

    There's also a move of a header file out of include/linux/i2c/ to
    platform_data, where it really belongs. It touches mostly ARM
    platform code for include changes so we took it through our tree"

    * tag 'cleanup-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (83 commits)
    ARM: OMAP2+: Add back the define for AM33XX_RST_GLOBAL_WARM_SW_MASK
    gpio: (gpio-pca953x) move header to linux/platform_data/
    arm: zynq: hotplug: Remove unreachable code
    ARM: SAMSUNG: Remove unnecessary exynos4_default_sdhci*()
    tegra: simplify use of devm_ioremap_resource
    ARM: SAMSUNG: Remove plat/regs-timer.h header
    ARM: SAMSUNG: Remove remaining uses of plat/regs-timer.h header
    ARM: SAMSUNG: Remove pwm-clock infrastructure
    ARM: SAMSUNG: Remove old PWM timer platform devices
    pwm: Remove superseded pwm-samsung-legacy driver
    ARM: SAMSUNG: Modify board files to use new PWM platform device
    ARM: SAMSUNG: Rework private data handling in dev-backlight
    pwm: Add new pwm-samsung driver
    ARM: mach-mvebu: remove redundant DT parsing and validation
    ARM: msm: Only compile io.c on platforms that use it
    iommu/msm: Move mach includes to iommu directory
    ARM: msm: Remove devices-iommu.c
    ARM: msm: Move mach/board.h contents to common.h
    ARM: msm: Migrate msm_timer to CLOCKSOURCE_OF_DECLARE
    ARM: msm: Remove TMR and TMR0 static mappings
    ...

    Linus Torvalds
     

03 Sep, 2013

7 commits

  • Commit 76abbdde2d95a3807d0dc6bf9f84d03d0dbd4f3d

    pwm: Add sysfs interface

    causes a kernel oops due to a null pointer dereference on PXA platforms.
    This happens because the class added by the patch is registered in a
    subsys_initcall (initcall4), but the pxa pwm driver is registered in
    arch_initcall (initcall3). If the class is not registered before the
    driver probe function runs, the oops occurs in device_add() when the
    uninitialized pointers in struct class are dereferenced. I don't see a
    reason that the driver must be an arch_initcall, so this patch makes it
    a regular module_platform_driver (initcall6), preventing the oops.

    Signed-off-by: Mike Dunn
    Acked-by: Robert Jarzmik
    Acked-by: Marek Vasut
    Signed-off-by: Thierry Reding

    Mike Dunn
     
  • Fix the following sparse warnings:

    drivers/pwm/pwm-tiehrpwm.c:144:16: warning: incorrect type in argument 1 (different address spaces)
    drivers/pwm/pwm-tiehrpwm.c:144:16: expected void const volatile [noderef] *addr
    drivers/pwm/pwm-tiehrpwm.c:144:16: got void *
    drivers/pwm/pwm-tiehrpwm.c:149:9: warning: incorrect type in argument 2 (different address spaces)
    drivers/pwm/pwm-tiehrpwm.c:149:9: expected void volatile [noderef] *addr
    drivers/pwm/pwm-tiehrpwm.c:149:9: got void *
    drivers/pwm/pwm-tiehrpwm.c:157:18: warning: incorrect type in argument 1 (different address spaces)
    drivers/pwm/pwm-tiehrpwm.c:157:18: expected void const volatile [noderef] *addr
    drivers/pwm/pwm-tiehrpwm.c:157:18: got void *
    drivers/pwm/pwm-tiehrpwm.c:160:9: warning: incorrect type in argument 2 (different address spaces)
    drivers/pwm/pwm-tiehrpwm.c:160:9: expected void volatile [noderef] *addr
    drivers/pwm/pwm-tiehrpwm.c:160:9: got void *

    Signed-off-by: Jingoo Han
    Signed-off-by: Thierry Reding

    Jingoo Han
     
  • ecap_pwm_save_context() and ecap_pwm_restore_context() are only used
    when CONFIG_PM_SLEEP is selected.

    drivers/pwm/pwm-tiecap.c:293:13: warning: 'ecap_pwm_save_context' defined but not used [-Wunused-function]
    drivers/pwm/pwm-tiecap.c:302:13: warning: 'ecap_pwm_restore_context' defined but not used [-Wunused-function]

    Signed-off-by: Jingoo Han
    Signed-off-by: Thierry Reding

    Jingoo Han
     
  • Remove unneeded error handling on the result of a call to
    platform_get_resource when the value is passed to devm_ioremap_resource.

    Move the call to platform_get_resource adjacent to the call to
    devm_ioremap_resource to make the connection between them more clear.

    A simplified version of the semantic patch that makes this change is as
    follows: (http://coccinelle.lip6.fr/)

    //
    @@
    expression pdev,res,n,e,e1;
    expression ret != 0;
    identifier l;
    @@

    - res = platform_get_resource(pdev, IORESOURCE_MEM, n);
    ... when != res
    - if (res == NULL) { ... \(goto l;\|return ret;\) }
    ... when != res
    + res = platform_get_resource(pdev, IORESOURCE_MEM, n);
    e = devm_ioremap_resource(e1, res);
    //

    Signed-off-by: Julia Lawall
    Acked-by: Viresh Kumar
    Signed-off-by: Thierry Reding

    Julia Lawall
     
  • Specify DT bindings for the TPU PWM controller and add OF support to the
    driver.

    Signed-off-by: Laurent Pinchart
    Acked-by: Stephen Warren
    Signed-off-by: Thierry Reding

    Laurent Pinchart
     
  • Don't redefine a PWM_SPEC_POLARITY macro with a value identical to
    PWM_POLARITY_INVERTED, use the PWM DT macro directly.

    Signed-off-by: Laurent Pinchart
    Reviewed-by: Stephen Warren
    Signed-off-by: Thierry Reding

    Laurent Pinchart
     
  • stmp_reset_block() may fail, so let's check its return value and
    propagate it in the case of error.

    Signed-off-by: Fabio Estevam
    Signed-off-by: Thierry Reding

    Fabio Estevam