Thread (20 messages) 20 messages, 5 authors, 2022-08-09

Re: [PATCH 0/2] arm64 defconfig: Get faddr2line working

From: Arnd Bergmann <arnd@arndb.de>
Date: 2022-07-28 09:09:34
Also in: lkml
Subsystem: arm/qualcomm mailing list, qcom audio (asoc) drivers, soundwire subsystem, the rest · Maintainers: Srinivas Kandagatla, Vinod Koul, Bard Liao, Linus Torvalds

On Thu, Jul 28, 2022 at 10:53 AM Srinivas Kandagatla
[off-list ref] wrote:
On 28/07/2022 09:23, Arnd Bergmann wrote:
quoted
On Thu, Jul 28, 2022 at 10:06 AM John Garry [off-list ref] wrote:
As we are using a common driver for this, we wanted to check if the
parent was a slimbus or not, to be able to select correct read/write
interfaces.

rethinking about this approach, It should be doable to also derive this
information from compatible strings, Soundwire controller versions 1.3.0
and below are always of type 1 and the newer ones are type 2.

So this could get rid of IS_REACHABLE check along with references to
slimbus_bus from driver.
Referencing slimbus_bus here is not a problem, just use IS_ENABLED()
and fix the dependency. While at it, please also
expressing the SlimBus dependency for type 1 should be either captured
using imply SLIMBUS or depends in Kconfig.
'imply' has no effect on compile testing, it only affects what goes in
the defconfig file, so there has a be a 'depends on'. To allow building both
with and without slimbus, but disallow the configuration with slimbus
as a loadable module and soundwire-qcom as built-in, do it like this:
diff --git a/drivers/soundwire/Kconfig b/drivers/soundwire/Kconfig
index 2b7795233282..69e46cce7d8b 100644
--- a/drivers/soundwire/Kconfig
+++ b/drivers/soundwire/Kconfig
@@ -35,7 +35,7 @@ config SOUNDWIRE_INTEL

 config SOUNDWIRE_QCOM
        tristate "Qualcomm SoundWire Master driver"
-       imply SLIMBUS
+       depends on SLIMBUS || !SLIMBUS
        depends on SND_SOC
        help
          SoundWire Qualcomm Master driver.
diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c
index 22b706350ead..f65c7737c2db 100644
--- a/drivers/soundwire/qcom.c
+++ b/drivers/soundwire/qcom.c
@@ -1289,11 +1289,7 @@ static int qcom_swrm_probe(struct platform_device *pdev)
        data = of_device_get_match_data(dev);
        ctrl->rows_index = sdw_find_row_index(data->default_rows);
        ctrl->cols_index = sdw_find_col_index(data->default_cols);
-#if IS_REACHABLE(CONFIG_SLIMBUS)
-       if (dev->parent->bus == &slimbus_bus) {
-#else
-       if (false) {
-#endif
+       if (IS_ENABLED(CONFIG_SLIMBUS) && dev->parent->bus == &slimbus_bus) {
                ctrl->reg_read = qcom_swrm_ahb_reg_read;
                ctrl->reg_write = qcom_swrm_ahb_reg_write;
                ctrl->regmap = dev_get_regmap(dev->parent, NULL);
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help