[PATCH] s3c2440-resume.patch

Harald Welte laforge at openmoko.org
Wed May 23 10:09:38 CEST 2007

On Wed, May 23, 2007 at 03:09:57PM +0800, matt_hsu wrote:
> Hi all,
> I thought the simplest correction is to set GPG[15:13] as input during
> s3c2410_ts suspending. 

Matt, the following patch won't work:

> +#if defined(CONFIG_CPU_S3C2440)

this config means: "If the 2440 was configured as one possible supported
CPU at compile time".

You cannot use #ifdef or any other compile-time based solution.  It has
to be decided on runtime.

I think the best option would be to unconditionally switch those three
GPIO's to input on all 2440 based systems.  

Ben: What are your thoghts on this?

I propose something like:

if (we_re_currently_running_on_2440) {
	s3c2410_gpio_cfgpin(S3C2410_GPG13, S3C2410_GPG13_INP);
	s3c2410_gpio_cfgpin(S3C2410_GPG14, S3C2410_GPG14_INP);
	s3c2410_gpio_cfgpin(S3C2410_GPG15, S3C2410_GPG15_INP);

I'd assume that this is always right, since you want to make sure the
correct boot mode is selected upon resume.  Right?

> +#if defined(CONFIG_CPU_S3C2440)
> +
> +	s3c2410_gpio_cfgpin(S3C2410_GPG13, S3C2410_GPG13_nXPON);
> +	s3c2410_gpio_cfgpin(S3C2410_GPG14, S3C2410_GPG14_YMON);
> +	s3c2410_gpio_cfgpin(S3C2410_GPG15, S3C2410_GPG15_nYPON);
> +
> +#endif

Matt: this is again broken since you unconditionally switch to that
function, no matter what the gpio config actually was before suspending.

- Harald Welte <laforge at openmoko.org>          	        http://openmoko.org/
Software for the world's first truly open Free Software mobile phone

More information about the openmoko-kernel mailing list