The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: "Par-Gunnar Hjalmdahl" <par-gunnar.p.hjalmdahl@stericsson.com>
Cc: "Greg Kroah-Hartman" <gregkh@suse.de>,
	devel@driverdev.osuosl.org,
	Linus Walleij <linus.walleij@linaro.org>,
	linux-kernel@vger.kernel.org, linux-bluetooth@vger.kernel.org,
	Pavan Savoy <pavan_savoy@sify.com>,
	Vitaly Wool <vitalywool@gmail.com>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Marcel Holtmann <marcel@holtmann.org>,
	Lukasz Rymanowski <Lukasz.Rymanowski@tieto.com>,
	Linus Walleij <linus.walleij@stericsson.com>,
	"Par-Gunnar Hjalmdahl" <pghatwork@gmail.com>,
	Lee Jones <lee.jones@linaro.org>
Subject: Re: [PATCH 2/2] mach-ux500: Add CG2900 devices
Date: Wed, 23 Mar 2011 15:42:28 +0100	[thread overview]
Message-ID: <201103231542.28311.arnd@arndb.de> (raw)
In-Reply-To: <1300888803-26474-1-git-send-email-par-gunnar.p.hjalmdahl@stericsson.com>

On Wednesday 23 March 2011, Par-Gunnar Hjalmdahl wrote:

> This patch adds the board specific data for the CG2900
> driver on a UX500 board.

Thanks for the follow-up in staging. I hope this will make the work
of getting this driver into shape done more easily as we have a
code base to discuss.

> diff --git a/arch/arm/mach-ux500/Makefile b/arch/arm/mach-ux500/Makefile
> index b549a8f..47c92fa 100644
> --- a/arch/arm/mach-ux500/Makefile
> +++ b/arch/arm/mach-ux500/Makefile
> @@ -2,6 +2,9 @@
>  # Makefile for the linux kernel, U8500 machine.
>  #
>  
> +ccflags-y :=					\
> +	-Idrivers/staging/cg2900/include
> +
>  obj-y				:= clock.o cpu.o devices.o devices-common.o \
>  				   id.o usb.o

Could we keep this more self-contained? Just register a
single device with the necessary resources and let the
staging driver figure out how to initialize it, rather
than splitting it between mach-ux500 and drivers/staging.

> +#ifdef CONFIG_CG2900
> +#define CG2900_BT_ENABLE_GPIO		170
> +#define CG2900_GBF_ENA_RESET_GPIO	171
> +#define CG2900_BT_CTS_GPIO		0

Don't make hardware definitions depending on Kconfig symbols.
Just describe what the hardware looks like if present, and
let the board code figure out if it's actually there.

> +static struct platform_device ux500_cg2900_device = {
> +	.name = "cg2900",
> +};
> +
> +#ifdef CONFIG_CG2900_CHIP
> +static struct platform_device ux500_cg2900_chip_device = {
> +	.name = "cg2900-chip",
> +	.dev = {
> +		.parent = &ux500_cg2900_device.dev,
> +	},
> +};
> +#endif /* CONFIG_CG2900_CHIP */
> +
> +#ifdef CONFIG_STLC2690_CHIP
> +static struct platform_device ux500_stlc2690_chip_device = {
> +	.name = "stlc2690-chip",
> +	.dev = {
> +		.parent = &ux500_cg2900_device.dev,
> +	},
> +};
> +#endif /* CONFIG_STLC2690_CHIP */
> +
> +#ifdef CONFIG_CG2900_TEST
> +static struct cg2900_platform_data cg2900_test_platform_data = {
> +	.bus = HCI_VIRTUAL,
> +	.gpio_sleep = cg2900_sleep_gpio,
> +};

Also, don't make the device registration dependent on the Kconfig.
Make sure that the hardware is there by asking the hardware, then
register it, even if we don't compile the driver using it.

I assume that this would get much simpler if you register everything
from the .probe function of the main "cg2900" device.

> diff --git a/arch/arm/mach-ux500/devices-cg2900.c b/arch/arm/mach-ux500/devices-cg2900.c
> new file mode 100644
> index 0000000..525c871
> --- /dev/null
> +++ b/arch/arm/mach-ux500/devices-cg2900.c

As far as I can tell, everything in this file can simply become part of the
staging driver. I'm fine with basically anything that compiles going into
drivers/staging, but we should keep the platform code outside of staging
clean of stuff that might have to change as part of the staging process.

	Arnd

  parent reply	other threads:[~2011-03-23 14:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-23 14:00 [PATCH 2/2] mach-ux500: Add CG2900 devices Par-Gunnar Hjalmdahl
2011-03-23 14:27 ` Greg KH
2011-03-23 14:35   ` Par-Gunnar HJALMDAHL
2011-03-23 17:55   ` Linus Walleij
2011-03-24 11:45     ` Par-Gunnar HJALMDAHL
2011-03-23 14:42 ` Arnd Bergmann [this message]
2011-03-23 16:08   ` Par-Gunnar HJALMDAHL
2011-03-23 16:13     ` Arnd Bergmann

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=201103231542.28311.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=Lukasz.Rymanowski@tieto.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@suse.de \
    --cc=lee.jones@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=par-gunnar.p.hjalmdahl@stericsson.com \
    --cc=pavan_savoy@sify.com \
    --cc=pghatwork@gmail.com \
    --cc=vitalywool@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