public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: kgene.kim@samsung.com (Kukjin Kim)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: S3C64XX: Remove gpio-bank-X header files
Date: Wed, 27 Apr 2011 12:16:19 +0900	[thread overview]
Message-ID: <054301cc0489$82a27fa0$87e77ee0$%kim@samsung.com> (raw)
In-Reply-To: <4DB782BD.9020205@samsung.com>

Joonyoung Shim wrote:
> 
> 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>
> >> ---
> > 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.
> 
Ok, I agree with you :)

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

      reply	other threads:[~2011-04-27  3:16 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
2011-04-27  3:16     ` Kukjin Kim [this message]

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='054301cc0489$82a27fa0$87e77ee0$%kim@samsung.com' \
    --to=kgene.kim@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