diff mbox

ARM: SAMSUNG: Fix compilation error with s3c2410_defconfig

Message ID 0a2d01cd7500$53e26c50$fba744f0$%kim@samsung.com
State New
Headers show

Commit Message

Kukjin Kim Aug. 8, 2012, 12:54 a.m. UTC
Tushar Behera wrote:
> 
> On 08/07/2012 04:03 PM, Kukjin Kim wrote:
> > Tushar Behera wrote:
> >>
> >> Commit 2663e766c56a "ARM Samsung: Move s3c pwm driver to pwm framework"
> >> moved Samsung PWM driver to drivers/pwm and the config option to select
> >> this driver has changed.
> >>
> >> This patch fixes following build-error with s3c2410_defconfig.
> >> arch/arm/mach-s3c24xx/mach-rx1950.c:430: undefined reference to
> >> `pwm_config'
> >>
> >
> > Yes, need to fix...
> >
> > arch/arm/mach-s3c24xx/built-in.o: In function `rx1950_lcd_power':
> > arch/arm/mach-s3c24xx/mach-rx1950.c:430: undefined reference to
> `pwm_config'
> > arch/arm/mach-s3c24xx/mach-rx1950.c:431: undefined reference to
> > `pwm_disable'
> > arch/arm/mach-s3c24xx/mach-rx1950.c:437: undefined reference to
> `pwm_config'
> > arch/arm/mach-s3c24xx/mach-rx1950.c:438: undefined reference to
> `pwm_enable'
> > arch/arm/mach-s3c24xx/built-in.o: In function `rx1950_backlight_exit':
> > arch/arm/mach-s3c24xx/mach-rx1950.c:504: undefined reference to
> `pwm_free'
> > arch/arm/mach-s3c24xx/built-in.o: In function `rx1950_backlight_init':
> > arch/arm/mach-s3c24xx/mach-rx1950.c:487: undefined reference to
> > `pwm_request'
> >
> 
> Yes, the patch fixes all of these errors, didn't include them in the
> patch comments though as they were all similar.
> 
I will add above description when I apply this :)

> 
> >> Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
> >> ---
> >>  arch/arm/mach-s3c24xx/Kconfig |    4 ++--
> >>  arch/arm/plat-samsung/Kconfig |    3 ++-
> >>  2 files changed, 4 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/arch/arm/mach-s3c24xx/Kconfig b/arch/arm/mach-
> s3c24xx/Kconfig
> >> index e249611..d56b0f7 100644
> >> --- a/arch/arm/mach-s3c24xx/Kconfig
> >> +++ b/arch/arm/mach-s3c24xx/Kconfig
> >> @@ -483,7 +483,7 @@ config MACH_NEO1973_GTA02
> >>  	select I2C
> >>  	select POWER_SUPPLY
> >>  	select MACH_NEO1973
> >> -	select S3C2410_PWM
> >> +	select S3C24XX_PWM
> 
> The above needs to be picked up as S3C2410_PWM is no longer defined.
> 
Correct, I know. In addition, I'd preferred to use SAMSUNG_PWM so I will
change the name later.

> >>  	select S3C_DEV_USB_HOST
> >>  	help
> >>  	   Say Y here if you are using the Openmoko GTA02 / Freerunner GSM
> >> Phone
> >> @@ -493,7 +493,7 @@ config MACH_RX1950
> >>  	select S3C24XX_DCLK
> >>  	select PM_H1940 if PM
> >>  	select I2C
> >> -	select S3C2410_PWM
> >> +	select S3C24XX_PWM
> 
> Same as above.
> 
> >>  	select S3C_DEV_NAND
> >>  	select S3C2410_IOTIMING if S3C2440_CPUFREQ
> >>  	select S3C2440_XTAL_16934400
> >> diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-
> samsung/Kconfig
> >> index 7aca31c..9c3b90c 100644
> >> --- a/arch/arm/plat-samsung/Kconfig
> >> +++ b/arch/arm/plat-samsung/Kconfig
> >> @@ -403,7 +403,8 @@ config S5P_DEV_USB_EHCI
> >>
> >>  config S3C24XX_PWM
> >>  	bool "PWM device support"
> >> -	select HAVE_PWM
> >> +	select PWM
> >> +	select PWM_SAMSUNG
> >>  	help
> >>  	  Support for exporting the PWM timer blocks via the pwm device
> >>  	  system
> >> --
> >> 1.7.4.1
> >
> > I think, following would be better? Or ...
> >
> 
> No issues. You can pick whichever you find better.
> 
Thanks, see below.

> > ---
> > diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-
> samsung/Kconfig
> > index 7aca31c..dcdfb77 100644
> > --- a/arch/arm/plat-samsung/Kconfig
> > +++ b/arch/arm/plat-samsung/Kconfig
> > @@ -403,7 +403,7 @@ config S5P_DEV_USB_EHCI
> >
> >  config S3C24XX_PWM
> >  	bool "PWM device support"
> > -	select HAVE_PWM
> > +	select PWM
> >  	help
> >  	  Support for exporting the PWM timer blocks via the pwm device
> >  	  system
> > diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig
> > index 8fc3808..34c8ec1 100644
> > --- a/drivers/pwm/Kconfig
> > +++ b/drivers/pwm/Kconfig
> > @@ -59,7 +59,7 @@ config PWM_PXA
> >
> >  config PWM_SAMSUNG
> >  	tristate "Samsung pwm support"
> > -	depends on PLAT_SAMSUNG
> > +	def_bool PLAT_SAMSUNG
> >  	help
> >  	  Generic PWM framework driver for Samsung.
> > ---
> >
> >

From: Tushar Behera <tushar.behera@linaro.org>
Subject: [PATCH] ARM: SAMSUNG: Fix compilation error with s3c2410_defconfig

Commit 2663e766c56a ("ARM Samsung: Move s3c pwm driver to pwm framework")
moved Samsung PWM driver to drivers/pwm and the config option to select
this driver has changed.

This patch fixes following build-error with s3c2410_defconfig.

arch/arm/mach-s3c24xx/built-in.o: In function 'rx1950_lcd_power':
arch/arm/mach-s3c24xx/mach-rx1950.c:430: undefined reference to 'pwm_config'
arch/arm/mach-s3c24xx/mach-rx1950.c:431: undefined reference to
'pwm_disable'
arch/arm/mach-s3c24xx/mach-rx1950.c:437: undefined reference to 'pwm_config'
arch/arm/mach-s3c24xx/mach-rx1950.c:438: undefined reference to 'pwm_enable'
arch/arm/mach-s3c24xx/built-in.o: In function 'rx1950_backlight_exit':
arch/arm/mach-s3c24xx/mach-rx1950.c:504: undefined reference to 'pwm_free'
arch/arm/mach-s3c24xx/built-in.o: In function 'rx1950_backlight_init':
arch/arm/mach-s3c24xx/mach-rx1950.c:487: undefined reference to
'pwm_request'

Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
[kgene.kim@samsung.com: re-worked as per review comments]
Cc: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
---
 arch/arm/mach-s3c24xx/Kconfig |    4 ++--
 arch/arm/plat-samsung/Kconfig |    2 +-
 drivers/pwm/Kconfig           |    2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

Comments

Thierry Reding Aug. 8, 2012, 6:11 a.m. UTC | #1
On Wed, Aug 08, 2012 at 09:54:13AM +0900, Kukjin Kim wrote:
> diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig
> index 7aca31c..dcdfb77 100644
> --- a/arch/arm/plat-samsung/Kconfig
> +++ b/arch/arm/plat-samsung/Kconfig
> @@ -403,7 +403,7 @@ config S5P_DEV_USB_EHCI
>  
>  config S3C24XX_PWM
>  	bool "PWM device support"
> -	select HAVE_PWM
> +	select PWM
>  	help
>  	  Support for exporting the PWM timer blocks via the pwm device
>  	  system

You could add

	select PWM_SAMSUNG

here to side-step the issue below.

> diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig
> index 8fc3808..34c8ec1 100644
> --- a/drivers/pwm/Kconfig
> +++ b/drivers/pwm/Kconfig
> @@ -59,7 +59,7 @@ config PWM_PXA
>  
>  config PWM_SAMSUNG
>  	tristate "Samsung pwm support"
> -	depends on PLAT_SAMSUNG
> +	def_bool PLAT_SAMSUNG

tristate and def_bool conflict, don't they? I think the easiest way to
solve this problem would be to add a default line, like so:

	default PLAT_SAMSUNG

I've checked this with a s3c2410_defconfig and this causes PWM_SAMSUNG
to be selected =y, which I guess is what you want.

Thierry
Kukjin Kim Aug. 8, 2012, 6:30 a.m. UTC | #2
Thierry Reding wrote:
> 
> On Wed, Aug 08, 2012 at 09:54:13AM +0900, Kukjin Kim wrote:
> > diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-
> samsung/Kconfig
> > index 7aca31c..dcdfb77 100644
> > --- a/arch/arm/plat-samsung/Kconfig
> > +++ b/arch/arm/plat-samsung/Kconfig
> > @@ -403,7 +403,7 @@ config S5P_DEV_USB_EHCI
> >
> >  config S3C24XX_PWM
> >  	bool "PWM device support"
> > -	select HAVE_PWM
> > +	select PWM
> >  	help
> >  	  Support for exporting the PWM timer blocks via the pwm device
> >  	  system
> 
> You could add
> 
> 	select PWM_SAMSUNG
> 
Well, the 'PWM_SAMSUNG' depends on 'PWM', so I think, it'd better to select
PWM_SAMSUNG for building pwm-samsung.c automatically when PWM is selected.

> here to side-step the issue below.
> 
> > diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig
> > index 8fc3808..34c8ec1 100644
> > --- a/drivers/pwm/Kconfig
> > +++ b/drivers/pwm/Kconfig
> > @@ -59,7 +59,7 @@ config PWM_PXA
> >
> >  config PWM_SAMSUNG
> >  	tristate "Samsung pwm support"
> > -	depends on PLAT_SAMSUNG
> > +	def_bool PLAT_SAMSUNG
> 
> tristate and def_bool conflict, don't they? I think the easiest way to

Yeah, your pointing out is correct, but in this case, it should be 'bool'
not 'tristate' because the PWM driver cannot support module now.

> solve this problem would be to add a default line, like so:
> 
> 	default PLAT_SAMSUNG
> 
> I've checked this with a s3c2410_defconfig and this causes PWM_SAMSUNG
> to be selected =y, which I guess is what you want.
> 
How do you think following, just adding from original one?

-	tristate "Samsung pwm support"
+	bool "SAMSUNG PWM support"

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
Thierry Reding Aug. 8, 2012, 6:50 a.m. UTC | #3
On Wed, Aug 08, 2012 at 03:30:32PM +0900, Kukjin Kim wrote:
> Thierry Reding wrote:
> > 
> > On Wed, Aug 08, 2012 at 09:54:13AM +0900, Kukjin Kim wrote:
> > > diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-
> > samsung/Kconfig
> > > index 7aca31c..dcdfb77 100644
> > > --- a/arch/arm/plat-samsung/Kconfig
> > > +++ b/arch/arm/plat-samsung/Kconfig
> > > @@ -403,7 +403,7 @@ config S5P_DEV_USB_EHCI
> > >
> > >  config S3C24XX_PWM
> > >  	bool "PWM device support"
> > > -	select HAVE_PWM
> > > +	select PWM
> > >  	help
> > >  	  Support for exporting the PWM timer blocks via the pwm device
> > >  	  system
> > 
> > You could add
> > 
> > 	select PWM_SAMSUNG
> > 
> Well, the 'PWM_SAMSUNG' depends on 'PWM', so I think, it'd better to select
> PWM_SAMSUNG for building pwm-samsung.c automatically when PWM is selected.
> 
> > here to side-step the issue below.
> > 
> > > diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig
> > > index 8fc3808..34c8ec1 100644
> > > --- a/drivers/pwm/Kconfig
> > > +++ b/drivers/pwm/Kconfig
> > > @@ -59,7 +59,7 @@ config PWM_PXA
> > >
> > >  config PWM_SAMSUNG
> > >  	tristate "Samsung pwm support"
> > > -	depends on PLAT_SAMSUNG
> > > +	def_bool PLAT_SAMSUNG
> > 
> > tristate and def_bool conflict, don't they? I think the easiest way to
> 
> Yeah, your pointing out is correct, but in this case, it should be 'bool'
> not 'tristate' because the PWM driver cannot support module now.

Is there any reason why that is so? Looking at the driver it seems like
it should be easy to turn it into a module. I know that Jingoo (Cc'ed)
has been working on the driver and I've asked him the same question
already.

Anyway I don't want to force the issue, I just think you should consider
it.

> > solve this problem would be to add a default line, like so:
> > 
> > 	default PLAT_SAMSUNG
> > 
> > I've checked this with a s3c2410_defconfig and this causes PWM_SAMSUNG
> > to be selected =y, which I guess is what you want.
> > 
> How do you think following, just adding from original one?
> 
> -	tristate "Samsung pwm support"
> +	bool "SAMSUNG PWM support"
> 
> Thanks.

If you convert this to bool anyway, then maybe you can still use
def_bool:

	config PWM_SAMSUNG
		prompt "SAMSUNG PWM support" if PLAT_SAMSUNG
		def_bool PLAT_SAMSUNG

Any particular reason why you want "SAMSUNG" capitalized?

Thierry
diff mbox

Patch

diff --git a/arch/arm/mach-s3c24xx/Kconfig b/arch/arm/mach-s3c24xx/Kconfig
index e249611..d56b0f7 100644
--- a/arch/arm/mach-s3c24xx/Kconfig
+++ b/arch/arm/mach-s3c24xx/Kconfig
@@ -483,7 +483,7 @@  config MACH_NEO1973_GTA02
 	select I2C
 	select POWER_SUPPLY
 	select MACH_NEO1973
-	select S3C2410_PWM
+	select S3C24XX_PWM
 	select S3C_DEV_USB_HOST
 	help
 	   Say Y here if you are using the Openmoko GTA02 / Freerunner GSM
Phone
@@ -493,7 +493,7 @@  config MACH_RX1950
 	select S3C24XX_DCLK
 	select PM_H1940 if PM
 	select I2C
-	select S3C2410_PWM
+	select S3C24XX_PWM
 	select S3C_DEV_NAND
 	select S3C2410_IOTIMING if S3C2440_CPUFREQ
 	select S3C2440_XTAL_16934400
diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig
index 7aca31c..dcdfb77 100644
--- a/arch/arm/plat-samsung/Kconfig
+++ b/arch/arm/plat-samsung/Kconfig
@@ -403,7 +403,7 @@  config S5P_DEV_USB_EHCI
 
 config S3C24XX_PWM
 	bool "PWM device support"
-	select HAVE_PWM
+	select PWM
 	help
 	  Support for exporting the PWM timer blocks via the pwm device
 	  system
diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig
index 8fc3808..34c8ec1 100644
--- a/drivers/pwm/Kconfig
+++ b/drivers/pwm/Kconfig
@@ -59,7 +59,7 @@  config PWM_PXA
 
 config PWM_SAMSUNG
 	tristate "Samsung pwm support"
-	depends on PLAT_SAMSUNG
+	def_bool PLAT_SAMSUNG
 	help
 	  Generic PWM framework driver for Samsung.