1
0
Fork 0
Commit Graph

875 Commits (4b6ba5e28b2903fa8b51c6d5fdafb2979fe6eeab)

Author SHA1 Message Date
Julia Lawall 4b6ba5e28b leds: bcm6358: add missing of_node_put
for_each_available_child_of_node performs an of_node_get on each
iteration, so a break out of the loop requires an of_node_put.

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

// <smpl>
@@
expression root,e;
local idexpression child;
@@

 for_each_available_child_of_node(root, child) {
   ... when != of_node_put(child)
       when != e = child
(
   return child;
|
+  of_node_put(child);
?  return ...;
)
   ...
 }
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
2015-11-03 09:00:02 +01:00
Julia Lawall dde4afe765 powerpc/powernv: add missing of_node_put
for_each_child_of_node performs an of_node_get on each iteration, so
a break out of the loop requires an of_node_put.

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

// <smpl>
@@
expression root,e;
local idexpression child;
@@

 for_each_child_of_node(root, child) {
   ... when != of_node_put(child)
       when != e = child
(
   return child;
|
+  of_node_put(child);
?  return ...;
)
   ...
 }
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
2015-11-03 09:00:00 +01:00
Fida Mohammad e9aadb864f leds: leds-wrap.c: Use devm_led_classdev_register
Use of resource managed function devm_led_classdev_register to
make initialization path simpler. Also removed redundant remove
function.

Signed-off-by: Fida Mohammad <fmthoker@gmail.com>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
2015-11-03 08:59:58 +01:00
Muhammad Falak R Wani 511676230b leds: leds-net48xx: Use devm_led_classdev_register
Use devm_led_classdev_register instead of led_classdev_register,
removing the redundant net48xx_led_remove function.

Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
2015-11-03 08:59:54 +01:00
Muhammad Falak R Wani 81aad9f81e leds: leds-menf21bmc.c: Use devm_led_class_register
Use resource-managed function devm_led_classdev_register instead
of led_classdev_register, consequently remove redundant
menf21bmc_led_remove function.
Also drop the unneeded label err_free_leds.

Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
2015-11-03 08:59:52 +01:00
Fida Mohammad d439861434 leds: leds-locomo.c: Use devm_led_classdev_register
Use resource managed function devm_led_classdev_register to make
initialisation path simpler.
Also removed redundant led_classdev_unregister function.

Signed-off-by: Fida Mohammad <fmthoker@gmail.com>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
2015-11-03 08:59:50 +01:00
Heiko Schocher 707f33ed85 leds: leds-gpio: add shutdown function
add a shutdown function for setting the gpio-leds
into off state when shuting down.

Signed-off-by: Heiko Schocher <hs@denx.de>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
2015-11-03 08:59:48 +01:00
Álvaro Fernández Rojas 9f82c778ce leds-bcm6328: add more init configuration options
This patch adds more init register configuration options:
- Serial LEDs multiplexing.
- Serial LEDs clock signal low/high polarity.
- Serial LEDs data signal low/high polarity.
- Serial LEDs shift direction inverted/normal.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
2015-11-03 08:59:44 +01:00
Álvaro Fernández Rojas d8fe1606d1 leds-bcm6328: simplify and improve default-state handling
This patch simplifies and improves the code related to
default-state handling.
It also changes the code to power off the LEDs by default.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
2015-11-03 08:59:40 +01:00
Álvaro Fernández Rojas 79653fbb33 leds-bcm6328: print invalid LED
Print invalid LED instead of warning only about maximum LED value.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
2015-11-03 08:59:38 +01:00
Simon Guinot 7b9d9d8815 leds: netxbig: set led_classdev max_brightness
This patch sets the led_classdev max_brightness to the maximum level
value supported by hardware. This allows to get rid of the brightness
conversion operation (from software [0:LED_FULL] to hardware ranges) in
brightness_set().

Signed-off-by: Simon Guinot <simon.guinot@sequanux.org>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
2015-11-03 08:59:36 +01:00
Simon Guinot cd0109555b leds: netxbig: convert to use the devm_ functions
This patch converts the leds-netxbig driver to use the devres functions
devm_gpio_request_one() and devm_led_classdev_register(). This allows to
simplify the code a bit.

Signed-off-by: Simon Guinot <simon.guinot@sequanux.org>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
2015-11-03 08:59:33 +01:00
Simon Guinot 2976b17989 leds: netxbig: add device tree binding
This patch adds device tree support for the netxbig LEDs.

This also introduces a additionnal DT binding for the GPIO extension bus
(netxbig-gpio-ext) used to configure the LEDs. Since this bus could also
be used to control other devices, then it seems more suitable to have it
in a separate DT binding.

Signed-off-by: Simon Guinot <simon.guinot@sequanux.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
2015-11-03 08:59:25 +01:00
Jiri Prchal 1c7b9d0edf leds: triggers: add invert to heartbeat
This patch adds possibility to invert heartbeat blinking.
The inverted LED is more time ON then OFF. It's because it looks
better when the heartbeat LED is next to other LED which is most
time ON. The invert value is exported same way via sysfs in file
invert like oneshot. I get inspiration from this trigger.

Signed-off-by: Jiri Prchal <jiri.prchal@aksignal.cz>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
2015-11-03 08:59:23 +01:00
Jacek Anaszewski 757b06ae04 leds: core: Move LED core callbacks out of led-class.c
Since the API for controlling LED brightness and blinking is defined in
the LED core, move the related timer and work callbacks to the led-core.c,
and initialize them through a new led_core_init API.

Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Acked-by: Andrew Lunn <andrew@lunn.ch>
Acked-by: Pavel Machek <pavel@ucw.cz>
2015-11-03 08:59:22 +01:00
Ralf Baechle 22a16873d3 LED/MIPS: Move SEAD3 LED driver to where it belongs.
Fixes the following randconfig problem

leds-sead3.c:(.text+0x7dc): undefined reference to `led_classdev_unregister'
leds-sead3.c:(.text+0x7e8): undefined reference to `led_classdev_unregister'

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Cc: Bryan Wu <cooloney@gmail.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Markos Chandras <markos.chandras@imgtec.com>
Cc: linux-leds@vger.kernel.org
Cc: linux-mips@linux-mips.org
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
2015-11-03 08:59:20 +01:00
Muhammad Falak R Wani 95281b5b59 leds: leds-ipaq-micro: Fix coding style issues
Spaces at the starting of a line are removed, indentation using
tab, instead of space. Also, line width of more than 80 characters
is also taken care of.
Two warnings are left alone to aid better readability.

Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
2015-11-03 08:59:17 +01:00
Muhammad Falak R Wani 431557f4a4 leds: leds-ipaq-micro: Use devm_led_classdev_register
Use of resource-managed function devm_led_classdev_register
instead of led_classdev_register is preferred, consequently
remove redundant function micro_leds_remove.

Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
2015-11-03 08:59:15 +01:00
Muhammad Falak R Wani 583a2b2cd7 leds: leds-ot200: Use devm_led_classdev_register
Use resource-managed function devm_led_classdev_register
instead of led_classdev_register to make the error path simpler.
The goto is replaced with direct return, unneeded label err is
dropped. Also, remove redundant ot200_led_remove.

Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
2015-11-03 08:59:13 +01:00
Muhammad Falak R Wani c0fc68ba97 leds: leds-hp6xx: Use devm_led_classdev_register
Use resource-managed function devm_led_classdev_register
instead of led_classdev_register to simplify error path.
An unnecessary check of ret is replaced with a direct return
Also, remove redundant hp6xxled_remove.

Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
2015-11-03 08:59:11 +01:00
Vaishali Thakkar aa4e252495 leds: leds-cobalt-qube: Use devm_led_classdev_register
Use resource-managed function devm_led_classdev_register instead
of led_classdev_register to make the error-path simpler.

To be compatible with the change, goto is replaced with direct
return, unneeded label err_null is dropped and unnecessary variable
retval is removed. Also, remove redundant cobalt_qube_led_remove.

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
2015-11-03 08:59:09 +01:00
Takashi Iwai 2338f73d40 leds:lp55xx: Correct Kconfig dependency for f/w user helper
The commit [b67893206fc0: leds:lp55xx: fix firmware loading error]
tries to address the firmware file handling with user helper, but it
sets a wrong Kconfig CONFIG_FW_LOADER_USER_HELPER_FALLBACK.  Since the
wrong option was enabled, the system got a regression -- it suffers
from the unexpected long delays for non-present firmware files.

This patch corrects the Kconfig dependency to the right one,
CONFIG_FW_LOADER_USER_HELPER.  This doesn't change the fallback
behavior but only enables UMH when needed.

Bugzilla: https://bugzilla.opensuse.org/show_bug.cgi?id=944661
Fixes: b67893206f ('leds:lp55xx: fix firmware loading error')
Cc: <stable@vger.kernel.org> # v4.2+
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
2015-09-17 10:02:20 +02:00
Jacek Anaszewski 35bfe456be leds: leds-ipaq-micro: Add LEDS_CLASS dependency
Fix missing Kconfig LEDS_CLASS dependency.

Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
2015-09-17 10:02:12 +02:00
Jacek Anaszewski 305c324f43 leds: aat1290: add 'static' modifier to init_mm_current_scale
Function init_mm_current_scale is used only locally. Make it static then.

Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
2015-09-17 10:02:08 +02:00
Luis de Bethencourt 98f9cc7ffc leds: leds-ns2: Fix module autoload for OF platform driver
This platform driver has a OF device ID table but the OF module
alias information is not created so module autoloading won't work.

Signed-off-by: Luis de Bethencourt <luis@debethencourt.com>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
2015-09-17 10:02:05 +02:00
Luis de Bethencourt e3df661ff3 leds: max77693: Fix module autoload for OF platform driver
This platform driver has a OF device ID table but the OF module
alias information is not created so module autoloading won't work.

Signed-off-by: Luis de Bethencourt <luis@debethencourt.com>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
2015-09-17 10:02:03 +02:00
Luis de Bethencourt 3682c7bdf5 leds: ktd2692: Fix module autoload for OF platform driver
This platform driver has a OF device ID table but the OF module
alias information is not created so module autoloading won't work.

Signed-off-by: Luis de Bethencourt <luis@debethencourt.com>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
2015-09-17 10:02:00 +02:00
Luis de Bethencourt 01736f07ca leds: bcm6358: Fix module autoload for OF platform driver
This platform driver has a OF device ID table but the OF module
alias information is not created so module autoloading won't work.

Signed-off-by: Luis de Bethencourt <luis@debethencourt.com>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
2015-09-17 10:01:57 +02:00
Luis de Bethencourt 6528ca19c1 leds: bcm6328: Fix module autoload for OF platform driver
This platform driver has a OF device ID table but the OF module
alias information is not created so module autoloading won't work.

Signed-off-by: Luis de Bethencourt <luis@debethencourt.com>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
2015-09-17 10:01:54 +02:00
Luis de Bethencourt 93a51aa406 leds: aat1290: Fix module autoload for OF platform driver
This platform driver has a OF device ID table but the OF module
alias information is not created so module autoloading won't work.

Signed-off-by: Luis de Bethencourt <luis@debethencourt.com>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
2015-09-17 10:01:51 +02:00
Linus Torvalds 670c039dee - Stop using LP855X Platform Data to control regulators
- Move PWM8941 WLED driver into Backlight
  - Remove invalid use of IS_ERR_VALUE() macro
  - Remove duplicate check for NULL data before unregistering
  - Export I2C Device ID structure
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJV6FPVAAoJEFGvii+H/Hdh1NIP/2mcBwvmF8zgmTUALbRLKyAp
 3LXx0/Nh64Pjz2rDsZPclo4NLlq43d9xq/A3CBI4b00VgiofgRG/Cihhzo8nxhTu
 XN73TgVQ2CiNrQ0yn85dedoVEbv0cAlZYdyuHrp1SUUSPOUhaiRU2w6k7BkY0gc2
 8lkzmVnMOkQjT+Elj6wVBcPiojm333Tu5wE125W8t6XDOwDfpLoVkzcxcv/V7eIo
 pStB7u3MsXZ9kmG2S9aMSZX1PS6C772OeN1I7+3lFy67qiIDj3tQ+8MyaMFvWGdQ
 /w8+f4K8k0t1m1OJVLgsT4UKR/7qprTOvEXYGrsVPPwZqSOypRZOooPOQbAVtkV6
 qYsVYEnbsJerkCuAyWETL+H5eH+P56Zl66t6a9hgnzw4wKYarufo+xUe0b+ntmoO
 dtegXgUVryY1P9teXsnnWx24r4pfaCWunO1RUXSZABCK+0qEeXa2SM/PFtkCWwEd
 AGBp8Rcv9a2BHtY2oaii+rs6WFUH+CGeZ8rt1cKBZvT2gCjlTPb5WiGvCEnN3OBi
 BCWgTLILldSRG7ERW6P6W6WkpP9u6gz8BChLNe0PsoOoNLXElHj6VCAlusOc1kHU
 6WwvMpKcQ+SVMVNouFLv3Ur5K8sF7VkyaHDRoipeKufu0n3b3+AXEaRr/Ch1BsIh
 cdUHgYJSujzcD/Zx8crp
 =URbg
 -----END PGP SIGNATURE-----

Merge tag 'backlight-for-linus-4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight

Pull backlight updates from Lee Jones:
 - Stop using LP855X Platform Data to control regulators
 - Move PWM8941 WLED driver into Backlight
 - Remove invalid use of IS_ERR_VALUE() macro
 - Remove duplicate check for NULL data before unregistering
 - Export I2C Device ID structure

* tag 'backlight-for-linus-4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight:
  backlight: tosa: Export I2C module alias information
  backlight: lp8788_bl: Delete a check before backlight_device_unregister()
  backlight: sky81452: Remove unneeded use of IS_ERR_VALUE() macro
  backlight: pm8941-wled: Move PM8941 WLED driver to backlight
  backlight: lp855x: Use private data for regulator control
2015-09-04 11:40:40 -07:00
Linus Torvalds ff474e8ca8 powerpc updates for 4.3
- Support "hybrid" iommu/direct DMA ops for coherent_mask < dma_mask from Benjamin Herrenschmidt
  - EEH fixes for SRIOV from Gavin
  - Introduce rtas_get_sensor_fast() for IRQ handlers from Thomas Huth
  - Use hardware RNG for arch_get_random_seed_* not arch_get_random_* from Paul Mackerras
  - Seccomp filter support from Michael Ellerman
  - opal_cec_reboot2() handling for HMIs & machine checks from Mahesh Salgaonkar
  - Add powerpc timebase as a trace clock source from Naveen N. Rao
  - Misc cleanups in the xmon, signal & SLB code from Anshuman Khandual
  - Add an inline function to update POWER8 HID0 from Gautham R. Shenoy
  - Fix pte_pagesize_index() crash on 4K w/64K hash from Michael Ellerman
  - Drop support for 64K local store on 4K kernels from Michael Ellerman
  - move dma_get_required_mask() from pnv_phb to pci_controller_ops from Andrew Donnellan
  - Initialize distance lookup table from drconf path from Nikunj A Dadhania
  - Enable RTC class support from Vaibhav Jain
  - Disable automatically blocked PCI config from Gavin Shan
  - Add LEDs driver for PowerNV platform from Vasant Hegde
  - Fix endianness issues in the HVSI driver from Laurent Dufour
  - Kexec endian fixes from Samuel Mendoza-Jonas
  - Fix corrupted pdn list from Gavin Shan
  - Fix fenced PHB caused by eeh_slot_error_detail() from Gavin Shan
 
  - Freescale updates from Scott: Highlights include 32-bit memcpy/memset
    optimizations, checksum optimizations, 85xx config fragments and updates,
    device tree updates, e6500 fixes for non-SMP, and misc cleanup and minor
    fixes.
 
  - A ton of cxl updates & fixes:
   - Add explicit precision specifiers from Rasmus Villemoes
   - use more common format specifier from Rasmus Villemoes
   - Destroy cxl_adapter_idr on module_exit from Johannes Thumshirn
   - Destroy afu->contexts_idr on release of an afu from Johannes Thumshirn
   - Compile with -Werror from Daniel Axtens
   - EEH support from Daniel Axtens
   - Plug irq_bitmap getting leaked in cxl_context from Vaibhav Jain
   - Add alternate MMIO error handling from Ian Munsie
   - Allow release of contexts which have been OPENED but not STARTED from Andrew Donnellan
   - Remove use of macro DEFINE_PCI_DEVICE_TABLE from Vaishali Thakkar
   - Release irqs if memory allocation fails from Vaibhav Jain
   - Remove racy attempt to force EEH invocation in reset from Daniel Axtens
   - Fix + cleanup error paths in cxl_dev_context_init from Ian Munsie
   - Fix force unmapping mmaps of contexts allocated through the kernel api from Ian Munsie
   - Set up and enable PSL Timebase from Philippe Bergheaud
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJV5+GzAAoJEFHr6jzI4aWA0iAP/jcd0kNaNBzLgcDKKygKdgz4
 xn4EWu81vfMfZYWesb0ATrjlH0hLsRxSXoFUqUMhtJTa5kNAoCIaz/M8WBALS50h
 aT+i7br4WEU2j2FcaMyP3iAZx/2hl+2utODJSHPRWPkec1fUDBfEyBf++e520RWM
 HUQGIGZXh8yq7KMA96Pwhsvls9vOB8hS2UdU/NS8ff3J5jFvXC1/WmF2qfzJBS1V
 8iHyz26Jl8+dJ+et7iC2oD5XQAjIH1oJgOyPVPBzAQttfi8RjuVzRA30TfPBAUwI
 lC9nlmPy6bCe4kiQYWVB1z7GegHyW/9vkeuMj/u8mZbqpaayMEMZmd2C3iNDXNHx
 i2NSvdln539t4qWYsV2v6lVCfa/ayDHD73Wackj5Dk394tzXnpCPhxNzc2yKEd5v
 h7vwYc9jBhsbfSCSogaM+gSHJ1APgCidggHJMYYNA2nN2u6V62RpsMB7zp/1+Q2v
 yqYdD8oYF4Dm21x/ujaNFrlizROD46WS0UqdJ3yP6HAqRYIpRXtibmpECJgt1n5h
 HjADEci4hQ2UQxdMdp/Q5KZnPTJebBtrZrmkW5r6cZBUaTB5TVkFaEWN44CT/Loh
 tMNeA3qOBN06CaQS2WL3UUUWpbZq9fSbWuUZ5lWZDb5AOyRxe5eWVYNLkiyIXozY
 L24l1bYdBhXahnjoS/kc
 =n9+X
 -----END PGP SIGNATURE-----

Merge tag 'powerpc-4.3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

Pull powerpc updates from Michael Ellerman:

 - support "hybrid" iommu/direct DMA ops for coherent_mask < dma_mask
   from Benjamin Herrenschmidt

 - EEH fixes for SRIOV from Gavin

 - introduce rtas_get_sensor_fast() for IRQ handlers from Thomas Huth

 - use hardware RNG for arch_get_random_seed_* not arch_get_random_*
   from Paul Mackerras

 - seccomp filter support from Michael Ellerman

 - opal_cec_reboot2() handling for HMIs & machine checks from Mahesh
   Salgaonkar

 - add powerpc timebase as a trace clock source from Naveen N.  Rao

 - misc cleanups in the xmon, signal & SLB code from Anshuman Khandual

 - add an inline function to update POWER8 HID0 from Gautham R.  Shenoy

 - fix pte_pagesize_index() crash on 4K w/64K hash from Michael Ellerman

 - drop support for 64K local store on 4K kernels from Michael Ellerman

 - move dma_get_required_mask() from pnv_phb to pci_controller_ops from
   Andrew Donnellan

 - initialize distance lookup table from drconf path from Nikunj A
   Dadhania

 - enable RTC class support from Vaibhav Jain

 - disable automatically blocked PCI config from Gavin Shan

 - add LEDs driver for PowerNV platform from Vasant Hegde

 - fix endianness issues in the HVSI driver from Laurent Dufour

 - kexec endian fixes from Samuel Mendoza-Jonas

 - fix corrupted pdn list from Gavin Shan

 - fix fenced PHB caused by eeh_slot_error_detail() from Gavin Shan

 - Freescale updates from Scott: Highlights include 32-bit memcpy/memset
   optimizations, checksum optimizations, 85xx config fragments and
   updates, device tree updates, e6500 fixes for non-SMP, and misc
   cleanup and minor fixes.

 - a ton of cxl updates & fixes:
    - add explicit precision specifiers from Rasmus Villemoes
    - use more common format specifier from Rasmus Villemoes
    - destroy cxl_adapter_idr on module_exit from Johannes Thumshirn
    - destroy afu->contexts_idr on release of an afu from Johannes
      Thumshirn
    - compile with -Werror from Daniel Axtens
    - EEH support from Daniel Axtens
    - plug irq_bitmap getting leaked in cxl_context from Vaibhav Jain
    - add alternate MMIO error handling from Ian Munsie
    - allow release of contexts which have been OPENED but not STARTED
      from Andrew Donnellan
    - remove use of macro DEFINE_PCI_DEVICE_TABLE from Vaishali Thakkar
    - release irqs if memory allocation fails from Vaibhav Jain
    - remove racy attempt to force EEH invocation in reset from Daniel
      Axtens
    - fix + cleanup error paths in cxl_dev_context_init from Ian Munsie
    - fix force unmapping mmaps of contexts allocated through the kernel
      api from Ian Munsie
    - set up and enable PSL Timebase from Philippe Bergheaud

* tag 'powerpc-4.3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (140 commits)
  cxl: Set up and enable PSL Timebase
  cxl: Fix force unmapping mmaps of contexts allocated through the kernel api
  cxl: Fix + cleanup error paths in cxl_dev_context_init
  powerpc/eeh: Fix fenced PHB caused by eeh_slot_error_detail()
  powerpc/pseries: Cleanup on pci_dn_reconfig_notifier()
  powerpc/pseries: Fix corrupted pdn list
  powerpc/powernv: Enable LEDS support
  powerpc/iommu: Set default DMA offset in dma_dev_setup
  cxl: Remove racy attempt to force EEH invocation in reset
  cxl: Release irqs if memory allocation fails
  cxl: Remove use of macro DEFINE_PCI_DEVICE_TABLE
  powerpc/powernv: Fix mis-merge of OPAL support for LEDS driver
  powerpc/powernv: Reset HILE before kexec_sequence()
  powerpc/kexec: Reset secondary cpu endianness before kexec
  powerpc/hvsi: Fix endianness issues in the HVSI driver
  leds/powernv: Add driver for PowerNV platform
  powerpc/powernv: Create LED platform device
  powerpc/powernv: Add OPAL interfaces for accessing and modifying system LED states
  powerpc/powernv: Fix the log message when disabling VF
  cxl: Allow release of contexts which have been OPENED but not STARTED
  ...
2015-09-03 16:41:38 -07:00
Linus Torvalds edc837da4b Besides the changes in MAINTAINERS we have:
- optimizations and improvements to existing LED class drivers
 - improvements to the common LEDs DT documentation
 - modifications of kirkwood-* dts files, to be in sync with patches for
   leds-ns2 driver, that move LEDs mode mapping outside of the driver
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.17 (GNU/Linux)
 
 iQIcBAABAgAGBQJV5EAlAAoJEL1qUBy3i3wmcZkP/3ZdQZsv5EbF5XLZFXPORs2s
 BQESLaTVdbgDuSP6CoNkpOGucc5115z+/8GmskWreSck8qxUzgwR8sClU9T2eNi4
 epA3SUBi2QaqjK8sl7tRbva0kAXNT+KqHgPwCuN0Pui0EgXsPHEnDYKfLWULx+wi
 6NVofK2pTHTV+V3QccjMvO4443Mi9FNO9Ee0EaSVPdE/Mh2rIUPhtB5KmK/XUEv1
 gBqVysRoTw/sE5z6SDX2FaSs+98L6UNP9tC8qZCLFqwe2SdQZNqwYJklzHlm3ErI
 lrkxJaJ7NixB4zAO5MKJ7eZJmJ+YMroC2uIa4DjKiiekfA1d18ioOB6jFgkFyH0o
 cErLiXKbJoabIc1XsoE/XT7v8a+dSVB9Tj3OPWQcx6HlGpBXTRcV5sayh0wX895Z
 mn0taprYqS+MnPY/M8jrsl6btsUVRfV6jyneExhIxc3gArkjEjb9m/h3mQNauB8h
 I0kZ56q1nYCcp/4JhfrUEwnD0sdX9jUqvr3yIOFgNknOHAsqgXMgW38H0RxsBiI4
 Tx33cXkp6zh0wqVTPmWe2Ic1xAVY/dSd3ZF2smjzhbwe37unPrXNym6eRguu0ezb
 4ZFjvetkqmz8uqyyTq3Lfc5rfbGPOgtCLvKXOgEyo2HaNPPAxeHqRI3HU8bBDtqp
 j0CCXXXhVqRg4VTzJiXk
 =sa6j
 -----END PGP SIGNATURE-----

Merge tag 'leds_for_4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds

Pull LED updates from Jacek Anaszewski:
 "In this merge window we'd like to announce a change on the list of LED
  subsystem maintainers - Bryan Wu decided to step back and handed over
  the maintainership to me (Jacek Anaszewski), which entailed an update
  of LED subsystem git tree URL.

  Besides the changes in MAINTAINERS we have:

   - optimizations and improvements to existing LED class drivers

   - improvements to the common LEDs DT documentation

   - modifications of kirkwood-* dts files, to be in sync with patches
     for leds-ns2 driver, that move LEDs mode mapping outside of the
     driver"

* tag 'leds_for_4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds:
  leds: Export OF module alias information in missing drivers
  leds:lp55xx: use the private data instead of updating I2C device platform data
  leds: syscon: Correct check for syscon_node_to_regmap() errors
  leds: leds-fsg: Use devm_led_classdev_register
  MAINTAINERS: Change LED subsystem git tree URL
  leds/led-class: Add missing put_device()
  ARM: Kirkwood: add modes-map property to ns2-leds nodes
  leds: tlc591xx: Remove redundant I2C_FUNC_SMBUS_BYTE_DATA functionality check
  leds: leds-ns2: depends on MACH_ARMADA_370
  leds: leds-ns2: handle can_sleep GPIOs
  leds: leds-ns2: move LED modes mapping outside of the driver
  leds: lp8860: Constify reg_default tables
  leds: Drop owner assignment from i2c_driver
  leds: Allow compile test of LEDS_AAT1290 and LEDS_KTD2692 if !GPIOLIB
  leds: Allow compile test of GPIO consumers if !GPIOLIB
  DT: leds: Improve description of flash LEDs related properties
2015-08-31 17:08:05 -07:00
Javier Martinez Canillas 4d59ed8545 leds: Export OF module alias information in missing drivers
The I2C core always reports the MODALIAS uevent as "i2c:<modalias>"
regardless of the mechanism that was used to register the device
(i.e: OF or board code) and the table that is used later to match
the driver with the device (i.e: I2C id table or OF match table).

So drivers needs to export the I2C id table and this be built into
the module or udev won't have the necessary information to autoload
the needed driver module when the device is added.

But this means that OF-only drivers needs to have both OF and I2C id
tables that have to be kept in sync and also the dev node compatible
manufacturer prefix is stripped when reporting the MODALIAS. Which can
lead to issues if two vendors use the same I2C device name for example.

To avoid the above, the I2C core behavior may be changed in the future
to not require an SPI device table for OF-only drivers and report the
OF module alias. So, it's better to also export the OF table even when
is unused now to prevent breaking module loading when the core changes.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
2015-08-28 14:06:30 +02:00
Milo Kim ed13335204 leds:lp55xx: use the private data instead of updating I2C device platform data
Currently, lp55xx_of_populate_pdata() allocates lp55xx_platform_data if
it's null. And it parses the DT and copies values into the
'client->dev.platform_data'. This may have architectural issue.
Platform data is configurable through the DT or I2C board info inside the
platform area. However, lp55xx common driver changes this configuration
when it is loaded. So 'client->dev.platform_data' is not null anymore.
Eventually, the driver initialization is not identical when it's unloaded
and loaded again.
The lp55xx common driver should use the private data, 'lp55xx_chip->pdata'
instead of changing the original platform data.

So, lp55xx_of_populate_pdata() is modified as follows.
* Do not update 'dev->platform_data'. Return the pointer of new allocated
   lp55xx_platform_data. Then the driver points it to private data,
   'lp55xx_chip->pdata'.
* Each lp55xx driver checks the pointer and handles an error case.

Then, original platform data configuration will be kept regardless of
loading or unloading the driver.
The driver allocates the memory and copies them from the DT if it's NULL.
After the driver is loaded again, 'client->dev.platform_data' is same as
initial load, so the driver is initialized identically.

Cc: Toshi Kikuchi <toshik@chromium.org>
Cc: linux-leds@vger.kernel.org
Signed-off-by: Milo Kim <milo.kim@ti.com>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
2015-08-28 14:06:28 +02:00
Bjorn Andersson 991a3f61fa leds: syscon: Correct check for syscon_node_to_regmap() errors
syscon_node_to_regmap() returns a regmap or an ERR_PTR().

Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
2015-08-28 14:06:25 +02:00
Vaishali Thakkar c2d4af9370 leds: leds-fsg: Use devm_led_classdev_register
Use resource-managed function devm_led_classdev_register instead
of led_classdev_register to make the error-path simpler.

To be compatible with the change, various gotos are replaced with
direct returns and unneeded labels are dropped. Also, remove
fsg_led_remove as it is now redundant.

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
2015-08-28 14:06:23 +02:00
Ricardo Ribalda Delgado e5b5a61fcb leds/led-class: Add missing put_device()
Devices found by class_find_device must be freed with put_device().
Otherwise the reference count will not work properly.

Fixes: a96aa64cb5 ("leds/led-class: Handle LEDs with the same name")
Reported-by: Alan Tull <delicious.quinoa@gmail.com>
Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
2015-08-28 14:06:19 +02:00
Axel Lin f3a2a097a3 leds: tlc591xx: Remove redundant I2C_FUNC_SMBUS_BYTE_DATA functionality check
This checking is done by regmap_get_i2c_bus() which is called in
devm_regmap_init_i2c().

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
2015-08-28 14:06:14 +02:00
Simon Guinot 259f5ba308 leds: leds-ns2: depends on MACH_ARMADA_370
The leds-ns2 driver is also used by the n090401 board (Seagate NAS
4-Bay), which is based on the Marvell Armada-370 SoC.

Then this patch allows to select the leds-ns2 driver if MACH_ARMADA_370
is enabled. Additionally, this also updates the Kconfig help message.

Signed-off-by: Simon Guinot <simon.guinot@sequanux.org>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
2015-08-28 14:06:12 +02:00
Simon Guinot 4b90432dc1 leds: leds-ns2: handle can_sleep GPIOs
On the board n090401 (Seagate NAS 4-Bay), some of the LEDs are handled
by the leds-ns2 driver. This LEDs are connected to an I2C GPIO expander
(PCA95554PW) which means that GPIO access may sleep. This patch makes
leds-ns2 compatible with such GPIOs by using the *_cansleep() variant of
the GPIO functions. As a drawback this functions can't be used safely in
a timer context (with the timer LED trigger for example). To fix this
issue, a workqueue mechanism (copied from the leds-gpio driver) is used.

Note that this patch also updates slightly the ns2_led_sata_store
function. The LED state is now retrieved from cached values instead of
reading the GPIOs previously. This prevents ns2_led_sata_store from
working with a stale LED state (which may happen when a delayed work
is pending).

Signed-off-by: Simon Guinot <simon.guinot@sequanux.org>
Signed-off-by: Vincent Donnefort <vdonnefort@gmail.com>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
2015-08-28 14:06:09 +02:00
Vincent Donnefort f7fafd083c leds: leds-ns2: move LED modes mapping outside of the driver
On the board n090401 (Seagate NAS 4-Bay), the LED mode mapping (GPIO
values to LED mode) is different from the one used on other boards
supported by the leds-ns2 driver.

With this patch the hardcoded mapping is removed from leds-ns2. Now,
it must be defined either in the platform data (if an old-fashion board
setup file is used) or in the DT node. In order to allow the later, this
patch also introduces a modes-map property for the leds-ns2 DT binding.

Signed-off-by: Vincent Donnefort <vdonnefort@gmail.com>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
2015-08-28 14:06:06 +02:00
Axel Lin de88e71a91 leds: lp8860: Constify reg_default tables
These reg_default tables are not modified after initialized, so make them
const.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
2015-08-28 14:06:04 +02:00
Krzysztof Kozlowski 44ab901f91 leds: Drop owner assignment from i2c_driver
i2c_driver does not need to set an owner because i2c_register_driver()
will set it.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
2015-08-28 14:06:02 +02:00
Geert Uytterhoeven 6e3956cd53 leds: Allow compile test of LEDS_AAT1290 and LEDS_KTD2692 if !GPIOLIB
The GPIO subsystem provides dummy GPIO consumer functions if GPIOLIB is
not enabled. Hence drivers that depend on GPIOLIB, but use GPIO consumer
functionality only, can still be compiled if GPIOLIB is not enabled.

If COMPILE_TEST is enabled, relax the dependency on GPIOLIB for the
recently introduced symbols LEDS_AAT1290 and LEDS_KTD2692.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
2015-08-28 14:05:59 +02:00
Geert Uytterhoeven 8232274195 leds: Allow compile test of GPIO consumers if !GPIOLIB
The GPIO subsystem provides dummy GPIO consumer functions if GPIOLIB is
not enabled. Hence drivers that depend on GPIOLIB, but use GPIO consumer
functionality only, can still be compiled if GPIOLIB is not enabled.

Relax the dependency on GPIOLIB if COMPILE_TEST is enabled, where
appropriate.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: linux-leds@vger.kernel.org
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
2015-08-28 14:05:57 +02:00
Bjorn Andersson 7ddbc2423c backlight: pm8941-wled: Move PM8941 WLED driver to backlight
The Qualcomm PM8941 WLED block is used for backlight and should therefor
be in the backlight framework and not in the LED framework. This moves
the driver and adapts to the backlight api instead.

Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Tested-by: Rob Clark <robdclark@gmail.com>
Acked-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Acked-by: Jingoo Han <jingoohan1@gmail.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-08-25 08:41:56 +01:00
Michael Ellerman 5d53be7d8c powerpc/powernv: Fix mis-merge of OPAL support for LEDS driver
When I merged the OPAL support for the powernv LEDS driver I missed a
hunk.

This is slightly modified from the original patch, as the original added
code to opal-api.h which is not in the skiboot version, which is
discouraged.

Instead those values are moved into the driver, which is the only place
they are used.

Fixes: 8a8d91817a ("powerpc/powernv: Add OPAL interfaces for accessing and modifying system LED states")
Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2015-08-22 21:09:12 +10:00
Vasant Hegde 84ad6e5cd3 leds/powernv: Add driver for PowerNV platform
This patch implements LED driver for PowerNV platform using the existing
generic LED class framework.

PowerNV platform has below type of LEDs:
  - System attention
      Indicates there is a problem with the system that needs attention.
  - Identify
      Helps the user locate/identify a particular FRU or resource in the
      system.
  - Fault
      Indicates there is a problem with the FRU or resource at the
      location with which the indicator is associated.

We register classdev structures for all individual LEDs detected on the
system through LED specific device tree nodes. Device tree nodes specify
what all kind of LEDs present on the same location code. It registers
LED classdev structure for each of them.

All the system LEDs can be found in the same regular path /sys/class/leds/.
We don't use LED colors. We use LED node and led-types property to form
LED classdev. Our LEDs have names in this format.

        <location_code>:<attention|identify|fault>

Any positive brightness value would turn on the LED and a zero value would
turn off the LED. The driver will return LED_FULL (255) for any turned on
LED and LED_OFF (0) for any turned off LED.

The platform level implementation of LED get and set state has been
achieved through OPAL calls. These calls are made available for the
driver by exporting from architecture specific codes.

Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>
Acked-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Tested-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Acked-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2015-08-20 18:19:07 +10:00
Krzysztof Kozlowski 61b305cd2a drivers: max77693: Move state container to common header
This prepares for merging some of the drivers between max77693 and
max77843 so the child MFD driver can be attached to any parent MFD main
driver.

Move the state container to common header file. Additionally add
consistent 'i2c' prefixes to its members (of 'struct i2c_client' type).

Signed-off-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com>
Acked-by: Sebastian Reichel <sre@kernel.org>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16 21:39:30 +01:00