Commit graph

20 commits

Author SHA1 Message Date
Rafał Miłecki
3c19c79146 leds: bcm63138: Rename dependency symbol ARCH_BCM4908 to ARCH_BCMBCA
Symbol ARCH_BCM4908 has been merged/removed without updating leds
Kconfig.

Fixes: dd5c672d7c ("arm64: bcmbca: Merge ARCH_BCM4908 to ARCH_BCMBCA")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Reviewed-by: William Zhang <william.zhang@broadcom.com>
Link: https://lore.kernel.org/r/20230714063214.3791-1-zajec5@gmail.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-07-28 09:59:58 +01:00
Dmitry Torokhov
17521f263f leds: lgm-sso: switch to using devm_fwnode_gpiod_get()
devm_fwnode_get_gpiod_from_child() is going away as the name is too
unwieldy, let's switch to using the new devm_fwnode_gpiod_get().

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2022-11-09 13:59:28 +01:00
Rafał Miłecki
92cfc71ee2 leds: leds-bcm63138: get rid of LED_OFF
The whole "enum led_brightness" is marked as obsolete. Replace it with a
(non-)zero check.

Reported-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
2022-07-17 14:55:40 +02:00
Rafał Miłecki
bcc607cdbb leds: add help info about BCM63138 module name
It's what we do for all other LEDs drivers.

Reported-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
2022-07-17 14:55:40 +02:00
Rafał Miłecki
a0ba692072 leds: bcm63138: add support for BCM63138 controller
It's a new controller first introduced in BCM63138 SoC. Later it was
also used in BCM4908, some BCM68xx and some BCM63xxx SoCs.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
2022-07-17 13:35:46 +02:00
Andy Shevchenko
2702c9be20 leds: lgm-sso: Get rid of duplicate of_node assignment
GPIO library does copy the of_node from the parent device of
the GPIO chip, there is no need to repeat this in the individual
drivers. Remove assignment here.

For the details one may look into the of_gpio_dev_init() implementation.

Call graph:
   --> sso_gpio_gc_init()
     --> devm_gpiochip_add_data
       --> devm_gpiochip_add_data_with_key
         --> gpiochip_add_data_with_key()
           --> of_gpio_dev_init()

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
2022-01-12 19:43:15 +01:00
Andy Shevchenko
9cbc861095 leds: lgm-sso: Propagate error codes from callee to caller
The one of the latest change to the driver reveals the problem that
the error codes from callee aren't propagated to the caller of
__sso_led_dt_parse(). Fix this accordingly.

Fixes: 9999908ca1 ("leds: lgm-sso: Put fwnode in any case during ->probe()")
Fixes: c3987cd2bc ("leds: lgm: Add LED controller driver for LGM SoC")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
2021-08-07 09:12:45 +02:00
Andy Shevchenko
3dd34dfb09 leds: lgm-sso: Convert to use list_for_each_entry*() API
Convert to use list_for_each_entry*() API insted of open coded variants.
It saves few lines of code and makes iteasier to read and maintain.

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
2021-08-03 23:46:12 +02:00
Andy Shevchenko
c31ef7004e leds: lgm-sso: Remove explicit managed GPIO resource cleanup
The idea of managed resources is that they will be cleaned up automatically
and in the proper order. Remove explicit GPIO cleanup.

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
2021-08-03 23:46:12 +02:00
Andy Shevchenko
1ed4d05e0a leds: lgm-sso: Don't spam logs when probe is deferred
When requesting GPIO line the probe can be deferred.
In such case don't spam logs with an error message.
This can be achieved by switching to dev_err_probe().

Fixes: c3987cd2bc ("leds: lgm: Add LED controller driver for LGM SoC")
Cc: Amireddy Mallikarjuna reddy <mallikarjunax.reddy@linux.intel.com>
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
2021-08-03 23:46:11 +02:00
Andy Shevchenko
9999908ca1 leds: lgm-sso: Put fwnode in any case during ->probe()
fwnode_get_next_child_node() bumps a reference counting of a returned variable.
We have to balance it whenever we return to the caller.

All the same in fwnode_for_each_child_node() case.

Fixes: c3987cd2bc ("leds: lgm: Add LED controller driver for LGM SoC")
Cc: Amireddy Mallikarjuna reddy <mallikarjunax.reddy@linux.intel.com>
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
2021-08-03 23:46:10 +02:00
Linus Walleij
7b97174cc9 leds: lgm: Fix up includes
This driver is including the legacy GPIO header <linux/gpio.h>
but the only thing it is using from that header is the wrong
define for GPIOF_DIR_OUT.

Fix it up by using GPIO_LINE_DIRECTION_OUT and including the
correct consumer and driver headers.

Cc: Amireddy Mallikarjuna reddy <mallikarjunax.reddy@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
2021-06-24 00:55:41 +02:00
Andy Shevchenko
f3e2b3825f leds: lgm-sso: Drop duplicate NULL check for GPIO operations
Since GPIO operations are NULL-aware, we don't need to duplicate
this check. Remove it and fold the rest of the code.

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
2021-05-28 12:00:01 +02:00
Andy Shevchenko
2cbbe9c50d leds: lgm-sso: Remove unneeded of_match_ptr()
LGM SSO is an OF dependent driver, so of_match_ptr() can be safely
removed.

Remove the unneeded of_match_ptr().

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
2021-05-28 12:00:00 +02:00
Andy Shevchenko
fba8a6f226 leds: lgm-sso: Fix clock handling
The clock handling has a few issues:
 - when getting second clock fails, the first one left prepared and enabled
 - on ->remove() clocks are unprepared and disabled twice

Fix all these by converting to use bulk clock operations since both clocks
are mandatory.

Fixes: c3987cd2bc ("leds: lgm: Add LED controller driver for LGM SoC")
Cc: Amireddy Mallikarjuna reddy <mallikarjunax.reddy@linux.intel.com>
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
2021-05-28 12:00:00 +02:00
Geert Uytterhoeven
1cfa807b06 leds: LEDS_BLINK_LGM should depend on X86
The Intel Lightning Mountain (LGM) Serial Shift Output controller (SSO)
is only present on Intel Lightning Mountain SoCs.  Hence add a
dependency on X86, to prevent asking the user about this driver when
configuring a kernel without Intel Lightning Mountain platform support.

While at it, merge the other dependencies into a single statement.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
2021-04-25 22:56:42 +02:00
Colin Ian King
ec50536b78 leds: lgm: Fix spelling mistake "prepate" -> "prepare"
There is a spelling mistake in a dev_err error message. Fix it.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
2021-04-25 22:37:57 +02:00
Rahul Tanwar
a7ed7150f3 leds: lgm: Improve Kconfig help
Remove unnecessary Kconfig symbol LEDS_BLINK
Improve Kconfig help text to make it more useful.

Signed-off-by: Rahul Tanwar <rtanwar@maxlinear.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
2021-03-25 11:37:41 +01:00
Arnd Bergmann
34731ed13e leds: lgm: fix gpiolib dependency
Without gpiolib, the driver fails to build:

    drivers/leds/blink/leds-lgm-sso.c:123:19: error: field has incomplete type 'struct gpio_chip'
            struct gpio_chip chip;
                             ^
    include/linux/gpio.h:107:8: note: forward declaration of 'struct gpio_chip'
    struct gpio_chip;
           ^
    drivers/leds/blink/leds-lgm-sso.c:263:3: error: implicit declaration of function 'gpiod_set_value' [-Werror,-Wimplicit-function-declaration]
                    gpiod_set_value(led->gpiod, val);
                    ^
    drivers/leds/blink/leds-lgm-sso.c:263:3: note: did you mean 'gpio_set_value'?
    include/linux/gpio.h:168:20: note: 'gpio_set_value' declared here
    static inline void gpio_set_value(unsigned gpio, int value)
                       ^
    drivers/leds/blink/leds-lgm-sso.c:345:3: error: implicit declaration of function 'gpiod_set_value' [-Werror,-Wimplicit-function-declaration]
                    gpiod_set_value(led->gpiod, 1);
                    ^

Add the dependency in Kconfig.

Fixes: c3987cd2bc ("leds: lgm: Add LED controller driver for LGM SoC")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
2021-03-09 19:06:46 +01:00
Amireddy Mallikarjuna reddy
c3987cd2bc leds: lgm: Add LED controller driver for LGM SoC
Parallel to serial conversion, which is also called SSO controller,
can drive external shift register for LED outputs, reset or
general purpose outputs.

This driver enables LED support for Serial Shift Output Controller (SSO).

Signed-off-by: Amireddy Mallikarjuna reddy <mallikarjunax.reddy@linux.intel.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
2021-02-19 11:40:18 +01:00