From: Felix Radensky <felix-L1vi/lXTdtvUXIAPrk8Z/A@public.gmane.org>
To: giometti-k2GhghHVRtY@public.gmane.org,
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
Subject: Re: [PATCH 1/3] i2c: virtual i2c adapter support
Date: Sun, 26 Oct 2008 23:53:55 +0200 [thread overview]
Message-ID: <4904E6F3.50609@embedded-sol.com> (raw)
Hi, Rodolfo
I've tried your patches with linux-2.6.27 kernel running
on custom board with 460EX PowerPC. This board has
two i2c buses and pca9548 switch on bus 0.
The 954x driver (compiled into the kernel) creates 8
virtual buses just fine. However devices behind the
mux are not detected if I use the "recommended" way
of doing things.
I have RTC (ds1338) and temp sensor (ds1625) on mux
channel 4 (i.e virtual bus 6). What I did initially to add
the following code to board init code:
struct board_i2c_info {
int bus;
int addr;
char *id;
};
static struct board_i2c_info board_i2c_devices[] = {
/* Bus Addr ID */
{6, 0x68, "ds1338"},
{6, 0x49, "ds1625"},
};
static int board_i2c_init(void)
{
int i;
for (i = 0; i < ARRAY_SIZE(board_i2c_devices); i++) {
struct i2c_board_info info = {};
info.irq = -1;
info.addr = board_i2c_devices[i].addr;
if (strlcpy(info.type, board_i2c_devices[i].id,
I2C_NAME_SIZE) >= I2C_NAME_SIZE)
return -ENOMEM;
i2c_register_board_info(board_i2c_devices[i].bus, &info, 1);
}
}
arch_initcall(board_i2c_init);
This code is invoked by kernel before i2c bus and mux detection,
but, as I said, RTC and sensor are not identified.
If I invoke the following code after creation of virtual
adapters, things start working, but I don't like this solution
static int board_i2c_init(void)
{
int i;
for (i = 0; i < ARRAY_SIZE(board_i2c_devices); i++) {
struct i2c_board_info info = {};
struct i2c_adapter *adap;
info.irq = -1;
info.addr = board_i2c_devices[i].addr;
if (strlcpy(info.type, board_i2c_devices[i].id,
I2C_NAME_SIZE) >= I2C_NAME_SIZE)
return -ENOMEM;
adap = i2c_get_adapter(board_i2c_devices[i].bus);
i2c_new_device(adap, &info);
}
}
My question is: how can I register board i2c devices behind
the mux in board init code, and make them properly identified
when relevant drivers are loaded.
Thanks a lot.
Felix.
_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c
next reply other threads:[~2008-10-26 21:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-26 21:53 Felix Radensky [this message]
[not found] ` <4904E6F3.50609-L1vi/lXTdtvUXIAPrk8Z/A@public.gmane.org>
2008-10-27 8:20 ` [PATCH 1/3] i2c: virtual i2c adapter support Rodolfo Giometti
2008-10-27 11:31 ` Felix Radensky
2008-10-27 11:31 ` Felix Radensky
[not found] ` <4905A68D.7040708-L1vi/lXTdtvUXIAPrk8Z/A@public.gmane.org>
2008-10-27 11:52 ` Rodolfo Giometti
-- strict thread matches above, loose matches on Subject: below --
2008-06-18 13:06 Rodolfo Giometti
[not found] ` <1213794365-8089-1-git-send-email-giometti-k2GhghHVRtY@public.gmane.org>
2008-06-18 19:00 ` Ben Dooks
[not found] ` <20080618190008.GK10351-SMNkleLxa3Z6Wcw2j4pizdi2O/JbrIOy@public.gmane.org>
2008-06-19 12:25 ` Rodolfo Giometti
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=4904E6F3.50609@embedded-sol.com \
--to=felix-l1vi/lxtdtvuxiaprk8z/a@public.gmane.org \
--cc=giometti-k2GhghHVRtY@public.gmane.org \
--cc=i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.