All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/7] soc: qcom: Allow COMPILE_TEST of all drivers
@ 2018-06-14 11:11 Niklas Cassel
  2018-06-14 11:11 ` [PATCH v2 1/7] rpmsg: smd: Add missing include of sizes.h Niklas Cassel
                   ` (6 more replies)
  0 siblings, 7 replies; 16+ messages in thread
From: Niklas Cassel @ 2018-06-14 11:11 UTC (permalink / raw)
  To: andy.gross, Ohad Ben-Cohen, Bjorn Andersson, David Brown,
	Patrick Lai, Banajit Goswami, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai
  Cc: linux-arm-msm, Niklas Cassel, linux-remoteproc, linux-kernel,
	linux-soc, alsa-devel

Since commit cab673583d96 ("soc: Unconditionally include qcom Makefile"),
we unconditionally include the soc/qcom/Makefile.

This opens up the possibility to compile test the code even when
building for other architectures.

This patch series prepares and enables all but two Kconfigs to be
compile tested even when building for other architectures.


Changes since v1:
Added two new patches, "ASoC: qdsp6: Add depends on OF"
and "soc: qcom: Remove bogus depends on OF".
Patch "soc: qcom: Allow COMPILE_TEST of all drivers"
now adds "depends on ARCH_QCOM || COMPILE_TEST" to the menu entry.


Niklas Cassel (7):
  rpmsg: smd: Add missing include of sizes.h
  soc: qcom: smem: Add missing include of sizes.h
  soc: qcom: smp2p: Add select IRQ_DOMAIN
  soc: qcom: smsm: Add select IRQ_DOMAIN
  ASoC: qdsp6: Add depends on OF
  soc: qcom: Remove bogus depends on OF
  soc: qcom: Allow COMPILE_TEST of all drivers

 drivers/rpmsg/qcom_smd.c |  1 +
 drivers/soc/qcom/Kconfig | 14 +++++---------
 drivers/soc/qcom/smem.c  |  1 +
 sound/soc/qcom/Kconfig   |  2 +-
 4 files changed, 8 insertions(+), 10 deletions(-)

-- 
2.17.1

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH v2 1/7] rpmsg: smd: Add missing include of sizes.h
  2018-06-14 11:11 [PATCH v2 0/7] soc: qcom: Allow COMPILE_TEST of all drivers Niklas Cassel
@ 2018-06-14 11:11 ` Niklas Cassel
  2018-06-14 11:11 ` [PATCH v2 2/7] soc: qcom: smem: " Niklas Cassel
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 16+ messages in thread
From: Niklas Cassel @ 2018-06-14 11:11 UTC (permalink / raw)
  To: andy.gross, Ohad Ben-Cohen, Bjorn Andersson
  Cc: linux-arm-msm, Niklas Cassel, linux-remoteproc, linux-kernel

Add missing include of sizes.h.

drivers/rpmsg/qcom_smd.c: In function ‘qcom_smd_channel_open’:
drivers/rpmsg/qcom_smd.c:809:36: error: ‘SZ_4K’ undeclared (first use in this function)
  bb_size = min(channel->fifo_size, SZ_4K);
                                    ^~~~~

Signed-off-by: Niklas Cassel <niklas.cassel@linaro.org>
---
 drivers/rpmsg/qcom_smd.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/rpmsg/qcom_smd.c b/drivers/rpmsg/qcom_smd.c
index 6437bbeebc91..8695cb041c31 100644
--- a/drivers/rpmsg/qcom_smd.c
+++ b/drivers/rpmsg/qcom_smd.c
@@ -14,6 +14,7 @@
 #include <linux/platform_device.h>
 #include <linux/regmap.h>
 #include <linux/sched.h>
+#include <linux/sizes.h>
 #include <linux/slab.h>
 #include <linux/soc/qcom/smem.h>
 #include <linux/wait.h>
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v2 2/7] soc: qcom: smem: Add missing include of sizes.h
  2018-06-14 11:11 [PATCH v2 0/7] soc: qcom: Allow COMPILE_TEST of all drivers Niklas Cassel
  2018-06-14 11:11 ` [PATCH v2 1/7] rpmsg: smd: Add missing include of sizes.h Niklas Cassel
@ 2018-06-14 11:11 ` Niklas Cassel
  2018-06-14 11:11 ` [PATCH v2 3/7] soc: qcom: smp2p: Add select IRQ_DOMAIN Niklas Cassel
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 16+ messages in thread
From: Niklas Cassel @ 2018-06-14 11:11 UTC (permalink / raw)
  To: andy.gross, David Brown
  Cc: linux-arm-msm, Niklas Cassel, linux-soc, linux-kernel

Add missing include of sizes.h

drivers/soc/qcom/smem.c: In function ‘qcom_smem_get_ptable’:
drivers/soc/qcom/smem.c:666:64: error: ‘SZ_4K’ undeclared (first use in this function)
  ptable = smem->regions[0].virt_base + smem->regions[0].size - SZ_4K;
                                                                ^~~~~

Signed-off-by: Niklas Cassel <niklas.cassel@linaro.org>
---
 drivers/soc/qcom/smem.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/soc/qcom/smem.c b/drivers/soc/qcom/smem.c
index 70b2ee80d6bd..0fcf60e8269c 100644
--- a/drivers/soc/qcom/smem.c
+++ b/drivers/soc/qcom/smem.c
@@ -18,6 +18,7 @@
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/platform_device.h>
+#include <linux/sizes.h>
 #include <linux/slab.h>
 #include <linux/soc/qcom/smem.h>
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v2 3/7] soc: qcom: smp2p: Add select IRQ_DOMAIN
  2018-06-14 11:11 [PATCH v2 0/7] soc: qcom: Allow COMPILE_TEST of all drivers Niklas Cassel
  2018-06-14 11:11 ` [PATCH v2 1/7] rpmsg: smd: Add missing include of sizes.h Niklas Cassel
  2018-06-14 11:11 ` [PATCH v2 2/7] soc: qcom: smem: " Niklas Cassel
@ 2018-06-14 11:11 ` Niklas Cassel
  2018-06-14 11:11 ` [PATCH v2 4/7] soc: qcom: smsm: " Niklas Cassel
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 16+ messages in thread
From: Niklas Cassel @ 2018-06-14 11:11 UTC (permalink / raw)
  To: andy.gross, David Brown
  Cc: linux-arm-msm, Niklas Cassel, linux-soc, linux-kernel

Since we are using irq_domain_add_linear(), add a select on IRQ_DOMAIN.
This is needed in order to be able to remove the depends on ARCH_QCOM.

drivers/soc/qcom/smp2p.c: In function ‘qcom_smp2p_inbound_entry’:
drivers/soc/qcom/smp2p.c:317:18: error: implicit declaration of function
  ‘irq_domain_add_linear’
  entry->domain = irq_domain_add_linear(node, 32, &smp2p_irq_ops, entry);
                  ^~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Niklas Cassel <niklas.cassel@linaro.org>
---
 drivers/soc/qcom/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig
index 9dc02f390ba3..2f59d0a835fd 100644
--- a/drivers/soc/qcom/Kconfig
+++ b/drivers/soc/qcom/Kconfig
@@ -106,6 +106,7 @@ config QCOM_SMP2P
 	depends on MAILBOX
 	depends on QCOM_SMEM
 	select QCOM_SMEM_STATE
+	select IRQ_DOMAIN
 	help
 	  Say yes here to support the Qualcomm Shared Memory Point to Point
 	  protocol.
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v2 4/7] soc: qcom: smsm: Add select IRQ_DOMAIN
  2018-06-14 11:11 [PATCH v2 0/7] soc: qcom: Allow COMPILE_TEST of all drivers Niklas Cassel
                   ` (2 preceding siblings ...)
  2018-06-14 11:11 ` [PATCH v2 3/7] soc: qcom: smp2p: Add select IRQ_DOMAIN Niklas Cassel
@ 2018-06-14 11:11 ` Niklas Cassel
  2018-06-14 11:11 ` [PATCH v2 5/7] ASoC: qdsp6: Add depends on OF Niklas Cassel
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 16+ messages in thread
From: Niklas Cassel @ 2018-06-14 11:11 UTC (permalink / raw)
  To: andy.gross, David Brown
  Cc: linux-arm-msm, Niklas Cassel, linux-soc, linux-kernel

Since we are using irq_domain_add_linear(), add a select on IRQ_DOMAIN.
This is needed in order to be able to remove the depends on ARCH_QCOM.

drivers/soc/qcom/smsm.c: In function ‘smsm_inbound_entry’:
drivers/soc/qcom/smsm.c:411:18: error: implicit declaration of function
  ‘irq_domain_add_linear’
  entry->domain = irq_domain_add_linear(node, 32, &smsm_irq_ops, entry);
                  ^~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Niklas Cassel <niklas.cassel@linaro.org>
---
 drivers/soc/qcom/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig
index 2f59d0a835fd..1d4a9f3ada8c 100644
--- a/drivers/soc/qcom/Kconfig
+++ b/drivers/soc/qcom/Kconfig
@@ -115,6 +115,7 @@ config QCOM_SMSM
 	tristate "Qualcomm Shared Memory State Machine"
 	depends on QCOM_SMEM
 	select QCOM_SMEM_STATE
+	select IRQ_DOMAIN
 	help
 	  Say yes here to support the Qualcomm Shared Memory State Machine.
 	  The state machine is represented by bits in shared memory.
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v2 5/7] ASoC: qdsp6: Add depends on OF
  2018-06-14 11:11 [PATCH v2 0/7] soc: qcom: Allow COMPILE_TEST of all drivers Niklas Cassel
                   ` (3 preceding siblings ...)
  2018-06-14 11:11 ` [PATCH v2 4/7] soc: qcom: smsm: " Niklas Cassel
@ 2018-06-14 11:11 ` Niklas Cassel
  2018-06-15  4:02   ` Banajit Goswami
  2018-06-18 11:06     ` Mark Brown
  2018-06-14 11:11 ` [PATCH v2 6/7] soc: qcom: Remove bogus " Niklas Cassel
  2018-06-14 11:11 ` [PATCH v2 7/7] soc: qcom: Allow COMPILE_TEST of all drivers Niklas Cassel
  6 siblings, 2 replies; 16+ messages in thread
From: Niklas Cassel @ 2018-06-14 11:11 UTC (permalink / raw)
  To: andy.gross, Patrick Lai, Banajit Goswami, Liam Girdwood,
	Mark Brown, Jaroslav Kysela, Takashi Iwai
  Cc: linux-arm-msm, Niklas Cassel, alsa-devel, linux-kernel

of_platform_device_destroy is only defined when building
with CONFIG_OF=y. Add a depends on OF.

sound/soc/qcom/qdsp6/q6afe.o: In function `q6afe_remove':
q6afe.c:(.text+0x363): undefined reference to `of_platform_device_destroy'
sound/soc/qcom/qdsp6/q6adm.o: In function `q6adm_remove':
q6adm.c:(.text+0x216): undefined reference to `of_platform_device_destroy'
sound/soc/qcom/qdsp6/q6asm.o: In function `q6asm_remove':
q6asm.c:(.text+0x723): undefined reference to `of_platform_device_destroy'

Signed-off-by: Niklas Cassel <niklas.cassel@linaro.org>
---
 sound/soc/qcom/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/qcom/Kconfig b/sound/soc/qcom/Kconfig
index 87838fa27997..3989ec856441 100644
--- a/sound/soc/qcom/Kconfig
+++ b/sound/soc/qcom/Kconfig
@@ -67,7 +67,7 @@ config SND_SOC_QDSP6_ASM_DAI
 
 config SND_SOC_QDSP6
 	tristate "SoC ALSA audio driver for QDSP6"
-	depends on QCOM_APR && HAS_DMA
+	depends on QCOM_APR && HAS_DMA && OF
 	select SND_SOC_QDSP6_COMMON
 	select SND_SOC_QDSP6_CORE
 	select SND_SOC_QDSP6_AFE
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v2 6/7] soc: qcom: Remove bogus depends on OF
  2018-06-14 11:11 [PATCH v2 0/7] soc: qcom: Allow COMPILE_TEST of all drivers Niklas Cassel
                   ` (4 preceding siblings ...)
  2018-06-14 11:11 ` [PATCH v2 5/7] ASoC: qdsp6: Add depends on OF Niklas Cassel
@ 2018-06-14 11:11 ` Niklas Cassel
  2018-06-14 11:11 ` [PATCH v2 7/7] soc: qcom: Allow COMPILE_TEST of all drivers Niklas Cassel
  6 siblings, 0 replies; 16+ messages in thread
From: Niklas Cassel @ 2018-06-14 11:11 UTC (permalink / raw)
  To: andy.gross, David Brown
  Cc: linux-arm-msm, Niklas Cassel, linux-soc, linux-kernel

Both QCOM_COMMAND_DB and QCOM_SMD_RPM build perfectly fine
without CONFIG_OF set. Remove these bogus depends of OF.

Signed-off-by: Niklas Cassel <niklas.cassel@linaro.org>
---
 drivers/soc/qcom/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig
index 1d4a9f3ada8c..3f4036a6173f 100644
--- a/drivers/soc/qcom/Kconfig
+++ b/drivers/soc/qcom/Kconfig
@@ -5,7 +5,7 @@ menu "Qualcomm SoC drivers"
 
 config QCOM_COMMAND_DB
 	bool "Qualcomm Command DB"
-	depends on (ARCH_QCOM && OF) || COMPILE_TEST
+	depends on ARCH_QCOM || COMPILE_TEST
 	help
 	  Command DB queries shared memory by key string for shared system
 	  resources. Platform drivers that require to set state of a shared
@@ -86,7 +86,7 @@ config QCOM_SMEM
 config QCOM_SMD_RPM
 	tristate "Qualcomm Resource Power Manager (RPM) over SMD"
 	depends on ARCH_QCOM
-	depends on RPMSG && OF
+	depends on RPMSG
 	help
 	  If you say yes to this option, support will be included for the
 	  Resource Power Manager system found in the Qualcomm 8974 based
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v2 7/7] soc: qcom: Allow COMPILE_TEST of all drivers
  2018-06-14 11:11 [PATCH v2 0/7] soc: qcom: Allow COMPILE_TEST of all drivers Niklas Cassel
                   ` (5 preceding siblings ...)
  2018-06-14 11:11 ` [PATCH v2 6/7] soc: qcom: Remove bogus " Niklas Cassel
@ 2018-06-14 11:11 ` Niklas Cassel
  6 siblings, 0 replies; 16+ messages in thread
From: Niklas Cassel @ 2018-06-14 11:11 UTC (permalink / raw)
  To: andy.gross, David Brown
  Cc: linux-arm-msm, Niklas Cassel, linux-soc, linux-kernel

Since commit cab673583d96 ("soc: Unconditionally include qcom Makefile"),
we unconditionally include the soc/qcom/Makefile.

This opens up the possibility to compile test the code even when
building for other architectures.

Add "depends on ARCH_QCOM || COMPILE_TEST" to the menu entry,
that way we can avoid adding it to every single Kconfig.

Remove the existing depend on ARCH_QCOM for all Kconfigs, except for
two Kconfigs that depend on QCOM_SCM, since that triggers lots of build
errors in qcom_scm.

Signed-off-by: Niklas Cassel <niklas.cassel@linaro.org>
---
 drivers/soc/qcom/Kconfig | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig
index 3f4036a6173f..fc5d11a6c0af 100644
--- a/drivers/soc/qcom/Kconfig
+++ b/drivers/soc/qcom/Kconfig
@@ -2,10 +2,10 @@
 # QCOM Soc drivers
 #
 menu "Qualcomm SoC drivers"
+	depends on ARCH_QCOM || COMPILE_TEST
 
 config QCOM_COMMAND_DB
 	bool "Qualcomm Command DB"
-	depends on ARCH_QCOM || COMPILE_TEST
 	help
 	  Command DB queries shared memory by key string for shared system
 	  resources. Platform drivers that require to set state of a shared
@@ -14,7 +14,6 @@ config QCOM_COMMAND_DB
 
 config QCOM_GENI_SE
 	tristate "QCOM GENI Serial Engine Driver"
-	depends on ARCH_QCOM || COMPILE_TEST
 	help
 	  This driver is used to manage Generic Interface (GENI) firmware based
 	  Qualcomm Technologies, Inc. Universal Peripheral (QUP) Wrapper. This
@@ -32,7 +31,6 @@ config QCOM_GLINK_SSR
 
 config QCOM_GSBI
         tristate "QCOM General Serial Bus Interface"
-        depends on ARCH_QCOM
         select MFD_SYSCON
         help
           Say y here to enable GSBI support.  The GSBI provides control
@@ -55,7 +53,7 @@ config QCOM_PM
 
 config QCOM_QMI_HELPERS
 	tristate
-	depends on ARCH_QCOM && NET
+	depends on NET
 	help
 	  Helper library for handling QMI encoded messages.  QMI encoded
 	  messages are used in communication between the majority of QRTR
@@ -76,7 +74,6 @@ config QCOM_RMTFS_MEM
 
 config QCOM_SMEM
 	tristate "Qualcomm Shared Memory Manager (SMEM)"
-	depends on ARCH_QCOM
 	depends on HWSPINLOCK
 	help
 	  Say y here to enable support for the Qualcomm Shared Memory Manager.
@@ -85,7 +82,6 @@ config QCOM_SMEM
 
 config QCOM_SMD_RPM
 	tristate "Qualcomm Resource Power Manager (RPM) over SMD"
-	depends on ARCH_QCOM
 	depends on RPMSG
 	help
 	  If you say yes to this option, support will be included for the
@@ -122,7 +118,6 @@ config QCOM_SMSM
 
 config QCOM_WCNSS_CTRL
 	tristate "Qualcomm WCNSS control driver"
-	depends on ARCH_QCOM
 	depends on RPMSG
 	help
 	  Client driver for the WCNSS_CTRL SMD channel, used to download nv
@@ -130,7 +125,6 @@ config QCOM_WCNSS_CTRL
 
 config QCOM_APR
 	tristate "Qualcomm APR Bus (Asynchronous Packet Router)"
-	depends on ARCH_QCOM
 	depends on RPMSG
 	help
           Enable APR IPC protocol support between
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH v2 5/7] ASoC: qdsp6: Add depends on OF
  2018-06-14 11:11 ` [PATCH v2 5/7] ASoC: qdsp6: Add depends on OF Niklas Cassel
@ 2018-06-15  4:02   ` Banajit Goswami
  2018-06-18 11:06     ` Mark Brown
  1 sibling, 0 replies; 16+ messages in thread
From: Banajit Goswami @ 2018-06-15  4:02 UTC (permalink / raw)
  To: Niklas Cassel, andy.gross, Patrick Lai, Liam Girdwood,
	Mark Brown, Jaroslav Kysela, Takashi Iwai
  Cc: linux-arm-msm, alsa-devel, linux-kernel


On 6/14/2018 4:11 AM, Niklas Cassel wrote:
> of_platform_device_destroy is only defined when building
> with CONFIG_OF=y. Add a depends on OF.
>
> sound/soc/qcom/qdsp6/q6afe.o: In function `q6afe_remove':
> q6afe.c:(.text+0x363): undefined reference to `of_platform_device_destroy'
> sound/soc/qcom/qdsp6/q6adm.o: In function `q6adm_remove':
> q6adm.c:(.text+0x216): undefined reference to `of_platform_device_destroy'
> sound/soc/qcom/qdsp6/q6asm.o: In function `q6asm_remove':
> q6asm.c:(.text+0x723): undefined reference to `of_platform_device_destroy'
>
> Signed-off-by: Niklas Cassel <niklas.cassel@linaro.org>
Acked-by: Banajit Goswami <bgoswami@codeaurora.org>

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v2 5/7] ASoC: qdsp6: Add depends on OF
  2018-06-14 11:11 ` [PATCH v2 5/7] ASoC: qdsp6: Add depends on OF Niklas Cassel
@ 2018-06-18 11:06     ` Mark Brown
  2018-06-18 11:06     ` Mark Brown
  1 sibling, 0 replies; 16+ messages in thread
From: Mark Brown @ 2018-06-18 11:06 UTC (permalink / raw)
  To: Niklas Cassel
  Cc: alsa-devel, Banajit Goswami, linux-arm-msm, Patrick Lai,
	Takashi Iwai, Liam Girdwood, andy.gross, linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 261 bytes --]

On Thu, Jun 14, 2018 at 01:11:36PM +0200, Niklas Cassel wrote:
> of_platform_device_destroy is only defined when building
> with CONFIG_OF=y. Add a depends on OF.

Is it sensible that of_platform_device_destroy() is only defined when
building with CONFIG_OF=y?

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v2 5/7] ASoC: qdsp6: Add depends on OF
@ 2018-06-18 11:06     ` Mark Brown
  0 siblings, 0 replies; 16+ messages in thread
From: Mark Brown @ 2018-06-18 11:06 UTC (permalink / raw)
  To: Niklas Cassel
  Cc: andy.gross, Patrick Lai, Banajit Goswami, Liam Girdwood,
	Jaroslav Kysela, Takashi Iwai, linux-arm-msm, alsa-devel,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 261 bytes --]

On Thu, Jun 14, 2018 at 01:11:36PM +0200, Niklas Cassel wrote:
> of_platform_device_destroy is only defined when building
> with CONFIG_OF=y. Add a depends on OF.

Is it sensible that of_platform_device_destroy() is only defined when
building with CONFIG_OF=y?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v2 5/7] ASoC: qdsp6: Add depends on OF
  2018-06-18 11:06     ` Mark Brown
  (?)
@ 2018-06-18 12:39     ` Niklas Cassel
  2018-06-18 14:48       ` Rob Herring
  -1 siblings, 1 reply; 16+ messages in thread
From: Niklas Cassel @ 2018-06-18 12:39 UTC (permalink / raw)
  To: Mark Brown, robh+dt, frowand.list
  Cc: andy.gross, Patrick Lai, Banajit Goswami, Liam Girdwood,
	Jaroslav Kysela, Takashi Iwai, linux-arm-msm, alsa-devel,
	linux-kernel

On Mon, Jun 18, 2018 at 12:06:42PM +0100, Mark Brown wrote:
> On Thu, Jun 14, 2018 at 01:11:36PM +0200, Niklas Cassel wrote:
> > of_platform_device_destroy is only defined when building
> > with CONFIG_OF=y. Add a depends on OF.
> 
> Is it sensible that of_platform_device_destroy() is only defined when
> building with CONFIG_OF=y?

I'm redirecting that question to the device tree maintainers.

There are a few of_* functions in include/linux/of_platform.h
that are only defined when CONFIG_OF=y:

of_platform_device_create()
of_platform_device_destroy()
of_platform_bus_probe()
of_device_alloc()

Rob, Frank, do you want me to create static inline dummy versions of these?

Regards,
Niklas

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v2 5/7] ASoC: qdsp6: Add depends on OF
  2018-06-18 12:39     ` Niklas Cassel
@ 2018-06-18 14:48       ` Rob Herring
  2018-06-18 20:08         ` Niklas Cassel
  0 siblings, 1 reply; 16+ messages in thread
From: Rob Herring @ 2018-06-18 14:48 UTC (permalink / raw)
  To: Niklas Cassel
  Cc: Mark Brown, Frank Rowand, Andy Gross, Patrick Lai,
	Banajit Goswami, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
	linux-arm-msm, Linux-ALSA, linux-kernel

On Mon, Jun 18, 2018 at 6:39 AM, Niklas Cassel <niklas.cassel@linaro.org> wrote:
> On Mon, Jun 18, 2018 at 12:06:42PM +0100, Mark Brown wrote:
>> On Thu, Jun 14, 2018 at 01:11:36PM +0200, Niklas Cassel wrote:
>> > of_platform_device_destroy is only defined when building
>> > with CONFIG_OF=y. Add a depends on OF.
>>
>> Is it sensible that of_platform_device_destroy() is only defined when
>> building with CONFIG_OF=y?
>
> I'm redirecting that question to the device tree maintainers.
>
> There are a few of_* functions in include/linux/of_platform.h
> that are only defined when CONFIG_OF=y:
>
> of_platform_device_create()
> of_platform_device_destroy()
> of_platform_bus_probe()
> of_device_alloc()
>
> Rob, Frank, do you want me to create static inline dummy versions of these?

No, because generally you should not be using these functions
directly. Yes, there are some users, but if you look at the tree,
there are few or isolated (PowerPC) users. Using
of_platform_populate/of_platform_depopulate is preferred.

Rob

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v2 5/7] ASoC: qdsp6: Add depends on OF
  2018-06-18 14:48       ` Rob Herring
@ 2018-06-18 20:08         ` Niklas Cassel
  2018-06-18 20:53           ` Rob Herring
  0 siblings, 1 reply; 16+ messages in thread
From: Niklas Cassel @ 2018-06-18 20:08 UTC (permalink / raw)
  To: Rob Herring
  Cc: Mark Brown, Frank Rowand, Andy Gross, Patrick Lai,
	Banajit Goswami, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
	linux-arm-msm, Linux-ALSA, linux-kernel, srinivas.kandagatla

On Mon, Jun 18, 2018 at 08:48:32AM -0600, Rob Herring wrote:
> On Mon, Jun 18, 2018 at 6:39 AM, Niklas Cassel <niklas.cassel@linaro.org> wrote:
> > On Mon, Jun 18, 2018 at 12:06:42PM +0100, Mark Brown wrote:
> >> On Thu, Jun 14, 2018 at 01:11:36PM +0200, Niklas Cassel wrote:
> >> > of_platform_device_destroy is only defined when building
> >> > with CONFIG_OF=y. Add a depends on OF.
> >>
> >> Is it sensible that of_platform_device_destroy() is only defined when
> >> building with CONFIG_OF=y?
> >
> > I'm redirecting that question to the device tree maintainers.
> >
> > There are a few of_* functions in include/linux/of_platform.h
> > that are only defined when CONFIG_OF=y:
> >
> > of_platform_device_create()
> > of_platform_device_destroy()
> > of_platform_bus_probe()
> > of_device_alloc()
> >
> > Rob, Frank, do you want me to create static inline dummy versions of these?
> 
> No, because generally you should not be using these functions
> directly. Yes, there are some users, but if you look at the tree,
> there are few or isolated (PowerPC) users. Using
> of_platform_populate/of_platform_depopulate is preferred.

of_platform_device_destroy() is also used by sound/soc/qcom/qdsp6/*
which is why I suggested this patch:
https://marc.info/?l=alsa-devel&m=152932497413567
that adds "depends on OF" for SND_SOC_QDSP6 in sound/soc/qcom/Kconfig.

Or do you think that a better solution would be to modify
sound/soc/qcom/qdsp6/* so that it instead uses
of_platform_populate()/of_platform_depopulate()?
(Or perhaps this isn't even an option,
I'm not at all familiar with the QDSP6 code).

Regards,
Niklas

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v2 5/7] ASoC: qdsp6: Add depends on OF
  2018-06-18 20:08         ` Niklas Cassel
@ 2018-06-18 20:53           ` Rob Herring
  2018-06-19  9:36             ` Srinivas Kandagatla
  0 siblings, 1 reply; 16+ messages in thread
From: Rob Herring @ 2018-06-18 20:53 UTC (permalink / raw)
  To: Niklas Cassel, Srinivas Kandagatla
  Cc: Mark Brown, Frank Rowand, Andy Gross, Patrick Lai,
	Banajit Goswami, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
	linux-arm-msm, Linux-ALSA, linux-kernel

On Mon, Jun 18, 2018 at 2:08 PM, Niklas Cassel <niklas.cassel@linaro.org> wrote:
> On Mon, Jun 18, 2018 at 08:48:32AM -0600, Rob Herring wrote:
>> On Mon, Jun 18, 2018 at 6:39 AM, Niklas Cassel <niklas.cassel@linaro.org> wrote:
>> > On Mon, Jun 18, 2018 at 12:06:42PM +0100, Mark Brown wrote:
>> >> On Thu, Jun 14, 2018 at 01:11:36PM +0200, Niklas Cassel wrote:
>> >> > of_platform_device_destroy is only defined when building
>> >> > with CONFIG_OF=y. Add a depends on OF.
>> >>
>> >> Is it sensible that of_platform_device_destroy() is only defined when
>> >> building with CONFIG_OF=y?
>> >
>> > I'm redirecting that question to the device tree maintainers.
>> >
>> > There are a few of_* functions in include/linux/of_platform.h
>> > that are only defined when CONFIG_OF=y:
>> >
>> > of_platform_device_create()
>> > of_platform_device_destroy()
>> > of_platform_bus_probe()
>> > of_device_alloc()
>> >
>> > Rob, Frank, do you want me to create static inline dummy versions of these?
>>
>> No, because generally you should not be using these functions
>> directly. Yes, there are some users, but if you look at the tree,
>> there are few or isolated (PowerPC) users. Using
>> of_platform_populate/of_platform_depopulate is preferred.
>
> of_platform_device_destroy() is also used by sound/soc/qcom/qdsp6/*
> which is why I suggested this patch:
> https://marc.info/?l=alsa-devel&m=152932497413567
> that adds "depends on OF" for SND_SOC_QDSP6 in sound/soc/qcom/Kconfig.
>
> Or do you think that a better solution would be to modify
> sound/soc/qcom/qdsp6/* so that it instead uses
> of_platform_populate()/of_platform_depopulate()?

Yes, that is preferred. However, that won't work here because the
child nodes don't have compatible strings. Maybe we should add them as
this all just went in. That would also allow DT based module
autoloading to work (which I don't think would currently). Really, as
is, of_platform_device_create isn't needed here and you could just use
platform_device_register_simple instead. The child driver would have
to get the DT node pointer from the parent device instead.

But if you want to add empty functions for just
of_platform_device_{create,destroy}, I guess that is fine.

Rob

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v2 5/7] ASoC: qdsp6: Add depends on OF
  2018-06-18 20:53           ` Rob Herring
@ 2018-06-19  9:36             ` Srinivas Kandagatla
  0 siblings, 0 replies; 16+ messages in thread
From: Srinivas Kandagatla @ 2018-06-19  9:36 UTC (permalink / raw)
  To: Rob Herring, Niklas Cassel
  Cc: Mark Brown, Frank Rowand, Andy Gross, Patrick Lai,
	Banajit Goswami, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
	linux-arm-msm, Linux-ALSA, linux-kernel



On 18/06/18 21:53, Rob Herring wrote:
> On Mon, Jun 18, 2018 at 2:08 PM, Niklas Cassel <niklas.cassel@linaro.org> wrote:
>> On Mon, Jun 18, 2018 at 08:48:32AM -0600, Rob Herring wrote:
>>> On Mon, Jun 18, 2018 at 6:39 AM, Niklas Cassel <niklas.cassel@linaro.org> wrote:
>>>> On Mon, Jun 18, 2018 at 12:06:42PM +0100, Mark Brown wrote:
>>>>> On Thu, Jun 14, 2018 at 01:11:36PM +0200, Niklas Cassel wrote:
>>>>>> of_platform_device_destroy is only defined when building
>>>>>> with CONFIG_OF=y. Add a depends on OF.
>>>>>
>>>>> Is it sensible that of_platform_device_destroy() is only defined when
>>>>> building with CONFIG_OF=y?
>>>>
>>>> I'm redirecting that question to the device tree maintainers.
>>>>
>>>> There are a few of_* functions in include/linux/of_platform.h
>>>> that are only defined when CONFIG_OF=y:
>>>>
>>>> of_platform_device_create()
>>>> of_platform_device_destroy()
>>>> of_platform_bus_probe()
>>>> of_device_alloc()
>>>>
>>>> Rob, Frank, do you want me to create static inline dummy versions of these?
>>>
>>> No, because generally you should not be using these functions
>>> directly. Yes, there are some users, but if you look at the tree,
>>> there are few or isolated (PowerPC) users. Using
>>> of_platform_populate/of_platform_depopulate is preferred.
>>
>> of_platform_device_destroy() is also used by sound/soc/qcom/qdsp6/*
>> which is why I suggested this patch:
>> https://marc.info/?l=alsa-devel&m=152932497413567
>> that adds "depends on OF" for SND_SOC_QDSP6 in sound/soc/qcom/Kconfig.
>>
>> Or do you think that a better solution would be to modify
>> sound/soc/qcom/qdsp6/* so that it instead uses
>> of_platform_populate()/of_platform_depopulate()?
> 
> Yes, that is preferred. However, that won't work here because the
> child nodes don't have compatible strings. Maybe we should add them as
> this all just went in. That would also allow DT based module
> autoloading to work (which I don't think would currently). Really, as
> is, of_platform_device_create isn't needed here and you could just use
> platform_device_register_simple instead. The child driver would have
> to get the DT node pointer from the parent device instead.
> 
compatible was the reason why I started using 
of_platform_device_{create,destroy} apis. As you said we could also do 
it with simple platform device too.

I think adding compatible seems to be better option here along with 
of_platform_populate()/of_platform_depopulate(), I will try this!

thanks,
srini

> But if you want to add empty functions for just
> of_platform_device_{create,destroy}, I guess that is fine.
> 
> Rob
> 

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2018-06-19  9:36 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-14 11:11 [PATCH v2 0/7] soc: qcom: Allow COMPILE_TEST of all drivers Niklas Cassel
2018-06-14 11:11 ` [PATCH v2 1/7] rpmsg: smd: Add missing include of sizes.h Niklas Cassel
2018-06-14 11:11 ` [PATCH v2 2/7] soc: qcom: smem: " Niklas Cassel
2018-06-14 11:11 ` [PATCH v2 3/7] soc: qcom: smp2p: Add select IRQ_DOMAIN Niklas Cassel
2018-06-14 11:11 ` [PATCH v2 4/7] soc: qcom: smsm: " Niklas Cassel
2018-06-14 11:11 ` [PATCH v2 5/7] ASoC: qdsp6: Add depends on OF Niklas Cassel
2018-06-15  4:02   ` Banajit Goswami
2018-06-18 11:06   ` Mark Brown
2018-06-18 11:06     ` Mark Brown
2018-06-18 12:39     ` Niklas Cassel
2018-06-18 14:48       ` Rob Herring
2018-06-18 20:08         ` Niklas Cassel
2018-06-18 20:53           ` Rob Herring
2018-06-19  9:36             ` Srinivas Kandagatla
2018-06-14 11:11 ` [PATCH v2 6/7] soc: qcom: Remove bogus " Niklas Cassel
2018-06-14 11:11 ` [PATCH v2 7/7] soc: qcom: Allow COMPILE_TEST of all drivers Niklas Cassel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.