public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Masayuki Ohtak <masa-korg@dsn.okisemi.com>
Cc: meego-dev@meego.com, "Andrew Morton" <akpm@linux-foundation.org>,
	"Samuel Ortiz" <sameo@linux.intel.com>,
	"Randy Dunlap" <randy.dunlap@oracle.com>,
	"Alek Du" <alek.du@intel.com>,
	"Richard Röjfors" <richard.rojfors@mocean-labs.com>,
	"Mike Frysinger" <vapier@gentoo.org>,
	linux-kernel@vger.kernel.org, qi.wang@intel.com,
	andrew.chih.howe.khor@intel.com, arjan@linux.intel.com,
	gregkh@suse.de, yong.y.wang@intel.com,
	"Tomoya MORINAGA" <morinaga526@dsn.okisemi.com>
Subject: Re: [MeeGo-Dev][PATCH] Topcliff: Update PCH_GPIO driver to 2.6.35
Date: Fri, 3 Sep 2010 14:48:27 +0100	[thread overview]
Message-ID: <20100903134827.GA7614@rakim.wolfsonmicro.main> (raw)
In-Reply-To: <4C80D3C8.9020204@dsn.okisemi.com>

On Fri, Sep 03, 2010 at 07:54:00PM +0900, Masayuki Ohtak wrote:

> Topcliff PCH is the platform controller hub that is going to be used in
> Intel's upcoming general embedded platform. All IO peripherals in
> Topcliff PCH are actually devices sitting on AMBA bus.
> Topcliff PCH has GPIO I/F. Using this I/F, it is able to access system
> devices connected to GPIO.

This has a similar issue to the CAN driver - it isn't a standard kernel
GPIO driver, it implements a custom ioctl based userspace ABI.  This
means it's not usable from within the kernel and isn't suitable for
mainline.  You should be implementing support for the device using the
standard interfaces used by the other GPIO drivers in kernel.

> +/**
> + * pch_gpio_handler - Implements the interrupt handler functionality of
> + *		      the gpio module.
> + * @irq:	Contains the irq value
> + * @pData:	Contains the reference to the base gpio address.

Please use the standard kernel coding style conventions for naming
variables.

> +static irqreturn_t pch_gpio_handler(s32 irq, void *pData)
> +{
> +	irqreturn_t ret = IRQ_NONE;
> +	u32 pch_idisp_regval;
> +	struct pch_gpio_chip *chip =  (struct pch_gpio_chip *)pData;

No need to cast away from void.

> +
> +	pch_idisp_regval =
> +			chip->pch_gpio_bit_mask & ioread32(&chip->reg->idisp);
> +	if (pch_idisp_regval != 0) {
> +		/*invoke the callback */
> +		(*pch_gpio_cbr) (pch_idisp_regval, chip);

The interrupts from the controller should be hooked up to genirq, not
using this custom callback mechanism.

  reply	other threads:[~2010-09-03 13:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-03 10:54 [MeeGo-Dev][PATCH] Topcliff: Update PCH_GPIO driver to 2.6.35 Masayuki Ohtak
2010-09-03 13:48 ` Mark Brown [this message]
     [not found]   ` <000301cb5ebc$35ad8d20$66f8800a@maildom.okisemi.com>
2010-09-28  3:38     ` Mike Frysinger
2010-09-28  4:57       ` Masayuki Ohtake
2010-09-28  5:02         ` Mike Frysinger
2010-09-28  5:25           ` Masayuki Ohtake
2010-09-28  5:29             ` Mark Brown
2010-09-28  6:35               ` Masayuki Ohtake
2010-09-28 16:28                 ` Mark Brown
2010-09-28  5:32             ` Mike Frysinger
2010-09-28  7:21               ` Masayuki Ohtake
2010-09-28  4:12     ` Mark Brown
  -- strict thread matches above, loose matches on Subject: below --
2010-08-10 10:59 Masayuki Ohtak
2010-08-10 17:08 ` Greg KH

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=20100903134827.GA7614@rakim.wolfsonmicro.main \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=akpm@linux-foundation.org \
    --cc=alek.du@intel.com \
    --cc=andrew.chih.howe.khor@intel.com \
    --cc=arjan@linux.intel.com \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masa-korg@dsn.okisemi.com \
    --cc=meego-dev@meego.com \
    --cc=morinaga526@dsn.okisemi.com \
    --cc=qi.wang@intel.com \
    --cc=randy.dunlap@oracle.com \
    --cc=richard.rojfors@mocean-labs.com \
    --cc=sameo@linux.intel.com \
    --cc=vapier@gentoo.org \
    --cc=yong.y.wang@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox