Re: [PATCH 6/6] i2c: davinci: bus recovery procedure to clear the bus

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 02/08/2010 04:05 PM, Nori, Sekhar wrote:
Hi Philby,

On Fri, Feb 05, 2010 at 19:23:43, Philby John wrote:
Hello Sekhar,


[...]

+/* Generate a pulse on the i2c clock pin. */
+static void generic_i2c_clock_pulse(unsigned int scl_pin)
+{
+     u16 i;
+
+     if (scl_pin) {
+             /* Send high and low on the SCL line */
+             for (i = 0; i<  9; i++) {
+                     gpio_set_value(scl_pin, 0);
+                     udelay(20);
+                     gpio_set_value(scl_pin, 1);
+                     udelay(20);
+             }

Before using the pins as GPIO, you would have to set the
functionality of these pins as GPIO. You had this code in
previous incarnations of this patch - not sure why it is
dropped now.


I now think that the previous versions were incorrect since davinci_cfg_reg() does not set the scl or sda pins for gpio functionality. Instead they set them as scl or sda which is not what we want at the time of pulsing. The previous versions used gpio_set_value() in disable_i2c_pins() and then called davinci_cfg_reg(). After which it called pulse_i2c_clock().

Please correct me if my interpretation of the code is incorrect.

Regards,
Philby
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux