summaryrefslogtreecommitdiffstats
path: root/drivers/leds/leds-turris-omnia.c
Commit message (Collapse)AuthorAgeFilesLines
* leds: turris-omnia: Convert to i2c's .probe_new()Uwe Kleine-König2023-01-301-3/+2
| | | | | | | | | | The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Marek Behún <kabel@kernel.org> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20221118224540.619276-289-uwe@kleine-koenig.org
* i2c: Make remove callback return voidUwe Kleine-König2022-08-161-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The value returned by an i2c driver's remove function is mostly ignored. (Only an error message is printed if the value is non-zero that the error is ignored.) So change the prototype of the remove function to return no value. This way driver authors are not tempted to assume that passing an error to the upper layer is a good idea. All drivers are adapted accordingly. There is no intended change of behaviour, all callbacks were prepared to return 0 before. Reviewed-by: Peter Senna Tschudin <peter.senna@gmail.com> Reviewed-by: Jeremy Kerr <jk@codeconstruct.com.au> Reviewed-by: Benjamin Mugnier <benjamin.mugnier@foss.st.com> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Reviewed-by: Crt Mori <cmo@melexis.com> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: Marek Behún <kabel@kernel.org> # for leds-turris-omnia Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Petr Machata <petrm@nvidia.com> # for mlxsw Reviewed-by: Maximilian Luz <luzmaximilian@gmail.com> # for surface3_power Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> # for bmc150-accel-i2c + kxcjk-1013 Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> # for media/* + staging/media/* Acked-by: Miguel Ojeda <ojeda@kernel.org> # for auxdisplay/ht16k33 + auxdisplay/lcd2s Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com> # for versaclock5 Reviewed-by: Ajay Gupta <ajayg@nvidia.com> # for ucsi_ccg Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> # for iio Acked-by: Peter Rosin <peda@axentia.se> # for i2c-mux-*, max9860 Acked-by: Adrien Grassein <adrien.grassein@gmail.com> # for lontium-lt8912b Reviewed-by: Jean Delvare <jdelvare@suse.de> # for hwmon, i2c-core and i2c/muxes Acked-by: Corey Minyard <cminyard@mvista.com> # for IPMI Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com> # for drivers/power Acked-by: Krzysztof Hałasa <khalasa@piap.pl> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Wolfram Sang <wsa@kernel.org>
* leds: turris-omnia: convert to use dev_groupsGreg Kroah-Hartman2022-07-301-3/+1
| | | | | | | | | | | | | | The driver core supports the ability to handle the creation and removal of device-specific sysfs files in a race-free manner. Take advantage of that by converting this driver to use this by moving the sysfs attributes into a group and assigning the dev_groups pointer to it. Cc: Pavel Machek <pavel@ucw.cz> Cc: linux-leds@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Marek Behún <kabel@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Pavel Machek <pavel@ucw.cz>
* leds: turris-omnia: add missing MODULE_DEVICE_TABLEZou Wei2021-06-231-0/+1
| | | | | | | | | | This patch adds missing MODULE_DEVICE_TABLE definition which generates correct modalias for automatic loading of this driver when it is built as an external module. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Zou Wei <zou_wei@huawei.com> Signed-off-by: Pavel Machek <pavel@ucw.cz>
* treewide: change my e-mail address, fix my nameMarek Behún2021-04-091-2/+2
| | | | | | | | | | | | | | | Change my e-mail address to kabel@kernel.org, and fix my name in non-code parts (add diacritical mark). Link: https://lkml.kernel.org/r/20210325171123.28093-2-kabel@kernel.org Signed-off-by: Marek Behún <kabel@kernel.org> Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Jassi Brar <jassisinghbrar@gmail.com> Cc: Linus Walleij <linus.walleij@linaro.org> Cc: Pavel Machek <pavel@ucw.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* leds: turris-omnia: check for LED_COLOR_ID_RGB instead LED_COLOR_ID_MULTIMarek Behún2020-11-251-2/+2
| | | | | | | | | LED core does not allow LED_COLOR_ID_MULTI for now and instead for RGB LEDs prefers LED_COLOR_ID_RGB. Signed-off-by: Marek Behún <kabel@kernel.org> Fixes: 77dce3a22e89 ("leds: disallow /sys/class/leds/*:multi:* for now") Signed-off-by: Pavel Machek <pavel@ucw.cz>
* leds: turris-omnia: fix checkpatch warningMarek Behún2020-11-251-2/+2
| | | | | | | Use kstrtoul instead of sscanf to satisfy checkpatch. Signed-off-by: Marek Behún <kabel@kernel.org> Signed-off-by: Pavel Machek <pavel@ucw.cz>
* leds: turris-omnia: wrap to 80 columnsMarek Behún2020-11-251-19/+24
| | | | | | | | Although checkpatch changed the max-line-length default to 100 columns, we still prefer 80 columns somewhere. Signed-off-by: Marek Behún <kabel@kernel.org> Signed-off-by: Pavel Machek <pavel@ucw.cz>
* leds: turris-omnia: use constants instead of macros for color commandMarek Behún2020-11-251-21/+13
| | | | | | | | | Use integer constants directly when building I2C messages for LED color change command, instead of macros. The command is simple enough to understand what is going on even without these names. Signed-off-by: Marek Behún <kabel@kernel.org> Signed-off-by: Pavel Machek <pavel@ucw.cz>
* leds: parse linux,default-trigger DT property in LED coreMarek Behún2020-09-261-2/+0
| | | | | | | | | | | | | | | | | | | | Do the parsing of `linux,default-trigger` DT property to LED core. Currently it is done in many different drivers and the code is repeated. This patch removes the parsing from 23 drivers: an30259a, aw2013, bcm6328, bcm6358, cr0014114, el15203000, gpio, is31fl32xx, lm3532, lm36274, lm3692x, lm3697, lp50xx, lp8860, lt3593, max77650, mt6323, ns2, pm8058, pwm, syscon, tlc591xx and turris-omnia. There is one driver in drivers/input which parses this property on it's own. I shall send a separate patch there after this is applied. There are still 8 drivers that parse this property on their own because they do not pass the led_init_data structure to the registering function. I will try to refactor those in the future. Signed-off-by: Marek Behún <marek.behun@nic.cz> Signed-off-by: Pavel Machek <pavel@ucw.cz>
* leds: various: fix OF node leaksMarek Behún2020-09-261-1/+3
| | | | | | | | | | | | Fix OF node leaks by calling of_node_put in for_each_available_child_of_node when the cycle breaks or returns. Signed-off-by: Marek Behún <marek.behun@nic.cz> Cc: Nikita Travkin <nikitos.tr@gmail.com> Cc: Milo Kim <milo.kim@ti.com> Cc: Dan Murphy <dmurphy@ti.com> Signed-off-by: Pavel Machek <pavel@ucw.cz> Not-for-stable: untested, theoretical, insignificant leaks
* leds: various: use dev_of_node(dev) instead of dev->of_nodeMarek Behún2020-09-261-1/+1
| | | | | | | | | | | | | The dev_of_node function should be preferred. Signed-off-by: Marek Behún <marek.behun@nic.cz> Cc: Orson Zhai <orsonzhai@gmail.com> Cc: Baolin Wang <baolin.wang7@gmail.com> Cc: Chunyan Zhang <zhang.lyra@gmail.com> Cc: Sean Wang <sean.wang@mediatek.com> Cc: Matthias Brugger <matthias.bgg@gmail.com> Cc: Riku Voipio <riku.voipio@iki.fi> Signed-off-by: Pavel Machek <pavel@ucw.cz>
* leds: initial support for Turris Omnia LEDsMarek Behún2020-07-241-0/+295
This adds basic support for LEDs on the front side of CZ.NIC's Turris Omnia router. There are 12 RGB LEDs. The controller supports HW triggering mode for the LEDs, but this driver does not support it yet, and sets all the LEDs defined in device-tree into SW mode upon probe. This driver uses the multicolor LED framework. Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Dan Murphy <dmurphy@ti.com> Signed-off-by: Pavel Machek <pavel@ucw.cz>