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
     

13 Aug, 2013

2 commits

  • This patch removes the now unused pwm-samsung-legacy driver, which was
    replaced by new pwm-samsung driver.

    Signed-off-by: Tomasz Figa
    Reviewed-by: Sylwester Nawrocki
    Tested-by: Heiko Stuebner
    Tested-by: Mark Brown
    Tested-by: Sylwester Nawrocki
    Acked-by: Arnd Bergmann
    Acked-by: Thierry Reding

    Tomasz Figa
     
  • This patch introduces new Samsung PWM driver, which is completely
    rewritten to be multiplatform- and DeviceTree-aware.

    In addition, remaining problems of old driver are fixed, such as:
    - proper handling of hardware variants,
    - synchronization on SMP systems,
    - handling of boundary parameter values,
    - hardware sharing with PWM clocksource driver,
    - undefined state of PWM output after stopping PWM channel.

    Signed-off-by: Tomasz Figa
    Reviewed-by: Sylwester Nawrocki
    Tested-by: Heiko Stuebner
    Tested-by: Mark Brown
    Tested-by: Sylwester Nawrocki
    Acked-by: Arnd Bergmann
    Acked-by: Thierry Reding

    Tomasz Figa
     

06 Aug, 2013

1 commit

  • This patch renames the old pwm-samsung driver to pwm-samsung-legacy to
    create place for the new, rewritten, DT-aware pwm-samsung driver.

    Signed-off-by: Tomasz Figa
    Reviewed-by: Sylwester Nawrocki
    Tested-by: Heiko Stuebner
    Tested-by: Mark Brown
    Tested-by: Sylwester Nawrocki
    Acked-by: Arnd Bergmann
    Acked-by: Thierry Reding

    Tomasz Figa
     

29 Jul, 2013

1 commit


27 Jun, 2013

2 commits

  • This was found when using pwm-led on am33xx and enable
    heartbeat trigger.

    [ 808.624876] =================================
    [ 808.629443] [ INFO: inconsistent lock state ]
    [ 808.634021] 3.9.0 #2 Not tainted
    [ 808.637415] ---------------------------------
    [ 808.641981] inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage.
    [ 808.648288] swapper/0 [HC0[0]:SC1[1]:HE1:SE0] takes:
    [ 808.653494] (prepare_lock){+.?.+.}, at: [] clk_unprepare+0x15/0x24
    [ 808.661040] {SOFTIRQ-ON-W} state was registered at:
    [ 808.666155] [] __lock_acquire+0x411/0x824
    [ 808.671465] [] lock_acquire+0x41/0x50
    [ 808.676412] [] mutex_lock_nested+0x31/0x1d8
    [ 808.681912] [] clk_prepare+0x15/0x28
    [ 808.686764] [] _init+0x117/0x1e0
    [ 808.691256] [] omap_hwmod_for_each+0x29/0x3c
    [ 808.696842] [] __omap_hwmod_setup_all+0x17/0x2c
    [ 808.702696] [] do_one_initcall+0xc3/0x10c
    [ 808.708017] [] kernel_init_freeable+0xa7/0x134
    [ 808.713778] [] kernel_init+0x7/0x98
    [ 808.718544] [] ret_from_fork+0x11/0x3c
    [ 808.723583] irq event stamp: 1379172
    [ 808.727328] hardirqs last enabled at (1379172): [] _raw_spin_unlock_irqrestore+0x21/0x30
    [ 808.736828] hardirqs last disabled at (1379171): [] _raw_spin_lock_irqsave+0x13/0x38
    [ 808.745876] softirqs last enabled at (1379164): [] irq_enter+0x49/0x4c
    [ 808.753747] softirqs last disabled at (1379165): [] irq_exit+0x63/0x88
    [ 808.761518]
    [ 808.761518] other info that might help us debug this:
    [ 808.768373] Possible unsafe locking scenario:
    [ 808.768373]
    [ 808.774578] CPU0
    [ 808.777141] ----
    [ 808.779705] lock(prepare_lock);
    [ 808.783186]
    [ 808.785929] lock(prepare_lock);
    [ 808.789595]
    [ 808.789595] *** DEADLOCK ***
    [ 808.789595]
    [ 808.795805] 1 lock held by swapper/0:
    [ 808.799643] #0: (((&heartbeat_data->timer))){+.-...}, at: [] call_timer_fn+0x0/0x90
    [ 808.808814]
    [ 808.808814] stack backtrace:
    [ 808.813402] [] (unwind_backtrace+0x1/0x98) from [] (print_usage_bug.part.25+0x16d/0x1cc)
    [ 808.823721] [] (print_usage_bug.part.25+0x16d/0x1cc) from [] (mark_lock+0x18d/0x434)
    [ 808.833669] [] (mark_lock+0x18d/0x434) from [] (__lock_acquire+0x3e1/0x824)
    [ 808.842803] [] (__lock_acquire+0x3e1/0x824) from [] (lock_acquire+0x41/0x50)
    [ 808.852031] [] (lock_acquire+0x41/0x50) from [] (mutex_lock_nested+0x31/0x1d8)
    [ 808.861433] [] (mutex_lock_nested+0x31/0x1d8) from [] (clk_unprepare+0x15/0x24)
    [ 808.870930] [] (clk_unprepare+0x15/0x24) from [] (ehrpwm_pwm_disable+0x5f/0x80)
    [ 808.880431] [] (ehrpwm_pwm_disable+0x5f/0x80) from [] (pwm_disable+0x27/0x28)
    [ 808.889751] [] (pwm_disable+0x27/0x28) from [] (led_heartbeat_function+0x3f/0xb0)
    [ 808.899431] [] (led_heartbeat_function+0x3f/0xb0) from [] (call_timer_fn+0x45/0x90)
    [ 808.909288] [] (call_timer_fn+0x45/0x90) from [] (run_timer_softirq+0x105/0x17c)
    [ 808.918884] [] (run_timer_softirq+0x105/0x17c) from [] (__do_softirq+0xa5/0x150)
    [ 808.928486] [] (__do_softirq+0xa5/0x150) from [] (irq_exit+0x63/0x88)
    [ 808.937098] [] (irq_exit+0x63/0x88) from [] (handle_IRQ+0x21/0x54)
    [ 808.945415] [] (handle_IRQ+0x21/0x54) from [] (omap3_intc_handle_irq+0x5d/0x68)
    [ 808.954900] [] (omap3_intc_handle_irq+0x5d/0x68) from [] (__irq_svc+0x3f/0x64)
    [ 808.964287] Exception stack(0xc05b1f68 to 0xc05b1fb0)
    [ 808.969587] 1f60: 00000001 00000001 00000000 00000000 c05b0000 c0619748
    [ 808.978158] 1f80: c05b0000 c05b0000 c0619748 413fc082 00000000 00000000 01000000 c05b1fb0
    [ 808.986719] 1fa0: c004f989 c000d6f0 400f0033 ffffffff
    [ 808.992024] [] (__irq_svc+0x3f/0x64) from [] (cpu_idle+0x60/0x98)
    [ 809.000250] [] (cpu_idle+0x60/0x98) from [] (start_kernel+0x1e9/0x234)

    Remove non atomic clk api calls and use only atomic for enable/disable because
    can be called from atomic context (led_heartbeat_function is timer callback).

    Signed-off-by: Marek Belisko
    Signed-off-by: Thierry Reding

    Marek BElisko
     
  • Current code actually does not set MODE1_SLEEP bit because the new value for
    bitmask (0x1) is wrong. To set MODE1_SLEEP bit, we should pass MODE1_SLEEP
    as the new value for bitmask.

    Signed-off-by: Axel Lin
    Reviewed-by: Steffen Trumtrar
    Signed-off-by: Thierry Reding

    Axel Lin
     

26 Jun, 2013

1 commit


25 Jun, 2013

1 commit


21 Jun, 2013

2 commits

  • The Timer Pulse Unit (TPU) is a 4-channels 16-bit timer used to generate
    waveforms. This driver exposes PWM functions through the PWM API for
    other drivers to use.

    The code is loosely based on the leds-renesas-tpu driver by Magnus Damm
    and the TPU PWM driver shipped in the Armadillo EVA 800 kernel sources.

    Signed-off-by: Laurent Pinchart
    Signed-off-by: Axel Lin
    Tested-by: Simon Horman
    Signed-off-by: Thierry Reding

    Laurent Pinchart
     
  • Add a simple sysfs interface to the generic PWM framework.

    /sys/class/pwm/
    `-- pwmchipN/ for each PWM chip
    |-- export (w/o) ask the kernel to export a PWM channel
    |-- npwm (r/o) number of PWM channels in this PWM chip
    |-- pwmX/ for each exported PWM channel
    | |-- duty_cycle (r/w) duty cycle (in nanoseconds)
    | |-- enable (r/w) enable/disable PWM
    | |-- period (r/w) period (in nanoseconds)
    | `-- polarity (r/w) polarity of PWM (normal/inversed)
    `-- unexport (w/o) return a PWM channel to the kernel

    Based on work by Lars Poeschel.

    Signed-off-by: H Hartley Sweeten
    Cc: Thierry Reding
    Cc: Lars Poeschel
    Cc: Ryan Mallon
    Cc: Rob Landley
    Signed-off-by: Thierry Reding

    H Hartley Sweeten
     

12 Jun, 2013

3 commits


10 Jun, 2013

1 commit


27 May, 2013

1 commit

  • Since commit ab78029 (drivers/pinctrl: grab default handles from device core),
    we can rely on device core for handling pinctrl.

    So remove devm_pinctrl_get_select_default() from the driver.

    Cc: Thierry Reding
    Cc:
    Signed-off-by: Fabio Estevam
    Tested-by: Shawn Guo
    Signed-off-by: Thierry Reding

    Fabio Estevam
     

18 May, 2013

1 commit


23 Apr, 2013

3 commits

  • lpc32xx_pwm_config() is supposed to set duty_ns and period_ns,
    it should not change PWM_ENABLE bit.

    Signed-off-by: Axel Lin
    Tested-by: Roland Stigge
    Signed-off-by: Thierry Reding

    Axel Lin
     
  • According to the LPC32x0 User Manual [1]:

    For both PWM1 and PWM2 Control Registers:
    BIT 31:
    This bit gates the PWM_CLK signal and enables the external output pin
    to the PWM_PIN_STATE logical level.

    0 = PWM disabled. (Default)
    1 = PWM enabled

    So in lpc32xx_pwm_enable(), we should set PWM_ENABLE bit.
    In lpc32xx_pwm_disable(), we should just clear PWM_ENABLE bit rather than
    write 0 to the register which will also clear PWMx_RELOADV and PWMx_DUTY bits.

    [1] http://www.nxp.com/documents/user_manual/UM10326.pdf

    Signed-off-by: Axel Lin
    Tested-by: Roland Stigge
    Signed-off-by: Thierry Reding

    Axel Lin
     
  • A few drivers already annotate this properly. Make the same change for
    all other OF supporting drivers.

    Signed-off-by: Thierry Reding
    Acked-by: Shawn Guo
    Acked-by: Alexandre Pereira da Silva
    Acked-by: Viresh Kumar

    Thierry Reding
     

02 Apr, 2013

12 commits


26 Mar, 2013

1 commit