All of lore.kernel.org
 help / color / mirror / Atom feed
* OMAP: send i2c message ignoring NAK
@ 2012-07-03  8:12 Yegor Yefremov
       [not found] ` <CAGm1_ktL96X7kF3tvKErtirwnL7FGU=zGe+EyhX4GcUkZUeSkQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Yegor Yefremov @ 2012-07-03  8:12 UTC (permalink / raw)
  To: Linux I2C; +Cc: shubhrajyoti-l0cyMroinI0, balbi-l0cyMroinI0

I'm using the second i2c channel to connect to HDMI transmitter
sii9022a. In order to get EDID information from the attached monitor
the sii9022a chip passes i2c request direct to the monitors i2c bus.
To return to sii9022a mode one has to write data to HDMI transmitter,
but this data won't be acknowledged. Because of this i2c produces
timeout permanently (omap_i2c omap_i2c.2: controller timed out), so no
communication is possible. The last bits I see on the scope are the
i2c address of sii9022a. The CPU automatically end the transfer.

The HDMI chip has i2c address 0x72 (8-bit notation) and EDID channel
0xa0 (8-bit notation). AFAIK there is only one device at a time on the
bus, i.e. as soon as I switch sii9022a to access monitor only 0xa0
responds to the queries. And I need to send a message to 0x72 ignoring
normal i2c conditions in order to turn it back in normal mode.

The driver for this HDMI transmitter can be found here:
http://gitorious.org/efikamx/linux-kernel.git
(drivers/video/mxc/siihdmi.c)

How can I send this write request without awaiting for ACK?

Yegor

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

* Re: OMAP: send i2c message ignoring NAK
       [not found] ` <CAGm1_ktL96X7kF3tvKErtirwnL7FGU=zGe+EyhX4GcUkZUeSkQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2012-07-03  8:32   ` Jean Delvare
       [not found]     ` <20120703103221.62fcb7ae-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Jean Delvare @ 2012-07-03  8:32 UTC (permalink / raw)
  To: Yegor Yefremov; +Cc: Linux I2C, shubhrajyoti-l0cyMroinI0, balbi-l0cyMroinI0

On Tue, 3 Jul 2012 10:12:09 +0200, Yegor Yefremov wrote:
> I'm using the second i2c channel to connect to HDMI transmitter
> sii9022a. In order to get EDID information from the attached monitor
> the sii9022a chip passes i2c request direct to the monitors i2c bus.
> To return to sii9022a mode one has to write data to HDMI transmitter,
> but this data won't be acknowledged. Because of this i2c produces
> timeout permanently (omap_i2c omap_i2c.2: controller timed out), so no
> communication is possible. The last bits I see on the scope are the
> i2c address of sii9022a. The CPU automatically end the transfer.
> 
> The HDMI chip has i2c address 0x72 (8-bit notation) and EDID channel
> 0xa0 (8-bit notation). AFAIK there is only one device at a time on the
> bus, i.e. as soon as I switch sii9022a to access monitor only 0xa0
> responds to the queries. And I need to send a message to 0x72 ignoring
> normal i2c conditions in order to turn it back in normal mode.
> 
> The driver for this HDMI transmitter can be found here:
> http://gitorious.org/efikamx/linux-kernel.git
> (drivers/video/mxc/siihdmi.c)
> 
> How can I send this write request without awaiting for ACK?

Use I2C_M_IGNORE_NAK, see Documentation/i2c/i2c-protocol.

-- 
Jean Delvare

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

* Re: OMAP: send i2c message ignoring NAK
       [not found]     ` <20120703103221.62fcb7ae-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
@ 2012-07-10 14:59       ` Yegor Yefremov
       [not found]         ` <CAGm1_kvBerv_Ot-NX2+ozZT3y+h4ECzwb-MM0-v=3M9aRRznzA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Yegor Yefremov @ 2012-07-10 14:59 UTC (permalink / raw)
  To: Jean Delvare; +Cc: Linux I2C, shubhrajyoti-l0cyMroinI0, balbi-l0cyMroinI0

On Tue, Jul 3, 2012 at 10:32 AM, Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org> wrote:
> On Tue, 3 Jul 2012 10:12:09 +0200, Yegor Yefremov wrote:
>> I'm using the second i2c channel to connect to HDMI transmitter
>> sii9022a. In order to get EDID information from the attached monitor
>> the sii9022a chip passes i2c request direct to the monitors i2c bus.
>> To return to sii9022a mode one has to write data to HDMI transmitter,
>> but this data won't be acknowledged. Because of this i2c produces
>> timeout permanently (omap_i2c omap_i2c.2: controller timed out), so no
>> communication is possible. The last bits I see on the scope are the
>> i2c address of sii9022a. The CPU automatically end the transfer.
>>
>> The HDMI chip has i2c address 0x72 (8-bit notation) and EDID channel
>> 0xa0 (8-bit notation). AFAIK there is only one device at a time on the
>> bus, i.e. as soon as I switch sii9022a to access monitor only 0xa0
>> responds to the queries. And I need to send a message to 0x72 ignoring
>> normal i2c conditions in order to turn it back in normal mode.
>>
>> The driver for this HDMI transmitter can be found here:
>> http://gitorious.org/efikamx/linux-kernel.git
>> (drivers/video/mxc/siihdmi.c)
>>
>> How can I send this write request without awaiting for ACK?
>
> Use I2C_M_IGNORE_NAK, see Documentation/i2c/i2c-protocol.

Jean, thanks for the tip. I got it working by disabling the omap-i2c
driver and enabling i2c-gpio on the same pins. Only in this
combination and I2C_M_IGNORE_NAK I could get back to the HDMI chip.
OMAP i2c driver/I2C_M_IGNORE_NAK combo is not working. But I still got
no chance to try the latest kernel.

Yegor

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

* Re: OMAP: send i2c message ignoring NAK
       [not found]         ` <CAGm1_kvBerv_Ot-NX2+ozZT3y+h4ECzwb-MM0-v=3M9aRRznzA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2012-07-10 15:08           ` Shubhrajyoti Datta
       [not found]             ` <CAM=Q2cv2yCEaxjSL45PSpf8k8pgMuhr88TJ-RWc0OW1GL+n6Dg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Shubhrajyoti Datta @ 2012-07-10 15:08 UTC (permalink / raw)
  To: Yegor Yefremov
  Cc: Jean Delvare, Linux I2C, shubhrajyoti-l0cyMroinI0, balbi-l0cyMroinI0

On Tue, Jul 10, 2012 at 8:29 PM, Yegor Yefremov
<yegorslists-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:
> On Tue, Jul 3, 2012 at 10:32 AM, Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org> wrote:
>> On Tue, 3 Jul 2012 10:12:09 +0200, Yegor Yefremov wrote:
>>> I'm using the second i2c channel to connect to HDMI transmitter
>>> sii9022a. In order to get EDID information from the attached monitor
>>> the sii9022a chip passes i2c request direct to the monitors i2c bus.
>>> To return to sii9022a mode one has to write data to HDMI transmitter,
>>> but this data won't be acknowledged. Because of this i2c produces
>>> timeout permanently (omap_i2c omap_i2c.2: controller timed out), so no
>>> communication is possible. The last bits I see on the scope are the
>>> i2c address of sii9022a. The CPU automatically end the transfer.
>>>
>>> The HDMI chip has i2c address 0x72 (8-bit notation) and EDID channel
>>> 0xa0 (8-bit notation). AFAIK there is only one device at a time on the
>>> bus, i.e. as soon as I switch sii9022a to access monitor only 0xa0
>>> responds to the queries. And I need to send a message to 0x72 ignoring
>>> normal i2c conditions in order to turn it back in normal mode.
>>>
>>> The driver for this HDMI transmitter can be found here:
>>> http://gitorious.org/efikamx/linux-kernel.git
>>> (drivers/video/mxc/siihdmi.c)
>>>
>>> How can I send this write request without awaiting for ACK?
>>
>> Use I2C_M_IGNORE_NAK, see Documentation/i2c/i2c-protocol.
>
> Jean, thanks for the tip. I got it working by disabling the omap-i2c
> driver and enabling i2c-gpio on the same pins. Only in this
> combination and I2C_M_IGNORE_NAK I could get back to the HDMI chip.
> OMAP i2c driver/I2C_M_IGNORE_NAK combo is not working. But I still got
> no chance to try the latest kernel.

OK may be you are missing patches like
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap.git;a=commit;h=464fca36d98b97ccd05e4f200ab7483d3acc8345

Personally will recommend the latest kernel.


>
> Yegor
> --
> To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: OMAP: send i2c message ignoring NAK
       [not found]             ` <CAM=Q2cv2yCEaxjSL45PSpf8k8pgMuhr88TJ-RWc0OW1GL+n6Dg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2012-07-11 16:23               ` Yegor Yefremov
       [not found]                 ` <CAGm1_kvLwj3iFz5M6zc+pitS_45OYPYw=aBU4bv8TdOhH600NA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Yegor Yefremov @ 2012-07-11 16:23 UTC (permalink / raw)
  To: Shubhrajyoti Datta; +Cc: Jean Delvare, Linux I2C, shubhrajyoti-l0cyMroinI0

On Tue, Jul 10, 2012 at 5:08 PM, Shubhrajyoti Datta
<omaplinuxkernel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> On Tue, Jul 10, 2012 at 8:29 PM, Yegor Yefremov
> <yegorslists-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:
>> On Tue, Jul 3, 2012 at 10:32 AM, Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org> wrote:
>>> On Tue, 3 Jul 2012 10:12:09 +0200, Yegor Yefremov wrote:
>>>> I'm using the second i2c channel to connect to HDMI transmitter
>>>> sii9022a. In order to get EDID information from the attached monitor
>>>> the sii9022a chip passes i2c request direct to the monitors i2c bus.
>>>> To return to sii9022a mode one has to write data to HDMI transmitter,
>>>> but this data won't be acknowledged. Because of this i2c produces
>>>> timeout permanently (omap_i2c omap_i2c.2: controller timed out), so no
>>>> communication is possible. The last bits I see on the scope are the
>>>> i2c address of sii9022a. The CPU automatically end the transfer.
>>>>
>>>> The HDMI chip has i2c address 0x72 (8-bit notation) and EDID channel
>>>> 0xa0 (8-bit notation). AFAIK there is only one device at a time on the
>>>> bus, i.e. as soon as I switch sii9022a to access monitor only 0xa0
>>>> responds to the queries. And I need to send a message to 0x72 ignoring
>>>> normal i2c conditions in order to turn it back in normal mode.
>>>>
>>>> The driver for this HDMI transmitter can be found here:
>>>> http://gitorious.org/efikamx/linux-kernel.git
>>>> (drivers/video/mxc/siihdmi.c)
>>>>
>>>> How can I send this write request without awaiting for ACK?
>>>
>>> Use I2C_M_IGNORE_NAK, see Documentation/i2c/i2c-protocol.
>>
>> Jean, thanks for the tip. I got it working by disabling the omap-i2c
>> driver and enabling i2c-gpio on the same pins. Only in this
>> combination and I2C_M_IGNORE_NAK I could get back to the HDMI chip.
>> OMAP i2c driver/I2C_M_IGNORE_NAK combo is not working. But I still got
>> no chance to try the latest kernel.
>
> OK may be you are missing patches like
> http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap.git;a=commit;h=464fca36d98b97ccd05e4f200ab7483d3acc8345

No, i don't.

> Personally will recommend the latest kernel.

To do that, I'll have to use device tree (there is no board file) and
I have no experience with this so far. So I'll have to postpone this
till am335x support stabilizes.

Yegor

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

* Re: OMAP: send i2c message ignoring NAK
       [not found]                 ` <CAGm1_kvLwj3iFz5M6zc+pitS_45OYPYw=aBU4bv8TdOhH600NA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2012-07-11 16:52                   ` Shubhrajyoti
       [not found]                     ` <4FFDAF5A.8070205-l0cyMroinI0@public.gmane.org>
  2012-07-11 16:52                   ` Shubhrajyoti
  1 sibling, 1 reply; 12+ messages in thread
From: Shubhrajyoti @ 2012-07-11 16:52 UTC (permalink / raw)
  To: Yegor Yefremov; +Cc: Shubhrajyoti Datta, Jean Delvare, Linux I2C

On Wednesday 11 July 2012 09:53 PM, Yegor Yefremov wrote:
>> OK may be you are missing patches like
>> > http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap.git;a=commit;h=464fca36d98b97ccd05e4f200ab7483d3acc8345
> No, i don't.
that's good.
>
>> > Personally will recommend the latest kernel.
> To do that, I'll have to use device tree (there is no board file) and
> I have no experience with this so far. So I'll have to postpone this
> till am335x support stabilizes.
I see.
Will check on this.

Thanks,
>
> Yegor

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

* Re: OMAP: send i2c message ignoring NAK
       [not found]                 ` <CAGm1_kvLwj3iFz5M6zc+pitS_45OYPYw=aBU4bv8TdOhH600NA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2012-07-11 16:52                   ` Shubhrajyoti
@ 2012-07-11 16:52                   ` Shubhrajyoti
  1 sibling, 0 replies; 12+ messages in thread
From: Shubhrajyoti @ 2012-07-11 16:52 UTC (permalink / raw)
  To: Yegor Yefremov; +Cc: Shubhrajyoti Datta, Jean Delvare, Linux I2C

On Wednesday 11 July 2012 09:53 PM, Yegor Yefremov wrote:
>> OK may be you are missing patches like
>> > http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap.git;a=commit;h=464fca36d98b97ccd05e4f200ab7483d3acc8345
> No, i don't.
that's good.
>
>> > Personally will recommend the latest kernel.
> To do that, I'll have to use device tree (there is no board file) and
> I have no experience with this so far. So I'll have to postpone this
> till am335x support stabilizes.
I see.
Will check on this.

Thanks,
>
> Yegor

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

* Re: OMAP: send i2c message ignoring NAK
       [not found]                     ` <4FFDAF5A.8070205-l0cyMroinI0@public.gmane.org>
@ 2012-07-12  5:24                       ` Datta, Shubhrajyoti
       [not found]                         ` <CANQgH-YxYY7M6o4Hxw0kq9=GSwF8TSgiobXLJoPnGhj=c3w4KQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Datta, Shubhrajyoti @ 2012-07-12  5:24 UTC (permalink / raw)
  To: Yegor Yefremov; +Cc: Shubhrajyoti Datta, Jean Delvare, Linux I2C

On Wed, Jul 11, 2012 at 10:22 PM, Shubhrajyoti <shubhrajyoti-l0cyMroinI0@public.gmane.org> wrote:
> On Wednesday 11 July 2012 09:53 PM, Yegor Yefremov wrote:
[...]
Yegor I have made a patch to ignore the NACK in the ISR let me know if
that helps you.


diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index 9895fa7..e13061f 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -476,6 +476,8 @@ static int omap_i2c_xfer_msg(struct i2c_adapter *adap,

 	if (msg->len == 0)
 		return -EINVAL;
+	if (msg->flags & I2C_M_IGNORE_NAK)
+		dev->flags |= OMAP_I2C_FLAG_NO_NAK;

 	omap_i2c_write_reg(dev, OMAP_I2C_SA_REG, msg->addr);

@@ -776,18 +778,26 @@ complete:
 				~(OMAP_I2C_STAT_RRDY | OMAP_I2C_STAT_RDR |
 				OMAP_I2C_STAT_XRDY | OMAP_I2C_STAT_XDR));

-		if (stat & OMAP_I2C_STAT_NACK)
+		if (stat & OMAP_I2C_STAT_NACK &&
+				!(dev->flags & OMAP_I2C_FLAG_NO_NAK)) {
 			err |= OMAP_I2C_STAT_NACK;
+			omap_i2c_ack_stat(dev, stat &
+				(OMAP_I2C_STAT_RRDY | OMAP_I2C_STAT_RDR |
+				OMAP_I2C_STAT_XRDY | OMAP_I2C_STAT_XDR |
+				OMAP_I2C_STAT_ARDY));
+			omap_i2c_complete_cmd(dev, err);
+			return IRQ_HANDLED;
+		}

 		if (stat & OMAP_I2C_STAT_AL) {
 			dev_err(dev->dev, "Arbitration lost\n");
 			err |= OMAP_I2C_STAT_AL;
 		}
+
 		/*
 		 * ProDB0017052: Clear ARDY bit twice
 		 */
-		if (stat & (OMAP_I2C_STAT_ARDY | OMAP_I2C_STAT_NACK |
-					OMAP_I2C_STAT_AL)) {
+		if (stat & (OMAP_I2C_STAT_ARDY | OMAP_I2C_STAT_AL)) {
 			omap_i2c_ack_stat(dev, stat &
 				(OMAP_I2C_STAT_RRDY | OMAP_I2C_STAT_RDR |
 				OMAP_I2C_STAT_XRDY | OMAP_I2C_STAT_XDR |
diff --git a/include/linux/i2c-omap.h b/include/linux/i2c-omap.h
index 92a0dc7..f386150 100644
--- a/include/linux/i2c-omap.h
+++ b/include/linux/i2c-omap.h
@@ -29,6 +29,7 @@
 #define OMAP_I2C_FLAG_BUS_SHIFT_1		BIT(7)
 #define OMAP_I2C_FLAG_BUS_SHIFT_2		BIT(8)
 #define OMAP_I2C_FLAG_BUS_SHIFT__SHIFT 7
+#define OMAP_I2C_FLAG_NO_NAK			BIT(9)

 struct omap_i2c_bus_platform_data {
 	u32		clkrate;

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

* Re: OMAP: send i2c message ignoring NAK
       [not found]                         ` <CANQgH-YxYY7M6o4Hxw0kq9=GSwF8TSgiobXLJoPnGhj=c3w4KQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2012-07-17  9:31                           ` Yegor Yefremov
       [not found]                             ` <CAGm1_ktYqq5HKt13RuQVL8axX0FUnZ_5a6va7BRuUschQRKERQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Yegor Yefremov @ 2012-07-17  9:31 UTC (permalink / raw)
  To: Datta, Shubhrajyoti; +Cc: Shubhrajyoti Datta, Jean Delvare, Linux I2C

On Thu, Jul 12, 2012 at 7:24 AM, Datta, Shubhrajyoti
<shubhrajyoti-l0cyMroinI0@public.gmane.org> wrote:
> On Wed, Jul 11, 2012 at 10:22 PM, Shubhrajyoti <shubhrajyoti-l0cyMroinI0@public.gmane.org> wrote:
>> On Wednesday 11 July 2012 09:53 PM, Yegor Yefremov wrote:
> [...]
> Yegor I have made a patch to ignore the NACK in the ISR let me know if
> that helps you.
>
>
> diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
> index 9895fa7..e13061f 100644
> --- a/drivers/i2c/busses/i2c-omap.c
> +++ b/drivers/i2c/busses/i2c-omap.c
> @@ -476,6 +476,8 @@ static int omap_i2c_xfer_msg(struct i2c_adapter *adap,
>
>         if (msg->len == 0)
>                 return -EINVAL;
> +       if (msg->flags & I2C_M_IGNORE_NAK)
> +               dev->flags |= OMAP_I2C_FLAG_NO_NAK;
>
>         omap_i2c_write_reg(dev, OMAP_I2C_SA_REG, msg->addr);
>
> @@ -776,18 +778,26 @@ complete:
>                                 ~(OMAP_I2C_STAT_RRDY | OMAP_I2C_STAT_RDR |
>                                 OMAP_I2C_STAT_XRDY | OMAP_I2C_STAT_XDR));
>
> -               if (stat & OMAP_I2C_STAT_NACK)
> +               if (stat & OMAP_I2C_STAT_NACK &&
> +                               !(dev->flags & OMAP_I2C_FLAG_NO_NAK)) {
>                         err |= OMAP_I2C_STAT_NACK;
> +                       omap_i2c_ack_stat(dev, stat &
> +                               (OMAP_I2C_STAT_RRDY | OMAP_I2C_STAT_RDR |
> +                               OMAP_I2C_STAT_XRDY | OMAP_I2C_STAT_XDR |
> +                               OMAP_I2C_STAT_ARDY));
> +                       omap_i2c_complete_cmd(dev, err);
> +                       return IRQ_HANDLED;
> +               }
>
>                 if (stat & OMAP_I2C_STAT_AL) {
>                         dev_err(dev->dev, "Arbitration lost\n");
>                         err |= OMAP_I2C_STAT_AL;
>                 }
> +
>                 /*
>                  * ProDB0017052: Clear ARDY bit twice
>                  */
> -               if (stat & (OMAP_I2C_STAT_ARDY | OMAP_I2C_STAT_NACK |
> -                                       OMAP_I2C_STAT_AL)) {
> +               if (stat & (OMAP_I2C_STAT_ARDY | OMAP_I2C_STAT_AL)) {
>                         omap_i2c_ack_stat(dev, stat &
>                                 (OMAP_I2C_STAT_RRDY | OMAP_I2C_STAT_RDR |
>                                 OMAP_I2C_STAT_XRDY | OMAP_I2C_STAT_XDR |
> diff --git a/include/linux/i2c-omap.h b/include/linux/i2c-omap.h
> index 92a0dc7..f386150 100644
> --- a/include/linux/i2c-omap.h
> +++ b/include/linux/i2c-omap.h
> @@ -29,6 +29,7 @@
>  #define OMAP_I2C_FLAG_BUS_SHIFT_1              BIT(7)
>  #define OMAP_I2C_FLAG_BUS_SHIFT_2              BIT(8)
>  #define OMAP_I2C_FLAG_BUS_SHIFT__SHIFT 7
> +#define OMAP_I2C_FLAG_NO_NAK                   BIT(9)
>
>  struct omap_i2c_bus_platform_data {
>         u32             clkrate;

Thank you for the patch and sorry for delay. I tried the patch, but it
doesn't help. I still get timeouts only. I fear it is really a
hardware feature, that OMAPs i2c stops if address is not acknowledged.
At least this is my understanding of the reference manual.

Here is the output from dmesg:

i2c i2c-2: master_xfer[0] W, addr=0x39, len=2
omap_i2c omap_i2c.2: addr: 0x0039, len: 2, flags: 0x0, stop: 1
omap_i2c omap_i2c.2: IRQ (ISR = 0x4000)
omap_i2c omap_i2c.2: IRQ (ISR = 0x0004)
i2c i2c-2: master_xfer[0] W, addr=0x39, len=1
i2c i2c-2: master_xfer[1] R, addr=0x39, len=1
omap_i2c omap_i2c.2: addr: 0x0039, len: 1, flags: 0x0, stop: 0
omap_i2c omap_i2c.2: IRQ (ISR = 0x4000)
omap_i2c omap_i2c.2: IRQ (ISR = 0x1004)
omap_i2c omap_i2c.2: addr: 0x0039, len: 1, flags: 0x1, stop: 1
omap_i2c omap_i2c.2: IRQ (ISR = 0x3000)
omap_i2c omap_i2c.2: IRQ (ISR = 0x0004)
SIIHDMI: Device ID: 0xb0
i2c i2c-2: master_xfer[0] W, addr=0x39, len=1
i2c i2c-2: master_xfer[1] R, addr=0x39, len=1
omap_i2c omap_i2c.2: addr: 0x0039, len: 1, flags: 0x0, stop: 0
omap_i2c omap_i2c.2: IRQ (ISR = 0x4000)
omap_i2c omap_i2c.2: IRQ (ISR = 0x1004)
omap_i2c omap_i2c.2: addr: 0x0039, len: 1, flags: 0x1, stop: 1
omap_i2c omap_i2c.2: IRQ (ISR = 0x3000)
omap_i2c omap_i2c.2: IRQ (ISR = 0x0004)
(rev 0.2)
i2c i2c-2: master_xfer[0] W, addr=0x39, len=1
i2c i2c-2: master_xfer[1] R, addr=0x39, len=1
omap_i2c omap_i2c.2: addr: 0x0039, len: 1, flags: 0x0, stop: 0
omap_i2c omap_i2c.2: IRQ (ISR = 0x4000)
omap_i2c omap_i2c.2: IRQ (ISR = 0x1004)
omap_i2c omap_i2c.2: addr: 0x0039, len: 1, flags: 0x1, stop: 1
omap_i2c omap_i2c.2: IRQ (ISR = 0x3000)
omap_i2c omap_i2c.2: IRQ (ISR = 0x0004)
(TPI revision 0.3)
i2c i2c-2: master_xfer[0] W, addr=0x39, len=1
i2c i2c-2: master_xfer[1] R, addr=0x39, len=1
omap_i2c omap_i2c.2: addr: 0x0039, len: 1, flags: 0x0, stop: 0
omap_i2c omap_i2c.2: IRQ (ISR = 0x4000)
omap_i2c omap_i2c.2: IRQ (ISR = 0x1004)
omap_i2c omap_i2c.2: addr: 0x0039, len: 1, flags: 0x1, stop: 1
omap_i2c omap_i2c.2: IRQ (ISR = 0x3000)
omap_i2c omap_i2c.2: IRQ (ISR = 0x0004)

I have placed some debugging output:

SIIHDMI: Device ID: 0xb0
 (rev 0.2)
 (TPI revision 0.3)

YY: NAK should be ignored (here the flag will be set according to the msg->flag)
omap_i2c omap_i2c.2: controller timed out
YY: NAK should be ignored
omap_i2c omap_i2c.2: controller timed out
omap_i2c omap_i2c.2: controller timed out
YY: NAK should be ignored
omap_i2c omap_i2c.2: controller timed out
omap_i2c omap_i2c.2: controller timed out
omap_i2c omap_i2c.2: controller timed out
omap_i2c omap_i2c.2: controller timed out

Yegor

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

* Re: OMAP: send i2c message ignoring NAK
       [not found]                             ` <CAGm1_ktYqq5HKt13RuQVL8axX0FUnZ_5a6va7BRuUschQRKERQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2012-07-17 14:01                               ` Shubhrajyoti Datta
       [not found]                                 ` <CAM=Q2ct_mfGiuKrX9KAuk7B+PA==FRL7DPOfge9fRAuFg6bA3Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Shubhrajyoti Datta @ 2012-07-17 14:01 UTC (permalink / raw)
  To: Yegor Yefremov; +Cc: Datta, Shubhrajyoti, Jean Delvare, Linux I2C

On Tue, Jul 17, 2012 at 3:01 PM, Yegor Yefremov
<yegorslists-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:
> On Thu, Jul 12, 2012 at 7:24 AM, Datta, Shubhrajyoti
> <shubhrajyoti-l0cyMroinI0@public.gmane.org> wrote:
[...]
>> On Wed, Jul 11, 2012 at 10:22 PM, Shubhrajyoti <shubhrajyoti-l0cyMroinI0@public.gmane.org> wrote:


>
> Thank you for the patch and sorry for delay. I tried the patch,

Thanks for the test.

> but it doesn't help. I still get timeouts only. I fear it is really a
> hardware feature,

I feel that could be unlikely.

> that OMAPs i2c stops if address is not acknowledged.
> At least this is my understanding of the reference manual.
>
> Here is the output from dmesg:


Another request. Can you disable the NACK interrupt on the ignore and
enable back?

Also let me know if you know of any of the panda or sdp peripherals
which could keep going on
NACK.

patch below.

diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index 801df60..82e52a5 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -523,6 +523,11 @@ static int omap_i2c_xfer_msg(struct i2c_adapter *adap,
 	if (msg->len == 0)
 		return -EINVAL;

+	if (msg->flags == I2C_M_IGNORE_NAK) {
+		dev->iestate = dev->iestate &  ~OMAP_I2C_IE_NACK ;
+		omap_i2c_write_reg(dev, OMAP_I2C_IE_REG, dev->iestate);
+	}
+
 	omap_i2c_write_reg(dev, OMAP_I2C_SA_REG, msg->addr);

 	/* REVISIT: Could the STB bit of I2C_CON be used with probing? */
@@ -584,6 +589,10 @@ static int omap_i2c_xfer_msg(struct i2c_adapter *adap,
 	 */
 	r = wait_for_completion_timeout(&dev->cmd_complete,
 					OMAP_I2C_TIMEOUT);
+	if (msg->flags == I2C_M_IGNORE_NAK) {
+		dev->iestate = dev->iestate | OMAP_I2C_IE_NACK ;
+		omap_i2c_write_reg(dev, OMAP_I2C_IE_REG, dev->iestate);
+	}
 	dev->buf_len = 0;
 	if (r < 0)
 		return r;

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

* Re: OMAP: send i2c message ignoring NAK
       [not found]                                 ` <CAM=Q2ct_mfGiuKrX9KAuk7B+PA==FRL7DPOfge9fRAuFg6bA3Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2012-07-19 13:05                                   ` Yegor Yefremov
       [not found]                                     ` <CAGm1_ktVXmEBZz90_SMB+WmZGax5DwoXD5pr66Dja=8QW1QcGA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Yegor Yefremov @ 2012-07-19 13:05 UTC (permalink / raw)
  To: Shubhrajyoti Datta; +Cc: Datta, Shubhrajyoti, Jean Delvare, Linux I2C

On Tue, Jul 17, 2012 at 4:01 PM, Shubhrajyoti Datta
<omaplinuxkernel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> On Tue, Jul 17, 2012 at 3:01 PM, Yegor Yefremov
> <yegorslists-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:
>> On Thu, Jul 12, 2012 at 7:24 AM, Datta, Shubhrajyoti
>> <shubhrajyoti-l0cyMroinI0@public.gmane.org> wrote:
> [...]
>>> On Wed, Jul 11, 2012 at 10:22 PM, Shubhrajyoti <shubhrajyoti-l0cyMroinI0@public.gmane.org> wrote:
>
>
>>
>> Thank you for the patch and sorry for delay. I tried the patch,
>
> Thanks for the test.
>
>> but it doesn't help. I still get timeouts only. I fear it is really a
>> hardware feature,
>
> I feel that could be unlikely.
>
>> that OMAPs i2c stops if address is not acknowledged.
>> At least this is my understanding of the reference manual.
>>
>> Here is the output from dmesg:
>
>
> Another request. Can you disable the NACK interrupt on the ignore and
> enable back?
>
> Also let me know if you know of any of the panda or sdp peripherals
> which could keep going on
> NACK.

I don't know any :-( This is also a not very common hardware where you
have to make such tricks.

> patch below.

As I understand it is a stand alone patch not based on the previous
one? I have the same result - timeout.

Yegor

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

* Re: OMAP: send i2c message ignoring NAK
       [not found]                                     ` <CAGm1_ktVXmEBZz90_SMB+WmZGax5DwoXD5pr66Dja=8QW1QcGA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2012-07-19 13:26                                       ` Shubhrajyoti
  0 siblings, 0 replies; 12+ messages in thread
From: Shubhrajyoti @ 2012-07-19 13:26 UTC (permalink / raw)
  To: Yegor Yefremov; +Cc: Shubhrajyoti Datta, Jean Delvare, Linux I2C

On Thursday 19 July 2012 06:35 PM, Yegor Yefremov wrote:
>> Another request. Can you disable the NACK interrupt on the ignore and
>> > enable back?
>> >
>> > Also let me know if you know of any of the panda or sdp peripherals
>> > which could keep going on
>> > NACK.
> I don't know any :-( This is also a not very common hardware where you
> have to make such tricks.
OK.
>
>> > patch below.
> As I understand it is a stand alone patch not based on the previous
> one? I have the same result - timeout.
Strange. Actually I disabled the NACK interrupt.

Can you share your i2c-omap.c file or link.

>
> Yegor

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

end of thread, other threads:[~2012-07-19 13:26 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-03  8:12 OMAP: send i2c message ignoring NAK Yegor Yefremov
     [not found] ` <CAGm1_ktL96X7kF3tvKErtirwnL7FGU=zGe+EyhX4GcUkZUeSkQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-07-03  8:32   ` Jean Delvare
     [not found]     ` <20120703103221.62fcb7ae-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2012-07-10 14:59       ` Yegor Yefremov
     [not found]         ` <CAGm1_kvBerv_Ot-NX2+ozZT3y+h4ECzwb-MM0-v=3M9aRRznzA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-07-10 15:08           ` Shubhrajyoti Datta
     [not found]             ` <CAM=Q2cv2yCEaxjSL45PSpf8k8pgMuhr88TJ-RWc0OW1GL+n6Dg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-07-11 16:23               ` Yegor Yefremov
     [not found]                 ` <CAGm1_kvLwj3iFz5M6zc+pitS_45OYPYw=aBU4bv8TdOhH600NA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-07-11 16:52                   ` Shubhrajyoti
     [not found]                     ` <4FFDAF5A.8070205-l0cyMroinI0@public.gmane.org>
2012-07-12  5:24                       ` Datta, Shubhrajyoti
     [not found]                         ` <CANQgH-YxYY7M6o4Hxw0kq9=GSwF8TSgiobXLJoPnGhj=c3w4KQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-07-17  9:31                           ` Yegor Yefremov
     [not found]                             ` <CAGm1_ktYqq5HKt13RuQVL8axX0FUnZ_5a6va7BRuUschQRKERQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-07-17 14:01                               ` Shubhrajyoti Datta
     [not found]                                 ` <CAM=Q2ct_mfGiuKrX9KAuk7B+PA==FRL7DPOfge9fRAuFg6bA3Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-07-19 13:05                                   ` Yegor Yefremov
     [not found]                                     ` <CAGm1_ktVXmEBZz90_SMB+WmZGax5DwoXD5pr66Dja=8QW1QcGA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-07-19 13:26                                       ` Shubhrajyoti
2012-07-11 16:52                   ` Shubhrajyoti

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.