linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* How to put extra clock cycles on i2c cavinci, problems on omapl138 (logic pd som)
@ 2011-03-11 12:52 Bastian.Ruppert-qHSRieSIjQqELgA04lAiVw
       [not found] ` <OF32D366B1.336E6433-ONC1257850.004650F2-C1257850.0046C1A3-qHSRieSIjQqELgA04lAiVw@public.gmane.org>
  0 siblings, 1 reply; 13+ messages in thread
From: Bastian.Ruppert-qHSRieSIjQqELgA04lAiVw @ 2011-03-11 12:52 UTC (permalink / raw)
  To: linux-i2c-u79uwXL29TY76Z2rM5mHXA, khali-PUYAD+kWke1g9hUCZPvPmw,
	pjohn-k0rHJ+Hhz/SB+jHODAdFcQ,
	Bastian.Ruppert-qHSRieSIjQqELgA04lAiVw

Hello,

we have problems with the davinci-i2c driver on an omapl-138 (Logic PD 
SOM) in
conjunction with tps65070 hardware and tps6507x_ts touchscreen driver. 

(The following thread is related to this issue.
http://www.mail-archive.com/davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/@public.gmane.org/msg21162.html
)

After some action on the touchscreen, there are communication errors
on the i2c, and the bus stalled.
In this state the SDA line is hold low and the driver gives repeatedly
the following messages:

tps6507x 1-0048: ADC result 1 read failed
i2c_davinci i2c_davinci.1: controller timed out
i2c_davinci i2c_davinci.1: initiating i2c bus recovery
i2c_davinci i2c_davinci.1: controller timed out
i2c_davinci i2c_davinci.1: initiating i2c bus recovery
tps6507x 1-0048: TSC mode read failed
i2c_davinci i2c_davinci.1: controller timed out
i2c_davinci i2c_davinci.1: initiating i2c bus recovery
i2c_davinci i2c_davinci.1: controller timed out
i2c_davinci i2c_davinci.1: initiating i2c bus recovery
tps6507x 1-0048: TSC mode read failed
[...]

When giving a short low impulse on the SCL wire by shortcutting
this line with ground, the i2c is running again. 

Under http://processors.wiki.ti.com/index.php/I2C_Tips 
there is article about : External Slave Device Hanging the Bus by
Holding SDA Low

Option 1: For devices that mux the SCL/SDA pins with GPIO, the easiest
thing is to configure the pins for GPIO operation and toggle SCL until
the slave releases SDA. At this point you should be able to resume
normal operation.

Option 2: Many devices don't mux SCL/SDA with GPIO since the I2C I/O
cells are often special open drain cells. A workaround has been
reported to work even on these devices. By configuring the I2C for
"free data format" and then reading a byte the I2C will immediately
start sending clocks to input data (rather than trying to send an
address). This can be used to free up the bus.

We would like to have some extra SCL pulses in the function 
static void i2c_recover_bus(struct davinci_i2c_dev *dev).

We tried to put the I2C in "free data format" and read one byte with
the following lines:

            flag |= DAVINCI_I2C_MDR_FDF;// free data format mode
            flag &= ~DAVINCI_I2C_MDR_TRX;// receive byte
            // Set STT to begin transmit now DXR is loaded
            flag |= DAVINCI_I2C_MDR_STT;
            davinci_i2c_write_reg(dev, DAVINCI_I2C_MDR_REG, flag); 

But that doesn`t work that way.

We have problems to use the GPIO variant to toggle SCL or using the 
generic_i2c_clock_pulse function, too.

Please tell me how to get extra clock cycles on i2c?

Thank you, regards,

Bastian Ruppert.

P.S.

[please put me on cc, i am not on the vger.kernel.org list, thx] 

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

end of thread, other threads:[~2011-03-18  8:53 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-11 12:52 How to put extra clock cycles on i2c cavinci, problems on omapl138 (logic pd som) Bastian.Ruppert-qHSRieSIjQqELgA04lAiVw
     [not found] ` <OF32D366B1.336E6433-ONC1257850.004650F2-C1257850.0046C1A3-qHSRieSIjQqELgA04lAiVw@public.gmane.org>
2011-03-15 17:02   ` Ben Gardiner
     [not found]     ` <AANLkTi=cRYbLWn9YKQFtABjg-NZ0tM1y9JHyb1QiuNVs-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-03-15 17:09       ` Ben Gardiner
     [not found]         ` <AANLkTi=opkM3WW2v3xV=ox9HwD__WjqQuh3sM6Vh7fLj-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-03-15 21:08           ` (unknown), Ben Gardiner
2011-03-17  9:08       ` How to put extra clock cycles on i2c cavinci, problems on omapl138 (logic pd som) Bastian.Ruppert-qHSRieSIjQqELgA04lAiVw
     [not found]         ` <OFCCCD2C6E.D899BA32-ONC1257856.00307955-C1257856.00323B2B-qHSRieSIjQqELgA04lAiVw@public.gmane.org>
2011-03-17 13:25           ` Ben Gardiner
2011-03-17 14:13             ` Bastian.Ruppert-qHSRieSIjQqELgA04lAiVw
     [not found]               ` <OF533CF913.E277EFE5-ONC1257856.004C0321-C1257856.004E1D46-qHSRieSIjQqELgA04lAiVw@public.gmane.org>
2011-03-17 14:36                 ` Ben Gardiner
     [not found]                   ` <AANLkTinLBASU07dYNnYoRCbgPHGxtkx4-nzVMFgztOD7-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-03-17 15:11                     ` Bastian.Ruppert-qHSRieSIjQqELgA04lAiVw
2011-03-17 14:28             ` Nori, Sekhar
     [not found]               ` <B85A65D85D7EB246BE421B3FB0FBB593024C30830A-/tLxBxkBPtCIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2011-03-17 15:49                 ` Ben Gardiner
2011-03-18  6:43                 ` Bastian.Ruppert-qHSRieSIjQqELgA04lAiVw
     [not found]                   ` <OFDFF6C831.8C9C5CF9-ONC1257857.0023FBF9-C1257857.0024F492-qHSRieSIjQqELgA04lAiVw@public.gmane.org>
2011-03-18  8:53                     ` Nori, Sekhar

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