linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: b39297@freescale.com (Wu Guoxing)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v8] ARM : mx35: 3ds-board: add framebuffer device
Date: Thu, 15 Mar 2012 16:02:36 +0800	[thread overview]
Message-ID: <20120315080235.GA2837@wgx-VirtualBox> (raw)
In-Reply-To: <20120314050238.GA15933@sapphire.tkos.co.il>

Hi Baruch:

On Wed, Mar 14, 2012 at 07:02:38AM +0200, Baruch Siach wrote:
> Hi Wu,
> 
> On Wed, Mar 14, 2012 at 10:10:54AM +0800, Wu Guoxing wrote:
> > From: wu guoxing <b39297@freescale.com>
> > 
> > This patch adds framebuffer support for freescale mx35 3ds board
> > 
> > Signed-off-by: Wu Guoxing <b39297@freescale.com>
> > ---
> 
> [snip]
> 
> > +static int lcd_power_gpio = -ENXIO;
> 
> Since this is only used in mx35_3ds_lcd_set_power() below, can't it be local 
> to that routine?
> 
when I search the whole kernel code, I didn't find much using of function local static
variable, and even if the static variable is used only by that one function.

and we need this variable to be global, to avoid search the gpiochip every time.
> > +
> > +static int mc9s08dz60_gpiochip_match(struct gpio_chip *chip,
> > +						     void *data)
> > +{
> > +	return !strcmp(chip->label, data);
> > +}
> > +
> > +static void mx35_3ds_lcd_set_power(
> > +				struct plat_lcd_data *pd, unsigned int power)
> > +{
> > +	struct gpio_chip *chip;
> > +
> > +	if (!gpio_is_valid(lcd_power_gpio)) {
> > +		chip = gpiochip_find(
> > +				"mc9s08dz60", mc9s08dz60_gpiochip_match);
> > +		if (chip) {
> > +			lcd_power_gpio =
> > +				chip->base + GPIO_MC9S08DZ60_LCD_ENABLE;
> > +			if (gpio_request(lcd_power_gpio, "lcd_power") < 0) {
> > +				pr_err("error: gpio already requested!\n");
> > +				lcd_power_gpio = -ENXIO;
> > +			}
> > +		} else {
> > +			pr_err("error: didn't find mc9s08dz60 gpio chip\n");
> > +		}
> > +	}
> > +
> > +	if (gpio_is_valid(lcd_power_gpio))
> > +		gpio_set_value_cansleep(lcd_power_gpio, power);
> > +}
> 
> baruch
> 
> -- 
>      http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
> =}------------------------------------------------ooO--U--Ooo------------{=
>    - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
> 

      reply	other threads:[~2012-03-15  8:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-14  2:10 [PATCH v8] ARM : mx35: 3ds-board: add framebuffer device Wu Guoxing
2012-03-14  5:02 ` Baruch Siach
2012-03-15  8:02   ` Wu Guoxing [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=20120315080235.GA2837@wgx-VirtualBox \
    --to=b39297@freescale.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;
as well as URLs for NNTP newsgroup(s).