All of lore.kernel.org
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely@secretlab.ca>
To: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com>
Cc: linux-kernel@vger.kernel.org, "'Ewe,
	Kok Howg'" <kok.howg.ewe@intel.com>,
	"'Lai, Mee Sim'" <mee.sim.lai@intel.com>,
	"'Toshiharu Okada'" <toshiharu-linux@dsn.okisemi.com>
Subject: Re: About GPIO interrupt function with sysfs
Date: Thu, 3 Mar 2011 11:56:32 -0700	[thread overview]
Message-ID: <20110303185632.GL22940@angua.secretlab.ca> (raw)
In-Reply-To: <BF5CB373A5A948A2976AE727EA3F6B70@hacdom.okisemi.com>

On Wed, Mar 02, 2011 at 03:38:13PM +0900, Tomoya MORINAGA wrote:
> Hi Grant,
> 
> On Friday, February 18, 2011 9:43 AM, Grant Likely wrote:
> > > Can our GPIO driver (pch_gpio) have interrupt function?
> > 
> > yes.
> Need your help.
> 
> I try to add interrupt function to GPIO driver of Intel EG20T PCH(pch_gpio.c).
> 
> However, executing "echo xxx > export", there is not "edge" file in /sys/class/gpio/gpioxxx/.
> 
> Seeing source code in gpio_export@gpiolib.c, like below
> 
> int gpio_export(unsigned gpio, bool direction_may_change)
> {
> snip...
> 
> 	if (!status && gpio_to_irq(gpio) >= 0
> 			&& (direction_may_change
> 				|| !test_bit(FLAG_IS_OUT,
> 					&desc->flags))) {
> 		status = device_create_file(dev,
> 				&dev_attr_edge);
> 		printk("%s:device_create_file!!! status=0x%x\n", __func__, status);
> 	}
> 
> snip...
> }

Hmmm, I haven't looked at that code yet.  I didn't realize that the
irq data was exported to userspace (ignore my last email).

> 
> The above "device_create_file(dev, &dev_attr_edge);" is not executed.
> 
> Seeing gpio_to_irq@arch/x86/include/asm/gpio.h, like below.
> 
> static inline int gpio_to_irq(unsigned int gpio)
> {
> 	return -ENOSYS;
> }
> 
> Thus,  device_create_file for "edge" is never executed.
> 
> Could you tell me how to create "edge" file ?

I don't know.  I'll need to dig into that code before I can answer.  I
suggest digging into it yourself to figure out the answer as I cannot
promise that I'll get to it anytime soon.

g.

  reply	other threads:[~2011-03-03 18:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-18  0:34 About GPIO interrupt function with sysfs Tomoya MORINAGA
2011-02-18  0:42 ` Grant Likely
2011-02-18  1:26   ` Tomoya MORINAGA
2011-03-02  6:38   ` Tomoya MORINAGA
2011-03-03 18:56     ` Grant Likely [this message]
2011-03-04  0:06       ` Tomoya MORINAGA
2011-03-10 15:13         ` Lai, Mee Sim
2011-03-17 18:51           ` Grant Likely
2011-03-10 15:52     ` Rabin Vincent
2011-03-11  0:07       ` Tomoya MORINAGA
2011-03-03 18:53 ` Grant Likely

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=20110303185632.GL22940@angua.secretlab.ca \
    --to=grant.likely@secretlab.ca \
    --cc=kok.howg.ewe@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mee.sim.lai@intel.com \
    --cc=tomoya-linux@dsn.okisemi.com \
    --cc=toshiharu-linux@dsn.okisemi.com \
    /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.