summaryrefslogtreecommitdiff
path: root/drivers/led
Commit message (Collapse)AuthorAgeFilesLines
* led: pwm: Use NOP uclass driver for top-level nodeStefan Herbrechtsmeier2022-07-081-12/+7
| | | | | | | | | | The top level DT node of pwm-leds is not a LED itself, bind NOP uclass driver to it, and bind different LED uclass driver to its subnodes which represent the actual LEDs. This change removes the top-level node from the 'led list' command output and is based on the commit 01074697801b ("led: gpio: Use NOP uclass driver for top-level node"). Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
* spl: Ensure all SPL symbols in Kconfig have some SPL dependencyTom Rini2022-07-071-2/+2
| | | | | | | | | | | Tighten up symbol dependencies in a number of places. Ensure that a SPL specific option has at least a direct dependency on SPL. In places where it's clear that we depend on something more specific, use that dependency instead. This means in a very small number of places we can drop redundant dependencies. Reported-by: Pali Rohár <pali@kernel.org> Signed-off-by: Tom Rini <trini@konsulko.com>
* led: Drop led_default_state()Marek Vasut2022-04-281-6/+0
| | | | | | | | | | | | This function is empty, drop it. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Patrice Chotard <patrice.chotard@foss.st.com> Cc: Patrick Delaunay <patrick.delaunay@foss.st.com> Cc: Sean Anderson <seanga2@gmail.com> Cc: Simon Glass <sjg@chromium.org> Cc: Steven Lawrance <steven.lawrance@softathome.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
* led: gpio: Use NOP uclass driver for top-level nodeMarek Vasut2022-04-281-17/+13
| | | | | | | | | | | | | | | | | | | | | | The top level DT node of gpio-leds is not a LED itself, bind NOP uclass driver to it, and bind different LED uclass driver to its subnodes which represent the actual LEDs. This simplifies the probe() implementation and fixes the bogus top-level not-an-LED in 'led list' command output: ``` => led list led Error -121 <--- This is removed/fixed by this patch green:user0 off ``` Signed-off-by: Marek Vasut <marex@denx.de> Cc: Patrice Chotard <patrice.chotard@foss.st.com> Cc: Patrick Delaunay <patrick.delaunay@foss.st.com> Cc: Sean Anderson <seanga2@gmail.com> Cc: Simon Glass <sjg@chromium.org> Cc: Steven Lawrance <steven.lawrance@softathome.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> Tested-by: Patrice Chotard <patrice.chotard@foss.st.com>
* led: gpio: Check device compatible string to determine the top level nodeMarek Vasut2022-04-281-2/+1
| | | | | | | | | | | | | | | | | | Since 2d1deaf88ed ("led: gpio: Drop duplicate OF "label" property parsing"), all LED nodes have some sort of label. Use device_is_compatible(..."leds-gpio") to determine whether this is a top-level node, since it is only the top level node which is compatible with "leds-gpio", the GPIO LEDs subnodes are not. Fixes: 2d1deaf88ed ("led: gpio: Drop duplicate OF "label" property parsing") Signed-off-by: Marek Vasut <marex@denx.de> Cc: Patrice Chotard <patrice.chotard@foss.st.com> Cc: Patrick Delaunay <patrick.delaunay@foss.st.com> Cc: Sean Anderson <seanga2@gmail.com> Cc: Simon Glass <sjg@chromium.org> Cc: Steven Lawrance <steven.lawrance@softathome.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> Tested-by: Patrice Chotard <patrice.chotard@foss.st.com>
* led: Mark device instance with DM_FLAG_PROBE_AFTER_BINDMarek Vasut2022-04-281-1/+3
| | | | | | | | | | | | | | | | | | | Calling device_probe() from uclass .post_bind() callback has all kinds of odd side-effects, e.g. device instances not being available just yet. Make use of the DM_FLAG_PROBE_AFTER_BIND instead, mark device instances which need to be probe()d in order to configure the LED default state with this flag and let the DM core do the device_probe() at the right time instead. Fixes: 72675b063b6 ("led: Configure LED default-state on boot") Signed-off-by: Marek Vasut <marex@denx.de> Cc: Patrice Chotard <patrice.chotard@foss.st.com> Cc: Patrick Delaunay <patrick.delaunay@foss.st.com> Cc: Sean Anderson <seanga2@gmail.com> Cc: Simon Glass <sjg@chromium.org> Cc: Steven Lawrance <steven.lawrance@softathome.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> Tested-by: Patrice Chotard <patrice.chotard@foss.st.com>
* led: Configure LED default-state on bootMarek Vasut2022-04-141-25/+32
| | | | | | | | | | | | | | | | In case the DT LED subnode contains "default-state" property set to either "on" or "off", probe the LED driver and configure the LED state automatically. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Alex Nemirovsky <alex.nemirovsky@cortina-access.com> Cc: Patrick Delaunay <patrick.delaunay@foss.st.com> Cc: Philippe Reynes <philippe.reynes@softathome.com> Cc: Sean Anderson <seanga2@gmail.com> Cc: Simon Glass <sjg@chromium.org> Cc: Steven Lawrance <steven.lawrance@softathome.com> [trini: Update the relevant test now that we have support] Signed-off-by: Tom Rini <trini@konsulko.com>
* led: gpio: Drop duplicate OF "label" property parsingMarek Vasut2022-04-141-8/+0
| | | | | | | | | | | | | The OF "label" property parsing is now handled in LED core, drop the duplicate implementation from this driver. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Alex Nemirovsky <alex.nemirovsky@cortina-access.com> Cc: Patrick Delaunay <patrick.delaunay@foss.st.com> Cc: Philippe Reynes <philippe.reynes@softathome.com> Cc: Sean Anderson <seanga2@gmail.com> Cc: Simon Glass <sjg@chromium.org> Cc: Steven Lawrance <steven.lawrance@softathome.com>
* led: pwm: Drop duplicate OF "label" property parsingTom Rini2022-04-141-10/+0
| | | | | | | The OF "label" property parsing is now handled in LED core, drop the duplicate implementation from this driver. Signed-off-by: Tom Rini <trini@konsulko.com>
* led: bcm6753: Drop duplicate OF "label" property parsingTom Rini2022-04-141-12/+0
| | | | | | | The OF "label" property parsing is now handled in LED core, drop the duplicate implementation from this driver. Signed-off-by: Tom Rini <trini@konsulko.com>
* led: cortina: Drop duplicate OF "label" property parsingMarek Vasut2022-04-141-11/+0
| | | | | | | | | | | | | The OF "label" property parsing is now handled in LED core, drop the duplicate implementation from this driver. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Alex Nemirovsky <alex.nemirovsky@cortina-access.com> Cc: Patrick Delaunay <patrick.delaunay@foss.st.com> Cc: Philippe Reynes <philippe.reynes@softathome.com> Cc: Sean Anderson <seanga2@gmail.com> Cc: Simon Glass <sjg@chromium.org> Cc: Steven Lawrance <steven.lawrance@softathome.com>
* led: bcm6858: Drop duplicate OF "label" property parsingMarek Vasut2022-04-141-12/+0
| | | | | | | | | | | | | The OF "label" property parsing is now handled in LED core, drop the duplicate implementation from this driver. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Alex Nemirovsky <alex.nemirovsky@cortina-access.com> Cc: Patrick Delaunay <patrick.delaunay@foss.st.com> Cc: Philippe Reynes <philippe.reynes@softathome.com> Cc: Sean Anderson <seanga2@gmail.com> Cc: Simon Glass <sjg@chromium.org> Cc: Steven Lawrance <steven.lawrance@softathome.com>
* led: bcm6358: Drop duplicate OF "label" property parsingMarek Vasut2022-04-141-12/+0
| | | | | | | | | | | | | The OF "label" property parsing is now handled in LED core, drop the duplicate implementation from this driver. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Alex Nemirovsky <alex.nemirovsky@cortina-access.com> Cc: Patrick Delaunay <patrick.delaunay@foss.st.com> Cc: Philippe Reynes <philippe.reynes@softathome.com> Cc: Sean Anderson <seanga2@gmail.com> Cc: Simon Glass <sjg@chromium.org> Cc: Steven Lawrance <steven.lawrance@softathome.com>
* led: bcm6328: Drop duplicate OF "label" property parsingMarek Vasut2022-04-141-12/+0
| | | | | | | | | | | | | The OF "label" property parsing is now handled in LED core, drop the duplicate implementation from this driver. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Alex Nemirovsky <alex.nemirovsky@cortina-access.com> Cc: Patrick Delaunay <patrick.delaunay@foss.st.com> Cc: Philippe Reynes <philippe.reynes@softathome.com> Cc: Sean Anderson <seanga2@gmail.com> Cc: Simon Glass <sjg@chromium.org> Cc: Steven Lawrance <steven.lawrance@softathome.com>
* led: Move OF "label" property parsing to coreMarek Vasut2022-04-141-0/+12
| | | | | | | | | | | | | | | Every driver in drivers/led/ currently does some form of "label" OF property parsing in its bind() callback. Move this label parsing to LED core, since this "label" OF property is a generic property. This permits code deduplication in subseuqent patches. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Alex Nemirovsky <alex.nemirovsky@cortina-access.com> Cc: Patrick Delaunay <patrick.delaunay@foss.st.com> Cc: Philippe Reynes <philippe.reynes@softathome.com> Cc: Sean Anderson <seanga2@gmail.com> Cc: Simon Glass <sjg@chromium.org> Cc: Steven Lawrance <steven.lawrance@softathome.com>
* drivers: led: bcm6858: Set a default brightness when probing LEDsPaul HENRYS2022-04-111-1/+31
| | | | | | | | | | | | When probing the LEDs, a default brightness is set based on settings from the U-Boot device tree, i.e. the 'default-brightness' property of the LED nodes. If that property is not present, the default maximum brightness is set. This should make sure the LED controller's registers affecting the brightness are correctly initialized and should give a consistent behaviour. Signed-off-by: Paul HENRYS <paul.henrys_ext@softathome.com>
* led: led_pwm: Add a driver for LEDs connected to PWMIvan Vozvakhov2022-04-113-0/+199
| | | | | | | | | Add a driver which allows to use of LEDs connected to PWM (Linux compatible). MAINTAINERS: add i.vozvakhov as a maintainer of leds-pwm C(required during new functionality adding). Signed-off-by: Ivan Vozvakhov <i.vozvakhov@corp.mail.ru>
* drivers: led: led_bcm6753: initial supportPhilippe Reynes2022-03-073-0/+278
| | | | | | | | Add the support of the LED IP for bcm6357. This LED IP supports blinking, fading and pulsating, but for the moment, only blinking is supported. Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
* dm: define LOG_CATEGORY for all uclassPatrick Delaunay2021-07-061-0/+2
| | | | | | | | Define LOG_CATEGORY for all uclass to allow filtering with log command. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* dm: treewide: Rename ..._platdata variables to just ..._platSimon Glass2020-12-131-4/+4
| | | | | | | Try to maintain some consistency between these variables by using _plat as a suffix for them. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: treewide: Rename ofdata_to_platdata() to of_to_plat()Simon Glass2020-12-131-2/+2
| | | | | | | This name is far too long. Rename it to remove the 'data' bits. This makes it consistent with the platdata->plat rename. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: treewide: Rename dev_get_platdata() to dev_get_plat()Simon Glass2020-12-131-2/+2
| | | | | | Rename this to be consistent with the change from 'platdata'. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: treewide: Rename 'platdata' variables to just 'plat'Simon Glass2020-12-136-19/+19
| | | | | | | | | | We use 'priv' for private data but often use 'platdata' for platform data. We can't really use 'pdata' since that is ambiguous (it could mean private or platform data). Rename some of the latter variables to end with 'plat' for consistency. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: treewide: Rename auto_alloc_size members to be shorterSimon Glass2020-12-136-7/+7
| | | | | | | | | | | | This construct is quite long-winded. In earlier days it made some sense since auto-allocation was a strange concept. But with driver model now used pretty universally, we can shorten this to 'auto'. This reduces verbosity and makes it easier to read. Coincidentally it also ensures that every declaration is on one line, thus making dtoc's job easier. Signed-off-by: Simon Glass <sjg@chromium.org>
* drivers: led: bcm6858: set the correct led polarity registerSteven Lawrance2020-11-191-4/+4
| | | | | | | | | This change sets the output (hardware) polarity register instead of the input (software) polarity register for the bcm6858 LED controller. The logic was inverted (a LED configued active high behaved as active low). Signed-off-by: Steven Lawrance <steven.lawrance@softathome.com> Reviewed-by: Philippe Reynes <philippe.reynes@softathome.com>
* led: gpio: Default to using node name if label is absentSean Anderson2020-10-081-5/+2
| | | | | | | | This more closely mirrors Linux's behaviour, and will make it easier to transition to using function+color in the future. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* led: led_cortina: Add CAxxx LED supportJway Lin2020-08-073-0/+307
| | | | | | | | | | | Add Cortina Access LED controller support for CAxxxx SOCs Signed-off-by: Jway Lin <jway.lin@cortina-access.com> Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com> CC: Simon Glass <sjg@chromium.org> Add head file fixed link error and remove unused flashing function Reviewed-by: Simon Glass <sjg@chromium.org>
* common: Drop linux/bitops.h from common headerSimon Glass2020-05-181-0/+1
| | | | | | Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
* common: Drop linux/delay.h from common headerSimon Glass2020-05-181-0/+1
| | | | | | Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
* common: Drop log.h from common headerSimon Glass2020-05-184-0/+4
| | | | | | Move this header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: core: Create a new header file for 'compat' featuresSimon Glass2020-02-051-0/+1
| | | | | | | | | | | | At present dm/device.h includes the linux-compatible features. This requires including linux/compat.h which in turn includes a lot of headers. One of these is malloc.h which we thus end up including in every file in U-Boot. Apart from the inefficiency of this, it is problematic for sandbox which needs to use the system malloc() in some files. Move the compatibility features into a separate header file. Signed-off-by: Simon Glass <sjg@chromium.org>
* led: bcm6858: allow to use this driver on arm bcm68360Philippe Reynes2020-01-231-1/+1
| | | | | | | This IP is also used on some arm SoC, so we allow to use it on arm bcm68360 too. Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
* led: bcm6858: allow to use this driver on ARCH_963158Philippe Reynes2019-04-231-1/+1
| | | | | | | Allow the led bcm6858 driver to be used on bcm63158. They have the same led controller. Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
* led: add initial support for bcm6858Philippe Reynes2019-04-223-0/+258
| | | | | | | | | The driver add the support of the led IP on bcm6858. This led IP can drive up to 32 leds, and can handle blinking. Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
* dm: led: move default state support in led uclassPatrick Delaunay2018-08-102-8/+30
| | | | | | | | | | | This patch save common LED property "default-state" value in post bind of LED uclass. The configuration for this default state is only performed when led_default_state() is called; It can be called in your board_init() or it could added in init_sequence_r[] in future. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
* Revert "dm: led: auto probe() LEDs with "default-state""Patrick Delaunay2018-08-101-9/+0
| | | | | | | | | | | This reverts commit bc882f5d5c7b4d6ed5e927bf838863af43c786e7. because this patch adds the probe of LED driver during the binding phasis. It is not allowed in driver model because the drivers (clock, pincontrol) needed by the LED driver can be also probed before the binding of all the device and it is a source of problems. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
* led: bcm6328: read base address in the parent nodePhilippe Reynes2018-07-111-1/+1
| | | | | | | | | | | | | | | In the device tree, the address for the led is located in the parent node (for exemple leds), not in the led node (for exemple led@0). The commit "led: bcm6328: convert to use live dt" (sha1: 899455176058d673887a762aa38853188a030af4) change this behaviour and read the address in the led node. We fix this by reading the base address for led in the parent node. Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
* led: bcm6328: convert to use live dtÁlvaro Fernández Rojas2018-06-011-35/+17
| | | | | | Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
* led: bcm6358: convert to use live dtÁlvaro Fernández Rojas2018-06-011-29/+15
| | | | | Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
* dm: led: auto probe() LEDs with "default-state"Patrick Bruenn2018-05-081-0/+9
| | | | | | | To avoid board specificy LED activation code, automatically activate gpio-leds with "default-state" property during bind(). Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>
* dm: led: Support "default-state" propertyPatrick Bruenn2018-05-081-1/+15
| | | | | | | | | | Add support for the device tree property "default-state". This feature might be useful for LEDs indicating "power on" or similar states. Note: Even with this commit gpio-leds remain in reset state. That's because the led_gpio is not probed until DM_FLAG_ACTIVATED is set. Signed-off-by: Patrick Bruenn <p.bruenn@beckhoff.com>
* SPDX: Convert all of our single license tags to Linux Kernel styleTom Rini2018-05-075-11/+5
| | | | | | | | | | | | | | | | | | | | When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
* Remove unnecessary instances of DECLARE_GLOBAL_DATA_PTRTom Rini2018-04-271-2/+0
| | | | | | | | We have a large number of places where while we historically referenced gd in the code we no longer do, as well as cases where the code added that line "just in case" during development and never dropped it. Signed-off-by: Tom Rini <trini@konsulko.com>
* dm: core: Update device_bind_driver_to_node() to use ofnodeSimon Glass2017-06-013-10/+7
| | | | | | | Adjust this function to us an ofnode instead of an offset, so it can be used with livetree. This involves updating all callers. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Rename dev_addr..() functionsSimon Glass2017-06-012-4/+6
| | | | | | | | | | | | | | | | | | | These support the flat device tree. We want to use the dev_read_..() prefix for functions that support both flat tree and live tree. So rename the existing functions to avoid confusion. In the end we will have: 1. dev_read_addr...() - works on devices, supports flat/live tree 2. devfdt_get_addr...() - current functions, flat tree only 3. of_get_address() etc. - new functions, live tree only All drivers will be written to use 1. That function will in turn call either 2 or 3 depending on whether the flat or live tree is in use. Note this involves changing some dead code - the imx_lpi2c.c file. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: led: add BCM6358 led driverÁlvaro Fernández Rojas2017-05-103-0/+236
| | | | | | | This driver is a simplified version of linux/drivers/leds/leds-bcm6358.c Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* dm: led: add BCM6328 led driverÁlvaro Fernández Rojas2017-05-103-0/+274
| | | | | | | | This driver is a simplified version of linux/drivers/leds/leds-bcm6328.c, simplified to remove HW leds and blink fallbacks. Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* dm: led: Add support for blinking LEDsSimon Glass2017-04-142-0/+21
| | | | | | | | Allow LEDs to be blinked if the driver supports it. Enable this for sandbox so that the tests run. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Ziping Chen <techping.chan@gmail.com>
* dm: led: Support toggling LEDsSimon Glass2017-04-141-0/+7
| | | | | | | | Add support for toggling an LED into the uclass interface. This can be efficiently implemented by the driver. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Ziping Chen <techping.chan@gmail.com>
* dm: led: Add support for getting the state of an LEDSimon Glass2017-04-142-0/+32
| | | | | | | | It is useful to be able to read the LED as well as write it. Add this to the uclass and update the GPIO driver. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Ziping Chen <techping.chan@gmail.com>