From: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
To: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Cc: Linux I2C <linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"Jeffrey (Sheng-Hui) Chu"
<jeffchu-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
Subject: Re: 10-bit address support
Date: Wed, 16 Nov 2011 15:56:10 +0100 [thread overview]
Message-ID: <20111116155610.6b02aab6@endymion.delvare> (raw)
In-Reply-To: <20111111104335.GC2493-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Hi Wolfram,
On Fri, 11 Nov 2011 11:43:35 +0100, Wolfram Sang wrote:
> > I can think of 2 different ways of addressing the problem.
> >
> > First way is to use a different device name format for 10-bit address
> > devices, for example %d-10bit-%04x. This has the drawback that some
> > user-space applications and libraries may not recognize these as valid
> > i2c device names. libsensors and sensors-detect would be amongst these.
>
> Wouldn't the cleanest solution be
>
> "%d-%02x" for 7 bit
> "%d-%04x" for 10 bit?
I'd rather use %03x for 10-bit then, for consistency.
> Yeah, I know that would really break userspace.
Yes indeed. While it wouldn't break libsensors (which uses sscanf
"%hd-%x" to parse the fields), it would break at least sensors-detect,
which really expects 4 hex digits in the sysfs name. This would
definitely be a change in the user-space interface anyway, who knows
which other tools would be affected.
Your solution was elegant (although it has its own drawbacks, such as
leaving it to every library and application to come up with a creative
way to handle and store 10-bit addresses separately from 7-bit addresses
internally), but unfortunately it would have had to be implemented in
the early days, not 8 years later.
> > I'd rather go with a larger offset such as 0x1000. This translates 0x2d
> > to 0x102d which is more obviously "10-bit address 0x2d". We have 16
> > bits to store the address so it shouldn't be an issue. Another possible
> > offset would be 0xa000 (as 0xa is 10.)
>
> I like 0xa000 a tad better than 0x1000, but well... Then again, those
> devices are probably rare enough to take a non-intrusive approach.
Yes I agree, we really want to leave 7-bit addresses unaffected by the
change.
0xa000 is not more intrusive than 0x1000, so if the majority - i.e.
you ;) - is in favor of this, that's fine with me. I'll send a patch
later today.
Thanks,
--
Jean Delvare
next prev parent reply other threads:[~2011-11-16 14:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-10 15:07 10-bit address support Jean Delvare
[not found] ` <20111110160739.540cda37-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2011-11-10 15:58 ` Jeffrey (Sheng-Hui) Chu
[not found] ` <B6A520E9CD57404AAFC0831E4FB39541AE68602AD7-4wnuKdaqIVJdD26/7+am4baTQr+y5IJFqs7JOtOhHmkAvxtiuMwx3w@public.gmane.org>
2011-11-10 16:33 ` Jean Delvare
[not found] ` <20111110173300.3f75d2db-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2011-11-10 16:38 ` Jeffrey (Sheng-Hui) Chu
2011-11-11 10:43 ` Wolfram Sang
[not found] ` <20111111104335.GC2493-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2011-11-16 14:56 ` Jean Delvare [this message]
[not found] ` <20111116155610.6b02aab6-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2011-11-16 15:04 ` Wolfram Sang
[not found] ` <20111116150449.GG2596-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2011-11-16 15:22 ` Jean Delvare
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=20111116155610.6b02aab6@endymion.delvare \
--to=khali-puyad+kwke1g9huczpvpmw@public.gmane.org \
--cc=jeffchu-dY08KVG/lbpWk0Htik3J/w@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox