Re: [PATCH 2/2] i2c/designware: Provide optional i2c bus recovery function

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

 



On 2/27/2012 1:52 PM, Laxman Dewangan wrote:
On Monday 27 February 2012 01:40 PM, Rajeev kumar wrote:
On 2/27/2012 12:57 PM, Laxman Dewangan wrote:
On Monday 27 February 2012 12:51 PM, Shubhrajyoti Datta wrote:
On Fri, Feb 24, 2012 at 5:01 PM, Viresh Kumar<viresh.kumar@xxxxxx>     wrote:
From: Vincenzo Frascino<vincenzo.frascino@xxxxxx>

Add optional i2c_recover_bus() function to the Synopsys DesignWare I2C adapter
driver that performs i2c bus recovery after timeout. The scope of this routine
is to define i2c bus recovery procedure as specified in the i2c protocol Rev. 03
section 3.16 titled "Bus clear".
What do you do in the function ?

Could we have it in the driver file itself?

I think bus recovery mechanism is to send  extra clock on SCL line by
toggling the pin (using gpio apis) and keep watching of sda line whether
it becomes high or not.
We can put this algorithms in the some common file (i2c/algos/) and so
if any i2c bus driver want to use, they can use it.
Little background: I am working on tegra i2c controller and we have
similar logic in tegra-i2c driver which we want to upstream.
If similar function is in common place, we can use this and need not to
duplicating it on every bus driver.

I agreed with Laxman, as this is the protocol issue and so it should not
be in each individual driver. It should be the part of framework
itself. We need to implement something like
drivers/i2c/busses/i2c-gpio.c.  We need to investigate more on it.

I am thinking to put this in drivers/i2c/busses/bus_recovery_gpio.c.
This will provide only one function and config variable for this code
can be selected from different driver by select option. it will not be
enabled as independent driver. Similar to regmap_i2c or regmap_spi which

What is this regmap_i2c or regmap_spi, I am not able to locate it.

is selected through select in kconfig

The function should take the gpio number and gpio flags for scl and sda,
bus freq and number of clock to be sent.

Need to pass "number of clock to be sent" or not . I am not very much sure. I think number of clock to be sent is fixed.

~Rajeev

All gpio related apis should be called on .c file which is implemented.

How bus driver gets the corresponding gpio number is specific to bus
driver but they need to pass all the information through arguments.



-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information.  Any unauthorized review, use, disclosure or distribution
is prohibited.  If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
.


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