summaryrefslogtreecommitdiff
path: root/drivers/leds/leds-netxbig.c
AgeCommit message (Collapse)Author
2015-11-03leds: netxbig: set led_classdev max_brightnessSimon Guinot
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-03leds: netxbig: convert to use the devm_ functionsSimon Guinot
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-03leds: netxbig: add device tree bindingSimon Guinot
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-01-13leds: netxbig: fix oops at probe timeSimon Guinot
This patch fixes a NULL pointer dereference on led_dat->mode_val. Due to this bug, a kernel oops can be observed at probe time on the LaCie 2Big and 5Big v2 boards: Unable to handle kernel NULL pointer dereference at virtual address 00000008 [...] [<c03f244c>] (netxbig_led_probe) from [<c02c8c6c>] (platform_drv_probe+0x4c/0x9c) [<c02c8c6c>] (platform_drv_probe) from [<c02c72d0>] (driver_probe_device+0x98/0x25c) [<c02c72d0>] (driver_probe_device) from [<c02c7520>] (__driver_attach+0x8c/0x90) [<c02c7520>] (__driver_attach) from [<c02c5c24>] (bus_for_each_dev+0x68/0x94) [<c02c5c24>] (bus_for_each_dev) from [<c02c6408>] (bus_add_driver+0x124/0x1dc) [<c02c6408>] (bus_add_driver) from [<c02c7ac0>] (driver_register+0x78/0xf8) [<c02c7ac0>] (driver_register) from [<c000888c>] (do_one_initcall+0x80/0x1cc) [<c000888c>] (do_one_initcall) from [<c0733618>] (kernel_init_freeable+0xe4/0x1b4) [<c0733618>] (kernel_init_freeable) from [<c058db9c>] (kernel_init+0xc/0xec) [<c058db9c>] (kernel_init) from [<c0009850>] (ret_from_fork+0x14/0x24) [...] This bug was introduced by commit 588a6a99286ae30afb1339d8bc2163517b1b7dd1 ("leds: netxbig: fix attribute-creation race"). Signed-off-by: Simon Guinot <simon.guinot@sequanux.org> Cc: <stable@vger.kernel.org> # 3.17+ Acked-by: Johan Hovold <johan@kernel.org> Signed-off-by: Bryan Wu <cooloney@gmail.com>
2014-10-20leds: drop owner assignment from platform_driversWolfram Sang
A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2014-06-25leds: netxbig: fix attribute-creation raceJohan Hovold
Use the attribute groups of the led-class to create the sata attribute during probe in order to avoid racing with userspace. [cooloney@gmail.com: clean up return led_classdev_register()] Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Bryan Wu <cooloney@gmail.com>
2014-02-27drivers/leds: delete non-required instances of include <linux/init.h>Paul Gortmaker
None of these files are actually using any __init type directives and hence don't need to include <linux/init.h>. Most are just a left over from __devinit and __cpuinit removal, or simply due to code getting copied from one driver to the next. Cc: Bryan Wu <cooloney@gmail.com> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: linux-leds@vger.kernel.org Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Bryan Wu <cooloney@gmail.com>
2013-08-26leds: use dev_get_platdata()Jingoo Han
Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Bryan Wu <cooloney@gmail.com>
2012-12-15Merge branch 'for-next' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds Pull LED subsystem update from Bryan Wu. * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds: (47 commits) leds: leds-lp5521: return an error code on error in probe() leds: leds-clevo-mail: Use pr_* instead of printks leds: leds-rb532: Fix checkpatch errors leds: led-triggers: Fix checkpatch warnings leds: ledtrig-backlight: Fix checkpatch error leds: leds-wrap: Use <linux/io.h> instead of <asm/io.h> leds: leds-wm8350: Use dev_err instead of printk leds: leds-pwm: Fix checkpatch warning leds: leds-pca955x: Use dev_info instead of printk leds: leds-net48xx: Use linux/io.h instead of asm/io.h leds: leds-lt3593: Fix checkpatch warnings leds: leds-gpio: Use dev_info instead of printk leds: leds-da903x: Fix checkpatch error and warnings leds: leds-bd2802: Fix checkpatch warnings leds: leds-adp5520: Fix checkpatch warnings leds: led-class: Fix checkpatch warning leds: leds-ns2: use devm_gpio_request_one leds: leds-lt3593: use devm_gpio_request_one leds: leds-gpio: use devm_gpio_request_one leds: lp3944: Fix return value ...
2012-11-28leds: remove use of __devexitBill Pemberton
CONFIG_HOTPLUG is going away as an option so __devexit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: Jan-Simon Moeller <jansimon.moeller@gmx.de> Acked-by: Bryan Wu <cooloney@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-28leds: remove use of __devinitBill Pemberton
CONFIG_HOTPLUG is going away as an option so __devinit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: Jan-Simon Moeller <jansimon.moeller@gmx.de> Acked-by: Bryan Wu <cooloney@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-28leds: remove use of __devexit_pBill Pemberton
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: Jan-Simon Moeller <jansimon.moeller@gmx.de> Acked-by: Bryan Wu <cooloney@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26leds: leds-netxbig: replace strict_strtoul() with kstrtoul()Jingoo Han
The usage of strict_strtoul() is not preferred, because strict_strtoul() is obsolete. Thus, kstrtoul() should be used. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Bryan Wu <cooloney@gmail.com>
2012-09-19ARM: orion: move platform_data definitionsArnd Bergmann
Platform data for device drivers should be defined in include/linux/platform_data/*.h, not in the architecture and platform specific directories. This moves such data out of the orion include directories Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: Nicolas Pitre <nico@linaro.org> Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com> Cc: Jason Cooper <jason@lakedaemon.net> Cc: Andrew Lunn <andrew@lunn.ch> Cc: Vinod Koul <vinod.koul@intel.com> Cc: Dan Williams <djbw@fb.com> Cc: Bryan Wu <bryan.wu@canonical.com> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: Chris Ball <cjb@laptop.org> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: Liam Girdwood <lrg@ti.com> Cc: Jaroslav Kysela <perex@perex.cz> Cc: Takashi Iwai <tiwai@suse.de>
2012-07-24leds: convert Big Networks LED driver to devm_kzalloc()Bryan Wu
Cc: Simon Guinot <sguinot@lacie.com> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
2012-05-10drivers/leds: correct __devexit annotationsArnd Bergmann
__devexit functions are discarded without CONFIG_HOTPLUG, so they need to be referenced carefully. A __devexit function may also not be called from a __devinit function. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Cc: Bryan Wu <bryan.wu@canonical.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-01-10drivers/leds/leds-netxbig.c: use gpio_request_one()Axel Lin
Use gpio_request_one() instead of multiple gpiolib calls. This also simplifies error handling a bit. Signed-off-by: Axel Lin <axel.lin@gmail.com> Cc: Simon Guinot <sguinot@lacie.com> Cc: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-01-10leds: convert led platform drivers to module_platform_driverAxel Lin
Factor out some boilerplate code for platform driver registration into module_platform_driver. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Haojian Zhuang <hzhuang1@marvell.com> [led-88pm860x.c] Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: Michael Hennerich <hennerich@blackfin.uclinux.org> Cc: Mike Rapoport <mike@compulab.co.il> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-10-07leds: add LED driver for Big Network series LEDsSimon Guinot
This patch add a LED class driver for LEDs found on the LaCie 2Big and 5Big Network v2 boards. The LEDs are wired to a CPLD and are controlled through a GPIO extension bus. Signed-off-by: Simon Guinot <sguinot@lacie.com> Signed-off-by: Nicolas Pitre <nico@fluxnic.net>