* i2c gpio expander on hotplug i2c-adapter
@ 2011-06-07 21:59 Hartmut Knaack
0 siblings, 0 replies; only message in thread
From: Hartmut Knaack @ 2011-06-07 21:59 UTC (permalink / raw)
To: linux-i2c-u79uwXL29TY76Z2rM5mHXA
Hi there,
I'm a bit puzzled. My desired setup is something like this: Linux
station => usb i2c-adapter (i2c tiny usb) => i2c switch (pca9548) => i2c
gpio expander (pca9555)
So far, instantiation works for the i2c switch using the sysfs method
(echo pca9548 0x70 > /sys/bus/i2c....). What's really causing me
troubles is instantiating the pca9555. What I found so far indicates
that it has to be defined in the machine specific file. So that is what
I already added:
static struct pca953x_platform_data pca9555_0 = {
.gpio_base = 32,
};
static struct i2c_board_info __initdata i2c_tiny_board_info[] = {
{
I2C_BOARD_INFO("pca9555",0x21),
.platform_data = &pca9555_0,
}
};
Now I'm struggling how to declare my i2c tiny usb adapter to be the bus
where the pca9555 should live on (leaving out the i2c switch for the
moment). What I tried so far did not work (obviously):
static struct platform_device i2c_tiny_usb_device = {
.name = "i2c-tiny-usb",
.id = 0,
};
static void __devinit i2c_tiny_usb_init(void)
{
i2c_register_board_info(0,i2c_tiny_board_info,
ARRAY_SIZE(i2c_tiny_board_info));
platform_device_register(&i2c_tiny_usb_device);
};
The i2c_tiny_usb_init() funciton gets called in the init section. It
compiles without errors, but with this kernel, the i2c-adapter now gets
registered as i2c-1. How would a proper declaration of that i2c-adapter
look like? Or would there even be a chance to do that instantiation from
a userspace program? I saw that the symbol "pca9555_0" is listed in the
system.map file of that kernel. So, would there even be a chance to just
declare the gpio platform data in the kernel and do the instantiation in
userspace?
Thanks in advance,
Hartmut
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-06-07 21:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-07 21:59 i2c gpio expander on hotplug i2c-adapter Hartmut Knaack
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).