From patchwork Mon Apr 22 09:53:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 16295 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f71.google.com (mail-vb0-f71.google.com [209.85.212.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5248225DEE for ; Mon, 22 Apr 2013 09:54:15 +0000 (UTC) Received: by mail-vb0-f71.google.com with SMTP id w16sf11688875vbb.10 for ; Mon, 22 Apr 2013 02:53:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-beenthere:x-received:received-spf:x-received :x-forwarded-to:x-forwarded-for:delivered-to:x-received:received-spf :from:to:cc:subject:date:message-id:x-mailer:mime-version :x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe :content-type; bh=dMzWQd7DQ+kK+g9G0YmQGJGYX7E4WZgHOHSOCE9gBlA=; b=AfGotLhCzdEyyerrirpru6jFZHLJq+yYlCDghctzArPr9PQx957m0WcDrF1tW4uIrd m7Ol1IN4vnKD63R6Y74YUwhU2hrEGVHxBB5YV6M6jYAbUzmGa3CH9TxOsihXEAj9h9Bq ryV/YxiDZtrMDuLaAjH3s/If7SU8IVnYgfvBXfvDBSuh+rhz7vtP5KuH2vKRrlQCfOjs 8Yhnr0jgdrfjtvwnP0ifmBqFB3oADXphEgSn7CtbN0nb4vxoWSKouN9FY0HSNuRUrbzr d7j8jurT9mhBXESHUgZDDU8mXaImMi0oNSxI0aFDqyOf+85KFwjdLPu6WETA3z7TBj5g dXlw== X-Received: by 10.224.160.65 with SMTP id m1mr19529469qax.2.1366624409188; Mon, 22 Apr 2013 02:53:29 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.1.4 with SMTP id 4ls3305489qei.68.gmail; Mon, 22 Apr 2013 02:53:28 -0700 (PDT) X-Received: by 10.52.176.163 with SMTP id cj3mr15902861vdc.35.1366624408950; Mon, 22 Apr 2013 02:53:28 -0700 (PDT) Received: from mail-vb0-x22f.google.com (mail-vb0-x22f.google.com [2607:f8b0:400c:c02::22f]) by mx.google.com with ESMTPS id u8si14595836vck.75.2013.04.22.02.53.28 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 22 Apr 2013 02:53:28 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::22f is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c02::22f; Received: by mail-vb0-f47.google.com with SMTP id x13so5554457vbb.6 for ; Mon, 22 Apr 2013 02:53:28 -0700 (PDT) X-Received: by 10.58.173.36 with SMTP id bh4mr4454112vec.9.1366624408732; Mon, 22 Apr 2013 02:53:28 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.127.98 with SMTP id nf2csp68702veb; Mon, 22 Apr 2013 02:53:28 -0700 (PDT) X-Received: by 10.194.5.228 with SMTP id v4mr11649682wjv.18.1366624407582; Mon, 22 Apr 2013 02:53:27 -0700 (PDT) Received: from eu1sys200aog118.obsmtp.com (eu1sys200aog118.obsmtp.com [207.126.144.145]) by mx.google.com with SMTP id x41si30052719eey.192.2013.04.22.02.53.19 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 22 Apr 2013 02:53:27 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.145 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.145; Received: from beta.dmz-us.st.com ([167.4.1.35]) (using TLSv1) by eu1sys200aob118.postini.com ([207.126.147.11]) with SMTP ID DSNKUXUIjopAN313YY69YxZS6+E10qtaGhFR@postini.com; Mon, 22 Apr 2013 09:53:27 UTC Received: from zeta.dmz-us.st.com (ns4.st.com [167.4.16.71]) by beta.dmz-us.st.com (STMicroelectronics) with ESMTP id 7E94D50; Mon, 22 Apr 2013 09:52:12 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-us.st.com (STMicroelectronics) with ESMTP id 8194C3F; Mon, 22 Apr 2013 03:01:39 +0000 (GMT) Received: from exdcvycastm003.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm003", Issuer "exdcvycastm003" (not verified)) by relay1.stm.gmessaging.net (Postfix) with ESMTPS id 205BB24C07D; Mon, 22 Apr 2013 11:53:02 +0200 (CEST) Received: from steludxu4075.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.1) with Microsoft SMTP Server (TLS) id 8.3.279.5; Mon, 22 Apr 2013 11:53:07 +0200 From: Linus Walleij To: , Wolfram Sang Cc: Arnd Bergmann , , Linus Walleij Subject: [PATCH 07/23] i2c: stu300: device tree support Date: Mon, 22 Apr 2013 11:53:03 +0200 Message-ID: <1366624383-6330-1-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.7.11.3 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQkQACnmzNPbAMH7CFMNMFBXs1tkgKOnIrh2y87TsGu3+9uoH7yFQYsUlfkhYqAo13GZFtpo X-Original-Sender: linus.walleij@stericsson.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::22f is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Linus Walleij This adds device tree support for the ST DDC I2C driver known as "stu300" in the kernel tree. Cc: Wolfram Sang Signed-off-by: Linus Walleij --- Wolfram, I'm seeking an ACK to take this with the other lump of U300 device tree patches through the ARM SoC tree. --- Documentation/devicetree/bindings/i2c/i2c-st-ddci2c.txt | 15 +++++++++++++++ drivers/i2c/busses/i2c-stu300.c | 12 ++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 Documentation/devicetree/bindings/i2c/i2c-st-ddci2c.txt diff --git a/Documentation/devicetree/bindings/i2c/i2c-st-ddci2c.txt b/Documentation/devicetree/bindings/i2c/i2c-st-ddci2c.txt new file mode 100644 index 0000000..bd81a48 --- /dev/null +++ b/Documentation/devicetree/bindings/i2c/i2c-st-ddci2c.txt @@ -0,0 +1,15 @@ +ST Microelectronics DDC I2C + +Required properties : +- compatible : Must be "st,ddci2c" +- reg: physical base address of the controller and length of memory mapped + region. +- interrupts: interrupt number to the cpu. +- #address-cells = <1>; +- #size-cells = <0>; + +Optional properties: +- Child nodes conforming to i2c bus binding + +Examples : + diff --git a/drivers/i2c/busses/i2c-stu300.c b/drivers/i2c/busses/i2c-stu300.c index 0a6f941..1beaa05a 100644 --- a/drivers/i2c/busses/i2c-stu300.c +++ b/drivers/i2c/busses/i2c-stu300.c @@ -17,6 +17,7 @@ #include #include #include +#include /* the name of this kernel module */ #define NAME "stu300" @@ -923,6 +924,7 @@ stu300_probe(struct platform_device *pdev) adap->nr = bus_nr; adap->algo = &stu300_algo; adap->dev.parent = &pdev->dev; + adap->dev.of_node = pdev->dev.of_node; i2c_set_adapdata(adap, dev); /* i2c device drivers may be active on return from add_adapter() */ @@ -934,6 +936,10 @@ stu300_probe(struct platform_device *pdev) } platform_set_drvdata(pdev, dev); + dev_info(&pdev->dev, "ST DDC I2C @ %p, irq %d\n", + dev->virtbase, dev->irq); + of_i2c_register_devices(adap); + return 0; } @@ -978,11 +984,17 @@ stu300_remove(struct platform_device *pdev) return 0; } +static const struct of_device_id stu300_dt_match[] = { + { .compatible = "st,ddci2c" }, + {}, +}; + static struct platform_driver stu300_i2c_driver = { .driver = { .name = NAME, .owner = THIS_MODULE, .pm = STU300_I2C_PM, + .of_match_table = stu300_dt_match, }, .remove = __exit_p(stu300_remove),