On Mon, Aug 30, 2010 at 7:45 PM, Masayuki Ohtake
<masa-korg@dsn.okisemi.com> wrote:
Well, to start with, the registration code currently in
spi_pch_device.c is probably pretty much unusable for any platform
other than the development board that you're working on. Every
machine using the topcliff chip will have a different set of spi
devices attached to the bus. So, you'll need a method for having a
different set of registrations depending on the machine.
Traditionally with ARM systems, there is a separate .c file for each
machine (see arch/arm/mach-*/*.c) which registers the expected
devices. In PowerPC the spi devices are described in a device tree
file (arch/powerpc/boot/dts/*) which the kernel will parse and
register the devices it finds. x86 doesn't support either approach
because traditionally the kernel is either able to detect the
hardware, or it can get information from the BIOS (which doesn't work
for embedded x86).
The x86 maintainers want to adopt the device tree approach for
describing devices. Using device tree data in an spi bus driver is
easy. All that is required is to supply the of_node pointer to the
spi bus before registering it. Search for 'of_node' in
drivers/spi/mpc52xx_spi.c for an example. However, device tree
support is not yet available for x86, so there is still some
development that needs to be done.
Regardless, the topcliff spi driver can still be merged into mainline
without the spi_device registration code, and you can keep your
personal copy of spi_pch_device.c for testing while the details about
device tree support for x86 get worked out.
g.
--