regmap: Kconfig: Select SPMI when REGMAP_SPMI is selected
Subsystems (3)
PATCH 1/1 regmap: Kconfig: Select SPMI when REGMAP_SPMI is selected
From: Pramod Gurav <[email protected]>
REGMAP_SPMI module calls some functions from SPMI hence build breaks when SPMI is not enabled while compiling REGMAP_SPMI with below linker errors:
drivers/built-in.o: In function `regmap_spmi_ext_read':
:(.text+0x1143ec): undefined reference to spmi_ext_register_read' :(.text+0x11443c): undefined reference to spmi_ext_register_readl' drivers/built-in.o: In function `regmap_spmi_ext_gather_write':
:(.text+0x1144c4): undefined reference to spmi_ext_register_write' :(.text+0x114520): undefined reference to spmi_ext_register_writel' drivers/built-in.o: In function `regmap_spmi_base_read':
:(.text+0x1145b8): undefined reference to spmi_register_read' drivers/built-in.o: In function regmap_spmi_base_gather_write':
:(.text+0x114630): undefined reference to spmi_register_write' :(.text+0x11465c): undefined reference to spmi_register_zero_write'
---
This was found when I enabled support for Qualcomm QPNP PMICs and was compiling it. It selects REGMAP_SPMI and hence the crash.
drivers/base/regmap/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/base/regmap/Kconfig +1 -0
@@ -16,6 +16,7 @@ config REGMAP_SPI tristate config REGMAP_SPMI + select SPMI tristate config REGMAP_MMIO
Signature · 1 line
1.7.9.5
Hi,
<snip>
Quoted 16 lines
Signed-off-by Pramod Gurav <[email protected]>CC Josh Cartwright <[email protected]>CC Mark Brown <[email protected]>---
This was found when I enabled support for Qualcomm QPNP PMICs and was compiling it. It selectsREGMAP_SPMIand hence the crash.drivers/base/regmap/Kconfig | 1 + 1 file changed, 1 insertion(+)drivers/base/regmap/Kconfig +0
-0
drivers/base/regmap/Kconfig config REGMAP_SPI · line 19
Quoted 4 lines
drivers/base/regmap/Kconfig +1
-0@@ -16,6 +16,7 @@ config REGMAP_SPI tristate config REGMAP_SPMI + select SPMI
NO, IMO the CONFIG_SPMI should be enabled by qcom_defconfig and multi_v7_defconfig. See CONFIG_I2C and REGMAP_I2C for example.
Signature · 2 lines
regards, Stan
Hi,
Quoted 21 lines · Stanimir Varbanov
Hi,
<snip>
Quoted 18 lines
Signed-off-by Pramod Gurav <[email protected]>CC Josh Cartwright <[email protected]>CC Mark Brown <[email protected]>---
This was found when I enabled support for Qualcomm QPNP PMICs and was compiling it. It selectsREGMAP_SPMIand hence the crash.drivers/base/regmap/Kconfig | 1 + 1 file changed, 1 insertion(+)drivers/base/regmap/Kconfig +0
-0@@ -16,6 +16,7 @@ config REGMAP_SPI tristate
Quoted 6 lines
drivers/base/regmap/Kconfig config REGMAP_SPI · line 19
Quoted 2 lines
drivers/base/regmap/Kconfig +1
-0config REGMAP_SPMI + select SPMINO, IMO the
CONFIG_SPMIshould be enabled byqcom_defconfigandmulti_v7_defconfig. SeeCONFIG_I2CandREGMAP_I2Cfor example.
I am using multi_v7_defconfig but its not enabling it. I ran qcom_defconfig which does.
Quoted 8 lines
--
regards,
Stan
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
<snip>
Quoted 9 lines
Quoted 7 lines
drivers/base/regmap/Kconfig config REGMAP_SPI · line 19
Quoted 3 lines
config
REGMAP_SPMIdrivers/base/regmap/Kconfig +1
-0+ select SPMINO, IMO the
CONFIG_SPMIshould be enabled byqcom_defconfigandmulti_v7_defconfig. SeeCONFIG_I2CandREGMAP_I2Cfor example.I am using
multi_v7_defconfigbut its not enabling it. I ranqcom_defconfigwhich does.
yes, it seems reasonable to add it in multi_v7_defconfig also.
Signature · 2 lines
regards, Stan
Hi,
Quoted 10 lines · Stanimir Varbanov
<snip>
Quoted 8 lines
Quoted 7 lines
drivers/base/regmap/Kconfig config REGMAP_SPI · line 19
Quoted 3 lines
config
REGMAP_SPMIdrivers/base/regmap/Kconfig +1
-0+ select SPMINO, IMO the
CONFIG_SPMIshould be enabled byqcom_defconfigandmulti_v7_defconfig. SeeCONFIG_I2CandREGMAP_I2Cfor example.
Quoted 5 lines
Quoted 2 lines
I am using
multi_v7_defconfigbut its not enabling it. I ranqcom_defconfigwhich does.yes, it seems reasonable to add it in
multi_v7_defconfigalso.
Thanks.
I misunderstood the Kconfig documentation which says, "Reverse dependencies can only be used with boolean or tristate symbols". In the note following this statement doc says, "In general use select only for non-visible symbols".
The CONFIG_SPMI option is visible in menuconfig hence either it should be set by default in multi_v7_defconfig(like in qcom_defconfig) or driver owner should mention a 'depneds on CONFIG_SPMI' as suggested by Lars-Peter Clausen. I prefer the former (defconfig).
Shall I send a new patch adding it in multi_v7_defconfig?
Quoted 9 lines
--
regards,
Stan
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
<snip>
Quoted 8 lines
Thanks.
I misunderstood theKconfigdocumentation which says, "Reverse dependencies can only be used with boolean or tristate symbols". In the note following this statement doc says, "In general use select only for non-visible symbols".The
CONFIG_SPMIoption is visible in menuconfig hence either it should be set by default inmulti_v7_defconfig(like in qcom_defconfig)or driver owner should mention a 'depneds onCONFIG_SPMI' as suggested by Lars-Peter Clausen. I prefer the former (defconfig).Shall I send a new patch adding it in
multi_v7_defconfig?
yes, I think it should be enabled. On the other side I'm not sure that it will be acceptable because presently there are no users if it in multi platform build. Might be worth to do it ones the MFD driver is in.
And I/we should add a dependency to SPMI in the MFD driver as Lars pointed out.
Signature · 2 lines
regards, Stan
Mark Brown
maintainerOn Wed, Jul 16, 2014 at 06:26:15PM +0530, Pramod Gurav wrote:
Fix your mailer to word wrap within paragraphs, this will make your mails more legible - see Documentation/email-clients.txt.
Quoted 8 lines · Stanimir Varbanov
The
CONFIG_SPMIoption is visible in menuconfig hence either it should be set by default inmulti_v7_defconfig(like in qcom_defconfig)or driver owner should mention a 'depneds onCONFIG_SPMI' as suggested by Lars-Peter Clausen.I prefer the former (defconfig).
No, this isn't an either/or thing - the dependency is absolutely mandatory if the device needs SPMI. The defconfigs are a separate thing, they just exist to give people a starting point for configuring their kernel so if the device using SPMI is important for relevant systems the defconfig needs to be set up to enable it but that's separate to the dependency since there's no need for people to ever even look at defconfigs.
Quoted 14 lines · Mark Brown
On Wed, Jul 16, 2014 at 06:26:15PM +0530, Pramod Gurav wrote:
Fix your mailer to word wrap within paragraphs, this will make your mails more legible - see
Documentation/email-clients.txt.Quoted 8 lines · Stanimir Varbanov
The
CONFIG_SPMIoption is visible in menuconfig hence either it should be set by default inmulti_v7_defconfig(like in qcom_defconfig)or driver owner should mention a 'depneds onCONFIG_SPMI' as suggested by Lars-Peter Clausen.I prefer the former (defconfig).
Quoted 7 lines
No, this isn't an either/or thing - the dependency is absolutely mandatory if the device needs SPMI. The defconfigs are a separate thing, they just exist to give people a starting point for configuring their kernel so if the device using SPMI is important for relevant systems the defconfig needs to be set up to enable it but that's separate to the dependency since there's no need for people to ever even look at defconfigs.
Then config REGMAP_SPMI should depend on SPMI, right?
Regards,
Ivan
Mark Brown
maintainerQuoted 11 lines · Ivan T. Ivanov
Quoted 7 lines · Mark Brown
No, this isn't an either/or thing - the dependency is absolutely mandatory if the device needs SPMI. The defconfigs are a separate thing, they just exist to give people a starting point for configuring their kernel so if the device using SPMI is important for relevant systems the defconfig needs to be set up to enable it but that's separate to the dependency since there's no need for people to ever even look at defconfigs.
Then config
REGMAP_SPMIshould depend on SPMI, right?
No, REGMAP_SPMI is not something that can be enabled directly - it is selected by its users which should be ensuring that SPMI is enabled as it is difficult to see a use case for REGMAP_SPMI which does not do this.
A dependency from a selected symbol will have no effect.
Quoted 11 lines · Mark Brown
Quoted 9 lines · Ivan T. Ivanov
Quoted 7 lines · Mark Brown
No, this isn't an either/or thing - the dependency is absolutely mandatory if the device needs SPMI. The defconfigs are a separate thing, they just exist to give people a starting point for configuring their kernel so if the device using SPMI is important for relevant systems the defconfig needs to be set up to enable it but that's separate to the dependency since there's no need for people to ever even look at defconfigs.
Quoted 8 lines
Quoted 1 line
Then config
REGMAP_SPMIshould depend on SPMI, right?No,
REGMAP_SPMIis not something that can be enabled directly - it is selected by its users which should be ensuring that SPMI is enabled as it is difficult to see a use case forREGMAP_SPMIwhich does not do this.A dependency from a selected symbol will have no effect.
Thanks Mark. So essentially in this case PMIC driver should 'select SPMI'. Right?
Signature · 2 lines
Thanks and Regards Pramod
Mark Brown
maintainerQuoted 6 lines · pramod gurav
Quoted 1 line · Mark Brown
A dependency from a selected symbol will have no effect.
Thanks Mark. So essentially in this case PMIC driver should 'select SPMI'. Right?
I would expect it to depend on SPMI and select REGMAP_SPMI, assuming SPMI is a user-selectable Kconfig symbol.
Quoted 18 lines · On 07/16/2014 01:39 PM, [email protected] wrote:
From: Pramod Gurav <[email protected]>
REGMAP_SPMImodule calls some functions from SPMI hence build breaks when SPMI is not enabled while compilingREGMAP_SPMIwith below linker errors:
drivers/built-in.o: In function `regmap_spmi_ext_read':
:(.text+0x1143ec): undefined reference tospmi_ext_register_read' :(.text+0x11443c): undefined reference tospmi_ext_register_readl'drivers/built-in.o: In function `regmap_spmi_ext_gather_write':
:(.text+0x1144c4): undefined reference tospmi_ext_register_write' :(.text+0x114520): undefined reference tospmi_ext_register_writel'drivers/built-in.o: In function `regmap_spmi_base_read':
:(.text+0x1145b8): undefined reference tospmi_register_read' drivers/built-in.o: In functionregmap_spmi_base_gather_write':
:(.text+0x114630): undefined reference tospmi_register_write' :(.text+0x11465c): undefined reference tospmi_register_zero_write'
Quoted 6 lines
Signed-off-by Pramod Gurav <[email protected]>CC Josh Cartwright <[email protected]>CC Mark Brown <[email protected]>---
This was found when I enabled support for Qualcomm QPNP PMICs and was compiling it. It selectsREGMAP_SPMIand hence the crash.
Any driver that does select REGMAP_SPMI needs to depends on SPMI. So the correct fix for this issue is to make sure that the driver can only be enabled if SPMI is enabled.
- Lars