All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Mike Frysinger <vapier@gentoo.org>
Cc: linux-input@vger.kernel.org,
	uclinux-dist-devel@blackfin.uclinux.org,
	Michael Hennerich <michael.hennerich@analog.com>
Subject: Re: [PATCH v2] Input: ad7879: support auxiliary GPIOs via gpiolib
Date: Tue, 12 Jan 2010 18:54:56 -0800	[thread overview]
Message-ID: <20100113025456.GA2301@core.coreip.homeip.net> (raw)
In-Reply-To: <1263330297-1387-1-git-send-email-vapier@gentoo.org>

Hi Mike,

On Tue, Jan 12, 2010 at 04:04:57PM -0500, Mike Frysinger wrote:
> +
> +		err = gpiochip_add(&ts->gc);
> +		if (err)
> +			dev_err(&bus->dev, "failed to register gpio %d\n",
> +				ts->gc.base);
> +	}

So if it fails here...

> +	struct ad7879_platform_data *pdata = bus->dev.platform_data;
> +	if (pdata->gpio_export) {
> +		if (gpiochip_remove(&ts->gc))
> +			dev_err(&bus->dev, "failed to remove gpio %d\n",
> +				ts->gc.base);

... how valid is it to remove it here?

Also, could you stub out ad7879_gptiochip_export/ad7879_gptiochip_unexport
in case of !CONFIG_GPIOLIB?

> +	}
> +#endif
> +
>  	ad7879_disable(ts);
>  	sysfs_remove_group(&ts->bus->dev.kobj, &ad7879_attr_group);
>  	free_irq(ts->bus->irq, ts);
> diff --git a/include/linux/spi/ad7879.h b/include/linux/spi/ad7879.h
> index 4231104..7231eab 100644
> --- a/include/linux/spi/ad7879.h
> +++ b/include/linux/spi/ad7879.h
> @@ -28,8 +28,12 @@ struct ad7879_platform_data {
>  	 * 1 = 4, 2 = 8, 3 = 16 (median > averaging)
>  	 */
>  	u8	median;
> -	/* 1 = AUX/VBAT/GPIO set to GPIO Output */
> -	u8	gpio_output;
> -	/* Initial GPIO pin state (valid if gpio_output = 1) */
> -	u8	gpio_default;
> +	/* 1 = AUX/VBAT/GPIO export GPIO to gpiolib
> +	 * requires CONFIG_GPIOLIB
> +	 */
> +	u8	gpio_export;

And make this a bool while you are at it.

Thanks!

-- 
Dmitry

  reply	other threads:[~2010-01-13  2:55 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-07  7:18 [PATCH] Input: ad7879: support auxiliary GPIOs via gpiolib Mike Frysinger
2010-01-07  7:31 ` Dmitry Torokhov
2010-01-07 16:16   ` [Uclinux-dist-devel] " Robin Getz
2010-01-07 16:46     ` Mike Frysinger
2010-01-07 17:07       ` Dmitry Torokhov
2010-01-07 17:43         ` Robin Getz
2010-01-10  7:48           ` Dmitry Torokhov
2010-01-12 13:57             ` Hennerich, Michael
2010-01-12 21:04   ` [PATCH v2] " Mike Frysinger
2010-01-13  2:54     ` Dmitry Torokhov [this message]
2010-01-13  9:46       ` Hennerich, Michael
     [not found]         ` <8A42379416420646B9BFAC9682273B6D0F0DF094-pcKY8lWzTjquVPpjEGsWsTcYPEmu4y7e@public.gmane.org>
2010-01-14  6:24           ` Dmitry Torokhov
2010-01-17 15:36       ` [PATCH v3] " Mike Frysinger
2010-01-18  6:35         ` Dmitry Torokhov
2010-01-18  6:48           ` [Uclinux-dist-devel] " Mike Frysinger

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=20100113025456.GA2301@core.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=michael.hennerich@analog.com \
    --cc=uclinux-dist-devel@blackfin.uclinux.org \
    --cc=vapier@gentoo.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.