mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 2/2] gpio: add driver for stmpe io-expander
Date: Mon, 3 Sep 2012 09:08:24 +0200	[thread overview]
Message-ID: <20120903070824.GW26594@pengutronix.de> (raw)
In-Reply-To: <1346404447-31961-3-git-send-email-s.trumtrar@pengutronix.de>

On Fri, Aug 31, 2012 at 11:14:07AM +0200, Steffen Trumtrar wrote:
> Add a driver for the stmpe1601 gpio block. The stmpe io-expanders have multiple
> blocks (keypad, gpio...) that can be enabled and used. Only gpio is supported atm.
> 
> This was only tested on a stmpe connected via i2c. It is also possible to connect
> via spi.
> 
> Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
> ---
> +
> +static int stmpe_gpio_probe(struct device_d *dev)
> +{
> +	struct stmpe_gpio_chip *stmpegpio;
> +
> +	stmpegpio = xzalloc(sizeof(*stmpegpio));
> +
> +	stmpegpio->base = dev_request_mem_region(dev, 0);
> +	stmpegpio->chip.ops = &stmpe_gpio_ops;
> +	stmpegpio->chip.base = 224;

This is not a good idea. Configure the base from platform_data instead.
Maybe we can add an optional -1 for dynamic base, but having hardcoded
bases so that board code knows the correct gpio numbers seems more
important for now.

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2012-09-03  7:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-31  9:14 [PATCH 0/2] Add stmpe mfd Steffen Trumtrar
2012-08-31  9:14 ` [PATCH 1/2] mfd: add stmpe-i2c driver Steffen Trumtrar
2012-08-31  9:14 ` [PATCH 2/2] gpio: add driver for stmpe io-expander Steffen Trumtrar
2012-09-03  7:08   ` Sascha Hauer [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=20120903070824.GW26594@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=s.trumtrar@pengutronix.de \
    /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