platform/kernel/linux-starfive.git
3 years agomfd: tps80031: Remove driver
Dmitry Osipenko [Thu, 21 Oct 2021 19:22:58 +0000 (22:22 +0300)]
mfd: tps80031: Remove driver

Driver was upstreamed in 2013 and never got a user, remove it.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211021192258.21968-4-digetx@gmail.com
3 years agomfd: max77686: Correct tab-based alignment of register addresses
Luca Ceresoli [Tue, 19 Oct 2021 14:59:11 +0000 (16:59 +0200)]
mfd: max77686: Correct tab-based alignment of register addresses

Some lines have an extra tab, remove them for proper visual alignment as
present on the rest of this file.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211019145919.7327-2-luca@lucaceresoli.net
3 years agomfd: wcd934x: Replace legacy gpio interface for gpiod
Maíra Canal [Thu, 21 Oct 2021 01:36:04 +0000 (22:36 -0300)]
mfd: wcd934x: Replace legacy gpio interface for gpiod

Considering the current transition of the GPIO subsystem, remove all
dependencies of the legacy GPIO interface (linux/gpio.h and linux
/of_gpio.h) and replace it with the descriptor-based GPIO approach.

Signed-off-by: Maíra Canal <maira.canal@usp.br>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/YXDEBCiSnXYRQPXt@fedora
3 years agodt-bindings: mfd: qcom: pm8xxx: Add pm8018 compatible
David Heidelberg [Wed, 20 Oct 2021 23:16:45 +0000 (01:16 +0200)]
dt-bindings: mfd: qcom: pm8xxx: Add pm8018 compatible

Add missing compatible for the PM8018 model.

Signed-off-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211020231646.278706-1-david@ixit.cz
3 years agomfd: dln2: Add cell for initializing DLN2 ADC
Jack Andersen [Mon, 18 Oct 2021 11:25:41 +0000 (13:25 +0200)]
mfd: dln2: Add cell for initializing DLN2 ADC

This patch extends the DLN2 driver; adding cell for adc_dln2 module.

The original patch[1] fell through the cracks when the driver was added
so ADC has never actually been usable. That patch did not have ACPI
support which was added in v5.9, so the oldest supported version this
current patch can be backported to is 5.10.

[1] https://www.spinics.net/lists/linux-iio/msg33975.html

Cc: <stable@vger.kernel.org> # 5.10+
Signed-off-by: Jack Andersen <jackoalan@gmail.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211018112541.25466-1-noralf@tronnes.org
3 years agomfd: qcom-spmi-pmic: Add missing PMICs supported by socinfo
Bjorn Andersson [Sun, 17 Oct 2021 16:12:18 +0000 (09:12 -0700)]
mfd: qcom-spmi-pmic: Add missing PMICs supported by socinfo

The Qualcomm socinfo driver has eight more PMICs described, add these to
the SPMI PMIC driver as well.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211017161218.2378176-4-bjorn.andersson@linaro.org
3 years agomfd: qcom-spmi-pmic: Document ten more PMICs in the binding
Bjorn Andersson [Sun, 17 Oct 2021 16:12:17 +0000 (09:12 -0700)]
mfd: qcom-spmi-pmic: Document ten more PMICs in the binding

Update the binding with eight more SPMI PMIC compatibles found in the
PMIC info list in the Qualcomm socinfo driver and add the two PM660
related PMICs supported by the SPMI PMIC driver but are missing from the
document.

Then remove the duplicate entry for pma8084.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211017161218.2378176-3-bjorn.andersson@linaro.org
3 years agomfd: qcom-spmi-pmic: Sort compatibles in the driver
Bjorn Andersson [Sun, 17 Oct 2021 16:12:16 +0000 (09:12 -0700)]
mfd: qcom-spmi-pmic: Sort compatibles in the driver

Sort the compatibles in the driver, to make it easier to validate that
the DT binding and driver are in sync.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211017161218.2378176-2-bjorn.andersson@linaro.org
3 years agomfd: qcom-spmi-pmic: Sort the compatibles in the binding
Bjorn Andersson [Sun, 17 Oct 2021 16:12:15 +0000 (09:12 -0700)]
mfd: qcom-spmi-pmic: Sort the compatibles in the binding

Create some order in the list of compatibles by sorting them.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211017161218.2378176-1-bjorn.andersson@linaro.org
3 years agomfd: janz-cmoio: Replace snprintf in show functions with sysfs_emit
Qing Wang [Fri, 15 Oct 2021 06:49:52 +0000 (23:49 -0700)]
mfd: janz-cmoio: Replace snprintf in show functions with sysfs_emit

show() must not use snprintf() when formatting the value to be
returned to user space.

Fix the following coccicheck warning:
drivers/mfd/janz-cmodio.c:157: WARNING: use scnprintf or sprintf.

Use sysfs_emit instead of scnprintf or sprintf makes more sense.

Signed-off-by: Qing Wang <wangqing@vivo.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/1634280592-4722-1-git-send-email-wangqing@vivo.com
3 years agomfd: altera-a10sr: Include linux/module.h
Arnd Bergmann [Wed, 13 Oct 2021 14:43:55 +0000 (16:43 +0200)]
mfd: altera-a10sr: Include linux/module.h

Without the header, the MODULE_DEVICE_TABLE() declaration fails:

drivers/mfd/altera-a10sr.c:153:1: error: data definition has no type or storage class [-Werror]
  153 | MODULE_DEVICE_TABLE(of, altr_a10sr_spi_of_match);

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211013144402.2292128-1-arnd@kernel.org
3 years agomfd: tps65912: Make tps65912_device_exit() return void
Uwe Kleine-König [Tue, 12 Oct 2021 15:39:35 +0000 (17:39 +0200)]
mfd: tps65912: Make tps65912_device_exit() return void

Up to now tps65912_device_exit() returns zero unconditionally. Make it
return void instead which makes it easier to see in the callers that
there is no error to handle.

Also the return value of i2c and spi remove callbacks is ignored anyway.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211012153945.2651412-11-u.kleine-koenig@pengutronix.de
3 years agomfd: stmpe: Make stmpe_remove() return void
Uwe Kleine-König [Tue, 12 Oct 2021 15:39:34 +0000 (17:39 +0200)]
mfd: stmpe: Make stmpe_remove() return void

Up to now stmpe_remove() returns zero unconditionally. Make it return
void instead which makes it easier to see in the callers that there is
no error to handle.

Also the return value of i2c and spi remove callbacks is ignored anyway.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211012153945.2651412-10-u.kleine-koenig@pengutronix.de
3 years agomfd: mc13xxx: Make mc13xxx_common_exit() return void
Uwe Kleine-König [Tue, 12 Oct 2021 15:39:33 +0000 (17:39 +0200)]
mfd: mc13xxx: Make mc13xxx_common_exit() return void

Up to now mc13xxx_common_exit() returns zero unconditionally. Make it
return void instead which makes it easier to see in the callers that
there is no error to handle.

Also the return value of i2c and spi remove callbacks is ignored anyway.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211012153945.2651412-9-u.kleine-koenig@pengutronix.de
3 years agodt-bindings: mfd: syscon: Add samsung,exynosautov9-sysreg compatible
Chanho Park [Sun, 10 Oct 2021 03:22:44 +0000 (12:22 +0900)]
dt-bindings: mfd: syscon: Add samsung,exynosautov9-sysreg compatible

Add document Samsung's Exynos Auto v9 compatible for system registers.

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211010032246.146939-2-chanho61.park@samsung.com
3 years agomfd: altera-sysmgr: Fix a mistake caused by resource_size conversion
Kai Song [Wed, 6 Oct 2021 14:19:26 +0000 (22:19 +0800)]
mfd: altera-sysmgr: Fix a mistake caused by resource_size conversion

The resource_size defines that:
res->end - res->start + 1;
The origin original code is:
sysmgr_config.max_register = res->end - res->start - 3;

So, the correct fix is that:
sysmgr_config.max_register = resource_size(res) - 4;

Fixes: d12edf9661a4 ("mfd: altera-sysmgr: Use resource_size function on resource object")
Signed-off-by: Kai Song <songkai01@inspur.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211006141926.6120-1-songkai01@inspur.com
3 years agodt-bindings: gpio: Convert X-Powers AXP209 GPIO binding to a schema
Maxime Ripard [Fri, 24 Sep 2021 07:16:12 +0000 (09:16 +0200)]
dt-bindings: gpio: Convert X-Powers AXP209 GPIO binding to a schema

The X-Powers AXP PMICs feature a GPIO Controller supported by Linux
thanks to its device tree binding.

Now that we have the DT validation in place, let's convert the device
tree bindings for that driver over to a YAML schema.

Cc: Chen-Yu Tsai <wens@csie.org>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-gpio@vger.kernel.org
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Acked-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20210924071614.868307-1-maxime@cerno.tech
3 years agodt-bindings: mfd: syscon: Add rk3368 QoS register compatible
Heiko Stuebner [Sat, 25 Sep 2021 09:04:04 +0000 (11:04 +0200)]
dt-bindings: mfd: syscon: Add rk3368 QoS register compatible

Document rk3368 compatible for QoS registers.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20210925090405.2601792-2-heiko@sntech.de
3 years agomfd: arizona: Split of_match table into I2C and SPI versions
Charles Keepax [Tue, 28 Sep 2021 16:30:35 +0000 (17:30 +0100)]
mfd: arizona: Split of_match table into I2C and SPI versions

The Arizona driver has both some devices which only have an I2C
interface and some which only have a SPI interface. Currently both of
these share an of_match table, but this means inapproriate compatibles
are available for each interface. Tidy this up by creating a table for
each interface listing only the appropriate compatibles.

Reported-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20210928163035.23960-1-ckeepax@opensource.cirrus.com
3 years agodt-bindings: mfd: Convert X-Powers AXP binding to a schema
Maxime Ripard [Fri, 24 Sep 2021 07:16:13 +0000 (09:16 +0200)]
dt-bindings: mfd: Convert X-Powers AXP binding to a schema

The X-Powers AXP PMICs are supported by Linux thanks to its device tree
binding.

Now that we have the DT validation in place, let's convert the device
tree bindings for that driver over to a YAML schema.

Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20210924071614.868307-2-maxime@cerno.tech
3 years agodt-bindings: mfd: Convert X-Powers AC100 binding to a schema
Maxime Ripard [Fri, 24 Sep 2021 07:16:14 +0000 (09:16 +0200)]
dt-bindings: mfd: Convert X-Powers AC100 binding to a schema

The X-Powers AC100 hybrid devices are supported by Linux thanks to its
device tree binding.

Now that we have the DT validation in place, let's convert the device
tree bindings for that driver over to a YAML schema.

Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20210924071614.868307-3-maxime@cerno.tech
3 years agomfd: qcom-pm8xxx: switch away from using chained IRQ handlers
Dmitry Baryshkov [Sat, 25 Sep 2021 23:43:33 +0000 (02:43 +0300)]
mfd: qcom-pm8xxx: switch away from using chained IRQ handlers

PM8xxx PMIC family uses GPIO as parent IRQ. Using it together with the
irq_set_chained_handler_and_data() results in warnings from the GPIOLIB
(see 461c1a7d4733 ("gpiolib: override irq_enable/disable"))
as in this path the IRQ resources are not allocated (and thus the
corresponding GPIO is not marked as used for the IRQ. Use request_irq so
that the IRQ resources are proprely setup.

[ 0.803271] ------------[ cut here ]------------
[ 0.803338] WARNING: CPU: 3 PID: 1 at drivers/gpio/gpiolib.c:3207 gpiochip_enable_irq+0xa4/0xa8
[ 0.803470] Modules linked in:
[ 0.803542] CPU: 3 PID: 1 Comm: swapper/0 Not tainted 5.14.0-rc6-next-20210820-postmarketos-qcom-apq8064+ #1
[ 0.803645] Hardware name: Generic DT based system
[ 0.803710] Backtrace:
[ 0.803777] [<c0e3493c>] (dump_backtrace) from [<c0e34d00>] (show_stack+0x20/0x24)
[ 0.803911] r7:00000c87 r6:c07062dc r5:60000093 r4:c11d0f54
[ 0.803980] [<c0e34ce0>] (show_stack) from [<c0e38314>] (dump_stack_lvl+0x48/0x54)
[ 0.804097] [<c0e382cc>] (dump_stack_lvl) from [<c0e38338>] (dump_stack+0x18/0x1c)
[ 0.804217] r5:00000009 r4:c11fe208
[ 0.804274] [<c0e38320>] (dump_stack) from [<c03219c8>] (__warn+0xfc/0x114)
[ 0.804387] [<c03218cc>] (__warn) from [<c0e35334>] (warn_slowpath_fmt+0x74/0xd0)
[ 0.804509] r7:c07062dc r6:00000c87 r5:c11fe208 r4:00000000
[ 0.804577] [<c0e352c4>] (warn_slowpath_fmt) from [<c07062dc>] (gpiochip_enable_irq+0xa4/0xa8)
[ 0.804716] r8:c27b6200 r7:c27aec00 r6:c27aec18 r5:cf77a448 r4:c02225f0
[ 0.804789] [<c0706238>] (gpiochip_enable_irq) from [<c0706348>] (gpiochip_irq_enable+0x28/0x38)
[ 0.804921] r5:cf77a448 r4:c27aec18
[ 0.804977] [<c0706320>] (gpiochip_irq_enable) from [<c03897a0>] (irq_enable+0x48/0x78)
[ 0.805111] r5:00000000 r4:c27aec00
[ 0.805167] [<c0389758>] (irq_enable) from [<c0389850>] (__irq_startup+0x80/0xbc)
[ 0.805286] r5:00000000 r4:c27aec00
[ 0.805343] [<c03897d0>] (__irq_startup) from [<c038996c>] (irq_startup+0xe0/0x18c)
[ 0.805468] r7:c27aec00 r6:00000001 r5:00000000 r4:c27aec00
[ 0.805535] [<c038988c>] (irq_startup) from [<c0389a54>] (irq_activate_and_startup+0x3c/0x74)
[ 0.805669] r7:c27aec00 r6:00000001 r5:c27aec00 r4:00000000
[ 0.805736] [<c0389a18>] (irq_activate_and_startup) from [<c0389b58>] (__irq_do_set_handler+0xcc/0x1c0)
[ 0.805875] r7:c27aec00 r6:c0383710 r5:c08a16b0 r4:00000001
[ 0.805943] [<c0389a8c>] (__irq_do_set_handler) from [<c0389d80>] (irq_set_chained_handler_and_data+0x60/0x98)
[ 0.806087] r7:c27b5c10 r6:c27aed40 r5:c08a16b0 r4:c27aec00
[ 0.806154] [<c0389d20>] (irq_set_chained_handler_and_data) from [<c08a1660>] (pm8xxx_probe+0x1fc/0x24c)
[ 0.806298] r6:0000003a r5:0000003a r4:c27b5c00
[ 0.806359] [<c08a1464>] (pm8xxx_probe) from [<c0871420>] (platform_probe+0x6c/0xc8)
[ 0.806495] r10:c2507080 r9:e8bea2cc r8:c165e0e0 r7:c165e0e0 r6:c15f08f8 r5:c27b5c10
[ 0.806582] r4:00000000
[ 0.806632] [<c08713b4>] (platform_probe) from [<c086e280>] (really_probe+0xe8/0x460)
[ 0.806769] r7:c165e0e0 r6:c15f08f8 r5:00000000 r4:c27b5c10
[ 0.806837] [<c086e198>] (really_probe) from [<c086e6a8>] (__driver_probe_device+0xb0/0x22c)
[ 0.806975] r7:c27b5c10 r6:cf70fba4 r5:c15f08f8 r4:c27b5c10
[ 0.807042] [<c086e5f8>] (__driver_probe_device) from [<c086e868>] (driver_probe_device+0x44/0xe0)
[ 0.807188] r9:e8bea2cc r8:00000000 r7:c27b5c10 r6:cf70fba4 r5:c16ae4b4 r4:c16ae4b0
[ 0.807271] [<c086e824>] (driver_probe_device) from [<c086ecd8>] (__device_attach_driver+0xb4/0x12c)
[ 0.807421] r9:e8bea2cc r8:c15eec08 r7:c27b5c10 r6:cf70fba4 r5:c15f08f8 r4:00000001
[ 0.807506] [<c086ec24>] (__device_attach_driver) from [<c086c06c>] (bus_for_each_drv+0x94/0xe4)
[ 0.807651] r7:c16ae484 r6:c086ec24 r5:cf70fba4 r4:00000000
[ 0.807718] [<c086bfd8>] (bus_for_each_drv) from [<c086e0e0>] (__device_attach+0x104/0x19c)
[ 0.807852] r6:00000001 r5:c27b5c54 r4:c27b5c10
[ 0.807913] [<c086dfdc>] (__device_attach) from [<c086eef4>] (device_initial_probe+0x1c/0x20)
[ 0.808050] r6:c27b5c10 r5:c15ef1b0 r4:c27b5c10
[ 0.808111] [<c086eed8>] (device_initial_probe) from [<c086d00c>] (bus_probe_device+0x94/0x9c)
[ 0.808240] [<c086cf78>] (bus_probe_device) from [<c086a60c>] (device_add+0x404/0x8f4)
[ 0.808370] r7:c16ae484 r6:c251ba10 r5:00000000 r4:c27b5c10
[ 0.808439] [<c086a208>] (device_add) from [<c0a82f50>] (of_device_add+0x44/0x4c)
[ 0.808581] r10:c144c854 r9:00000001 r8:e8bea314 r7:c251ba10 r6:00000000 r5:00000000
[ 0.808669] r4:c27b5c00
[ 0.808718] [<c0a82f0c>] (of_device_add) from [<c0a836cc>] (of_platform_device_create_pdata+0xa0/0xc8)
[ 0.808850] [<c0a8362c>] (of_platform_device_create_pdata) from [<c0a83908>] (of_platform_bus_create+0x1f0/0x514)
[ 0.809005] r9:00000001 r8:c251ba10 r7:00000000 r6:00000000 r5:00000000 r4:e8bea2b0
[ 0.809086] [<c0a83718>] (of_platform_bus_create) from [<c0a83e04>] (of_platform_populate+0x98/0x128)
[ 0.809233] r10:c144c854 r9:00000001 r8:c251ba10 r7:00000000 r6:00000000 r5:e8bea170
[ 0.809321] r4:e8bea2b0
[ 0.809371] [<c0a83d6c>] (of_platform_populate) from [<c0a83f20>] (devm_of_platform_populate+0x60/0xa8)
[ 0.809521] r9:0000011d r8:c165e0e0 r7:e8bea170 r6:c2c34f40 r5:c2cac140 r4:c251ba10
[ 0.809604] [<c0a83ec0>] (devm_of_platform_populate) from [<c08a212c>] (ssbi_probe+0x138/0x16c)
[ 0.809738] r6:c2c34f40 r5:c251ba10 r4:ff822700
[ 0.809800] [<c08a1ff4>] (ssbi_probe) from [<c0871420>] (platform_probe+0x6c/0xc8)
[ 0.809923] r7:c165e0e0 r6:c15f0a80 r5:c251ba10 r4:00000000
[ 0.809989] [<c08713b4>] (platform_probe) from [<c086e280>] (really_probe+0xe8/0x460)
[ 0.810120] r7:c165e0e0 r6:c15f0a80 r5:00000000 r4:c251ba10
[ 0.810187] [<c086e198>] (really_probe) from [<c086e6a8>] (__driver_probe_device+0xb0/0x22c)
[ 0.810325] r7:c251ba10 r6:c15f0a80 r5:c15f0a80 r4:c251ba10
[ 0.810393] [<c086e5f8>] (__driver_probe_device) from [<c086e868>] (driver_probe_device+0x44/0xe0)
[ 0.810539] r9:0000011d r8:00000000 r7:c251ba10 r6:c15f0a80 r5:c16ae4b4 r4:c16ae4b0
[ 0.810623] [<c086e824>] (driver_probe_device) from [<c086ee2c>] (__driver_attach+0xdc/0x188)
[ 0.810766] r9:0000011d r8:c144c834 r7:00000000 r6:c15f0a80 r5:c251ba10 r4:00000000
[ 0.810849] [<c086ed50>] (__driver_attach) from [<c086bf60>] (bus_for_each_dev+0x88/0xd4)
[ 0.810985] r7:00000000 r6:c086ed50 r5:c15f0a80 r4:00000000
[ 0.811052] [<c086bed8>] (bus_for_each_dev) from [<c086dad4>] (driver_attach+0x2c/0x30)
[ 0.811182] r6:c15ef1b0 r5:c2c34e80 r4:c15f0a80
[ 0.811243] [<c086daa8>] (driver_attach) from [<c086d2dc>] (bus_add_driver+0x180/0x21c)
[ 0.811364] [<c086d15c>] (bus_add_driver) from [<c086fa6c>] (driver_register+0x84/0x118)
[ 0.811492] r7:00000000 r6:ffffe000 r5:c1428210 r4:c15f0a80
[ 0.811558] [<c086f9e8>] (driver_register) from [<c0871174>] (__platform_driver_register+0x2c/0x34)
[ 0.811683] r5:c1428210 r4:c16524a0
[ 0.811739] [<c0871148>] (__platform_driver_register) from [<c1428234>] (ssbi_driver_init+0x24/0x28)
[ 0.811868] [<c1428210>] (ssbi_driver_init) from [<c0302394>] (do_one_initcall+0x68/0x2c8)
[ 0.811990] [<c030232c>] (do_one_initcall) from [<c140147c>] (kernel_init_freeable+0x1dc/0x23c)
[ 0.812135] r7:cf7b0400 r6:c130339c r5:00000007 r4:c147f6a0
[ 0.812204] [<c14012a0>] (kernel_init_freeable) from [<c0e40e60>] (kernel_init+0x20/0x138)
[ 0.812345] r10:00000000 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:c0e40e40
[ 0.812433] r4:00000000
[ 0.812483] [<c0e40e40>] (kernel_init) from [<c0300150>] (ret_from_fork+0x14/0x24)
[ 0.812596] Exception stack(0xcf70ffb0 to 0xcf70fff8)
[ 0.812684] ffa0: 00000000 00000000 00000000 00000000
[ 0.812809] ffc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 0.812923] ffe0: 00000000 00000000 00000000 00000000 00000013 00000000
[ 0.813008] r5:c0e40e40 r4:00000000
[ 0.813075] ---[ end trace ad2443eee078d094 ]---

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Tested-by: David Heidelberg <david@ixit.cz> # on Nexus 7 (deb)
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20210925234333.2430755-1-dmitry.baryshkov@linaro.org
3 years agomfd: sprd: Add SPI device ID table
Mark Brown [Fri, 24 Sep 2021 14:33:47 +0000 (15:33 +0100)]
mfd: sprd: Add SPI device ID table

Currently autoloading for SPI devices does not use the DT ID table, it uses
SPI modalises. Supporting OF modalises is going to be difficult if not
impractical, an attempt was made but has been reverted, so ensure that
module autoloading works for this driver by adding a SPI device ID table.

Fixes: 96c8395e2166 ("spi: Revert modalias changes")
Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Baolin Wang <baolin.wang7@gmail.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20210924143347.14721-4-broonie@kernel.org
3 years agomfd: cpcap: Add SPI device ID table
Mark Brown [Fri, 24 Sep 2021 14:33:46 +0000 (15:33 +0100)]
mfd: cpcap: Add SPI device ID table

Currently autoloading for SPI devices does not use the DT ID table, it uses
SPI modalises. Supporting OF modalises is going to be difficult if not
impractical, an attempt was made but has been reverted, so ensure that
module autoloading works for this driver by adding a SPI device ID table.

Fixes: 96c8395e2166 ("spi: Revert modalias changes")
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20210924143347.14721-3-broonie@kernel.org
3 years agomfd: altr_a10sr: Add SPI device ID table
Mark Brown [Fri, 24 Sep 2021 14:33:45 +0000 (15:33 +0100)]
mfd: altr_a10sr: Add SPI device ID table

Currently autoloading for SPI devices does not use the DT ID table, it uses
SPI modalises. Supporting OF modalises is going to be difficult if not
impractical, an attempt was made but has been reverted, so ensure that
module autoloading works for this driver by adding a SPI device ID table.

Fixes: 96c8395e2166 ("spi: Revert modalias changes")
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20210924143347.14721-2-broonie@kernel.org
3 years agomfd: exynos-lpass: Describe driver in KConfig
Krzysztof Kozlowski [Fri, 24 Sep 2021 13:33:32 +0000 (15:33 +0200)]
mfd: exynos-lpass: Describe driver in KConfig

Describe better which driver applies to which SoC, to make configuring
kernel for Samsung SoC easier.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20210924133332.112092-1-krzysztof.kozlowski@canonical.com
3 years agomfd: core: Add missing of_node_put for loop iteration
Krzysztof Kozlowski [Fri, 28 May 2021 11:51:26 +0000 (07:51 -0400)]
mfd: core: Add missing of_node_put for loop iteration

Early exits from for_each_child_of_node() should decrement the
node reference counter.  Reported by Coccinelle:

  drivers/mfd/mfd-core.c:197:2-24: WARNING:
    Function "for_each_child_of_node" should have of_node_put() before goto around lines 209.

Fixes: c94bb233a9fe ("mfd: Make MFD core code Device Tree and IRQ domain aware")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20210528115126.18370-1-krzysztof.kozlowski@canonical.com
3 years agomfd: intel-lpss: Add support for MacBookPro16,2 ICL-N UART
Orlando Chamberlain [Sat, 2 Oct 2021 11:16:30 +0000 (11:16 +0000)]
mfd: intel-lpss: Add support for MacBookPro16,2 ICL-N UART

Added 8086:38a8 to the intel_lpss_pci driver. It is an Intel Ice Lake
PCH-N UART controler present on the MacBookPro16,2.

Signed-off-by: Orlando Chamberlain <redecorating@protonmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211002111449.12674-1-redecorating@protonmail.com
3 years agomfd: max14577: Do not enforce (incorrect) interrupt trigger type
Krzysztof Kozlowski [Wed, 2 Jun 2021 11:04:45 +0000 (13:04 +0200)]
mfd: max14577: Do not enforce (incorrect) interrupt trigger type

Interrupt line can be configured on different hardware in different way,
even inverted.  Therefore driver should not enforce specific trigger
type - edge falling - but instead rely on Devicetree to configure it.

The Maxim 14577/77836 datasheets describe the interrupt line as active
low with a requirement of acknowledge from the CPU therefore the edge
falling is not correct.

The interrupt line is shared between PMIC and charger driver, so using
level sensitive interrupt is here especially important to avoid races.
With an edge configuration in case if first PMIC signals interrupt
followed shortly after by the RTC, the interrupt might not be yet
cleared/acked thus the second one would not be noticed.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20210602110445.33536-4-krzysztof.kozlowski@canonical.com
3 years agomfd: max77693: Do not enforce (incorrect) interrupt trigger type
Krzysztof Kozlowski [Wed, 2 Jun 2021 11:04:44 +0000 (13:04 +0200)]
mfd: max77693: Do not enforce (incorrect) interrupt trigger type

Interrupt line can be configured on different hardware in different way,
even inverted.  Therefore driver should not enforce specific trigger
type - edge falling - but instead rely on Devicetree to configure it.

The Maxim 77693 datasheet describes the interrupt line as active low
with a requirement of acknowledge from the CPU therefore the edge
falling is not correct.

The interrupt line is shared between PMIC and RTC driver, so using level
sensitive interrupt is here especially important to avoid races.  With
an edge configuration in case if first PMIC signals interrupt followed
shortly after by the RTC, the interrupt might not be yet cleared/acked
thus the second one would not be noticed.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20210602110445.33536-3-krzysztof.kozlowski@canonical.com
3 years agomfd: max77686: Do not enforce (incorrect) interrupt trigger type
Krzysztof Kozlowski [Wed, 2 Jun 2021 11:04:43 +0000 (13:04 +0200)]
mfd: max77686: Do not enforce (incorrect) interrupt trigger type

Interrupt line can be configured on different hardware in different way,
even inverted.  Therefore driver should not enforce specific trigger
type - edge falling - but instead rely on Devicetree to configure it.

The Maxim 77686 datasheet describes the interrupt line as active low
with a requirement of acknowledge from the CPU therefore the edge
falling is not correct.

The interrupt line is shared between PMIC and RTC driver, so using level
sensitive interrupt is here especially important to avoid races.  With
an edge configuration in case if first PMIC signals interrupt followed
shortly after by the RTC, the interrupt might not be yet cleared/acked
thus the second one would not be noticed.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20210602110445.33536-2-krzysztof.kozlowski@canonical.com
3 years agomfd: sec-irq: Do not enforce (incorrect) interrupt trigger type
Krzysztof Kozlowski [Wed, 2 Jun 2021 11:04:42 +0000 (13:04 +0200)]
mfd: sec-irq: Do not enforce (incorrect) interrupt trigger type

Interrupt line can be configured on different hardware in different way,
even inverted.  Therefore driver should not enforce specific trigger
type - edge falling - but instead rely on Devicetree to configure it.

The Samsung PMIC drivers are used only on Devicetree boards.

Additionally, the PMIC datasheets describe the interrupt line as active
low with a requirement of acknowledge from the CPU therefore the edge
falling is not correct.

Marek Szyprowski reports that together with DTS change (proper level in
DTS) it fixes RTC alarm failure that he observed from time to time on
TM2e board.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20210602110445.33536-1-krzysztof.kozlowski@canonical.com
3 years agodt-bindings: mfd: logicvc: Add patternProperties for the display
Paul Kocialkowski [Tue, 14 Sep 2021 20:05:37 +0000 (22:05 +0200)]
dt-bindings: mfd: logicvc: Add patternProperties for the display

The LogiCVC multi-function device has a display part which is now
described in its binding. Add a patternProperties match for it.

Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
3 years agomfd: cros_ec: Drop unneeded MODULE_ALIAS
Krzysztof Kozlowski [Thu, 16 Sep 2021 17:05:34 +0000 (19:05 +0200)]
mfd: cros_ec: Drop unneeded MODULE_ALIAS

The MODULE_DEVICE_TABLE already creates proper alias.  Having another
MODULE_ALIAS causes the alias to be duplicated:

  $ modinfo cros_ec_dev.ko

  alias:          platform:cros-ec-dev
  srcversion:     F84A69D2156719A4F717A76
  alias:          platform:cros-ec-dev

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
3 years agomfd: Kconfig: Fix typo in PMIC_ADP5520 from AD5520 to ADP5520
Ramona Alexandra Nechita [Wed, 15 Sep 2021 10:40:16 +0000 (13:40 +0300)]
mfd: Kconfig: Fix typo in PMIC_ADP5520 from AD5520 to ADP5520

The description mentioned AD5520, which is a different device.
Fixed the typo.

Signed-off-by: Ramona Alexandra Nechita <ramona.nechita@analog.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
3 years agomfd: sprd: Add support for SC2730 PMIC
Chunyan Zhang [Wed, 15 Sep 2021 09:17:26 +0000 (17:17 +0800)]
mfd: sprd: Add support for SC2730 PMIC

SC2730 is a PMIC SoC integrated in UMS512.

Signed-off-by: Chunyan Zhang <chunyan.zhang@unisoc.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
3 years agodt-bindings: mfd: qcom,tcsr: Document ipq6018 compatible
Baruch Siach [Mon, 30 Aug 2021 11:46:24 +0000 (14:46 +0300)]
dt-bindings: mfd: qcom,tcsr: Document ipq6018 compatible

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
3 years agomfd: da9063: Add support for latest EA silicon revision
Carlos de Paula [Mon, 30 Aug 2021 19:53:45 +0000 (16:53 -0300)]
mfd: da9063: Add support for latest EA silicon revision

This update adds new regmap to support the latest EA silicon
which will be selected based on the chip and variant
information read from the device.

Signed-off-by: Carlos de Paula <me@carlosedp.com>
Reviewed-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
3 years agomfd: rk808: Add support for power off on RK817
Ondrej Jirman [Sun, 29 Aug 2021 02:51:53 +0000 (04:51 +0200)]
mfd: rk808: Add support for power off on RK817

RK817 has a power-off bit in SYS_CFG3. Add support for powering
off the PMIC.

Signed-off-by: Ondrej Jirman <megous@megous.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
3 years agomfd: intel_pmt: Only compile on x86
Prarit Bhargava [Wed, 25 Aug 2021 12:57:35 +0000 (08:57 -0400)]
mfd: intel_pmt: Only compile on x86

The intel_pmt driver shows up as a compile option for all arches but is
32-bit and 64-bit x86 specific.

Add a CONFIG dependency on X86 for intel_pmt.

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Reviewed-by: David E. Box <david.e.box@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
3 years agomfd: ti_am335x_tscadc: Fix spelling mistake "atleast" -> "at least"
Colin Ian King [Thu, 26 Aug 2021 12:32:50 +0000 (13:32 +0100)]
mfd: ti_am335x_tscadc: Fix spelling mistake "atleast" -> "at least"

There is a spelling mistake in a dev_err message. Fix it.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
3 years agodt-bindings: mfd: brcm,cru: Add USB 2.0 PHY
Rafał Miłecki [Mon, 13 Sep 2021 08:00:23 +0000 (10:00 +0200)]
dt-bindings: mfd: brcm,cru: Add USB 2.0 PHY

Northstar's USB 2.0 PHY is part of the CRU MFD.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
3 years agodt-bindings: mfd: brcm,cru: Add clkset syscon
Rafał Miłecki [Mon, 13 Sep 2021 08:00:21 +0000 (10:00 +0200)]
dt-bindings: mfd: brcm,cru: Add clkset syscon

CRU has a shared register that is used e.g. to control USB 2.0 PHY block
access. It's a single 32 b register. Document it as syscon so it can be
used with a regmap.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
3 years agodt-bindings: mfd: Add Broadcom's MISC block
Rafał Miłecki [Thu, 19 Aug 2021 15:25:52 +0000 (17:25 +0200)]
dt-bindings: mfd: Add Broadcom's MISC block

Broadcom's MISC is an MFD hardware block used on some of their SoCs like
bcm63xx and bcm4908. At this point only PCIe reset is fully understood
and documented. More functions may be added later.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
3 years agoMerge branches 'ib-mfd-iio-touchscreen-clk-5.16', 'ib-mfd-misc-regulator-5.16' and...
Lee Jones [Fri, 5 Nov 2021 14:37:56 +0000 (14:37 +0000)]
Merge branches 'ib-mfd-iio-touchscreen-clk-5.16', 'ib-mfd-misc-regulator-5.16' and 'tb-mfd-from-regulator-5.16' into ibs-for-mfd-merged

3 years agodt-bindings: mfd: samsung,s5m8767: Document buck and LDO supplies
Krzysztof Kozlowski [Fri, 8 Oct 2021 11:40:24 +0000 (13:40 +0200)]
dt-bindings: mfd: samsung,s5m8767: Document buck and LDO supplies

Document the properties with regulator supplies for bucks and LDOs.  At
least one board uses it (Exynos5250 Arndale).

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211008114024.135335-1-krzysztof.kozlowski@canonical.com
3 years agodt-bindings: mfd: samsung,s5m8767: Convert to dtschema
Krzysztof Kozlowski [Fri, 8 Oct 2021 11:39:31 +0000 (13:39 +0200)]
dt-bindings: mfd: samsung,s5m8767: Convert to dtschema

Convert the MFD part of Samsung S5M8767 PMIC to DT schema format.
Previously the bindings were mostly in mfd/samsung,sec-core.txt.

Since all of bindings for Samsung S2M and S5M family of PMICs were
converted from mfd/samsung,sec-core.txt to respective dtschema file,
remove the former one.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211008113931.134847-6-krzysztof.kozlowski@canonical.com
3 years agodt-bindings: mfd: samsung,s2mpa01: Convert to dtschema
Krzysztof Kozlowski [Fri, 8 Oct 2021 11:39:30 +0000 (13:39 +0200)]
dt-bindings: mfd: samsung,s2mpa01: Convert to dtschema

Convert the MFD part of Samsung S2MPA01 PMIC to DT schema format.
Previously the bindings were mostly in mfd/samsung,sec-core.txt.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211008113931.134847-5-krzysztof.kozlowski@canonical.com
3 years agodt-bindings: mfd: samsung,s2mps11: Convert to dtschema
Krzysztof Kozlowski [Fri, 8 Oct 2021 11:39:29 +0000 (13:39 +0200)]
dt-bindings: mfd: samsung,s2mps11: Convert to dtschema

Convert the MFD part of Samsung S2MPS11/S2MPS13/S2MPS14/S2MPS15/S2MPU02
family of PMICs to DT schema format.  Previously the bindings were
mostly in mfd/samsung,sec-core.txt.

The conversion copies parts of description from existing bindings
therefore the license is not changed from GPLv2.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211008113931.134847-4-krzysztof.kozlowski@canonical.com
3 years agoMerge tag 'tags/s2m_s5m_dtschema' into tb-mfd-from-regulator-5.16
Lee Jones [Thu, 21 Oct 2021 09:44:22 +0000 (10:44 +0100)]
Merge tag 'tags/s2m_s5m_dtschema' into tb-mfd-from-regulator-5.16

regulator/clock: Convert the s2m and s5m DT bindings to schema

Tagged to allow further bindings to rely on these.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
3 years agoiio: adc: ti_am335x_adc: Add the am437x compatible
Miquel Raynal [Fri, 15 Oct 2021 08:15:03 +0000 (10:15 +0200)]
iio: adc: ti_am335x_adc: Add the am437x compatible

This driver supports both the legacy controller (am33xx) and the
extended one (am437x), so let's add a new compatible.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211015081506.933180-46-miquel.raynal@bootlin.com
3 years agoiio: adc: ti_am335x_adc: Add the scale information
Miquel Raynal [Fri, 15 Oct 2021 08:15:02 +0000 (10:15 +0200)]
iio: adc: ti_am335x_adc: Add the scale information

Without the scale, the values returned to the user are just a picture of
the input voltage against the full scale range of the ADC. We need to
provide the actual conversion factor to get milli-Volts values.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211015081506.933180-45-miquel.raynal@bootlin.com
3 years agoiio: adc: ti_am335x_adc: Add a unit to the timeout delay
Miquel Raynal [Fri, 15 Oct 2021 08:15:01 +0000 (10:15 +0200)]
iio: adc: ti_am335x_adc: Add a unit to the timeout delay

The lack of unit in the macro name kind of tricked me when I was
troubleshooting an issue. Physical constants should always get a unit.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211015081506.933180-44-miquel.raynal@bootlin.com
3 years agoiio: adc: ti_am335x_adc: Gather the checks on the delays
Miquel Raynal [Fri, 15 Oct 2021 08:15:00 +0000 (10:15 +0200)]
iio: adc: ti_am335x_adc: Gather the checks on the delays

Move the checks over the delays provided in the device tree to the
location where these values are read to clarify where they come from.

There are no functional changes besides the device structure used to
display the warnings: let's use the ADC instead of the MFD device.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211015081506.933180-43-miquel.raynal@bootlin.com
3 years agoiio: adc: ti_am335x_adc: Get rid of useless gotos
Miquel Raynal [Fri, 15 Oct 2021 08:14:59 +0000 (10:14 +0200)]
iio: adc: ti_am335x_adc: Get rid of useless gotos

Gotos jumping to a return statement are not really useful, drop them.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211015081506.933180-42-miquel.raynal@bootlin.com
3 years agoiio: adc: ti_am335x_adc: Fix style
Miquel Raynal [Fri, 15 Oct 2021 08:14:58 +0000 (10:14 +0200)]
iio: adc: ti_am335x_adc: Fix style

These warnings are reported by checkpatch.pl essentially.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211015081506.933180-41-miquel.raynal@bootlin.com
3 years agoiio: adc: ti_am335x_adc: Replace license text with SPDX tag
Miquel Raynal [Fri, 15 Oct 2021 08:14:57 +0000 (10:14 +0200)]
iio: adc: ti_am335x_adc: Replace license text with SPDX tag

Drop the text license and replace it with an equivalent SPDX license tag
identifier which also matches the MODULE_LICENSE("GPL").

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211015081506.933180-40-miquel.raynal@bootlin.com
3 years agoiio: adc: ti_am335x_adc: Wait the idle state to avoid stalls
Miquel Raynal [Fri, 15 Oct 2021 08:14:56 +0000 (10:14 +0200)]
iio: adc: ti_am335x_adc: Wait the idle state to avoid stalls

At least on a am4372, a simple:
$ cat /sys/bus/iio/devices/iio\:deviceX/in_voltage*_raw
can stall forever. It seems that it comes from the fact that the
internal state machine does not have enough time to return to its idle
state in this situation before receiving another request, leading to an
internal stall.

Add a tiadc_wait_idle() helper to ensure no new conversion is requested
while the FSM is still busy.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211015081506.933180-39-miquel.raynal@bootlin.com
3 years agomfd: ti_am335x_tscadc: Support the correctly spelled DT property
Miquel Raynal [Fri, 15 Oct 2021 08:14:55 +0000 (10:14 +0200)]
mfd: ti_am335x_tscadc: Support the correctly spelled DT property

There was in the past a typo in the coordinate readouts property. The
bindings have been updated, the touchscreen driver as well and now
supports both. However, the MFD driver that is in charge of verifying
the validity of the property only checks the bogus one. Add support for
the correctly spelled DT property.

Fixes: c9aeb249bf72 ("Input: ti_am335x_tsc - fix spelling mistake in TSC/ADC DT binding")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211015081506.933180-38-miquel.raynal@bootlin.com
3 years agomfd: ti_am335x_tscadc: Add ADC1/magnetic reader support
Miquel Raynal [Fri, 15 Oct 2021 08:14:54 +0000 (10:14 +0200)]
mfd: ti_am335x_tscadc: Add ADC1/magnetic reader support

Introduce a new compatible that has another set of driver data,
targeting am437x SoCs with a magnetic reader instead of the
touchscreen and a more featureful set of registers.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211015081506.933180-37-miquel.raynal@bootlin.com
3 years agomfd: ti_am335x_tscadc: Introduce a helper to deal with the type of hardware
Miquel Raynal [Fri, 15 Oct 2021 08:14:53 +0000 (10:14 +0200)]
mfd: ti_am335x_tscadc: Introduce a helper to deal with the type of hardware

One way of knowing which hardware we are dealing with is to check the
compatible string. When this must be done at several places, it's best
and certainly more clear to use a helper for that.

Introduce ti_adc_with_touchscreen() to indicate if there is a touchscreen
controller available (meaning it's an am33xx-like ADC). This helper does
not indicate if it is actually used (that is the purpose of the use_tsc
boolean).

Introducing this helper helps making a difference in the code between
what is generic to both types of ADCs and what is specific to the am33xx
hardware before introducing support for the am437x hardware.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211015081506.933180-36-miquel.raynal@bootlin.com
3 years agomfd: ti_am335x_tscadc: Add a boolean to clarify the presence of a touchscreen
Miquel Raynal [Fri, 15 Oct 2021 08:14:52 +0000 (10:14 +0200)]
mfd: ti_am335x_tscadc: Add a boolean to clarify the presence of a touchscreen

Just checking the number of wires will soon not be enough, add a boolean
to indicate the actual use or not of the touchscreen.

Certain checks only make sense when there is a touchscreen wired. Make
these checks explicitly depend on the presence of the touchscreen.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211015081506.933180-35-miquel.raynal@bootlin.com
3 years agomfd: ti_am335x_tscadc: Fix an error message
Miquel Raynal [Fri, 15 Oct 2021 08:14:51 +0000 (10:14 +0200)]
mfd: ti_am335x_tscadc: Fix an error message

The error message if we cannot retrieve the clock tells us that the
touchscreen controller clock was unavailable. This is wrong, this is the
"main" clock for the hardware block, it is not specific to the
touchscreen and won't change when we will introduce ADC1/magnetic reader
support so let's correct this comment.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211015081506.933180-34-miquel.raynal@bootlin.com
3 years agomfd: ti_am335x_tscadc: Rename a variable
Miquel Raynal [Fri, 15 Oct 2021 08:14:50 +0000 (10:14 +0200)]
mfd: ti_am335x_tscadc: Rename a variable

We need to retrieve the number of wires used by the "secondary" device
(the touchscreen or the magnetic reader). Let's rename tsc_wires to
become tscmag_wires to clarify the fact that this variable can be used
in both situations.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211015081506.933180-33-miquel.raynal@bootlin.com
3 years agomfd: ti_am335x_tscadc: Add TSC prefix in certain macros
Miquel Raynal [Fri, 15 Oct 2021 08:14:49 +0000 (10:14 +0200)]
mfd: ti_am335x_tscadc: Add TSC prefix in certain macros

While the register list (and names) between ADC0 and ADC1 are pretty
close, the bits inside changed a little bit. To avoid any future
confusion, let's add the TSC prefix when some bits are in a register
that is common to both revisions of the ADC, but are specific to the
am33xx hardware.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211015081506.933180-32-miquel.raynal@bootlin.com
3 years agomfd: ti_am335x_tscadc: Rename the subsystem enable macro
Miquel Raynal [Fri, 15 Oct 2021 08:14:48 +0000 (10:14 +0200)]
mfd: ti_am335x_tscadc: Rename the subsystem enable macro

This bit is common to all devices (ADC, Touchscreen, Magnetic reader) so
make it clear that it can be used from any location by operating a
mechanical rename:
s/CNTRLREG_TSCSSENB/CNTRLREG_SSENB/

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211015081506.933180-31-miquel.raynal@bootlin.com
3 years agomfd: ti_am335x_tscadc: Drop useless definitions from the header
Miquel Raynal [Fri, 15 Oct 2021 08:14:47 +0000 (10:14 +0200)]
mfd: ti_am335x_tscadc: Drop useless definitions from the header

Drop useless definitions from the header like the "masks" definitions
which are only used by the following definition.

It could be possible to got even further by removing these definitions
entirely and use FIELD_PREP() macros from the code directly, but while I
have no troubles making these changes in the header, changing the values
in the code directly could darkening a bit the logic and
hardening future git-blames for very little added value IMHO (but this
is of course a personal taste).

Certain macros are using GENMASK() to define the value of a particular
field, while this is purely "by chance" that the value and the mask have
the same value. In this case, drop the "mask" definition, use
FIELD_PREP() and GENMASK() in the macro defining the field, and use the
new macro to define the particular value by feeding directly the actual
number advertised in the datasheet into that macro, as in:
-#define STEPCONFIG_RFM_VREFN   GENMASK(24, 23)
-#define STEPCONFIG_RFM(val)    FIELD_PREP(STEPCONFIG_RFM_VREFN, (val))
+#define STEPCONFIG_RFM(val)    FIELD_PREP(GENMASK(24, 23), (val))
+#define STEPCONFIG_RFM_VREFN   STEPCONFIG_RFM(3)

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211015081506.933180-30-miquel.raynal@bootlin.com
3 years agomfd: ti_am335x_tscadc: Clarify the maximum values for DT entries
Miquel Raynal [Fri, 15 Oct 2021 08:14:46 +0000 (10:14 +0200)]
mfd: ti_am335x_tscadc: Clarify the maximum values for DT entries

Clearly define the maximum open delay and sample delay. Use these
definitions in place of a mask (which works because this is the first
field in the register) and an open-coded value. While at it reword a
little bit the error messages to make them look clearer and similar.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211015081506.933180-29-miquel.raynal@bootlin.com
3 years agomfd: ti_am335x_tscadc: Use BIT(), GENMASK() and FIELD_PREP() when relevant
Miquel Raynal [Fri, 15 Oct 2021 08:14:45 +0000 (10:14 +0200)]
mfd: ti_am335x_tscadc: Use BIT(), GENMASK() and FIELD_PREP() when relevant

Clean the ti_am335x_tscadc.h header by:
* converting masks to GENMASK()
* converting regular shifts to BIT()
* using FIELD_PREP() when relevant

Sometimes reorder the lines to be able to use the relevant bitmask.

Mind the s/%d/%ld/ change in a log due to the type change following the
use of FIELD_PREP() in the header.

Suggested-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211015081506.933180-28-miquel.raynal@bootlin.com
3 years agomfd: ti_am335x_tscadc: Drop unused definitions from the header
Miquel Raynal [Fri, 15 Oct 2021 08:14:44 +0000 (10:14 +0200)]
mfd: ti_am335x_tscadc: Drop unused definitions from the header

The STEP ENABLE definitions are highly unclear and not used so drop them.

Suggested-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211015081506.933180-27-miquel.raynal@bootlin.com
3 years agomfd: ti_am335x_tscadc: Use the new HZ_PER_MHZ macro
Miquel Raynal [Fri, 15 Oct 2021 08:14:43 +0000 (10:14 +0200)]
mfd: ti_am335x_tscadc: Use the new HZ_PER_MHZ macro

Before adding another frequency with even more zeroes, use the
HZ_PER_MHZ macro to clarify the number.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211015081506.933180-26-miquel.raynal@bootlin.com
3 years agomfd: ti_am335x_tscadc: Fix header spacing
Miquel Raynal [Fri, 15 Oct 2021 08:14:42 +0000 (10:14 +0200)]
mfd: ti_am335x_tscadc: Fix header spacing

Harmonize the spacing within macro definitions.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211015081506.933180-25-miquel.raynal@bootlin.com
3 years agomfd: ti_am335x_tscadc: Replace the header license text with SPDX tag
Miquel Raynal [Fri, 15 Oct 2021 08:14:41 +0000 (10:14 +0200)]
mfd: ti_am335x_tscadc: Replace the header license text with SPDX tag

Drop the text license and replace it with an equivalent SPDX license tag
identifier.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211015081506.933180-24-miquel.raynal@bootlin.com
3 years agomfd: ti_am335x_tscadc: Gather the ctrl register logic in one place
Miquel Raynal [Fri, 15 Oct 2021 08:14:40 +0000 (10:14 +0200)]
mfd: ti_am335x_tscadc: Gather the ctrl register logic in one place

Instead of deriving in the probe and in the resume path the value of the
ctrl register, let's do it only once in the probe, save the value of
this register (all but the subsystem enable bit) in the driver's
structure and use it from the resume callback.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211015081506.933180-23-miquel.raynal@bootlin.com
3 years agomfd: ti_am335x_tscadc: Reorder the initialization steps
Miquel Raynal [Fri, 15 Oct 2021 08:14:39 +0000 (10:14 +0200)]
mfd: ti_am335x_tscadc: Reorder the initialization steps

TI AM335X TRM [1] states that most of the configuration should be set in
the control register in the first place, before actually enabling the
hardware with the subsystem enable bit.

So far only half of the configuration was made in the first step (before
enabling the "subsystem"), which does not make really sense. Also, the
probe and the resume patch were acting differently. Let's harmonize all
this by following these steps:
1/ Configure the CLKDIV register
2/ Configure the CTRL register
3/ Configure the idle configuration
4/ Really enable the device by rewriting the CTRL register with the
   subsystem enable bit set.

[1] https://www.ti.com/lit/pdf/spruh73

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211015081506.933180-22-miquel.raynal@bootlin.com
3 years agomfd: ti_am335x_tscadc: Always provide an idle configuration
Miquel Raynal [Fri, 15 Oct 2021 08:14:38 +0000 (10:14 +0200)]
mfd: ti_am335x_tscadc: Always provide an idle configuration

The idle register is valid no matter if the touchscreen is used or not,
let's always configure it.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211015081506.933180-21-miquel.raynal@bootlin.com
3 years agomfd: ti_am335x_tscadc: Drop useless variables from the driver structure
Miquel Raynal [Fri, 15 Oct 2021 08:14:37 +0000 (10:14 +0200)]
mfd: ti_am335x_tscadc: Drop useless variables from the driver structure

Keeping the count of tsc_cells and adc_cells is completely redundant, we
can derive this information from other variables. Plus, these variables
are not used anywhere else now. Let's get rid of them.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211015081506.933180-20-miquel.raynal@bootlin.com
3 years agomfd: ti_am335x_tscadc: Mimic the probe from resume()
Miquel Raynal [Fri, 15 Oct 2021 08:14:36 +0000 (10:14 +0200)]
mfd: ti_am335x_tscadc: Mimic the probe from resume()

Use the number of touchscreen wires (tsc_wires) instead of the flag
indicating a touchscreen cell (tsc_cell) to mimic the logic from the
probe.

Besides keeping a certain harmony in the driver, the main benefit is
that we are going to simplify the number of entries in the main MFD
structure and tsc_cell can now be removed more easily.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211015081506.933180-19-miquel.raynal@bootlin.com
3 years agomfd: ti_am335x_tscadc: Use driver data
Miquel Raynal [Fri, 15 Oct 2021 08:14:35 +0000 (10:14 +0200)]
mfd: ti_am335x_tscadc: Use driver data

So far every sub-cell parameter in this driver was hardcoded: cell name,
cell compatible, specific clock name and desired clock frequency.

As we are about to introduce support for ADC1/magnetic reader, we need a
bit of flexibility. Let's add a driver data structure which will contain
these information.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211015081506.933180-18-miquel.raynal@bootlin.com
3 years agomfd: ti_am335x_tscadc: Move the driver structure allocation earlier
Miquel Raynal [Fri, 15 Oct 2021 08:14:34 +0000 (10:14 +0200)]
mfd: ti_am335x_tscadc: Move the driver structure allocation earlier

Allocating the driver structure should be done earlier in the probe so
that we can used its members from the beginning.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211015081506.933180-17-miquel.raynal@bootlin.com
3 years agomfd: ti_am335x_tscadc: Simplify divisor calculation
Miquel Raynal [Fri, 15 Oct 2021 08:14:33 +0000 (10:14 +0200)]
mfd: ti_am335x_tscadc: Simplify divisor calculation

Let's rewrite this on a single line, it does not hurt the readability
and saves a useless temporary variable.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211015081506.933180-16-miquel.raynal@bootlin.com
3 years agomfd: ti_am335x_tscadc: Don't search the tree for our clock
Miquel Raynal [Fri, 15 Oct 2021 08:14:32 +0000 (10:14 +0200)]
mfd: ti_am335x_tscadc: Don't search the tree for our clock

There is a single clock available in our node, which is named
"fck". The clock handler then points to adc_tsc_fck but no need to point
directly to it and do a full tree search.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211015081506.933180-15-miquel.raynal@bootlin.com
3 years agomfd: ti_am335x_tscadc: Reword the comment explaining the dividers
Miquel Raynal [Fri, 15 Oct 2021 08:14:31 +0000 (10:14 +0200)]
mfd: ti_am335x_tscadc: Reword the comment explaining the dividers

The comment misses the main information which is that we assume that a
sample takes 15 ADC clock cycles to be generated. Let's take the
occasion to rework a little bit this comment.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211015081506.933180-14-miquel.raynal@bootlin.com
3 years agomfd: ti_am335x_tscadc: Drop extra spacing when declaring stack variables
Miquel Raynal [Fri, 15 Oct 2021 08:14:29 +0000 (10:14 +0200)]
mfd: ti_am335x_tscadc: Drop extra spacing when declaring stack variables

Many variables will be updated (renamed, dropped, added) in the upcoming
changes, so let's simplify the style to avoid messing with spaces over
and over again.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211015081506.933180-12-miquel.raynal@bootlin.com
3 years agomfd: ti_am335x_tscadc: Get rid of useless gotos
Miquel Raynal [Fri, 15 Oct 2021 08:14:30 +0000 (10:14 +0200)]
mfd: ti_am335x_tscadc: Get rid of useless gotos

Goto's jumping to a return statement are not really useful, drop them.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211015081506.933180-13-miquel.raynal@bootlin.com
3 years agomfd: ti_am335x_tscadc: Fix style
Miquel Raynal [Fri, 15 Oct 2021 08:14:28 +0000 (10:14 +0200)]
mfd: ti_am335x_tscadc: Fix style

These are mostly deffects reported by checkpatch.pl.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211015081506.933180-11-miquel.raynal@bootlin.com
3 years agomfd: ti_am335x_tscadc: Replace license text with SPDX tag
Miquel Raynal [Fri, 15 Oct 2021 08:14:27 +0000 (10:14 +0200)]
mfd: ti_am335x_tscadc: Replace license text with SPDX tag

Drop the text license and replace it with an equivalent SPDX license tag
identifier which also matches the MODULE_LICENSE(GPL) macro.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211015081506.933180-10-miquel.raynal@bootlin.com
3 years agomfd: ti_am335x_tscadc: Ensure a balanced number of node get/put
Miquel Raynal [Fri, 15 Oct 2021 08:14:26 +0000 (10:14 +0200)]
mfd: ti_am335x_tscadc: Ensure a balanced number of node get/put

of_node_put() should be called after a successful of_get_child_by_name().

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211015081506.933180-9-miquel.raynal@bootlin.com
3 years agodt-bindings: iio: adc: ti,am3359-adc: Describe am4372 ADC compatible
Miquel Raynal [Fri, 15 Oct 2021 08:14:25 +0000 (10:14 +0200)]
dt-bindings: iio: adc: ti,am3359-adc: Describe am4372 ADC compatible

A more recent version of the am3359 ADC is available on certain SoCs of
the am437x family. This IP has evolved a little bit and deserves its own
compatible.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211015081506.933180-8-miquel.raynal@bootlin.com
3 years agodt-bindings: mfd: ti,am3359-tscadc: Describe am4372 MFD compatible
Miquel Raynal [Fri, 15 Oct 2021 08:14:24 +0000 (10:14 +0200)]
dt-bindings: mfd: ti,am3359-tscadc: Describe am4372 MFD compatible

A more recent version of the am3359 ADC/Touchscreen controller is
available on certain SoCs of the am437x family. This IP has evolved a
little bit and deserves its own compatible.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211015081506.933180-7-miquel.raynal@bootlin.com
3 years agodt-bindings: touchscreen: ti,am3359-tsc: Remove deprecated text file
Miquel Raynal [Fri, 15 Oct 2021 08:14:23 +0000 (10:14 +0200)]
dt-bindings: touchscreen: ti,am3359-tsc: Remove deprecated text file

Now that the three hardware peaces described in this file have been
translated in yaml in 3 dedicated files (MFD, touchscreen controller and
ADC) it is time to remove this text file.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: Rob Herring <robh@kernel.org>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211015081506.933180-6-miquel.raynal@bootlin.com
3 years agodt-bindings: iio: adc: ti,am3359-adc: New yaml description
Miquel Raynal [Fri, 15 Oct 2021 08:14:22 +0000 (10:14 +0200)]
dt-bindings: iio: adc: ti,am3359-adc: New yaml description

This ADC was already described in a text file also containing an MFD
description an a touchscreen description:
Documentation/devicetree/bindings/input/touchscreen/ti-tsc-adc.txt
Let's add a proper description for this hardware.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211015081506.933180-5-miquel.raynal@bootlin.com
3 years agodt-bindings: touchscreen: ti,am3359-tsc: New yaml description
Miquel Raynal [Fri, 15 Oct 2021 08:14:21 +0000 (10:14 +0200)]
dt-bindings: touchscreen: ti,am3359-tsc: New yaml description

This touchscreen controller is already described in a text file:
Documentation/devicetree/bindings/input/touchscreen/ti-tsc-adc.txt

After introducing a proper description of the MFD, this is the second
step. The file cannot be removed yet as it also contains an ADC
description.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211015081506.933180-4-miquel.raynal@bootlin.com
3 years agodt-bindings: mfd: ti,am3359-tscadc: Add a yaml description for this MFD
Miquel Raynal [Fri, 15 Oct 2021 08:14:20 +0000 (10:14 +0200)]
dt-bindings: mfd: ti,am3359-tscadc: Add a yaml description for this MFD

There is a very light description of this MFD in a text file dedicated
to a touchscreen controller (which is one of the two children of the
MFD). Here is now a complete yaml description.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211015081506.933180-3-miquel.raynal@bootlin.com
3 years agoclk: ti: am43xx: Add clkctrl data for am43xx ADC1
Miquel Raynal [Fri, 15 Oct 2021 08:14:19 +0000 (10:14 +0200)]
clk: ti: am43xx: Add clkctrl data for am43xx ADC1

Declare ADC1 clkctrl which feeds the magnetic-reader/ADC1 hardware
module.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Acked-by: Stephen Boyd <sboyd@kernel.org>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211015081506.933180-2-miquel.raynal@bootlin.com
3 years agoregulator: dt-bindings: samsung,s5m8767: convert to dtschema
Krzysztof Kozlowski [Fri, 8 Oct 2021 11:39:28 +0000 (13:39 +0200)]
regulator: dt-bindings: samsung,s5m8767: convert to dtschema

Convert the regulators of Samsung S5M8767 PMIC to DT schema format.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Message-Id: <20211008113931.134847-3-krzysztof.kozlowski@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoregulator: dt-bindings: samsung,s2mpa01: convert to dtschema
Krzysztof Kozlowski [Fri, 8 Oct 2021 11:39:27 +0000 (13:39 +0200)]
regulator: dt-bindings: samsung,s2mpa01: convert to dtschema

Convert the regulators of Samsung S2MPA01 PMIC to DT schema format.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Message-Id: <20211008113931.134847-2-krzysztof.kozlowski@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoregulator: dt-bindings: samsung,s2m: convert to dtschema
Krzysztof Kozlowski [Fri, 8 Oct 2021 11:39:26 +0000 (13:39 +0200)]
regulator: dt-bindings: samsung,s2m: convert to dtschema

Convert the regulators of Samsung
S2MPS11/S2MPS13/S2MPS14/S2MPS15/S2MPU02 family of PMICs to DT schema
format.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Message-Id: <20211008113931.134847-1-krzysztof.kozlowski@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agodt-bindings: clock: samsung,s2mps11: convert to dtschema
Krzysztof Kozlowski [Fri, 8 Oct 2021 11:37:15 +0000 (13:37 +0200)]
dt-bindings: clock: samsung,s2mps11: convert to dtschema

Convert the clock provider of Samsung S2MPS11 family of PMICs to DT
schema format.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Stephen Boyd <sboyd@kernel.org>
Message-Id: <20211008113723.134648-4-krzysztof.kozlowski@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoregulator: dt-bindings: samsung,s5m8767: correct s5m8767,pmic-buck-default-dvs-idx...
Krzysztof Kozlowski [Fri, 8 Oct 2021 11:37:14 +0000 (13:37 +0200)]
regulator: dt-bindings: samsung,s5m8767: correct s5m8767,pmic-buck-default-dvs-idx property

The driver was always parsing "s5m8767,pmic-buck-default-dvs-idx", not
"s5m8767,pmic-buck234-default-dvs-idx".

Cc: <stable@vger.kernel.org>
Fixes: 26aec009f6b6 ("regulator: add device tree support for s5m8767")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Acked-by: Rob Herring <robh@kernel.org>
Message-Id: <20211008113723.134648-3-krzysztof.kozlowski@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>