diff mbox

[OMAPZOOM] Testing for TWL4030 in board file change.

Message ID 200902161815.13645.dcurran@ti.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Dominic Curran Feb. 17, 2009, 12:15 a.m. UTC
From: Dominic Curran <dcurran@ti.com>
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.

Signed-off-by: Dominic Curran <dcurran@ti.com>
---
 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(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Nishanth Menon Feb. 17, 2009, 8:11 a.m. UTC | #1
Dominic Curran said the following on 02/17/2009 02:15 AM:
> From: Dominic Curran <dcurran@ti.com>
> 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.
>
>   
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
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Dominic Curran Feb. 17, 2009, 2:27 p.m. UTC | #2
> -----Original Message-----
> From: Nishanth Menon [mailto:menon.nishanth@gmail.com]
> 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:
> > From: Dominic Curran <dcurran@ti.com>
> > 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.
> >
> >
> 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

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.

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Nishanth Menon Feb. 17, 2009, 3:33 p.m. UTC | #3
Curran, Dominic said the following on 02/17/2009 04:27 PM:
>> -----Original Message-----
>> From: Nishanth Menon [mailto:menon.nishanth@gmail.com]
>> 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?
>> 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.
>>     
>
> 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
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
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Aguirre Rodriguez, Sergio Alberto Feb. 17, 2009, 4:02 p.m. UTC | #4
> -----Original Message-----
> From: Nishanth Menon [mailto:menon.nishanth@gmail.com]
> 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:
> >> -----Original Message-----
> >> From: Nishanth Menon [mailto:menon.nishanth@gmail.com]
> >> 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?
> >> 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.
> >>
> >
> > 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
> 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..

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?

> 
> my 2cents: i like select better than #ifdef ;).. but then, that is just
> me :)..
> 
> Regards,
> Nishanth Menon

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Nishanth Menon Feb. 17, 2009, 4:52 p.m. UTC | #5
On Tue, Feb 17, 2009 at 6:02 PM, Aguirre Rodriguez, Sergio Alberto
<saaguirre@ti.com> wrote:
>> -----Original Message-----
>> From: Nishanth Menon [mailto:menon.nishanth@gmail.com]
>> 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:
>> >> -----Original Message-----
>> >> From: Nishanth Menon [mailto:menon.nishanth@gmail.com]
>> >> 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?
>> >> 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.
>> >>
>> >
>> > 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
>> 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..
>
> 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
> - 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 ;) )..

> - 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 :)..
> - 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
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Aguirre Rodriguez, Sergio Alberto Feb. 17, 2009, 5:20 p.m. UTC | #6
> -----Original Message-----
> From: Nishanth Menon [mailto:menon.nishanth@gmail.com]
> 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.
> 
> On Tue, Feb 17, 2009 at 6:02 PM, Aguirre Rodriguez, Sergio Alberto
> <saaguirre@ti.com> wrote:
> >> -----Original Message-----
> >> From: Nishanth Menon [mailto:menon.nishanth@gmail.com]
> >> 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:
> >> >> -----Original Message-----
> >> >> From: Nishanth Menon [mailto:menon.nishanth@gmail.com]
> >> >> 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?
> >> >> 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.
> >> >>
> >> >
> >> > 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
> >> 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..
> >
> > 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
> > - 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 ;) )..
> 
> > - 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 :)..
> > - 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.

> 
> Regards,
> Nishanth Menon

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Dominic Curran Feb. 17, 2009, 7:35 p.m. UTC | #7
> -----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.
>
>
>
> > -----Original Message-----
> > From: Nishanth Menon [mailto:menon.nishanth@gmail.com]
> > 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:
> > >> -----Original Message-----
> > >> From: Nishanth Menon [mailto:menon.nishanth@gmail.com]
> > >> 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?
> > >> 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.
> > >>
> > >
> > > 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
> > 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..
>
> 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?
>
> >
> > 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...

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

Index: omapzoom04/arch/arm/mach-omap2/board-3430sdp.c
===================================================================
--- omapzoom04.orig/arch/arm/mach-omap2/board-3430sdp.c
+++ omapzoom04/arch/arm/mach-omap2/board-3430sdp.c
@@ -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 mt9p0
 static 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(enum 
 	struct 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(enum 
 			twl4030_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(enum 
 		twl4030_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(enum 
 	static 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(enum 
 			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);
@@ -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:
Index: omapzoom04/arch/arm/mach-omap2/board-ldp.c
===================================================================
--- omapzoom04.orig/arch/arm/mach-omap2/board-ldp.c
+++ omapzoom04/arch/arm/mach-omap2/board-ldp.c
@@ -672,6 +672,11 @@  static int ov3640_sensor_power_set(enum 
 	struct 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(enum 
 		twl4030_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);
Index: omapzoom04/arch/arm/mach-omap2/board-zoom2.c
===================================================================
--- omapzoom04.orig/arch/arm/mach-omap2/board-zoom2.c
+++ omapzoom04/arch/arm/mach-omap2/board-zoom2.c
@@ -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(enum 
 	static 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(enum 
 		printk(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: