[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200810212122.49121.david-b@pacbell.net>
Date: Tue, 21 Oct 2008 21:22:48 -0700
From: David Brownell <david-b@...bell.net>
To: benh@...nel.crashing.org, avorontsov@...mvista.com
Cc: linux-kernel@...r.kernel.org, linuxppc-dev@...abs.org,
i2c@...sensors.org, Jean Delvare <khali@...ux-fr.org>,
David Miller <davem@...emloft.net>
Subject: Re: [PATCH 4/7] gpiolib: implement dev_gpiochip_{add,remove} calls
On Tuesday 21 October 2008, Benjamin Herrenschmidt wrote:
> The notifier can be registered before the devices, though it's a little
> bit fishy and fragile.
>
> Easier I suppose to just have OF specific hooks in the bus code.
Like what I suggested: "chip-aware OF glue drivers". The relevant
bus code being the "of_platform_bus_type" infrastructure.
Example: instead of Anton's patch #6 modifying the existing pca953x
driver, an of_pca953x driver that knows how to poke around in the OF
device attributes to (a) create the pca953x_platform_data, (b) call
i2c_register_board_info() to make that available later, and then
finally (c) vanish, since it's not needed any longer.
Better that than either the $SUBJECT patch, or modifying gpiolib to
grow OF-specific hooks ... hooks that can at best solve *one* of the
problems: which GPIO numbers to use with this chip. The platform
data does solve other problems(*) like: (i) how to initialize the
polarity inversion register, (ii) arranging to set up other devices
only after their GPIOs are ready, (iii) initializing things that
device drivers won't always know about, or which may need to be
set up before such drivers are available.
- Dave
(*) A trivial example of (ii) would be LEDs driven by those GPIOs.
A less trivial example: see arch/arm/mach-davinci/board-evm.c
in current GIT. There are three pcf8574 I2C expanders used for
various things ... LEDs, audio PLL, device power supplies, reset
lines for external devices, more.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists