public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: jy0922.shim@samsung.com (Joonyoung Shim)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: S3C64XX: Remove gpio-bank-X header files
Date: Wed, 27 Apr 2011 11:43:09 +0900	[thread overview]
Message-ID: <4DB782BD.9020205@samsung.com> (raw)
In-Reply-To: <052c01cc047a$5cb8d500$162a7f00$%kim@samsung.com>

On 2011-04-27 ?? 10:27, Kukjin Kim wrote:
> Joonyoung Shim wrote:
>>
>> The gpio-bank-X header files of S3C64XX have defines which can be
>> substituted by more common API, so they can be removed. This is compile
>> tested only.
>>
>> Signed-off-by: Joonyoung Shim<jy0922.shim@samsung.com>
>> ---
>>   arch/arm/mach-s3c64xx/dev-spi.c                  |   20 ++----
>>   arch/arm/mach-s3c64xx/include/mach/gpio-bank-a.h |   48 --------------
>>   arch/arm/mach-s3c64xx/include/mach/gpio-bank-b.h |   60 -----------------
>>   arch/arm/mach-s3c64xx/include/mach/gpio-bank-c.h |   53 ---------------
>>   arch/arm/mach-s3c64xx/include/mach/gpio-bank-d.h |   49 --------------
>>   arch/arm/mach-s3c64xx/include/mach/gpio-bank-e.h |   44 -------------
>>   arch/arm/mach-s3c64xx/include/mach/gpio-bank-f.h |   71
> --------------------
>> -
>>   arch/arm/mach-s3c64xx/include/mach/gpio-bank-g.h |   42 ------------
>>   arch/arm/mach-s3c64xx/include/mach/gpio-bank-h.h |   74
> --------------------
>> --
>>   arch/arm/mach-s3c64xx/include/mach/gpio-bank-i.h |   40 ------------
>>   arch/arm/mach-s3c64xx/include/mach/gpio-bank-j.h |   36 -----------
>>   arch/arm/mach-s3c64xx/include/mach/gpio-bank-n.h |   54 ----------------
>>   arch/arm/mach-s3c64xx/include/mach/gpio-bank-o.h |   70
> --------------------
>>   arch/arm/mach-s3c64xx/include/mach/gpio-bank-p.h |   69
> --------------------
>>   arch/arm/mach-s3c64xx/include/mach/gpio-bank-q.h |   46 -------------
>>   arch/arm/mach-s3c64xx/mach-smdk6410.c            |    1 -
>>   arch/arm/mach-s3c64xx/pm.c                       |   35 +++++------
>>   arch/arm/mach-s3c64xx/setup-i2c0.c               |    7 +--
>>   arch/arm/mach-s3c64xx/setup-i2c1.c               |    7 +--
>>   arch/arm/mach-s3c64xx/sleep.S                    |    8 ++-
>>   20 files changed, 34 insertions(+), 800 deletions(-)
>>   delete mode 100644 arch/arm/mach-s3c64xx/include/mach/gpio-bank-a.h
>>   delete mode 100644 arch/arm/mach-s3c64xx/include/mach/gpio-bank-b.h
>>   delete mode 100644 arch/arm/mach-s3c64xx/include/mach/gpio-bank-c.h
>>   delete mode 100644 arch/arm/mach-s3c64xx/include/mach/gpio-bank-d.h
>>   delete mode 100644 arch/arm/mach-s3c64xx/include/mach/gpio-bank-e.h
>>   delete mode 100644 arch/arm/mach-s3c64xx/include/mach/gpio-bank-f.h
>>   delete mode 100644 arch/arm/mach-s3c64xx/include/mach/gpio-bank-g.h
>>   delete mode 100644 arch/arm/mach-s3c64xx/include/mach/gpio-bank-h.h
>>   delete mode 100644 arch/arm/mach-s3c64xx/include/mach/gpio-bank-i.h
>>   delete mode 100644 arch/arm/mach-s3c64xx/include/mach/gpio-bank-j.h
>>   delete mode 100644 arch/arm/mach-s3c64xx/include/mach/gpio-bank-n.h
>>   delete mode 100644 arch/arm/mach-s3c64xx/include/mach/gpio-bank-o.h
>>   delete mode 100644 arch/arm/mach-s3c64xx/include/mach/gpio-bank-p.h
>>   delete mode 100644 arch/arm/mach-s3c64xx/include/mach/gpio-bank-q.h
>>
>
> Hi,
>
> Oh, great.
>
> I also tried to remove useless gpio header files :) and it is in my dev/gpio
> branch. But I think, this is better.
> Anyway there are small comments.
>
> (snip)
>
>>   void s3c_pm_debug_smdkled(u32 set, u32 clear)
>>   {
>> -	unsigned long flags;
>> -	u32 reg;
>> -
>> -	local_irq_save(flags);
>> -	reg = __raw_readl(S3C64XX_GPNCON);
>> -	reg&= ~(S3C64XX_GPN_CONMASK(12) | S3C64XX_GPN_CONMASK(13) |
>> -		 S3C64XX_GPN_CONMASK(14) | S3C64XX_GPN_CONMASK(15));
>> -	reg |= S3C64XX_GPN_OUTPUT(12) | S3C64XX_GPN_OUTPUT(13) |
>> -	       S3C64XX_GPN_OUTPUT(14) | S3C64XX_GPN_OUTPUT(15);
>> -	__raw_writel(reg, S3C64XX_GPNCON);
>> -
>> -	reg = __raw_readl(S3C64XX_GPNDAT);
>> -	reg&= ~(clear<<  12);
>> -	reg |= set<<  12;
>> -	__raw_writel(reg, S3C64XX_GPNDAT);
>> -
>> -	local_irq_restore(flags);
>> +	int i;
>> +
>> +	for (i = 0; i<  4; i++) {
>> +		if (clear&  (1<<  i))
>> +			gpio_direction_output(S3C64XX_GPN(12 + i), 0);
>> +		if (set&  (1<<  i))
>> +			gpio_direction_output(S3C64XX_GPN(12 + i), 1);
>> +	}
>
> Hmm...
>
> According to comments in gpio_direction_{input,output}, it isn't called more
> than once...but it can be called twice in your code. And need
> local_irq_{save,restore} around them.
>

OK, gpio_set_value will need here instead of gpio_diretion_output.

> So how about keeping old codes here? In addtion, as you know, need to keep
> definitions of S3C64XX_GPNxxx now :(
>

I won't keep old codes, it can replace fully.

Thanks.

  reply	other threads:[~2011-04-27  2:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-22  9:51 [PATCH] ARM: S3C64XX: Remove gpio-bank-X header files Joonyoung Shim
2011-04-27  1:27 ` Kukjin Kim
2011-04-27  2:43   ` Joonyoung Shim [this message]
2011-04-27  3:16     ` Kukjin Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DB782BD.9020205@samsung.com \
    --to=jy0922.shim@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox