linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: pghatwork@gmail.com
Cc: linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org,
	linus.walleij@stericsson.com, Pavan Savoy <pavan_savoy@sify.com>
Subject: Re: [PATCH 1/6] This patch adds support for the ST-Ericsson CG2900
Date: Fri, 24 Sep 2010 15:10:46 +0100	[thread overview]
Message-ID: <20100924141046.GA26454@sirena.org.uk> (raw)
In-Reply-To: <AANLkTin9Qji_bdyd3yqrP_-ti5xRT9jJ4je2fPM=uHFX@mail.gmail.com>

On Fri, Sep 24, 2010 at 03:46:44PM +0200, Par-Gunnar Hjalmdahl wrote:

> +#ifndef PIN_INPUT_PULLUP
> +#define PIN_INPUT_PULLUP		(PIN_DIR_INPUT | PIN_PULL_UP)
> +#endif
> +
> +#ifndef GPIO_LOW
> +#define GPIO_LOW			0
> +#endif
> +
> +#ifndef GPIO_HIGH
> +#define GPIO_HIGH			1
> +#endif
> +
> +#ifndef GPIO_TO_IRQ
> +#define GPIO_TO_IRQ			NOMADIK_GPIO_TO_IRQ
> +#endif

None of this looks like things that should be added in driver code -
there should be standard ways of doing this stuff that you should use
and if there aren't and they are useful they should be added in generic
code so that other code can use them.

> +/** BT_ENABLE_GPIO - GPIO to enable/disable the BT module.
> + */
> +#define BT_ENABLE_GPIO			170

This sort of thing should be passed in from the board configuration
normallly.

> +void cg2900_devices_enable_chip(void)
> +{
> +	gpio_set_value(GBF_ENA_RESET_GPIO, GPIO_HIGH);
> +}
> +EXPORT_SYMBOL(cg2900_devices_enable_chip);

This looks like something that the driver should be organising rather
than something that should be exported for some random code to pick up?
In general most of the code in here looks like it should have more
device model usage and make more use of standard kernel infrastructure.

> +static irqreturn_t cg2900_devices_interrupt(int irq, void *dev_id)
> +{
> +	disable_irq_nosync(irq);
> +	if (cg2900_dev_callback && cg2900_dev_callback->interrupt_cb)
> +		cg2900_dev_callback->interrupt_cb();
> +
> +	return IRQ_HANDLED;
> +}

Why is there this callback mechanism - I'd expect the users of this code
to just be using the standard IRQ infrastructure?

  reply	other threads:[~2010-09-24 14:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-24 13:46 [PATCH 1/6] This patch adds support for the ST-Ericsson CG2900 Par-Gunnar Hjalmdahl
2010-09-24 14:10 ` Mark Brown [this message]
2010-09-24 14:44   ` Par-Gunnar Hjalmdahl
2010-09-27  8:16   ` Par-Gunnar Hjalmdahl
2010-09-27 15:15     ` Mark Brown

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=20100924141046.GA26454@sirena.org.uk \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavan_savoy@sify.com \
    --cc=pghatwork@gmail.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;
as well as URLs for NNTP newsgroup(s).