diff mbox series

[[RESEND] PATCHv6 1/2] dt-bindings: i2c: Add Altera I2C Controller

Message ID 1505164640-26413-1-git-send-email-thor.thayer@linux.intel.com
State Not Applicable, archived
Headers show
Series [[RESEND] PATCHv6 1/2] dt-bindings: i2c: Add Altera I2C Controller | expand

Commit Message

Thor Thayer Sept. 11, 2017, 9:17 p.m. UTC
From: Thor Thayer <thor.thayer@linux.intel.com>

Add the documentation to support the Altera synthesizable
logic I2C Controller in FPGA.

Signed-off-by: Thor Thayer <thor.thayer@linux.intel.com>
Acked-by: Rob Herring <robh@kernel.org>
---
v2  Change the subject to identify dt-bindings
    Add synthesizable logic to description.
    Change compatible string to "altr,softip-i2c"
    Make description of clock phandle singular since 1 clock.
    Remove altr, from fifo-size
    Specify fifo-size is in bytes.
v3  Add version to compatible string "altr,softip-i2c-v1.0"
    Add for use in FPGA in description.
v4  No Change - Add Acked-by
v5-6  No Change
---
 .../devicetree/bindings/i2c/i2c-altera.txt         | 39 ++++++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i2c/i2c-altera.txt

Comments

Wolfram Sang Sept. 13, 2017, 8:50 p.m. UTC | #1
On Mon, Sep 11, 2017 at 04:17:20PM -0500, thor.thayer@linux.intel.com wrote:
> From: Thor Thayer <thor.thayer@linux.intel.com>
> 
> Add driver support for the Altera I2C Controller. The I2C
> controller is soft IP for use in FPGAs.
> 
> Signed-off-by: Thor Thayer <thor.thayer@linux.intel.com>
> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
> ---

Applied to for-next (will be in v4.14), thanks!

> +	if (finish) {
> +		/* Wait for the Core to finish */
> +		ret = readl_poll_timeout_atomic(idev->base + ALTR_I2C_STATUS,

I wonder a bit about polling in an interrupt handler (maybe threaded
irqs?) but we can fix that later, I think.
Wolfram Sang Sept. 13, 2017, 8:50 p.m. UTC | #2
On Mon, Sep 11, 2017 at 04:17:19PM -0500, thor.thayer@linux.intel.com wrote:
> From: Thor Thayer <thor.thayer@linux.intel.com>
> 
> Add the documentation to support the Altera synthesizable
> logic I2C Controller in FPGA.
> 
> Signed-off-by: Thor Thayer <thor.thayer@linux.intel.com>
> Acked-by: Rob Herring <robh@kernel.org>

Applied to for-next (will be in v4.14), thanks!
Wolfram Sang Sept. 13, 2017, 9:28 p.m. UTC | #3
And please use [PATCH V6 RESEND ...] in the future; the double '[['
confuses the tools like patchwork.
Thor Thayer Sept. 18, 2017, 8:04 p.m. UTC | #4
On 09/13/2017 03:50 PM, Wolfram Sang wrote:
> On Mon, Sep 11, 2017 at 04:17:20PM -0500, thor.thayer@linux.intel.com wrote:
>> From: Thor Thayer <thor.thayer@linux.intel.com>
>>
>> Add driver support for the Altera I2C Controller. The I2C
>> controller is soft IP for use in FPGAs.
>>
>> Signed-off-by: Thor Thayer <thor.thayer@linux.intel.com>
>> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
>> ---
> 
> Applied to for-next (will be in v4.14), thanks!
> 
>> +	if (finish) {
>> +		/* Wait for the Core to finish */
>> +		ret = readl_poll_timeout_atomic(idev->base + ALTR_I2C_STATUS,
> 
> I wonder a bit about polling in an interrupt handler (maybe threaded
> irqs?) but we can fix that later, I think.
> 

Yes, based on your previous feedback, I changed to a threaded IRQ as 
shown below. The altr_i2c_isr_quick wakes up this IRQ handler if the 
status is non-zero.

+
+	ret = devm_request_threaded_irq(&pdev->dev, irq, altr_i2c_isr_quick,
+					altr_i2c_isr, IRQF_ONESHOT,
+					pdev->name, idev);

Thanks for the review and applying the patch!
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/i2c/i2c-altera.txt b/Documentation/devicetree/bindings/i2c/i2c-altera.txt
new file mode 100644
index 000000000000..767664f448ec
--- /dev/null
+++ b/Documentation/devicetree/bindings/i2c/i2c-altera.txt
@@ -0,0 +1,39 @@ 
+* Altera I2C Controller
+* This is Altera's synthesizable logic block I2C Controller for use
+* in Altera's FPGAs.
+
+Required properties :
+ - compatible : should be "altr,softip-i2c-v1.0"
+ - reg        : Offset and length of the register set for the device
+ - interrupts : <IRQ> where IRQ is the interrupt number.
+ - clocks     : phandle to input clock.
+ - #address-cells = <1>;
+ - #size-cells = <0>;
+
+Recommended properties :
+ - clock-frequency : desired I2C bus clock frequency in Hz.
+
+Optional properties :
+ - fifo-size : Size of the RX and TX FIFOs in bytes.
+ - Child nodes conforming to i2c bus binding
+
+Example :
+
+	i2c@100080000 {
+		compatible = "altr,softip-i2c-v1.0";
+		reg = <0x00000001 0x00080000 0x00000040>;
+		interrupt-parent = <&intc>;
+		interrupts = <0 43 4>;
+		clocks = <&clk_0>;
+		clock-frequency = <100000>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		fifo-size = <4>;
+
+		eeprom@51 {
+			compatible = "atmel,24c32";
+			reg = <0x51>;
+			pagesize = <32>;
+		};
+	};
+