11 Apr, 2014

1 commit

  • Pull LED updates from Bryan Wu:
    "This cycle we got:
    - new driver for leds-mc13783
    - bug fixes
    - code cleanup"

    * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds:
    leds: make sure we unregister a trigger only once
    leds: leds-pwm: properly clean up after probe failure
    leds: clevo-mail: Make probe function __init
    leds-ot200: Fix dependencies
    leds-gpio: of: introduce MODULE_DEVICE_TABLE for module autoloading
    leds: clevo-mail: remove __initdata marker
    leds: leds-ss4200: remove __initdata marker
    leds: blinkm: remove unnecessary spaces
    leds: lp5562: remove unnecessary parentheses
    leds: leds-ss4200: remove DEFINE_PCI_DEVICE_TABLE macro
    leds: leds-s3c24xx: Trivial cleanup in header file
    drivers/leds: delete non-required instances of include
    leds: leds-gpio: add retain-state-suspended property
    leds: leds-mc13783: Add devicetree support
    leds: leds-mc13783: Remove unnecessary cleaning of registers on exit
    leds: leds-mc13783: Use proper "max_brightness" value fo LEDs
    leds: leds-mc13783: Use LED core PM functions
    leds: leds-mc13783: Add MC34708 LED support
    leds: Turn off led if blinking is disabled
    ledtrig-cpu: Handle CPU hot(un)plugging

    Linus Torvalds
     

08 Apr, 2014

2 commits

  • Currently, we may attempt to unregister a trigger more than once, for
    example when we receive two consecutive reboot notifications, or when
    we do a regular unregistration plus reboot notification.

    This leads to the following error since we try to delete the list node
    twice:

    [ 2780.254922] WARNING: CPU: 0 PID: 13764 at lib/list_debug.c:53 __list_del_entry+0x3e/0xe0()
    [ 2780.265559] list_del corruption, ffffffffa5eb6470->next is LIST_POISON1 (dead000000100100)
    [ 2780.271710] Modules linked in:
    [ 2780.274156] CPU: 0 PID: 13764 Comm: kworker/0:2 Tainted: G W 3.14.0-next-20140403-sasha-00012-gef5fa7d-dirty #373
    [ 2780.283063] Workqueue: events do_poweroff
    [ 2780.285644] 0000000000000009 ffff8800330dbb38 ffffffffa34bfa33 0000000000002fe0
    [ 2780.291571] ffff8800330dbb88 ffff8800330dbb78 ffffffffa015a37c ffff8800330dbb68
    [ 2780.296670] ffffffffa5eb6470 0000000000000000 ffffffffa5eb6400 ffffffffa5ad7430
    [ 2780.299756] Call Trace:
    [ 2780.301530] dump_stack (lib/dump_stack.c:52)
    [ 2780.303802] warn_slowpath_common (kernel/panic.c:418)
    [ 2780.306151] warn_slowpath_fmt (kernel/panic.c:433)
    [ 2780.308156] __list_del_entry (lib/list_debug.c:51 (discriminator 1))
    [ 2780.310800] list_del (lib/list_debug.c:78)
    [ 2780.313175] led_trigger_unregister (drivers/leds/led-triggers.c:225)
    [ 2780.315599] heartbeat_reboot_notifier (drivers/leds/trigger/ledtrig-heartbeat.c:119)
    [ 2780.317247] notifier_call_chain (kernel/notifier.c:95)
    [ 2780.320014] __blocking_notifier_call_chain (kernel/notifier.c:316)
    [ 2780.323263] blocking_notifier_call_chain (kernel/notifier.c:326)
    [ 2780.326096] kernel_power_off (include/linux/kmod.h:95 kernel/reboot.c:153 kernel/reboot.c:179)
    [ 2780.327883] do_poweroff (kernel/power/poweroff.c:23)
    [ 2780.330748] process_one_work (kernel/workqueue.c:2221 include/linux/jump_label.h:105 include/trace/events/workqueue.h:111 kernel/workqueue.c:2226)
    [ 2780.333027] ? process_one_work (include/linux/workqueue.h:186 kernel/workqueue.c:611 kernel/workqueue.c:638 kernel/workqueue.c:2214)
    [ 2780.335487] process_scheduled_works (include/linux/list.h:188 kernel/workqueue.c:2277)
    [ 2780.337101] worker_thread (kernel/workqueue.c:2352)
    [ 2780.338712] ? rescuer_thread (kernel/workqueue.c:2297)
    [ 2780.341326] kthread (kernel/kthread.c:219)
    [ 2780.343446] ? kthread_create_on_node (kernel/kthread.c:185)
    [ 2780.345733] ret_from_fork (arch/x86/kernel/entry_64.S:555)
    [ 2780.347168] ? kthread_create_on_node (kernel/kthread.c:185)

    Prevent it by making sure we don't attempt to unregister a trigger that
    is not in the triggers list.

    Signed-off-by: Sasha Levin
    Signed-off-by: Bryan Wu

    Sasha Levin
     
  • When probing with DT, we add each LED one at a time. If we find a LED
    without a PWM device (because it is not available yet) we fail the
    initialisation, unregister previous LEDs, and then by way of managed
    resources, we free the structure.

    The problem with this is we may have a scheduled and active work_struct
    in this structure, and this results in a nasty kernel oops.

    We need to cancel this work_struct properly upon cleanup - and the
    cleanup we require is the same cleanup as we do when the LED platform
    device is removed. Rather than writing this same code three times,
    move it into a separate function and use it in all three places.

    Fixes: c971ff185f64 ("leds: leds-pwm: Defer led_pwm_set() if PWM can sleep")
    Signed-off-by: Russell King
    Signed-off-by: Bryan Wu

    Russell King
     

14 Mar, 2014

1 commit


12 Mar, 2014

1 commit

  • The Bachmann OT200 is a Geode-based device, so OT200-specific drivers
    are only useful on X86_32, except for build testing.

    Signed-off-by: Jean Delvare
    Cc: Bryan Wu
    Cc: Richard Purdie
    Signed-off-by: Bryan Wu

    Jean Delvare
     

07 Mar, 2014

1 commit


01 Mar, 2014

2 commits

  • Remove __initdata marker, because it is not right for a module
    parameter. It will make the kernel oops problem.

    (cooloney@gmail.com: update commit message since it's really a
    wrong notation)

    Signed-off-by: Jingoo Han
    Suggested-by: Uwe Kleine-König
    Signed-off-by: Bryan Wu

    Jingoo Han
     
  • Remove __initdata marker, because it is not right for a module
    parameter. It will make the kernel oops problem.

    (cooloney@gmail.com: update commit message since it's really a
    wrong notation)

    Signed-off-by: Jingoo Han
    Signed-off-by: Bryan Wu

    Jingoo Han
     

28 Feb, 2014

12 commits


25 Feb, 2014

1 commit

  • With the move of kirkwood into mach-mvebu, drivers Kconfig need
    tweeking to allow the kirkwood specific drivers to be built.

    Signed-off-by: Andrew Lunn
    Acked-by: Arnd Bergmann
    Acked-by: Mark Brown
    Acked-by: Kishon Vijay Abraham I
    Acked-by: Daniel Lezcano
    Acked-by: Viresh Kumar
    Tested-by: Jason Gunthorpe
    Cc: Viresh Kumar
    Cc: Rafael J. Wysocki
    Cc: Richard Purdie
    Cc: Bryan Wu
    Cc: Zhang Rui
    Cc: Eduardo Valentin
    Signed-off-by: Jason Cooper

    Andrew Lunn
     

29 Jan, 2014

1 commit

  • Pull LED subsystem update from Bryan Wu:
    "Basically this cycle is mostly cleanup for LED subsystem"

    * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds:
    leds: s3c24xx: Remove hardware.h inclusion
    leds: replace list_for_each with list_for_each_entry
    leds: kirkwood: Cleanup in header files
    leds: pwm: Remove a warning on non-DT platforms
    leds: leds-pwm: fix duty time overflow.
    leds: leds-mc13783: Remove unneeded mc13xxx_{un}lock
    leds: leds-mc13783: Remove duplicate field in platform data
    drivers: leds: leds-tca6507: check CONFIG_GPIOLIB whether defined for 'gpio_base'
    leds: lp5523: Support LED MUX configuration on running a pattern
    leds: lp5521/5523: Fix multiple engine usage bug
    LEDS: tca6507 - fix up some comments.
    LEDS: tca6507: add device-tree support for GPIO configuration.
    LEDS: tca6507 - fix bugs in parsing of device-tree configuration.

    Linus Torvalds
     

28 Jan, 2014

12 commits

  • The contents of this header file is not referenced in the led driver.
    Remove its inclusion. While at it, re-arrange the headers as per the
    category.

    Signed-off-by: Sachin Kamat
    Signed-off-by: Bryan Wu

    Sachin Kamat
     
  • Use the more convenient macro.

    Signed-off-by: ZHAO Gang
    Signed-off-by: Bryan Wu

    ZHAO Gang
     
  • This removes a warning on non-DT-enabled platforms:

    drivers/leds/leds-pwm.c: In function 'led_pwm_create_of':
    drivers/leds/leds-pwm.c:88:22: warning: unused variable 'node'

    Really caused by the local variable that is assigned to and then never
    used. Just do away with the local var, it's not needed.

    Technically this code path can never be entered without DT enabled,
    since there's an earlier check about number of children in the calling
    function, but the compiler can't see that.

    Signed-off-by: Olof Johansson
    Signed-off-by: Bryan Wu

    Olof Johansson
     
  • Overflow maybe occurs when calculates the duty time. For instance,
    the period time is 990000000ns, and the max_brightness is 127, when
    setting the brightness to 12, the duty value will be 25906026ns, but
    it should be 93543307ns.

    Signed-off-by: Bryan Wu

    Xiubo Li
     
  • LED registers are used only in this driver, so no additional
    locking is needed. Read-Modify-Write cycle in workqueue is already
    protected by regmap.

    Signed-off-by: Alexander Shiyan
    Signed-off-by: Bryan Wu

    Alexander Shiyan
     
  • LED platform data are overwhelmed by excessive field "max_cur"
    which just replicates few bits of "led_control" field.
    This patch removes this field and adds a definition for the
    current settings in the header.

    Signed-off-by: Alexander Shiyan
    Signed-off-by: Bryan Wu

    Alexander Shiyan
     
  • Need check CONFIG_GPIOLIB whether defined, just like another area has
    done within this file. Or can not pass compiling when CONFIG_GPIOLIB
    disabled.

    The related error (with allmodconfig for metag):

    CC [M] drivers/leds/leds-tca6507.o
    drivers/leds/leds-tca6507.c: In function 'tca6507_led_dt_init':
    drivers/leds/leds-tca6507.c:731: error: 'struct tca6507_platform_data' has no member named 'gpio_base'

    Signed-off-by: Chen Gang
    Signed-off-by: Bryan Wu

    Chen Gang
     
  • There are two ways to run a pattern in LP5523.
    One is using legacy sysfs files such as 'enginex_mode','enginex_load' and
    'enginex_leds'. ('x' is from 1 to 3).
    Among them, 'enginex_leds' are used for selecting specific LED channel MUX.
    (MUX means which LEDs are used for running a pattern from LED 1 to 9.)

    The other way is using the firmware interface.
    In this mode, the default LED MUX strings are used.
    In other words, LED MUX is not configurable on the fly.

    This patch enables dynamic LED MUX configuration when the firmware is loaded.
    By accessing the sysfs file 'enginex_leds', the LED channels can be configured.
    To synchronize the operation mode, each engine mode should be set to 'LOAD'.

    The documentation is updated as well.

    Cc: Pali Rohár
    Signed-off-by: Milo Kim
    Signed-off-by: Bryan Wu

    Milo Kim
     
  • Whenever the engine is loaded by the user-application, the operation mode is
    reset first. But it has a problem in case of multiple engine used because
    previous engine settings are cleared.
    The driver should update not whole 8bits but each engine bit by masking.

    On the other hands, whole engines should be reset when the driver is unloaded
    and on initializing the LP5523 driver.
    So, new functions are used for this handling - lp5521/5523_stop_all_engines().

    Cc: Pali Rohár
    Signed-off-by: Milo Kim
    Signed-off-by: Bryan Wu

    Milo Kim
     
  • In particular fix the capitalisation of GPIO and LED and
    correct TCA6507_MAKE_CPIO, but also rewrite the comment about
    platform-data to include reference to devicetree.

    Also re-wrap comments to fit 80 columns.

    Reported-by: Bryan Wu
    Signed-off-by: NeilBrown
    Signed-off-by: Bryan Wu

    NeilBrown
     
  • The 7 lines driven by the TCA6507 can either drive LEDs or act as output-only
    GPIOs.

    To make this distinction in devicetree we use the "compatible" property.

    If the device attached to a line is "compatible" with "gpio", we treat it
    like a GPIO. If it is "compatible" with "led" (or if no "compatible" value
    is set) we treat it like an LED.

    (cooloney@gmail.com: fix typo in the subject)

    Signed-off-by: NeilBrown
    Signed-off-by: Bryan Wu

    NeilBrown
     
  • 1/ The led_info array must be allocated to allow the full number
    of LEDs even if not all are present. The array maybe be sparsely
    filled but it is indexed by device address so we must at least
    allocate as many slots as the highest address used. It is easiest
    just to allocate all 7.

    2/ range check the 'reg' value properly.

    3/ led.flags must be initialised to zero, else all leds could
    be treated as GPIOs (depending on what happens to be on the stack).

    Signed-off-by: NeilBrown
    Signed-off-by: Bryan Wu

    NeilBrown
     

23 Jan, 2014

1 commit

  • Pull trivial tree updates from Jiri Kosina:
    "Usual rocket science stuff from trivial.git"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (39 commits)
    neighbour.h: fix comment
    sched: Fix warning on make htmldocs caused by wait.h
    slab: struct kmem_cache is protected by slab_mutex
    doc: Fix typo in USB Gadget Documentation
    of/Kconfig: Spelling s/one/once/
    mkregtable: Fix sscanf handling
    lp5523, lp8501: comment improvements
    thermal: rcar: comment spelling
    treewide: fix comments and printk msgs
    IXP4xx: remove '1 &&' from a condition check in ixp4xx_restart()
    Documentation: update /proc/uptime field description
    Documentation: Fix size parameter for snprintf
    arm: fix comment header and macro name
    asm-generic: uaccess: Spelling s/a ny/any/
    mtd: onenand: fix comment header
    doc: driver-model/platform.txt: fix a typo
    drivers: fix typo in DEVTMPFS_MOUNT Kconfig help text
    doc: Fix typo (acces_process_vm -> access_process_vm)
    treewide: Fix typos in printk
    drivers/gpu/drm/qxl/Kconfig: reformat the help text
    ...

    Linus Torvalds
     

22 Jan, 2014

1 commit

  • Pull GPIO tree bulk changes from Linus Walleij:
    "A big set this merge window, as we have much going on in this
    subsystem. The changes to other subsystems (notably a slew of ARM
    machines as I am doing away with their custom APIs) have all been
    ACKed to the extent possible.

    Major changes this time:

    - Some core improvements and cleanups to the new GPIO descriptor API.
    This seems to be working now so we can start the exodus to this
    API, moving gradually away from the global GPIO numberspace.

    - Incremental improvements to the ACPI GPIO core, and move the few
    GPIO ACPI clients we have to the GPIO descriptor API right *now*
    before we go any further. We actually managed to contain this
    *before* we started to litter the kernel with yet another hackish
    global numberspace for the ACPI GPIOs, which is a big win.

    - The RFkill GPIO driver and all platforms using it have been
    migrated to use the GPIO descriptors rather than fixed number
    assignments. Tegra machine has been migrated as part of this.

    - New drivers for MOXA ART, Xtensa GPIO32 and SMSC SCH311x. Those
    should be really good examples of how I expect a nice GPIO driver
    to look these days.

    - Do away with custom GPIO implementations on a major part of the ARM
    machines: ks8695, lpc32xx, mv78xx0. Make a first step towards the
    same in the horribly convoluted Samsung S3C include forest. We
    expect to continue to clean this up as we move forward.

    - Flag GPIO lines used for IRQ on adnp, bcm-kona, em, intel-mid and
    lynxpoint.

    This makes the GPIOlib core aware that a certain GPIO line is used
    for IRQs and can then enforce some semantics such as disallowing a
    GPIO line marked as in use for IRQ to be switched to output mode.

    - Drop all use of irq_set_chip_and_handler_name(). The name provided
    in these cases were just unhelpful tags like "mux" or "demux".

    - Extend the MCP23s08 driver to handle interrupts.

    - Minor incremental improvements for rcar, lynxpoint, em 74x164 and
    msm drivers.

    - Some non-urgent bug fixes here and there, duplicate #includes and
    that usual kind of cleanups"

    Fix up broken Kconfig file manually to make this all compile.

    * tag 'gpio-v3.14-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (71 commits)
    gpio: mcp23s08: fix casting caused build warning
    gpio: mcp23s08: depend on OF_GPIO
    gpio: mcp23s08: Add irq functionality for i2c chips
    ARM: S5P[v210|c100|64x0]: Fix build error
    gpio: pxa: clamp gpio get value to [0,1]
    ARM: s3c24xx: explicit dependency on
    ARM: S3C[24|64]xx: move includes back under scope
    Documentation / ACPI: update to GPIO descriptor API
    gpio / ACPI: get rid of acpi_gpio.h
    gpio / ACPI: register to ACPI events automatically
    mmc: sdhci-acpi: convert to use GPIO descriptor API
    ARM: s3c24xx: fix build error
    gpio: f7188x: set can_sleep attribute
    gpio: samsung: Update documentation
    gpio: samsung: Remove hardware.h inclusion
    gpio: xtensa: depend on HAVE_XTENSA_GPIO32
    gpio: clps711x: Enable driver compilation with COMPILE_TEST
    gpio: clps711x: Use of_match_ptr()
    net: rfkill: gpio: convert to descriptor-based GPIO interface
    leds: s3c24xx: Fix build failure
    ...

    Linus Torvalds
     

11 Jan, 2014

1 commit

  • It can be a problem when a pattern is loaded via the firmware interface.
    LP55xx common driver has already locked the mutex in 'lp55xx_firmware_loaded()'.
    So it should be deleted.

    On the other hand, locks are required in store_engine_load()
    on updating program memory.

    Reported-by: Pali Rohár
    Reported-by: Pavel Machek
    Signed-off-by: Milo Kim
    Signed-off-by: Bryan Wu
    Cc:

    Milo Kim
     

10 Jan, 2014

1 commit


08 Jan, 2014

1 commit

  • Commit c67d0f29262b ("ARM: s3c24xx: get rid of custom ")
    removed the usage of mach/gpio.h file, but we need to include>
    plat/gpio-cfg.h to avoid following build error.

    Fixes following build error.
    drivers/leds/leds-s3c24xx.c: In function ‘s3c24xx_led_probe’:
    drivers/leds/leds-s3c24xx.c:100:2: error: implicit declaration of
    function ‘s3c_gpio_setpull’ [-Werror=implicit-function-declaration]

    Signed-off-by: Tushar Behera
    Acked-by: Bryan Wu
    Signed-off-by: Linus Walleij

    Tushar Behera
     

03 Dec, 2013

1 commit

  • We need to make sure that the error code from devm_of_pwm_get() is the one
    the module returns in case of failure.
    Restructure the code to make this possible for DT booted case.
    With this patch the driver can ask for deferred probing when the board is
    booted with DT.
    Fixes for example omap4-sdp board's keyboard backlight led.

    Signed-off-by: Peter Ujfalusi
    Signed-off-by: Bryan Wu

    Peter Ujfalusi