kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: jim.cromie@gmail.com (Jim Cromie)
To: kernelnewbies@lists.kernelnewbies.org
Subject: linux gpio
Date: Sun, 3 Apr 2011 01:36:33 -0600	[thread overview]
Message-ID: <AANLkTi=pFDgiRwxy6sosz29EnAhubaTPu_7=LpdaChhK@mail.gmail.com> (raw)
In-Reply-To: <4D919322.9060003@televic.com>

2011/3/29 J?rgen Lambrecht <J.Lambrecht@televic.com>:
> Hello,
>
> I am new to linux (coming from eCos).
> My backlight driver does not start up because the reset gpio pin is not
> correct specified.
> How does gpio work in Linux?
>

theres no single way.
the new way is in drivers/gpio/* , implemented in gpiolib.c
defined in #include <linux/gpio.h>

there are also char drivers, with which Im more familiar.
./char/nsc_gpio.c
./char/pc8736x_gpio.c
./char/scx200_gpio.c



> I have 2 platforms that use the same backlight driver, under arm, for freescale imx: imx31_3ds and imx27_3ds.
> I don't think that matters, I just need to understand the linux gpio.
>
> The imx31 platform gives the number 88 as gpio number to the backlight
> driver.
> That number comes out of 'iomux-mx3.h'.
> In 'iomux-mx27.h' the GPIO's are specified in an other way, the
> "hardware" way, specifying bank and port. I think Linux GPIO needs a
> sort of general gpio number.

The problem here is that board IDs are somewhat arbitrary,
whereas driver IDs are predictable.  Take soekris 4801 as an example;
it has gpio on the CPU-SOC (scx200_gpio), and on a peripheral chip
(pc8736x_gpio)
The board uses CPU pins for Leds (and reset button I think),
but the GPIO exposed to connector is on pc87366 chip.
The char drivers use major device numbers to select the chip & driver,
and minor numbers to select the bank/pin on the chip.
THis lets users create device files with suitable names / numbers.

> But how do I calculate that number out of the datasheet?
> In the imx31 datasheet, I cannot find that number 88 (or the other
> numbers in 'iomux-mx3.h').
>

what driver supports your boards ?
is it a new gpio driver ?


> Kind regards,
> J?rgen
>
> --
> J?rgen Lambrecht
> R&D Associate
> Tel: +32 (0)51 303045 ? ?Fax: +32 (0)51 310670
> http://www.televic-rail.com
> Televic Rail NV - Leo Bekaertlaan 1 - 8870 Izegem - Belgium
> Company number 0825.539.581 - RPR Kortrijk
>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>

  reply	other threads:[~2011-04-03  7:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-29  8:06 linux gpio Jürgen Lambrecht
2011-04-03  7:36 ` Jim Cromie [this message]
2011-04-04 11:44   ` Jürgen Lambrecht

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='AANLkTi=pFDgiRwxy6sosz29EnAhubaTPu_7=LpdaChhK@mail.gmail.com' \
    --to=jim.cromie@gmail.com \
    --cc=kernelnewbies@lists.kernelnewbies.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).