From: "Richard Röjfors" <richard.rojfors-gfIc91nka+FZroRs9YW3xA@public.gmane.org>
To: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>,
Andrew Morton
<akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
Subject: Re: [PATCH RESEND 1/1] i2c: Add support for Xilinx XPS IIC Bus Interface
Date: Tue, 26 Jan 2010 16:29:06 +0100 [thread overview]
Message-ID: <4B5F0A42.6060401@pelagicore.com> (raw)
In-Reply-To: <20100126144402.GE12774-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org>
Ben Dooks wrote:
> On Sun, Jan 24, 2010 at 06:33:20PM +0100, Richard R?jfors wrote:
>>
>>>> +
>>>> +#define XIIC_MSB_OFFSET 0
>>>> +#define XIIC_REG_OFFSET (0x100+XIIC_MSB_OFFSET)
>>> givevn you're running everything through indirect read/write calls,
>>> how about doing it in there?
>> Could do, bad thing is that it would add in an addition during runtime
>> rather than having the C preprocessor doing it.
>>
>> I think I would like to leave it as is.
>>
>> What do you think?
>
> Compilers aren't that stupid nowadays, they can generally sort this
> thing out at compile time, esepcially with inline code. Try it and
> see what happens...
If a constant value needs to be added to the sum of two input parameters of a function, I don's see
any option for the compiler but add it runtime.
>>>> +
>>>> + /* add in known devices to the bus */
>>>> + for (i = 0; i < pdata->num_devices; i++)
>>>> + i2c_new_device(&i2c->adap, pdata->devices + i);
>>> wouldn't i2c_register_board_info() do the job for you too?
>> No actually not, we had a discussion about this like 6-9 months ago,
>> when I posted the similar solution as a patch to ocores. Problem is that
>> we don't know the bus number in advance and in theory several boards
>> containing the I2C bus could in theory show up.
>> I would like to see the same solution here.
>
> Sorry, you've just registered the bus so should now know the number?
Ahh, you mean to call i2c_register_board_info in here after the i2c_add_adapter call?
The boardinfo list is only checked when adding the adapter. Adding the boardinfo afterwards has no
effect.
A second problem would be that every time we probe we would append the same boardinfo again... (the
device could be removed and come back).
We can not do the register_board_info before adding the adapter because then we don't know the bus
number.
--Richard
next prev parent reply other threads:[~2010-01-26 15:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-19 16:01 [PATCH RESEND 1/1] i2c: Add support for Xilinx XPS IIC Bus Interface Richard Röjfors
[not found] ` <4B55D74C.2010806-gfIc91nka+FZroRs9YW3xA@public.gmane.org>
2010-01-24 15:49 ` Ben Dooks
[not found] ` <20100124154930.GE28675-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org>
2010-01-24 17:33 ` Richard Röjfors
[not found] ` <4B5C8460.2040309-gfIc91nka+FZroRs9YW3xA@public.gmane.org>
2010-01-24 18:15 ` Wolfram Sang
[not found] ` <20100124181526.GB25641-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2010-01-24 18:54 ` Jean Delvare
2010-01-24 19:08 ` Peter Korsgaard
2010-01-26 14:44 ` Ben Dooks
2010-01-26 14:44 ` Ben Dooks
[not found] ` <20100126144402.GE12774-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org>
2010-01-26 15:29 ` Richard Röjfors [this message]
[not found] ` <4B5F0A42.6060401-gfIc91nka+FZroRs9YW3xA@public.gmane.org>
2010-01-28 15:49 ` Richard Röjfors
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=4B5F0A42.6060401@pelagicore.com \
--to=richard.rojfors-gfic91nka+fzrors9yw3xa@public.gmane.org \
--cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
--cc=ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org \
--cc=khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@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.