Testing for TWL4030 in board file change.
Subsystems (3)
PATCH 1/1 Testing for TWL4030 in board file change.
From: Dominic Curran <[email protected]>
Subject: [OMAPZOOM][PATCH] Testing for TWL4030 in board file change.
This patch changes the method of testing for TWL4030 in the sensor portion of the board file.
Previously, if TWL4030 was not built into kernel then the build would be stopped by code in the board file simular to:
#ifndef CONFIG_TWL4030_CORE
#error "no power companion board defined!"
#endif
However for debugging purposes it maybe required to build without TWL4030. Therefore this patch allows the kernel to be compiled without a build error when TWL4030 is not present.
In such a case the sensor power function will build, but when called immediately return a -ENODEV error (so initilization of sensor will go no further).
This change is targeted at all camera sensors within the board files for SDP, Zoom1 & Zoom2.
Alternative fixes to this problem like changes to Kconfig were considered, but rejected as inappropriate solutions.
--- arch/arm/mach-omap2/board-3430sdp.c | 32 ++++++++++++++++++++------------ arch/arm/mach-omap2/board-ldp.c | 9 +++++---- arch/arm/mach-omap2/board-zoom2.c | 13 ++++++++----- 3 files changed, 33 insertions(+), 21 deletions(-)
arch/arm/mach-omap2/board-3430sdp.c +20 -12
@@ -45,9 +45,6 @@#include "ti-compat.h" #ifdef CONFIG_VIDEO_OMAP3 -#ifndef CONFIG_TWL4030_CORE -#error "no power companion board defined!" -#endif #include <media/v4l2-int-device.h> #include <../drivers/media/video/omap34xxcam.h> #include <../drivers/media/video/isp/ispreg.h>
@@ -668,14 +665,17 @@ static struct isp_interface_config mt9p0static int mt9p012_sensor_power_set (enum v4l2_power power) {static enum v4l2_power previous_power =V4L2_POWER_OFF ; + +#ifndef CONFIG_TWL4030_CORE +return -ENODEV ; +#endif +switch (power) {case V4L2_POWER_OFF :/* Power Down Sequence */ #ifdef CONFIG_TWL4030_CORE twl4030_i2c_write_u8 (TWL4030_MODULE_PM_RECEIVER ,VAUX_DEV_GRP_NONE ,TWL4030_VAUX2_DEV_GRP ); -#else -#error "no power companion board defined!"#endif enable_fpga_vio_1v8 (0 );omap_free_gpio (MT9P012_RESET_GPIO );
@@ -718,8 +718,6 @@ static int mt9p012_sensor_power_set(enum VAUX_2_8_V, TWL4030_VAUX2_DEDICATED);twl4030_i2c_write_u8 (TWL4030_MODULE_PM_RECEIVER ,VAUX_DEV_GRP_P1 ,TWL4030_VAUX2_DEV_GRP ); -#else -#error "no power companion board defined!"#endif }
@@ -832,6 +830,11 @@ static int ov3640_sensor_power_set(enumstruct isp_csi2_lanes_cfg lanecfg;struct isp_csi2_phy_cfg phyconfig;static enum v4l2_power previous_power =V4L2_POWER_OFF ; + +#ifndef CONFIG_TWL4030_CORE +return -ENODEV ; +#endif +switch (power) {case V4L2_POWER_ON :printk (KERN_DEBUG "ov3640_sensor_power_set(ON)\n" );
@@ -876,10 +879,9 @@ static int ov3640_sensor_power_set(enumtwl4030_i2c_write_u8 (TWL4030_MODULE_PM_RECEIVER ,VAUX_DEV_GRP_P1 ,TWL4030_VAUX2_DEV_GRP );#endif -udelay (100 ); -#else -#error "no power companion board defined!"#endif +udelay (100 ); +/* Request and configure gpio pins */ if (omap_request_gpio (OV3640_RESET_GPIO ) !=0 ) { printk(KERN_ERR "Could not request GPIO %d",
@@ -923,8 +925,6 @@ static int ov3640_sensor_power_set(enumtwl4030_i2c_write_u8 (TWL4030_MODULE_PM_RECEIVER ,VAUX_DEV_GRP_NONE ,TWL4030_VAUX2_DEV_GRP );#endif -#else -#error "no power companion board defined!"#endif enable_fpga_vio_1v8 (0 );omap_free_gpio (OV3640_RESET_GPIO );
@@ -1015,6 +1015,10 @@ static int imx046_sensor_power_set(enumstatic enum v4l2_power previous_power =V4L2_POWER_OFF ;int err =0 ; +#ifndef CONFIG_TWL4030_CORE +return -ENODEV ; +#endif +switch (power) {case V4L2_POWER_ON :/* Power Up Sequence */
@@ -1059,6 +1063,7 @@ static int imx046_sensor_power_set(enumomap_set_gpio_direction (IMX046_RESET_GPIO ,GPIO_DIR_OUTPUT ); +#ifdef CONFIG_TWL4030_CORE /* turn on analog power */ twl4030_i2c_write_u8 (TWL4030_MODULE_PM_RECEIVER ,VAUX_2_8_V ,TWL4030_VAUX2_DEDICATED );
@@ -1069,6 +1074,7 @@ static int imx046_sensor_power_set(enum VAUX_1_8_V, TWL4030_VAUX4_DEDICATED);twl4030_i2c_write_u8 (TWL4030_MODULE_PM_RECEIVER ,VAUX_DEV_GRP_P1 ,TWL4030_VAUX4_DEV_GRP ); +#endif udelay (100 );/* have to put sensor to reset to guarantee detection */
@@ -1085,10 +1091,12 @@ static int imx046_sensor_power_set(enum/* Power Down Sequence */ isp_csi2_complexio_power (ISP_CSI2_POWER_OFF ); +#ifdef CONFIG_TWL4030_CORE twl4030_i2c_write_u8 (TWL4030_MODULE_PM_RECEIVER ,VAUX_DEV_GRP_NONE ,TWL4030_VAUX4_DEV_GRP );twl4030_i2c_write_u8 (TWL4030_MODULE_PM_RECEIVER ,VAUX_DEV_GRP_NONE ,TWL4030_VAUX2_DEV_GRP ); +#endif omap_free_gpio (IMX046_RESET_GPIO );break ;case V4L2_POWER_STANDBY :
arch/arm/mach-omap2/board-ldp.c +5 -4
@@ -672,6 +672,11 @@ static int ov3640_sensor_power_set(enumstruct isp_csi2_lanes_cfg lanecfg;struct isp_csi2_phy_cfg phyconfig;static enum v4l2_power previous_power =V4L2_POWER_OFF ; + +#ifndef CONFIG_TWL4030_CORE +return -ENODEV ; +#endif +switch (power) {case V4L2_POWER_ON :printk (KERN_DEBUG "ov3640_sensor_power_set(ON)\n" );
@@ -715,8 +720,6 @@ static int ov3640_sensor_power_set(enum VAUX_DEV_GRP_P1, TWL4030_VAUX2_DEV_GRP);#endif udelay (100 ); -#else -#error "no power companion board defined!"#endif /* Request and configure gpio pins */ if (omap_request_gpio (OV3640_RESET_GPIO ) !=0 ) {
@@ -756,8 +759,6 @@ static int ov3640_sensor_power_set(enumtwl4030_i2c_write_u8 (TWL4030_MODULE_PM_RECEIVER ,VAUX_DEV_GRP_NONE ,TWL4030_VAUX2_DEV_GRP );#endif -#else -#error "no power companion board defined!"#endif omap_free_gpio (OV3640_RESET_GPIO );omap_free_gpio (OV3640_STANDBY_GPIO );
arch/arm/mach-omap2/board-zoom2.c +8 -5
@@ -69,9 +69,6 @@#define IMX046_CSI2_PHY_TCLK_TERM 0#define IMX046_CSI2_PHY_TCLK_MISS 1#define IMX046_CSI2_PHY_TCLK_SETTLE 14 -#ifndef CONFIG_TWL4030_CORE -#error "no power companion board defined!" -#endif #endif #endif
@@ -393,6 +390,10 @@ static int imx046_sensor_power_set(enumstatic enum v4l2_power previous_power =V4L2_POWER_OFF ;int err =0 ; +#ifndef CONFIG_TWL4030_CORE +return -ENODEV ; +#endif +switch (power) {case V4L2_POWER_ON :/* Power Up Sequence */
@@ -436,7 +437,7 @@ static int imx046_sensor_power_set(enum/* set to output mode */ omap_set_gpio_direction (IMX046_RESET_GPIO ,GPIO_DIR_OUTPUT ); - +#ifdef CONFIG_TWL4030_CORE /* turn on analog power */ twl4030_i2c_write_u8 (TWL4030_MODULE_PM_RECEIVER ,VAUX_2_8_V ,TWL4030_VAUX2_DEDICATED );
@@ -447,6 +448,7 @@ static int imx046_sensor_power_set(enum VAUX_1_8_V, TWL4030_VAUX4_DEDICATED);twl4030_i2c_write_u8 (TWL4030_MODULE_PM_RECEIVER ,VAUX_DEV_GRP_P1 ,TWL4030_VAUX4_DEV_GRP ); +#endif udelay (100 );/* have to put sensor to reset to guarantee detection */
@@ -462,11 +464,12 @@ static int imx046_sensor_power_set(enumprintk (KERN_DEBUG "imx046_sensor_power_set(OFF)\n" );/* Power Down Sequence */ isp_csi2_complexio_power (ISP_CSI2_POWER_OFF ); - +#ifdef CONFIG_TWL4030_CORE twl4030_i2c_write_u8 (TWL4030_MODULE_PM_RECEIVER ,VAUX_DEV_GRP_NONE ,TWL4030_VAUX4_DEV_GRP );twl4030_i2c_write_u8 (TWL4030_MODULE_PM_RECEIVER ,VAUX_DEV_GRP_NONE ,TWL4030_VAUX2_DEV_GRP ); +#endif omap_free_gpio (IMX046_RESET_GPIO );break ;case V4L2_POWER_STANDBY :
Dominic Curran said the following on 02/17/2009 02:15 AM:
Quoted 17 lines
From: Dominic Curran <[email protected]>
Subject: [OMAPZOOM][PATCH] Testing for TWL4030 in board file change.This patch changes the method of testing for TWL4030 in the sensor portion of the board file.
Previously, if TWL4030 was not built into kernel then the build would be stopped by code in the board file simular to:
#ifndefCONFIG_TWL4030_CORE
#error "no power companion board defined!"
#endifHowever for debugging purposes it maybe required to build without TWL4030. Therefore this patch allows the kernel to be compiled without a build error when TWL4030 is not present.
In such a case the sensor power function will build, but when called immediately return a-ENODEVerror (so initilization of sensor will go no further).
Quoted 7 lines
This change is targeted at all camera sensors within the board files for SDP, Zoom1 & Zoom2.
Alternative fixes to this problem like changes to
Kconfigwere considered, but rejected as inappropriate solutions.
Would a solution as follows be appropriate?
in arch/arm/mach-omap2/Kconfig:
config MACH_OMAP_ZOOM2
bool "OMAP3 ZOOM2 board"
depends on ARCH_OMAP3 && ARCH_OMAP34XX
+ select TWL4030_CORE if VIDEO_OMAP3
A similar strategy has been implemented for N800, albeit for other peripherals.
Regards,
Nishanth Menon
Quoted 47 lines
-----Original Message-----
From: Nishanth Menon [mailto:[email protected]]
Sent: Tuesday, February 17, 2009 2:12 AM
To: Curran, Dominic
Cc: linux-omap; Aguirre Rodriguez, Sergio Alberto
Subject: Re: [OMAPZOOM][PATCH] Testing for TWL4030 in board file change.Dominic Curran said the following on 02/17/2009 02:15 AM:
Quoted 4 lines
From: Dominic Curran <[email protected]>
Subject: [OMAPZOOM][PATCH] Testing for TWL4030 in board file change.This patch changes the method of testing for TWL4030 in the sensor portion
of the
Quoted 2 lines
board file.
Previously, if TWL4030 was not built into kernel then the build would bestopped
Quoted 7 lines
by code in the board file simular to:
#ifndefCONFIG_TWL4030_CORE
#error "no power companion board defined!"
#endifHowever for debugging purposes it maybe required to build without TWL4030. Therefore this patch allows the kernel to be compiled without a build error
when
Quoted 2 lines
TWL4030 is not present.
In such a case the sensor power function will build, but when calledimmediately
Quoted 3 lines
return a
-ENODEVerror (so initilization of sensor will go no further).This change is targeted at all camera sensors within the board files for
SDP,
Quoted 3 lines
Zoom1 & Zoom2.
Alternative fixes to this problem like changes to
Kconfigwere considered,but
Quoted 3 lines
rejected as inappropriate solutions.
Would a solution as follows be appropriate?
inarch/arm/mach-omap2/Kconfig:
configMACH_OMAP_ZOOM2
bool "OMAP3 ZOOM2 board"
depends onARCH_OMAP3&&ARCH_OMAP34XX
+ selectTWL4030_COREifVIDEO_OMAP3
Quoted 4 lines
A similar strategy has been implemented for N800, albeit for other peripherals.
Regards,
Nishanth Menon
If 'reverse dependencies' set the symbol and its dependencies I would say this would be a good solution, but unfortunately it does not. The documentation for reverse dependencies warns:
107 select should be used with care. select will force 108 a symbol to a value without visiting the dependencies. 109 By abusing select you are able to select a symbol FOO even 110 if FOO depends on BAR that is not set. 111 In general use select only for non-visible symbols
Since TWL4030 has dependencies then I don't think this is appropriate.
Curran, Dominic said the following on 02/17/2009 04:27 PM:
Quoted 21 lines
Quoted 14 lines
-----Original Message-----
From: Nishanth Menon [mailto:[email protected]]
Sent: Tuesday, February 17, 2009 2:12 AM
To: Curran, Dominic
Cc: linux-omap; Aguirre Rodriguez, Sergio Alberto
Subject: Re: [OMAPZOOM][PATCH] Testing for TWL4030 in board file change.Would a solution as follows be appropriate?
inarch/arm/mach-omap2/Kconfig:
configMACH_OMAP_ZOOM2
bool "OMAP3 ZOOM2 board"
depends onARCH_OMAP3&&ARCH_OMAP34XX
+ selectTWL4030_COREifVIDEO_OMAP3Quoted 3 lines
A similar strategy has been implemented for N800, albeit for other peripherals.
If 'reverse dependencies' set the symbol and its dependencies I would say this would be a good solution, but unfortunately it does not. The documentation for reverse dependencies warns:
Quoted 7 lines
107 select should be used with care. select will force 108 a symbol to a value without visiting the dependencies. 109 By abusing select you are able to select a symbol FOO even 110 if FOO depends on BAR that is not set. 111 In general use select only for non-visible symbolsSince TWL4030 has dependencies then I don't think this is appropriate
Mach-omap && video_omap3 depends on twl4030 and twl4030 is not reverse dependent on mach-omap. twl4030 is dependent on i2c - I believe based on drivers/mfd/Kconfig how do we handle this? Maybe a select of i2c is appropriate there? or how about:
+ select TWL4030_CORE if VIDEO_OMAP3
+ select I2C if TWL4030_CORE
You may want to see arch/arm/mach-omap2/Kconfig -> MACH_NOKIA_N800. I think we have a similar condition there with CBUS and VIDEO_TCM825X I think..
my 2cents: i like select better than #ifdef ;).. but then, that is just me :)..
Regards,
Nishanth Menon
Quoted 48 lines
-----Original Message-----
From: Nishanth Menon [mailto:[email protected]]
Sent: Tuesday, February 17, 2009 9:33 AM
To: Curran, Dominic
Cc: linux-omap; Aguirre Rodriguez, Sergio Alberto
Subject: Re: [OMAPZOOM][PATCH] Testing for TWL4030 in board file change.Curran, Dominic said the following on 02/17/2009 04:27 PM:
Quoted 14 lines
Quoted 14 lines
-----Original Message-----
From: Nishanth Menon [mailto:[email protected]]
Sent: Tuesday, February 17, 2009 2:12 AM
To: Curran, Dominic
Cc: linux-omap; Aguirre Rodriguez, Sergio Alberto
Subject: Re: [OMAPZOOM][PATCH] Testing for TWL4030 in board file change.Would a solution as follows be appropriate?
inarch/arm/mach-omap2/Kconfig:
configMACH_OMAP_ZOOM2
bool "OMAP3 ZOOM2 board"
depends onARCH_OMAP3&&ARCH_OMAP34XX
+ selectTWL4030_COREifVIDEO_OMAP3Quoted 5 lines
Quoted 3 lines
A similar strategy has been implemented for N800, albeit for other peripherals.
If 'reverse dependencies' set the symbol and its dependencies I would
say this would be a good solution, but unfortunately it does not.
Quoted 9 lines
The documentation for reverse dependencies warns:
107 select should be used with care. select will force 108 a symbol to a value without visiting the dependencies. 109 By abusing select you are able to select a symbol FOO even 110 if FOO depends on BAR that is not set. 111 In general use select only for non-visible symbolsSince TWL4030 has dependencies then I don't think this is appropriate
Mach-omap &&
video_omap3depends on twl4030 and twl4030 is not reverse dependent on mach-omap. twl4030 is dependent on i2c - I believe based ondrivers/mfd/Kconfighow do we handle this? Maybe a select of i2c is appropriate there? or how about:(quoted diff) +2
-0+ select TWL4030_CORE if VIDEO_OMAP3 + select I2C if TWL4030_CORE
Quoted 3 lines
You may want to see
arch/arm/mach-omap2/Kconfig->MACH_NOKIA_N800. I think we have a similar condition there with CBUS andVIDEO_TCM825XI think..
Honestly, I'm a bit lost about the goal of this. I don't see how this is solving our problem.
- 3430SDP and Zoom1/2 uses TWL4030 for power handling the camera sensors
- Current Omap3 camera driver can be used in other platforms than the above that uses OMAP3x30 chip, so we cannot add dependencies on camera driver to platform specific powering methods.
- On above platforms, there exists the need for compiling without T2 support sometimes and you don't want a broken build because of this
How is above helping for solving this out?
Quoted 6 lines
my 2cents: i like select better than #ifdef ;).. but then, that is just me :)..
Regards,
Nishanth Menon
Quoted 46 lines · Sergio Alberto
Quoted 46 lines
-----Original Message-----
From: Nishanth Menon [mailto:[email protected]]
Sent: Tuesday, February 17, 2009 9:33 AM
To: Curran, Dominic
Cc: linux-omap; Aguirre Rodriguez, Sergio Alberto
Subject: Re: [OMAPZOOM][PATCH] Testing for TWL4030 in board file change.Curran, Dominic said the following on 02/17/2009 04:27 PM:
Quoted 14 lines
Quoted 14 lines
-----Original Message-----
From: Nishanth Menon [mailto:[email protected]]
Sent: Tuesday, February 17, 2009 2:12 AM
To: Curran, Dominic
Cc: linux-omap; Aguirre Rodriguez, Sergio Alberto
Subject: Re: [OMAPZOOM][PATCH] Testing for TWL4030 in board file change.Would a solution as follows be appropriate?
inarch/arm/mach-omap2/Kconfig:
configMACH_OMAP_ZOOM2
bool "OMAP3 ZOOM2 board"
depends onARCH_OMAP3&&ARCH_OMAP34XX
+ selectTWL4030_COREifVIDEO_OMAP3Quoted 5 lines
Quoted 3 lines
A similar strategy has been implemented for N800, albeit for other peripherals.
If 'reverse dependencies' set the symbol and its dependencies I would
say this would be a good solution, but unfortunately it does not.
Quoted 9 lines
The documentation for reverse dependencies warns:
107 select should be used with care. select will force 108 a symbol to a value without visiting the dependencies. 109 By abusing select you are able to select a symbol FOO even 110 if FOO depends on BAR that is not set. 111 In general use select only for non-visible symbolsSince TWL4030 has dependencies then I don't think this is appropriate
Mach-omap &&
video_omap3depends on twl4030 and twl4030 is not reverse dependent on mach-omap. twl4030 is dependent on i2c - I believe based ondrivers/mfd/Kconfighow do we handle this? Maybe a select of i2c is appropriate there? or how about:(quoted diff) +2
-0+ select TWL4030_CORE if VIDEO_OMAP3 + select I2C if TWL4030_CORE
Quoted 8 lines
Quoted 3 lines
You may want to see
arch/arm/mach-omap2/Kconfig->MACH_NOKIA_N800. I think we have a similar condition there with CBUS andVIDEO_TCM825XI think..Honestly, I'm a bit lost about the goal of this. I don't see how this is solving our problem.
How is above helping for solving this out?
config MACH_OMAP_ZOOM2
bool "OMAP3 ZOOM2 board" depends on ARCH_OMAP3 && ARCH_OMAP34XX
+ select TWL4030_CORE if VIDEO_OMAP3
Quoted 1 line
- 3430SDP and Zoom1/2 uses TWL4030 for power handling the camera sensors
We say that on zoom2 configuration, if video_omap3 is enabled == use any camera, we need twl4030 -> for power etc (if you like you can add a # comment ;) )..
Quoted 1 line
- Current Omap3 camera driver can be used in other platforms than the above that uses OMAP3x30 chip, so we cannot add dependencies on camera driver to platform specific powering methods.
the above method i proposed has no dependency on specific camera -> the dependency is based on MACH_OMAP_ZOOM2 -> on other platforms, handle them accordingly -> esp if you have a different (power management)PM Chip or even no PM chip :)..
Quoted 1 line
- On above platforms, there exists the need for compiling without T2 support sometimes and you don't want a broken build because of this
you wont.. if you want to build without t2, you need to disable all drivers which depend on T2 -> including camera. this also avoids a unnecessary probe call since it wont even be built in..
Regards,
Nishanth Menon
Quoted 85 lines
-----Original Message-----
From: Nishanth Menon [mailto:[email protected]]
Sent: Tuesday, February 17, 2009 10:53 AM
To: Aguirre Rodriguez, Sergio Alberto
Cc: Curran, Dominic; linux-omap
Subject: Re: [OMAPZOOM][PATCH] Testing for TWL4030 in board file change.Quoted 7 lines · Sergio Alberto
Quoted 7 lines
-----Original Message-----
From: Nishanth Menon [mailto:[email protected]]
Sent: Tuesday, February 17, 2009 9:33 AM
To: Curran, Dominic
Cc: linux-omap; Aguirre Rodriguez, Sergio Alberto
Subject: Re: [OMAPZOOM][PATCH] Testing for TWL4030 in board file change.Quoted 7 lines
Quoted 7 lines
Curran, Dominic said the following on 02/17/2009 04:27 PM:
Quoted 6 lines
Quoted 6 lines
-----Original Message-----
From: Nishanth Menon [mailto:[email protected]]
Sent: Tuesday, February 17, 2009 2:12 AM
To: Curran, Dominic
Cc: linux-omap; Aguirre Rodriguez, Sergio Alberto
Subject: Re: [OMAPZOOM][PATCH] Testing for TWL4030 in board filechange.
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 11 lines
Would a solution as follows be appropriate?
inarch/arm/mach-omap2/Kconfig:
configMACH_OMAP_ZOOM2
bool "OMAP3 ZOOM2 board"
depends onARCH_OMAP3&&ARCH_OMAP34XX
+ selectTWL4030_COREifVIDEO_OMAP3A similar strategy has been implemented for N800, albeit for other peripherals.
Quoted 7 lines
Quoted 7 lines
Quoted 1 line
If 'reverse dependencies' set the symbol and its dependencies I would
say this would be a good solution, but unfortunately it does not.
Quoted 5 lines
The documentation for reverse dependencies warns:
107 select should be used with care. select will force 108 a symbol to a value without visiting the dependencies. 109 By abusing select you are able to select a symbol FOOeven
Quoted 6 lines
Quoted 6 lines
Quoted 4 lines
110 if FOO depends on BAR that is not set.
111 In general use select only for non-visible symbolsSince TWL4030 has dependencies then I don't think this is appropriate
Mach-omap &&
video_omap3depends on twl4030 and twl4030 is not reverse dependent on mach-omap. twl4030 is dependent on i2c - I believe basedon
Quoted 7 lines
Quoted 7 lines
drivers/mfd/Kconfighow do we handle this? Maybe a select of i2c is appropriate there? or how about:(quoted diff) +2
-0+ select TWL4030_CORE if VIDEO_OMAP3 + select I2C if TWL4030_COREQuoted 5 lines
Quoted 3 lines
You may want to see
arch/arm/mach-omap2/Kconfig->MACH_NOKIA_N800. I think we have a similar condition there with CBUS andVIDEO_TCM825XI think..Honestly, I'm a bit lost about the goal of this. I don't see how this is
solving our problem.
Quoted 3 lines
How is above helping for solving this out?
config
MACH_OMAP_ZOOM2
bool "OMAP3 ZOOM2 board" depends onARCH_OMAP3&&ARCH_OMAP34XX
+ selectTWL4030_COREifVIDEO_OMAP3Quoted 1 line
- 3430SDP and Zoom1/2 uses TWL4030 for power handling the camera sensors
We say that on zoom2 configuration, if
video_omap3is enabled == use any camera, we need twl4030 -> for power etc (if you like you can add a # comment ;) )..Quoted 1 line
- Current Omap3 camera driver can be used in other platforms than the
above that uses OMAP3x30 chip, so we cannot add dependencies on camera driver to platform specific powering methods.
the above method i proposed has no dependency on specific camera -> the dependency is based onMACH_OMAP_ZOOM2-> on other platforms, handle them accordingly -> esp if you have a different (power management)PM Chip or even no PM chip :)..
Quoted 5 lines
Quoted 1 line
- On above platforms, there exists the need for compiling without T2
support sometimes and you don't want a broken build because of this you wont.. if you want to build without t2, you need to disable all drivers which depend on T2 -> including camera. this also avoids a unnecessary probe call since it wont even be built in..
Ok, now I'm convinced this would do the job. Sorry for having trouble understanding your idea.
Thanks for clarifying!
So Dom,
Then shall we add to MACH_OMAP_3430SDP, MACH_OMAP_LDP and MACH_OMAP_ZOOM2 these selects?:
select TWL4030_CORE if VIDEO_OMAP3
select I2C if TWL4030_CORE
And get rid entirely of ifdefs for TWL4030.
Quoted 3 lines
Regards,
Nishanth Menon
Quoted 64 lines
-----Original Message-----
From: Aguirre Rodriguez, Sergio Alberto
Sent: Tuesday, February 17, 2009 10:03 AM
To: Nishanth Menon; Curran, Dominic
Cc: linux-omap
Subject: RE: [OMAPZOOM][PATCH] Testing for TWL4030 in board file change.Quoted 46 lines
-----Original Message-----
From: Nishanth Menon [mailto:[email protected]]
Sent: Tuesday, February 17, 2009 9:33 AM
To: Curran, Dominic
Cc: linux-omap; Aguirre Rodriguez, Sergio Alberto
Subject: Re: [OMAPZOOM][PATCH] Testing for TWL4030 in board file change.Curran, Dominic said the following on 02/17/2009 04:27 PM:
Quoted 14 lines
Quoted 14 lines
-----Original Message-----
From: Nishanth Menon [mailto:[email protected]]
Sent: Tuesday, February 17, 2009 2:12 AM
To: Curran, Dominic
Cc: linux-omap; Aguirre Rodriguez, Sergio Alberto
Subject: Re: [OMAPZOOM][PATCH] Testing for TWL4030 in board file change.Would a solution as follows be appropriate?
inarch/arm/mach-omap2/Kconfig:
configMACH_OMAP_ZOOM2
bool "OMAP3 ZOOM2 board"
depends onARCH_OMAP3&&ARCH_OMAP34XX
+ selectTWL4030_COREifVIDEO_OMAP3Quoted 5 lines
Quoted 3 lines
A similar strategy has been implemented for N800, albeit for other peripherals.
If 'reverse dependencies' set the symbol and its dependencies I would
say this would be a good solution, but unfortunately it does not.
Quoted 9 lines
The documentation for reverse dependencies warns:
107 select should be used with care. select will force 108 a symbol to a value without visiting the dependencies. 109 By abusing select you are able to select a symbol FOO even 110 if FOO depends on BAR that is not set. 111 In general use select only for non-visible symbolsSince TWL4030 has dependencies then I don't think this is appropriate
Mach-omap &&
video_omap3depends on twl4030 and twl4030 is not reverse dependent on mach-omap. twl4030 is dependent on i2c - I believe based ondrivers/mfd/Kconfighow do we handle this? Maybe a select of i2c is appropriate there? or how about:(quoted diff) +2
-0+ select TWL4030_CORE if VIDEO_OMAP3 + select I2C if TWL4030_COREQuoted 3 lines
You may want to see
arch/arm/mach-omap2/Kconfig->MACH_NOKIA_N800. I think we have a similar condition there with CBUS andVIDEO_TCM825XI think..Honestly, I'm a bit lost about the goal of this. I don't see how this is solving our problem.
Quoted 15 lines
- 3430SDP and Zoom1/2 uses TWL4030 for power handling the camera sensors
- Current Omap3 camera driver can be used in other platforms than the above that uses OMAP3x30 chip, so we cannot add dependencies on camera driver to platform specific powering methods.
- On above platforms, there exists the need for compiling without T2 support sometimes and you don't want a broken build because of thisHow is above helping for solving this out?
Quoted 6 lines
my 2cents: i like select better than #ifdef ;).. but then, that is just me :)..
Regards,
Nishanth Menon
Fyi, This didn't seem to work:
$ make menuconfig scripts/kconfig/mconf arch/arm/Kconfig drivers/media/Kconfig:35:error: found recursive dependency: VIDEO_V4L2_COMMON -> VIDEO_V4L2 -> VIDEO_CAPTURE_DRIVERS -> VIDEO_OMAP3 -> TWL4030_CORE -> I2C -> VIDEO_V4L2_COMMON make[1]: *** [menuconfig] Error 1 make: *** [menuconfig] Error 2 [gromit@gromit omapzoom04]$
Sergio told me you had discussed a different approach anyway...