devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] of_i2c: I2C child node 10-bit client addressing
@ 2013-01-13  3:03 Stephen Warren
  0 siblings, 0 replies; 8+ messages in thread
From: Stephen Warren @ 2013-01-13  3:03 UTC (permalink / raw)
  To: Bharat Kumar Reddy Gooty,
	Grant Likely (grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org)
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org

FYI, re:

> https://lists.ozlabs.org/pipermail/devicetree-discuss/2012-November/022645.html

I know that was a long time ago, but I was searching for information on
which chips supported 10-bit I2C addresses, and found a partial answer
to the question:

Grant Likely wrote:
> Is it possible for a device to have an address that fits in the first 7
> bits, but still requires 10 bit address transactions?

The following chip (link below) certainly supports a 10-bit I2C address
with the top-most 3 bits set to 0. Now, it does also respond to a 7-bit
I2C address of the same value, so this perhaps isn't quite an exact
answer to Grant's question. However, it does indicate to me that we
shouldn't determine whether to use 7- or 10-bit addresses solely from
the set bits in the I2C address; a separate property or flag bit in the
address field would be better, I think.

http://www.ti.com/lit/ds/snvs839/snvs839.pdf

Quoting it:

> 7-BIT and 10-BIT ADDRESSING MODES
>
> The LM8330 supports both the 7-bit and 10-bit addressing modes as defined in the NXP (Philips) I 2 C
> Specification UM10204 rev 0.3 from 2007. The default 7-bit slave address is 0x88, and the default 10-bit slave
> address is 0x088. NOTE: The upper three address bits in 10-bit mode are hard tied to 0.

^ permalink raw reply	[flat|nested] 8+ messages in thread
* [PATCH] of_i2c: I2C child node 10-bit client addressing
@ 2012-11-15  9:35 bharat_404-PkbjNfxxIARBDgjK7y7TUQ
       [not found] ` <1352972157-21299-1-git-send-email-bharat_404-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: bharat_404-PkbjNfxxIARBDgjK7y7TUQ @ 2012-11-15  9:35 UTC (permalink / raw)
  To: glikely-s3s/WqlpOiPyB63q8FvJNQ,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ
  Cc: bharat_404-PkbjNfxxIARBDgjK7y7TUQ,
	jonsmirl-Re5JQEeQqe8AvxtiuMwx3w

From: Bharat Kumar Reddy <bharat_404-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org>

I2C clients which has 10 bit address, struct i2c_board_info,
member "flags = I2C_CLIENT_TEN" is needed.

Signed-off-by: Bharat Kumar Reddy <bharat_404-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org>

diff --git a/drivers/of/of_i2c.c b/drivers/of/of_i2c.c
index 3550f3b..28c5566 100644
--- a/drivers/of/of_i2c.c
+++ b/drivers/of/of_i2c.c
@@ -57,6 +57,10 @@ void of_i2c_register_devices(struct i2c_adapter *adap)
 			continue;
 		}
 
+		/* Support for i2c 10 bit client address */
+		if ((info.addr > (1 << 7) - 1) && (info.addr <= (1 << 10) - 1))
+			info.flags = I2C_CLIENT_TEN;
+
 		info.irq = irq_of_parse_and_map(node, 0);
 		info.of_node = of_node_get(node);
 		info.archdata = &dev_ad;
-- 
1.7.6

^ permalink raw reply related	[flat|nested] 8+ messages in thread
* [PATCH] of_i2c: I2C child node 10-bit client addressing
@ 2012-10-12  3:42 Bharat Reddy
       [not found] ` <BLU002-W134A2F0BA0EF1C3BF8E491EAC8C0-MsuGFMq8XAE@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Bharat Reddy @ 2012-10-12  3:42 UTC (permalink / raw)
  To: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
  Cc: jonsmirl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, Bharat Reddy


[-- Attachment #1.1: Type: text/plain, Size: 935 bytes --]

I2C clients which has 10 bit address, struct i2c_board_info,
member "flags = I2C_CLIENT_TEN" is needed.

Signed-off-by: Bharat Kumar Reddy Gooty <bharat_404-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org>
---
 drivers/of/of_i2c.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/of/of_i2c.c b/drivers/of/of_i2c.c
index 1e173f3..9cda7e2 100644
--- a/drivers/of/of_i2c.c
+++ b/drivers/of/of_i2c.c
@@ -57,6 +57,10 @@ void of_i2c_register_devices(struct i2c_adapter *adap)
                        continue;
                }   
 
+               /* Support for i2c 10 bit client address */
+               if ((info.addr > (1 << 7) - 1) && (info.addr <= (1 << 10) - 1))
+                       info.flags = I2C_CLIENT_TEN;
+
                info.irq = irq_of_parse_and_map(node, 0); 
                info.of_node = of_node_get(node);
                info.archdata = &dev_ad;
-- 
1.7.9.5


 		 	   		  

[-- Attachment #1.2: Type: text/html, Size: 1919 bytes --]

[-- Attachment #2: Type: text/plain, Size: 192 bytes --]

_______________________________________________
devicetree-discuss mailing list
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
https://lists.ozlabs.org/listinfo/devicetree-discuss

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-01-13  3:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-13  3:03 [PATCH] of_i2c: I2C child node 10-bit client addressing Stephen Warren
  -- strict thread matches above, loose matches on Subject: below --
2012-11-15  9:35 bharat_404-PkbjNfxxIARBDgjK7y7TUQ
     [not found] ` <1352972157-21299-1-git-send-email-bharat_404-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org>
2012-11-15 16:53   ` Grant Likely
     [not found]     ` <CACxGe6uSWy0-qZ3qYk5kfZzkxuyeZn0HMuzz+UU=6bGtGds1Hw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-11-16 13:12       ` Bharat Reddy
     [not found]         ` <BLU002-W228A2064248B1A622AA97D6AC510-MsuGFMq8XAE@public.gmane.org>
2012-11-16 14:09           ` Grant Likely
2012-10-12  3:42 Bharat Reddy
     [not found] ` <BLU002-W134A2F0BA0EF1C3BF8E491EAC8C0-MsuGFMq8XAE@public.gmane.org>
2012-11-14 16:27   ` Grant Likely
2012-11-14 16:30   ` Grant Likely

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).