All of lore.kernel.org
 help / color / mirror / Atom feed
From: Felipe Balbi <felipe.balbi@nokia.com>
To: ext Hua Yu Yang <huayu.yang@gmail.com>
Cc: "linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>
Subject: Re: trying to understand the device model
Date: Wed, 24 Mar 2010 19:42:04 +0200	[thread overview]
Message-ID: <20100324174204.GA2511@nokia.com> (raw)
In-Reply-To: <24f4a101003240943i7e6699f0ocee92abb5d45c19a@mail.gmail.com>

On Wed, Mar 24, 2010 at 05:43:38PM +0100, ext Hua Yu Yang wrote:
>hi
>
>sorry for spam if this is actually just naive.
>
>i'm new to linux kernel driver module and planning to write a small
>driver module for gpio test, here is what confuses me:
>
>1. in the kernel module programming guide from tldp.org, a device is
>registered with system by major and minor numbers but in recent kernel
>source( i'm working with 2.6.28.10 ), the files under

that's not recent at all :-s Could you move to current linux-omap git ?

>Documentation/driver-model/ seem to introduce a whole new set of
>models, also in kernel source, gpiolib and plat-omap/gpio.c seem to
>follow the new models. i'm not sure if the way described in kernel
>module programming guide is still valid for recent kernels.

you should try to use current kernels.

>2. for your information, i want to write a simple driver based on gpio
>interface described in Documentation/gpio.txt and implement a 8-bit
>read function as well as an interrupt handler, sort of using gpios to
>emulate a parallel port. this is just a workaround for lacking access
>to camera interface on IGEPv2 board, so no need to consider
>portability or whatsoever, is there any problem for me to just use
>module_init() and module_exit(), as is shown in the kernel module
>programming guide, instead of going into all those add/remove classes,
>buses, interfaces?

I believe you'll like to look at the platform_driver structures and make 
a driver that claims the gpios you need and sets correct direction/value 
when needed.

-- 
balbi

      reply	other threads:[~2010-03-24 17:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-24 16:43 trying to understand the device model Hua Yu Yang
2010-03-24 17:42 ` Felipe Balbi [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=20100324174204.GA2511@nokia.com \
    --to=felipe.balbi@nokia.com \
    --cc=huayu.yang@gmail.com \
    --cc=linux-omap@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.