From: Mark Brown on
On Mon, Jun 14, 2010 at 12:32:37PM +0200, Luotao Fu wrote:

> +static struct gpio_chip gpio_chip = {
> + .label = STMPE811_GPIO_NAME,
> + .owner = THIS_MODULE,
> + .direction_input = stmpe811_gpio_direction_in,
> + .get = stmpe811_gpio_get,
> + .direction_output = stmpe811_gpio_direction_out,
> + .set = stmpe811_gpio_set,
> + .request = stmpe811_gpio_request,
> + .can_sleep = 1,
> +};

Assuming you're able to do interrupts on the GPIOs you should now be
able to implement to_irq() as well.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Luotao Fu on
Hi Mark,

thaks for the review.

On Mon, Jun 14, 2010 at 12:51:23PM +0100, Mark Brown wrote:
> On Mon, Jun 14, 2010 at 12:32:37PM +0200, Luotao Fu wrote:
>
> > +static struct gpio_chip gpio_chip = {
> > + .label = STMPE811_GPIO_NAME,
> > + .owner = THIS_MODULE,
> > + .direction_input = stmpe811_gpio_direction_in,
> > + .get = stmpe811_gpio_get,
> > + .direction_output = stmpe811_gpio_direction_out,
> > + .set = stmpe811_gpio_set,
> > + .request = stmpe811_gpio_request,
> > + .can_sleep = 1,
> > +};
>
> Assuming you're able to do interrupts on the GPIOs you should now be
> able to implement to_irq() as well.

The chip can indeed generate irqs on the GPIO line. I, however, kept out
the irq stuff for now because i want to get the core functionalies done
for this turn. I'd like to add the irq stuff with a separate patch later.

Thanks

cheers
Luotao Fu
--
Pengutronix e.K. | Dipl.-Ing. Luotao Fu |
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 |
From: Mark Brown on
On Mon, Jun 14, 2010 at 02:09:43PM +0200, Luotao Fu wrote:
> On Mon, Jun 14, 2010 at 12:51:23PM +0100, Mark Brown wrote:

> > Assuming you're able to do interrupts on the GPIOs you should now be
> > able to implement to_irq() as well.

> The chip can indeed generate irqs on the GPIO line. I, however, kept out
> the irq stuff for now because i want to get the core functionalies done
> for this turn. I'd like to add the irq stuff with a separate patch later.

It should be a trivial function - it just does a mapping from a GPIO
number to an IRQ number.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Luotao Fu on
Hi Mark,
On Mon, Jun 14, 2010 at 01:13:49PM +0100, Mark Brown wrote:
> On Mon, Jun 14, 2010 at 02:09:43PM +0200, Luotao Fu wrote:
> > On Mon, Jun 14, 2010 at 12:51:23PM +0100, Mark Brown wrote:
>
> > > Assuming you're able to do interrupts on the GPIOs you should now be
> > > able to implement to_irq() as well.
>
> > The chip can indeed generate irqs on the GPIO line. I, however, kept out
> > the irq stuff for now because i want to get the core functionalies done
> > for this turn. I'd like to add the irq stuff with a separate patch later.
>
> It should be a trivial function - it just does a mapping from a GPIO
> number to an IRQ number.

right, to_irq is simple. However, there're some more stuff necessary for
gpio irq on this chip, since it has separate registers for GPIO
interrupt control and status. A further gpio chip might be needed
needed to get the stuff done. Hence I'd like to push out the most
importatn core funcationalities out for the first turn before I take a
deeper look into other stuffs.

thanks

cheers
Luotao Fu

--
Pengutronix e.K. | Dipl.-Ing. Luotao Fu |
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 |
From: Mark Brown on
On Mon, Jun 14, 2010 at 02:28:53PM +0200, Luotao Fu wrote:

> right, to_irq is simple. However, there're some more stuff necessary for
> gpio irq on this chip, since it has separate registers for GPIO
> interrupt control and status. A further gpio chip might be needed
> needed to get the stuff done. Hence I'd like to push out the most
> importatn core funcationalities out for the first turn before I take a
> deeper look into other stuffs.

Ah, right - that makes sense. I'd have expected it to have just flopped
out of haiving working IRQ support in the core.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/