summaryrefslogtreecommitdiff
path: root/drivers/pinctrl/pinctrl-aw9523.c
AgeCommit message (Collapse)AuthorFilesLines
2024-10-10pinctrl: aw9523: fix kerneldoc for _aw9523_gpio_get_multiple()Bartosz Golaszewski1-2/+2
The parameters' descriptions are wrong, drop the invalid ones and document the ones that are missing the description. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Link: https://lore.kernel.org/20241010080347.7759-1-brgl@bgdev.pl Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-10-04pinctrl: aw9523: use devm_mutex_initRosen Penev1-23/+13
Simplifies probe by removing all gotos and removing mutex_destroy from _remove. Signed-off-by: Rosen Penev <rosenp@gmail.com> Link: https://lore.kernel.org/20241003214746.146207-1-rosenp@gmail.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-10-04pinctrl: aw9523: add missing mutex_destroyRosen Penev1-2/+4
Otherwise the mutex remains after a failed kzalloc. Signed-off-by: Rosen Penev <rosenp@gmail.com> Link: https://lore.kernel.org/20241001212724.309320-1-rosenp@gmail.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-10-02pinctrl: aw9523: use enable for regulatorRosen Penev1-16/+5
devm_regulator_get_enable_optional can be used to simplify the logic here. Signed-off-by: Rosen Penev <rosenp@gmail.com> Link: https://lore.kernel.org/20241001212724.309320-2-rosenp@gmail.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-10-01pinctrl: aw9523: Drop explicit initialization of struct ↵Uwe Kleine-König1-1/+1
i2c_device_id::driver_data to 0 These drivers don't use the driver_data member of struct i2c_device_id, so don't explicitly initialize this member. This prepares putting driver_data in an anonymous union which requires either no initialization or named designators. But it's also a nice cleanup on its own. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com> Link: https://lore.kernel.org/20240920153430.503212-13-u.kleine-koenig@baylibre.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-04-04pinctrl: aw9523: Fix indentation in a few placesAndy Shevchenko1-9/+8
In the comment, function prototype, and array of strings indentation is kinda broken. Reindent that. Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com> Message-ID: <20240329105634.712457-11-andy.shevchenko@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-04-04pinctrl: aw9523: Sort headers and group pinctrl/*Andy Shevchenko1-5/+6
One header was misplaced and group pinctrl/* ones to show the relation with the pin control subsystem. Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com> Message-ID: <20240329105634.712457-10-andy.shevchenko@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-04-04pinctrl: aw9523: Make use of dev_err_probe()Andy Shevchenko1-6/+3
Simplify the error handling in probe function by switching from dev_err() to dev_err_probe(). Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com> Message-ID: <20240329105634.712457-9-andy.shevchenko@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-04-04pinctrl: aw9523: Remove unused irqchip field in struct aw9523_irqAndy Shevchenko1-8/+0
The irqchip field is allocated, assigned but never used. Remove it. Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com> Message-ID: <20240329105634.712457-8-andy.shevchenko@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-04-04pinctrl: aw9523: Get rid of redundant ' & U8_MAX' piecesAndy Shevchenko1-7/+7
When the variable is declared as u8, no need to perform ' & U8_MAX' as it's implied anyway. Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com> Message-ID: <20240329105634.712457-7-andy.shevchenko@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-04-04pinctrl: aw9523: Use temporary variable for HW IRQ numberAndy Shevchenko1-8/+8
There are two different ways on how to get HW IRQ number in some functions. Unify that by using temporary variable and irqd_to_hwirq() call. Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com> Message-ID: <20240329105634.712457-6-andy.shevchenko@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-04-04pinctrl: aw9523: Make use of struct pinfunction and PINCTRL_PINFUNCTION()Andy Shevchenko1-26/+6
Since pin control provides a generic data type and a macro for the pin function definition, use them in the driver. Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com> Message-ID: <20240329105634.712457-5-andy.shevchenko@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-04-04pinctrl: aw9523: Always try both ports in aw9523_gpio_set_multiple()Andy Shevchenko1-5/+2
The ports are equivalent from the user's point of view. Don't limit trying them both if writing to one fails. Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com> Message-ID: <20240329105634.712457-4-andy.shevchenko@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-04-04pinctrl: aw9523: Use correct error code for not supported functionalityAndy Shevchenko1-4/+5
The pin control subsystem internally uses ENOTSUPP for the not supported functionality. The checkpatch is false positive about this error code. Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com> Message-ID: <20240329105634.712457-3-andy.shevchenko@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-04-04pinctrl: aw9523: Destroy mutex on ->remove()Andy Shevchenko1-7/+1
If aw9523_hw_init() fails on ->remove() the mutex left alive. Destroy it in that case as well. While at it, remove never true check at the beginning of the function. Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com> Message-ID: <20240329105634.712457-2-andy.shevchenko@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-03-06pinctrl: aw9523: Add proper terminatorLinus Walleij1-0/+1
The of_device_id array needs to be terminated with a NULL entry. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202403061147.85XYVsk3-lkp@intel.com/ Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20240306-fix-aw9523-terminator-v1-1-13f90f87a7f6@linaro.org
2024-03-06pinctrl: Add driver for Awinic AW9523/B I2C GPIO ExpanderAngeloGioacchino Del Regno1-0/+1118
The Awinic AW9523(B) is a multi-function I2C gpio expander in a TQFN-24L package, featuring PWM (max 37mA per pin, or total max power 3.2Watts) for LED driving capability. It has two ports with 8 pins per port (for a total of 16 pins), configurable as either PWM with 1/256 stepping or GPIO input/output, 1.8V logic input; each GPIO can be configured as input or output independently from each other. This IC also has an internal interrupt controller, which is capable of generating an interrupt for each GPIO, depending on the configuration, and will raise an interrupt on the INTN pin to advertise this to an external interrupt controller. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org> Signed-off-by: David Bauer <mail@david-bauer.net> Link: https://lore.kernel.org/r/20210624214458.68716-2-mail@david-bauer.net Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20240301-awinic-aw9523-v8-1-7ec572f5dfb4@linaro.org