Re: [PATCH 1/2] i2c designware make SCL and SDA falling time configurable

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

 



On 10/10/13 9:54 AM, Ryan Mallon wrote:
On 09/10/13 18:55, Mika Westerberg wrote:
On Tue, Oct 08, 2013 at 05:00:54PM +0200, Romain Baeriswyl wrote:
@@ -307,15 +309,25 @@ int i2c_dw_init(struct dw_i2c_dev *dev)

  	/* set standard and fast speed deviders for high/low periods */

+	if (dev->sda_falling_time)
+		sda_falling_time = dev->sda_falling_time;
+	else
+		sda_falling_time = 300; /* ns */

I think this looks better:

	sda_falling_time = dev->sda_falling_time ? dev->sda_falling_time : 300;

You can also use the gcc-ism, which is a bit more concise:

	sda_falling_time = dev->sda_falling_time ?: 300;

+1

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